@orderly.network/markets 2.11.3-rc.0 → 2.12.0-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.d.mts +44 -16
- package/dist/index.d.ts +44 -16
- package/dist/index.js +1286 -632
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1288 -635
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
var React6 = require('react');
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
5
|
var hooks = require('@orderly.network/hooks');
|
|
6
|
-
var ui = require('@orderly.network/ui');
|
|
7
6
|
var i18n = require('@orderly.network/i18n');
|
|
7
|
+
var ui = require('@orderly.network/ui');
|
|
8
8
|
var utils = require('@orderly.network/utils');
|
|
9
9
|
var ramda = require('ramda');
|
|
10
10
|
var uiScaffold = require('@orderly.network/ui-scaffold');
|
|
@@ -27,7 +27,7 @@ var init_marketsProvider = __esm({
|
|
|
27
27
|
"src/components/marketsProvider/index.tsx"() {
|
|
28
28
|
MarketsContext = React6.createContext({});
|
|
29
29
|
exports.MarketsProvider = (props) => {
|
|
30
|
-
const { symbol, comparisonProps, children, onSymbolChange } = props;
|
|
30
|
+
const { symbol, comparisonProps, children, onSymbolChange, tabs } = props;
|
|
31
31
|
const [searchValue, setSearchValue] = React6.useState("");
|
|
32
32
|
const clearSearchValue = React6.useCallback(() => {
|
|
33
33
|
setSearchValue("");
|
|
@@ -39,9 +39,17 @@ var init_marketsProvider = __esm({
|
|
|
39
39
|
clearSearchValue,
|
|
40
40
|
symbol,
|
|
41
41
|
onSymbolChange,
|
|
42
|
-
comparisonProps
|
|
42
|
+
comparisonProps,
|
|
43
|
+
tabs
|
|
43
44
|
};
|
|
44
|
-
}, [
|
|
45
|
+
}, [
|
|
46
|
+
searchValue,
|
|
47
|
+
symbol,
|
|
48
|
+
onSymbolChange,
|
|
49
|
+
setSearchValue,
|
|
50
|
+
comparisonProps,
|
|
51
|
+
tabs
|
|
52
|
+
]);
|
|
45
53
|
return /* @__PURE__ */ jsxRuntime.jsx(MarketsContext.Provider, { value: memoizedValue, children });
|
|
46
54
|
};
|
|
47
55
|
useMarketsContext = () => {
|
|
@@ -49,14 +57,63 @@ var init_marketsProvider = __esm({
|
|
|
49
57
|
};
|
|
50
58
|
}
|
|
51
59
|
});
|
|
60
|
+
var RwaDotTooltip;
|
|
61
|
+
var init_rwaDotTooltip = __esm({
|
|
62
|
+
"src/components/rwaDotTooltip.tsx"() {
|
|
63
|
+
RwaDotTooltip = ({ record }) => {
|
|
64
|
+
const { t } = i18n.useTranslation();
|
|
65
|
+
const isInTradingHours = hooks.isCurrentlyTrading(
|
|
66
|
+
record.rwaNextClose,
|
|
67
|
+
record.rwaStatus
|
|
68
|
+
);
|
|
69
|
+
if (!record.isRwa) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
73
|
+
ui.Tooltip,
|
|
74
|
+
{
|
|
75
|
+
content: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { color: isInTradingHours ? "success" : "danger", children: isInTradingHours ? t("trading.rwa.marketHours") : t("trading.rwa.outsideMarketHours") }),
|
|
76
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { py: 2, px: 1, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
77
|
+
ui.Box,
|
|
78
|
+
{
|
|
79
|
+
width: 4,
|
|
80
|
+
height: 4,
|
|
81
|
+
r: "full",
|
|
82
|
+
className: isInTradingHours ? "oui-bg-success" : "oui-bg-danger"
|
|
83
|
+
}
|
|
84
|
+
) })
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
var BrokerIdBadge, SymbolBadge;
|
|
91
|
+
var init_symbolBadge = __esm({
|
|
92
|
+
"src/components/symbolBadge.tsx"() {
|
|
93
|
+
BrokerIdBadge = (props) => {
|
|
94
|
+
const { brokerId, brokerName, brokerNameRaw } = hooks.useBadgeBySymbol(
|
|
95
|
+
props.symbol
|
|
96
|
+
);
|
|
97
|
+
const badge = brokerName ?? brokerId ?? void 0;
|
|
98
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ui.SymbolBadge, { badge, fullName: brokerNameRaw });
|
|
99
|
+
};
|
|
100
|
+
SymbolBadge = BrokerIdBadge;
|
|
101
|
+
}
|
|
102
|
+
});
|
|
52
103
|
exports.SymbolDisplay = void 0;
|
|
53
104
|
var init_symbolDisplay = __esm({
|
|
54
105
|
"src/components/symbolDisplay.tsx"() {
|
|
106
|
+
init_rwaDotTooltip();
|
|
107
|
+
init_symbolBadge();
|
|
55
108
|
exports.SymbolDisplay = React6.memo((props) => {
|
|
56
|
-
const { children, size = "xs", ...rest } = props;
|
|
109
|
+
const { children, size = "xs", showBadge = true, record, ...rest } = props;
|
|
57
110
|
const symbol = children;
|
|
58
111
|
const symbolsInfo = hooks.useSymbolsInfo();
|
|
59
112
|
const displayName = symbolsInfo[symbol]("displayName");
|
|
113
|
+
const suffix = record?.isRwa || showBadge ? /* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { gapX: 0, itemAlign: "center", children: [
|
|
114
|
+
record?.isRwa && /* @__PURE__ */ jsxRuntime.jsx(RwaDotTooltip, { record }),
|
|
115
|
+
showBadge && /* @__PURE__ */ jsxRuntime.jsx(SymbolBadge, { symbol })
|
|
116
|
+
] }) : null;
|
|
60
117
|
if (displayName) {
|
|
61
118
|
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { gapX: 1, className: props.className, children: [
|
|
62
119
|
props.showIcon && /* @__PURE__ */ jsxRuntime.jsx(ui.TokenIcon, { size, symbol }),
|
|
@@ -68,10 +125,21 @@ var init_symbolDisplay = __esm({
|
|
|
68
125
|
className: "oui-whitespace-nowrap oui-break-normal",
|
|
69
126
|
children: displayName
|
|
70
127
|
}
|
|
71
|
-
)
|
|
128
|
+
),
|
|
129
|
+
suffix
|
|
72
130
|
] });
|
|
73
131
|
}
|
|
74
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
132
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
133
|
+
ui.Text.formatted,
|
|
134
|
+
{
|
|
135
|
+
size: "xs",
|
|
136
|
+
rule: "symbol",
|
|
137
|
+
weight: "semibold",
|
|
138
|
+
suffix,
|
|
139
|
+
...rest,
|
|
140
|
+
children: symbol
|
|
141
|
+
}
|
|
142
|
+
);
|
|
75
143
|
});
|
|
76
144
|
}
|
|
77
145
|
});
|
|
@@ -1082,6 +1150,101 @@ var init_marketsHeader_widget = __esm({
|
|
|
1082
1150
|
};
|
|
1083
1151
|
}
|
|
1084
1152
|
});
|
|
1153
|
+
function createCommunityBrokerFilter(selected) {
|
|
1154
|
+
return (data) => selected === "all" ? data?.filter((m) => Boolean(m?.broker_id)) : data?.filter((m) => m?.broker_id === selected);
|
|
1155
|
+
}
|
|
1156
|
+
function useCommunityTabs() {
|
|
1157
|
+
const brokerId = hooks.useConfig("brokerId");
|
|
1158
|
+
const [brokers] = hooks.useAllBrokers();
|
|
1159
|
+
const [allMarkets] = hooks.useMarkets(hooks.MarketsType.ALL);
|
|
1160
|
+
const lastSignatureRef = React6.useRef("");
|
|
1161
|
+
const lastValueRef = React6.useRef([]);
|
|
1162
|
+
return React6.useMemo(() => {
|
|
1163
|
+
const brokerIdSet = /* @__PURE__ */ new Set();
|
|
1164
|
+
for (const m of allMarkets ?? []) {
|
|
1165
|
+
const id = m?.broker_id;
|
|
1166
|
+
if (typeof id === "string" && id.length) {
|
|
1167
|
+
brokerIdSet.add(id);
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
const entries = Array.from(
|
|
1171
|
+
brokerIdSet
|
|
1172
|
+
).map((id) => ({
|
|
1173
|
+
id,
|
|
1174
|
+
name: brokers?.[id]
|
|
1175
|
+
}));
|
|
1176
|
+
const sorted = entries.map(({ id, name }) => ({
|
|
1177
|
+
id,
|
|
1178
|
+
label: name ?? id,
|
|
1179
|
+
sortKey: (name ?? id).toLowerCase()
|
|
1180
|
+
})).sort((a, b) => a.sortKey.localeCompare(b.sortKey));
|
|
1181
|
+
if (brokerId) {
|
|
1182
|
+
const idx = sorted.findIndex((x) => x.id === brokerId);
|
|
1183
|
+
if (idx > 0) {
|
|
1184
|
+
const [cur] = sorted.splice(idx, 1);
|
|
1185
|
+
sorted.unshift(cur);
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
const signature = sorted.map((x) => `${x.id}:${x.label}`).join("|");
|
|
1189
|
+
if (signature === lastSignatureRef.current) {
|
|
1190
|
+
return lastValueRef.current;
|
|
1191
|
+
}
|
|
1192
|
+
lastSignatureRef.current = signature;
|
|
1193
|
+
lastValueRef.current = sorted;
|
|
1194
|
+
return sorted;
|
|
1195
|
+
}, [allMarkets, brokers, brokerId]);
|
|
1196
|
+
}
|
|
1197
|
+
var init_useCommunityTabs = __esm({
|
|
1198
|
+
"src/hooks/useCommunityTabs.ts"() {
|
|
1199
|
+
}
|
|
1200
|
+
});
|
|
1201
|
+
var CommunityBrokerTabs;
|
|
1202
|
+
var init_communityBrokerTabs_ui = __esm({
|
|
1203
|
+
"src/components/communityBrokerTabs/communityBrokerTabs.ui.tsx"() {
|
|
1204
|
+
init_useCommunityTabs();
|
|
1205
|
+
CommunityBrokerTabs = (props) => {
|
|
1206
|
+
const {
|
|
1207
|
+
storageKey,
|
|
1208
|
+
className,
|
|
1209
|
+
classNames,
|
|
1210
|
+
variant = "contained",
|
|
1211
|
+
size = "sm",
|
|
1212
|
+
showScrollIndicator,
|
|
1213
|
+
allTitle,
|
|
1214
|
+
renderPanel
|
|
1215
|
+
} = props;
|
|
1216
|
+
const { t } = i18n.useTranslation();
|
|
1217
|
+
const [communitySubTab, setCommunitySubTab] = hooks.useLocalStorage(
|
|
1218
|
+
storageKey,
|
|
1219
|
+
"all"
|
|
1220
|
+
);
|
|
1221
|
+
const communityBrokerTabs = useCommunityTabs();
|
|
1222
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1223
|
+
ui.Tabs,
|
|
1224
|
+
{
|
|
1225
|
+
variant,
|
|
1226
|
+
size,
|
|
1227
|
+
value: communitySubTab,
|
|
1228
|
+
onValueChange: setCommunitySubTab,
|
|
1229
|
+
classNames,
|
|
1230
|
+
className,
|
|
1231
|
+
showScrollIndicator,
|
|
1232
|
+
children: [
|
|
1233
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.TabPanel, { title: allTitle ?? t("common.all"), value: "all", children: renderPanel("all") }),
|
|
1234
|
+
communityBrokerTabs.map((b) => /* @__PURE__ */ jsxRuntime.jsx(ui.TabPanel, { title: b.label, value: b.id, children: renderPanel(b.id) }, b.id))
|
|
1235
|
+
]
|
|
1236
|
+
}
|
|
1237
|
+
);
|
|
1238
|
+
};
|
|
1239
|
+
}
|
|
1240
|
+
});
|
|
1241
|
+
|
|
1242
|
+
// src/components/communityBrokerTabs/index.ts
|
|
1243
|
+
var init_communityBrokerTabs = __esm({
|
|
1244
|
+
"src/components/communityBrokerTabs/index.ts"() {
|
|
1245
|
+
init_communityBrokerTabs_ui();
|
|
1246
|
+
}
|
|
1247
|
+
});
|
|
1085
1248
|
exports.CollapseMarkets = void 0;
|
|
1086
1249
|
var init_collapseMarkets = __esm({
|
|
1087
1250
|
"src/components/collapseMarkets/index.tsx"() {
|
|
@@ -1182,6 +1345,7 @@ var init_collapseMarkets = __esm({
|
|
|
1182
1345
|
exports.FavoritesDropdownMenu = void 0;
|
|
1183
1346
|
var init_favoritesDropdownMenu_ui = __esm({
|
|
1184
1347
|
"src/components/favoritesDropdownMenu/favoritesDropdownMenu.ui.tsx"() {
|
|
1348
|
+
init_symbolBadge();
|
|
1185
1349
|
exports.FavoritesDropdownMenu = (props) => {
|
|
1186
1350
|
const {
|
|
1187
1351
|
symbol,
|
|
@@ -1293,9 +1457,10 @@ var init_favoritesDropdownMenu_ui = __esm({
|
|
|
1293
1457
|
ui.Text.formatted,
|
|
1294
1458
|
{
|
|
1295
1459
|
rule: "symbol",
|
|
1296
|
-
formatString: "base
|
|
1460
|
+
formatString: "base",
|
|
1297
1461
|
size: "base",
|
|
1298
1462
|
showIcon: true,
|
|
1463
|
+
suffix: /* @__PURE__ */ jsxRuntime.jsx(SymbolBadge, { symbol }),
|
|
1299
1464
|
children: symbol
|
|
1300
1465
|
}
|
|
1301
1466
|
)
|
|
@@ -1507,36 +1672,6 @@ var init_favoritesDropdownMenu = __esm({
|
|
|
1507
1672
|
init_favoritesDropdownMenu_widget();
|
|
1508
1673
|
}
|
|
1509
1674
|
});
|
|
1510
|
-
var RwaDotTooltip;
|
|
1511
|
-
var init_rwaDotTooltip = __esm({
|
|
1512
|
-
"src/components/rwaDotTooltip.tsx"() {
|
|
1513
|
-
RwaDotTooltip = ({ record }) => {
|
|
1514
|
-
const { t } = i18n.useTranslation();
|
|
1515
|
-
const isInTradingHours = hooks.isCurrentlyTrading(
|
|
1516
|
-
record.rwaNextClose,
|
|
1517
|
-
record.rwaStatus
|
|
1518
|
-
);
|
|
1519
|
-
if (!record.isRwa) {
|
|
1520
|
-
return null;
|
|
1521
|
-
}
|
|
1522
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1523
|
-
ui.Tooltip,
|
|
1524
|
-
{
|
|
1525
|
-
content: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { color: isInTradingHours ? "success" : "danger", children: isInTradingHours ? t("trading.rwa.marketHours") : t("trading.rwa.outsideMarketHours") }),
|
|
1526
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { p: 2, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1527
|
-
ui.Box,
|
|
1528
|
-
{
|
|
1529
|
-
width: 4,
|
|
1530
|
-
height: 4,
|
|
1531
|
-
r: "full",
|
|
1532
|
-
className: isInTradingHours ? "oui-bg-success" : "oui-bg-danger"
|
|
1533
|
-
}
|
|
1534
|
-
) })
|
|
1535
|
-
}
|
|
1536
|
-
);
|
|
1537
|
-
};
|
|
1538
|
-
}
|
|
1539
|
-
});
|
|
1540
1675
|
function getSymbolColumn(favorite, isFavoriteList = false, options) {
|
|
1541
1676
|
return {
|
|
1542
1677
|
title: i18n.i18n.t("common.symbol"),
|
|
@@ -1571,8 +1706,7 @@ function getSymbolColumn(favorite, isFavoriteList = false, options) {
|
|
|
1571
1706
|
children: [
|
|
1572
1707
|
/* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { gapX: 1, itemAlign: "center", children: [
|
|
1573
1708
|
/* @__PURE__ */ jsxRuntime.jsx(ui.TokenIcon, { symbol: value, className: "oui-size-[18px]" }),
|
|
1574
|
-
/* @__PURE__ */ jsxRuntime.jsx(exports.SymbolDisplay, { formatString: "base", size: "2xs", children: value })
|
|
1575
|
-
/* @__PURE__ */ jsxRuntime.jsx(RwaDotTooltip, { record })
|
|
1709
|
+
/* @__PURE__ */ jsxRuntime.jsx(exports.SymbolDisplay, { formatString: "base", size: "2xs", record, children: value })
|
|
1576
1710
|
] }),
|
|
1577
1711
|
typeof record.leverage === "number" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Badge, { size: "xs", color: "primary", children: [
|
|
1578
1712
|
record.leverage,
|
|
@@ -1743,7 +1877,6 @@ var init_column = __esm({
|
|
|
1743
1877
|
init_icons();
|
|
1744
1878
|
init_icons();
|
|
1745
1879
|
init_favoritesDropdownMenu();
|
|
1746
|
-
init_rwaDotTooltip();
|
|
1747
1880
|
init_symbolDisplay();
|
|
1748
1881
|
}
|
|
1749
1882
|
});
|
|
@@ -1836,7 +1969,7 @@ var init_marketsList_ui = __esm({
|
|
|
1836
1969
|
});
|
|
1837
1970
|
|
|
1838
1971
|
// src/type.ts
|
|
1839
|
-
exports.MarketsPageTab = void 0; exports.MarketsTabName = void 0; exports.FundingTabName = void 0;
|
|
1972
|
+
exports.MarketsPageTab = void 0; exports.MarketsTabName = void 0; exports.CommunitySubTabName = void 0; exports.FundingTabName = void 0;
|
|
1840
1973
|
var init_type = __esm({
|
|
1841
1974
|
"src/type.ts"() {
|
|
1842
1975
|
exports.MarketsPageTab = /* @__PURE__ */ ((MarketsPageTab2) => {
|
|
@@ -1850,8 +1983,15 @@ var init_type = __esm({
|
|
|
1850
1983
|
MarketsTabName2["All"] = "all";
|
|
1851
1984
|
MarketsTabName2["Rwa"] = "rwa";
|
|
1852
1985
|
MarketsTabName2["NewListing"] = "newListing";
|
|
1986
|
+
MarketsTabName2["Community"] = "community";
|
|
1853
1987
|
return MarketsTabName2;
|
|
1854
1988
|
})(exports.MarketsTabName || {});
|
|
1989
|
+
exports.CommunitySubTabName = /* @__PURE__ */ ((CommunitySubTabName2) => {
|
|
1990
|
+
CommunitySubTabName2["All"] = "all";
|
|
1991
|
+
CommunitySubTabName2["MyListings"] = "myListings";
|
|
1992
|
+
CommunitySubTabName2["OtherListings"] = "otherListings";
|
|
1993
|
+
return CommunitySubTabName2;
|
|
1994
|
+
})(exports.CommunitySubTabName || {});
|
|
1855
1995
|
exports.FundingTabName = /* @__PURE__ */ ((FundingTabName2) => {
|
|
1856
1996
|
FundingTabName2["Overview"] = "overview";
|
|
1857
1997
|
FundingTabName2["Comparison"] = "comparison";
|
|
@@ -1867,6 +2007,7 @@ var init_marketsList_script = __esm({
|
|
|
1867
2007
|
init_marketsProvider();
|
|
1868
2008
|
MarketsTypeMap = {
|
|
1869
2009
|
["all" /* All */]: hooks.MarketsType.ALL,
|
|
2010
|
+
["community" /* Community */]: hooks.MarketsType.COMMUNITY,
|
|
1870
2011
|
["rwa" /* Rwa */]: hooks.MarketsType.RWA,
|
|
1871
2012
|
["favorites" /* Favorites */]: hooks.MarketsType.FAVORITES,
|
|
1872
2013
|
["recent" /* Recent */]: hooks.MarketsType.RECENT,
|
|
@@ -1966,18 +2107,7 @@ var init_rwaTab = __esm({
|
|
|
1966
2107
|
};
|
|
1967
2108
|
RwaTab = () => {
|
|
1968
2109
|
const { t } = i18n.useTranslation();
|
|
1969
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
1970
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Text, { children: t("common.rwa") }),
|
|
1971
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1972
|
-
ui.Box,
|
|
1973
|
-
{
|
|
1974
|
-
r: "base",
|
|
1975
|
-
px: 2,
|
|
1976
|
-
className: "oui-bg-gradient-to-r oui-from-[rgb(var(--oui-gradient-brand-start)_/_0.12)] oui-to-[rgb(var(--oui-gradient-brand-end)_/_0.12)]",
|
|
1977
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(ui.GradientText, { color: "brand", children: t("common.new") })
|
|
1978
|
-
}
|
|
1979
|
-
)
|
|
1980
|
-
] });
|
|
2110
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ui.Flex, { gap: 1, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { children: t("common.rwa") }) });
|
|
1981
2111
|
};
|
|
1982
2112
|
}
|
|
1983
2113
|
});
|
|
@@ -2490,19 +2620,137 @@ var init_useFavoritesExtraProps = __esm({
|
|
|
2490
2620
|
init_marketsProvider();
|
|
2491
2621
|
}
|
|
2492
2622
|
});
|
|
2623
|
+
function isBuiltInMarketTab(tab) {
|
|
2624
|
+
return "type" in tab;
|
|
2625
|
+
}
|
|
2626
|
+
function isCustomMarketTab(tab) {
|
|
2627
|
+
return "id" in tab;
|
|
2628
|
+
}
|
|
2629
|
+
function tabKey(tab, index) {
|
|
2630
|
+
return isBuiltInMarketTab(tab) ? tab.type : tab.id || `category_${index}`;
|
|
2631
|
+
}
|
|
2632
|
+
function resolveIcon(icon) {
|
|
2633
|
+
if (typeof icon === "string") {
|
|
2634
|
+
return React6.createElement("img", {
|
|
2635
|
+
src: icon,
|
|
2636
|
+
alt: "",
|
|
2637
|
+
style: { width: 16, height: 16 }
|
|
2638
|
+
});
|
|
2639
|
+
}
|
|
2640
|
+
return icon;
|
|
2641
|
+
}
|
|
2642
|
+
function resolveSuffix(suffix) {
|
|
2643
|
+
if (typeof suffix === "undefined" || suffix === null) {
|
|
2644
|
+
return void 0;
|
|
2645
|
+
}
|
|
2646
|
+
if (typeof suffix === "string") {
|
|
2647
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "oui-ml-1 oui-inline-flex oui-items-center oui-rounded oui-bg-gradient-to-r oui-from-[rgb(var(--oui-gradient-brand-start)_/_0.12)] oui-to-[rgb(var(--oui-gradient-brand-end)_/_0.12)] oui-px-2", children: /* @__PURE__ */ jsxRuntime.jsx(ui.GradientText, { color: "brand", children: suffix }) });
|
|
2648
|
+
}
|
|
2649
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "oui-ml-1", children: suffix });
|
|
2650
|
+
}
|
|
2651
|
+
function composeTabTitle(label, options) {
|
|
2652
|
+
const icon = options?.icon;
|
|
2653
|
+
const suffix = resolveSuffix(options?.suffix);
|
|
2654
|
+
const hasLabel = typeof label !== "undefined" && label !== null && label !== "";
|
|
2655
|
+
if (!hasLabel) {
|
|
2656
|
+
if (!icon) {
|
|
2657
|
+
return suffix ?? null;
|
|
2658
|
+
}
|
|
2659
|
+
return suffix ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "oui-inline-flex oui-items-center oui-gap-x-1", children: [
|
|
2660
|
+
icon,
|
|
2661
|
+
suffix
|
|
2662
|
+
] }) : icon;
|
|
2663
|
+
}
|
|
2664
|
+
if (icon) {
|
|
2665
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "oui-inline-flex oui-items-center oui-gap-x-1", children: [
|
|
2666
|
+
icon,
|
|
2667
|
+
label,
|
|
2668
|
+
suffix
|
|
2669
|
+
] });
|
|
2670
|
+
}
|
|
2671
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2672
|
+
label,
|
|
2673
|
+
suffix
|
|
2674
|
+
] });
|
|
2675
|
+
}
|
|
2676
|
+
function resolveTabTriggerIcon(tab, fallbackIcon) {
|
|
2677
|
+
const resolvedIcon = typeof tab.icon !== "undefined" ? resolveIcon(tab.icon) : fallbackIcon;
|
|
2678
|
+
return React6.isValidElement(resolvedIcon) ? resolvedIcon : void 0;
|
|
2679
|
+
}
|
|
2680
|
+
function resolveTabTitle(tab, titleOverrides, rwaTitle) {
|
|
2681
|
+
if (isBuiltInMarketTab(tab) && tab.type === "favorites") {
|
|
2682
|
+
return /* @__PURE__ */ jsxRuntime.jsx(FavoritesIcon, {});
|
|
2683
|
+
}
|
|
2684
|
+
if (isBuiltInMarketTab(tab) && tab.type === "rwa") {
|
|
2685
|
+
return rwaTitle;
|
|
2686
|
+
}
|
|
2687
|
+
if (isBuiltInMarketTab(tab) && titleOverrides[tab.type]) {
|
|
2688
|
+
return tab.name ?? titleOverrides[tab.type];
|
|
2689
|
+
}
|
|
2690
|
+
return composeTabTitle(tab.name, {
|
|
2691
|
+
icon: resolveIcon(tab.icon),
|
|
2692
|
+
suffix: tab.suffix
|
|
2693
|
+
});
|
|
2694
|
+
}
|
|
2695
|
+
function useBuiltInTitles() {
|
|
2696
|
+
const { t } = i18n.useTranslation();
|
|
2697
|
+
return React6.useMemo(
|
|
2698
|
+
() => Object.fromEntries(
|
|
2699
|
+
Object.entries(BUILT_IN_TITLE_MAP).map(([key, i18nKey]) => [
|
|
2700
|
+
key,
|
|
2701
|
+
t(i18nKey)
|
|
2702
|
+
])
|
|
2703
|
+
),
|
|
2704
|
+
[t]
|
|
2705
|
+
);
|
|
2706
|
+
}
|
|
2707
|
+
function getCustomTabDataFilter(tab) {
|
|
2708
|
+
if (!tab) return void 0;
|
|
2709
|
+
return (data) => data.filter((item) => tab.match(item));
|
|
2710
|
+
}
|
|
2711
|
+
function useCustomTabDataFilters(tabs) {
|
|
2712
|
+
return React6.useMemo(() => {
|
|
2713
|
+
if (!tabs) return {};
|
|
2714
|
+
const result = {};
|
|
2715
|
+
tabs.forEach((tab, i) => {
|
|
2716
|
+
if (isCustomMarketTab(tab)) {
|
|
2717
|
+
result[tabKey(tab, i)] = (data) => data.filter((item) => tab.match(item));
|
|
2718
|
+
}
|
|
2719
|
+
});
|
|
2720
|
+
return result;
|
|
2721
|
+
}, [tabs]);
|
|
2722
|
+
}
|
|
2723
|
+
var BUILT_IN_TITLE_MAP;
|
|
2724
|
+
var init_tabUtils = __esm({
|
|
2725
|
+
"src/components/shared/tabUtils.tsx"() {
|
|
2726
|
+
init_icons();
|
|
2727
|
+
BUILT_IN_TITLE_MAP = {
|
|
2728
|
+
community: "markets.community",
|
|
2729
|
+
all: "common.all",
|
|
2730
|
+
newListing: "markets.newListings",
|
|
2731
|
+
recent: "markets.recent"
|
|
2732
|
+
};
|
|
2733
|
+
}
|
|
2734
|
+
});
|
|
2493
2735
|
var MobileMarketsDataList;
|
|
2494
2736
|
var init_marketsDataList_mobile_ui = __esm({
|
|
2495
2737
|
"src/pages/home/marketsDataList/marketsDataList.mobile.ui.tsx"() {
|
|
2738
|
+
init_communityBrokerTabs();
|
|
2496
2739
|
init_marketsList();
|
|
2740
|
+
init_marketsProvider();
|
|
2497
2741
|
init_rwaTab();
|
|
2498
2742
|
init_searchInput();
|
|
2499
2743
|
init_column();
|
|
2500
2744
|
init_useFavoritesExtraProps();
|
|
2745
|
+
init_tabUtils();
|
|
2746
|
+
init_useCommunityTabs();
|
|
2501
2747
|
init_icons();
|
|
2502
2748
|
init_type();
|
|
2503
2749
|
MobileMarketsDataList = (props) => {
|
|
2504
2750
|
const { activeTab, onTabChange, tabSort, onTabSort } = props;
|
|
2505
2751
|
const { t } = i18n.useTranslation();
|
|
2752
|
+
const { tabs } = useMarketsContext();
|
|
2753
|
+
const tabDataFilters = useCustomTabDataFilters(tabs);
|
|
2506
2754
|
const getColumns = React6.useCallback(
|
|
2507
2755
|
(favorite, isFavoriteList = false) => {
|
|
2508
2756
|
return [
|
|
@@ -2516,6 +2764,37 @@ var init_marketsDataList_mobile_ui = __esm({
|
|
|
2516
2764
|
[]
|
|
2517
2765
|
);
|
|
2518
2766
|
const { getFavoritesProps } = useFavoritesProps();
|
|
2767
|
+
const builtInMeta = React6.useMemo(
|
|
2768
|
+
() => ({
|
|
2769
|
+
favorites: {
|
|
2770
|
+
title: /* @__PURE__ */ jsxRuntime.jsx(FavoritesIcon, {}),
|
|
2771
|
+
value: "favorites",
|
|
2772
|
+
tabName: "favorites" /* Favorites */
|
|
2773
|
+
},
|
|
2774
|
+
community: {
|
|
2775
|
+
title: t("markets.community"),
|
|
2776
|
+
value: "community"
|
|
2777
|
+
},
|
|
2778
|
+
all: {
|
|
2779
|
+
title: t("markets.allMarkets"),
|
|
2780
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(AllMarketsIcon, {}),
|
|
2781
|
+
value: "all",
|
|
2782
|
+
tabName: "all" /* All */
|
|
2783
|
+
},
|
|
2784
|
+
rwa: {
|
|
2785
|
+
title: /* @__PURE__ */ jsxRuntime.jsx(RwaIconTab, {}),
|
|
2786
|
+
value: "rwa",
|
|
2787
|
+
tabName: "rwa" /* Rwa */
|
|
2788
|
+
},
|
|
2789
|
+
newListing: {
|
|
2790
|
+
title: t("markets.newListings"),
|
|
2791
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(NewListingsIcon, {}),
|
|
2792
|
+
value: "new",
|
|
2793
|
+
tabName: "newListing" /* NewListing */
|
|
2794
|
+
}
|
|
2795
|
+
}),
|
|
2796
|
+
[t]
|
|
2797
|
+
);
|
|
2519
2798
|
const renderTab = (type) => {
|
|
2520
2799
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2521
2800
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2542,7 +2821,20 @@ var init_marketsDataList_mobile_ui = __esm({
|
|
|
2542
2821
|
)
|
|
2543
2822
|
] });
|
|
2544
2823
|
};
|
|
2545
|
-
|
|
2824
|
+
const renderCommunityList = (selected) => {
|
|
2825
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2826
|
+
exports.MarketsListWidget,
|
|
2827
|
+
{
|
|
2828
|
+
type: "all" /* All */,
|
|
2829
|
+
initialSort: tabSort["community" /* Community */],
|
|
2830
|
+
onSort: onTabSort("community" /* Community */),
|
|
2831
|
+
getColumns,
|
|
2832
|
+
rowClassName: "!oui-h-[34px]",
|
|
2833
|
+
dataFilter: createCommunityBrokerFilter(selected)
|
|
2834
|
+
}
|
|
2835
|
+
);
|
|
2836
|
+
};
|
|
2837
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { id: "oui-markets-list", intensity: 900, py: 3, mt: 2, r: "2xl", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2546
2838
|
ui.Tabs,
|
|
2547
2839
|
{
|
|
2548
2840
|
variant: "contained",
|
|
@@ -2553,28 +2845,85 @@ var init_marketsDataList_mobile_ui = __esm({
|
|
|
2553
2845
|
scrollIndicator: "oui-mx-3"
|
|
2554
2846
|
},
|
|
2555
2847
|
showScrollIndicator: true,
|
|
2556
|
-
children:
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2848
|
+
children: tabs?.map((tab, index) => {
|
|
2849
|
+
const key = tabKey(tab, index);
|
|
2850
|
+
const isBuiltIn = isBuiltInMarketTab(tab);
|
|
2851
|
+
const meta = isBuiltIn ? builtInMeta[tab.type] : void 0;
|
|
2852
|
+
if (isBuiltIn && meta) {
|
|
2853
|
+
const title = tab.type === "favorites" ? composeTabTitle(tab.name, {
|
|
2854
|
+
icon: resolveTabTriggerIcon(tab, /* @__PURE__ */ jsxRuntime.jsx(FavoritesIcon, {})),
|
|
2855
|
+
suffix: tab.suffix
|
|
2856
|
+
}) : tab.type === "rwa" ? resolveTabTitle(tab, {}, /* @__PURE__ */ jsxRuntime.jsx(RwaIconTab, {})) : composeTabTitle(tab.name ?? meta.title, {
|
|
2857
|
+
suffix: tab.suffix
|
|
2858
|
+
});
|
|
2859
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2860
|
+
ui.TabPanel,
|
|
2861
|
+
{
|
|
2862
|
+
title,
|
|
2863
|
+
icon: tab.type === "favorites" || tab.type === "rwa" ? void 0 : resolveTabTriggerIcon(tab, meta.icon),
|
|
2864
|
+
value: meta.value,
|
|
2865
|
+
children: tab.type === "community" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2866
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2867
|
+
SearchInput,
|
|
2868
|
+
{
|
|
2869
|
+
classNames: {
|
|
2870
|
+
root: ui.cn("oui-mx-3 oui-mb-4 oui-mt-5", "oui-mb-2")
|
|
2871
|
+
}
|
|
2872
|
+
}
|
|
2873
|
+
),
|
|
2874
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2875
|
+
CommunityBrokerTabs,
|
|
2876
|
+
{
|
|
2877
|
+
storageKey: "orderly_mobile_markets_datalist_community_sel_sub_tab",
|
|
2878
|
+
size: "md",
|
|
2879
|
+
classNames: {
|
|
2880
|
+
tabsList: "oui-px-3 oui-pt-1 oui-pb-2",
|
|
2881
|
+
tabsContent: "oui-h-full",
|
|
2882
|
+
scrollIndicator: "oui-mx-3"
|
|
2883
|
+
},
|
|
2884
|
+
className: "oui-mobileMarketsDataList-community-tabs",
|
|
2885
|
+
showScrollIndicator: true,
|
|
2886
|
+
renderPanel: renderCommunityList
|
|
2887
|
+
}
|
|
2888
|
+
)
|
|
2889
|
+
] }) : renderTab(meta.tabName)
|
|
2890
|
+
},
|
|
2891
|
+
key
|
|
2892
|
+
);
|
|
2893
|
+
}
|
|
2894
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2569
2895
|
ui.TabPanel,
|
|
2570
2896
|
{
|
|
2571
|
-
title:
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2897
|
+
title: composeTabTitle(tab.name ?? key, {
|
|
2898
|
+
icon: resolveTabTriggerIcon(tab),
|
|
2899
|
+
suffix: tab.suffix
|
|
2900
|
+
}),
|
|
2901
|
+
value: key,
|
|
2902
|
+
children: [
|
|
2903
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2904
|
+
SearchInput,
|
|
2905
|
+
{
|
|
2906
|
+
classNames: {
|
|
2907
|
+
root: ui.cn("oui-mx-3 oui-mb-4 oui-mt-5", "oui-mb-2")
|
|
2908
|
+
}
|
|
2909
|
+
}
|
|
2910
|
+
),
|
|
2911
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2912
|
+
exports.MarketsListWidget,
|
|
2913
|
+
{
|
|
2914
|
+
type: "all" /* All */,
|
|
2915
|
+
dataFilter: (data) => tabDataFilters[key]?.(data) ?? data,
|
|
2916
|
+
initialSort: tabSort[key],
|
|
2917
|
+
onSort: onTabSort(key),
|
|
2918
|
+
getColumns,
|
|
2919
|
+
rowClassName: "!oui-h-[34px]"
|
|
2920
|
+
}
|
|
2921
|
+
)
|
|
2922
|
+
]
|
|
2923
|
+
},
|
|
2924
|
+
key
|
|
2925
|
+
);
|
|
2926
|
+
})
|
|
2578
2927
|
}
|
|
2579
2928
|
) });
|
|
2580
2929
|
};
|
|
@@ -2989,7 +3338,7 @@ var init_marketsListFull_script = __esm({
|
|
|
2989
3338
|
rwa: hooks.MarketsType.RWA
|
|
2990
3339
|
};
|
|
2991
3340
|
exports.useMarketsListFullScript = (options) => {
|
|
2992
|
-
const { type = "all" } = options;
|
|
3341
|
+
const { type = "all", dataFilter } = options;
|
|
2993
3342
|
const [loading, setLoading] = React6.useState(true);
|
|
2994
3343
|
const { setPage, pagination } = ui.usePagination({
|
|
2995
3344
|
pageSize: 100
|
|
@@ -2998,9 +3347,10 @@ var init_marketsListFull_script = __esm({
|
|
|
2998
3347
|
const { searchValue } = useMarketsContext();
|
|
2999
3348
|
const { onSort, getSortedList, sort } = useSort(options.initialSort);
|
|
3000
3349
|
const dataSource = React6.useMemo(() => {
|
|
3001
|
-
const
|
|
3350
|
+
const filtered = typeof dataFilter === "function" ? dataFilter(data) : data;
|
|
3351
|
+
const searchList = searchBySymbol(filtered, searchValue, "base-type");
|
|
3002
3352
|
return getSortedList(searchList);
|
|
3003
|
-
}, [data, getSortedList, searchValue]);
|
|
3353
|
+
}, [data, dataFilter, getSortedList, searchValue]);
|
|
3004
3354
|
React6.useEffect(() => {
|
|
3005
3355
|
setLoading(false);
|
|
3006
3356
|
}, [data]);
|
|
@@ -3056,11 +3406,15 @@ var init_marketsListFull = __esm({
|
|
|
3056
3406
|
init_marketsListFull_widget();
|
|
3057
3407
|
}
|
|
3058
3408
|
});
|
|
3059
|
-
var LazySearchInput, LazyFavoritesListFullWidget, LazyMarketsListFullWidget; exports.MarketsDataList = void 0;
|
|
3409
|
+
var LazySearchInput, LazyFavoritesListFullWidget, LazyMarketsListFullWidget, DEFAULT_SORT; exports.MarketsDataList = void 0;
|
|
3060
3410
|
var init_marketsDataList_ui = __esm({
|
|
3061
3411
|
"src/pages/home/marketsDataList/marketsDataList.ui.tsx"() {
|
|
3412
|
+
init_communityBrokerTabs();
|
|
3062
3413
|
init_favoritesEmpty();
|
|
3414
|
+
init_marketsProvider();
|
|
3063
3415
|
init_rwaTab();
|
|
3416
|
+
init_tabUtils();
|
|
3417
|
+
init_useCommunityTabs();
|
|
3064
3418
|
init_icons();
|
|
3065
3419
|
init_type();
|
|
3066
3420
|
LazySearchInput = React6__default.default.lazy(
|
|
@@ -3078,10 +3432,53 @@ var init_marketsDataList_ui = __esm({
|
|
|
3078
3432
|
return { default: mod.MarketsListFullWidget };
|
|
3079
3433
|
})
|
|
3080
3434
|
);
|
|
3435
|
+
DEFAULT_SORT = { sortKey: "24h_amount", sortOrder: "desc" };
|
|
3081
3436
|
exports.MarketsDataList = (props) => {
|
|
3082
3437
|
const { searchValue, activeTab, onTabChange } = props;
|
|
3083
3438
|
const { t } = i18n.useTranslation();
|
|
3084
|
-
|
|
3439
|
+
const { tabs } = useMarketsContext();
|
|
3440
|
+
const tabDataFilters = useCustomTabDataFilters(tabs);
|
|
3441
|
+
const builtInMeta = React6.useMemo(
|
|
3442
|
+
() => ({
|
|
3443
|
+
favorites: {
|
|
3444
|
+
title: /* @__PURE__ */ jsxRuntime.jsx(FavoritesIcon, {}),
|
|
3445
|
+
value: "favorites",
|
|
3446
|
+
testid: "oui-testid-markets-favorites-tab",
|
|
3447
|
+
initialSort: DEFAULT_SORT
|
|
3448
|
+
},
|
|
3449
|
+
community: {
|
|
3450
|
+
title: t("markets.community"),
|
|
3451
|
+
value: "community",
|
|
3452
|
+
testid: "oui-testid-markets-community-tab",
|
|
3453
|
+
initialSort: DEFAULT_SORT
|
|
3454
|
+
},
|
|
3455
|
+
all: {
|
|
3456
|
+
title: t("markets.allMarkets"),
|
|
3457
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(AllMarketsIcon, {}),
|
|
3458
|
+
value: "all",
|
|
3459
|
+
testid: "oui-testid-markets-all-tab",
|
|
3460
|
+
listType: "all",
|
|
3461
|
+
initialSort: DEFAULT_SORT
|
|
3462
|
+
},
|
|
3463
|
+
rwa: {
|
|
3464
|
+
title: /* @__PURE__ */ jsxRuntime.jsx(RwaIconTab, {}),
|
|
3465
|
+
value: "rwa",
|
|
3466
|
+
testid: "oui-testid-markets-rwa-tab",
|
|
3467
|
+
listType: "rwa",
|
|
3468
|
+
initialSort: DEFAULT_SORT
|
|
3469
|
+
},
|
|
3470
|
+
newListing: {
|
|
3471
|
+
title: t("markets.newListings"),
|
|
3472
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(NewListingsIcon, {}),
|
|
3473
|
+
value: "new",
|
|
3474
|
+
testid: "oui-testid-markets-newListing-tab",
|
|
3475
|
+
listType: "new",
|
|
3476
|
+
initialSort: { sortKey: "created_time", sortOrder: "desc" }
|
|
3477
|
+
}
|
|
3478
|
+
}),
|
|
3479
|
+
[t]
|
|
3480
|
+
);
|
|
3481
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { id: "oui-markets-list", intensity: 900, p: 6, r: "2xl", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3085
3482
|
ui.Tabs,
|
|
3086
3483
|
{
|
|
3087
3484
|
variant: "contained",
|
|
@@ -3091,93 +3488,98 @@ var init_marketsDataList_ui = __esm({
|
|
|
3091
3488
|
trailing: /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(LazySearchInput, { classNames: { root: "oui-my-1 oui-w-[240px]" } }) }),
|
|
3092
3489
|
classNames: {
|
|
3093
3490
|
tabsList: "oui-tabs-markets-list",
|
|
3094
|
-
tabsContent: "oui-tabs-markets-content"
|
|
3491
|
+
tabsContent: "oui-tabs-markets-content",
|
|
3492
|
+
scrollIndicator: "oui-mr-3"
|
|
3095
3493
|
},
|
|
3096
3494
|
className: "oui-markets-list-tabs",
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3495
|
+
showScrollIndicator: true,
|
|
3496
|
+
children: tabs?.map((tab, index) => {
|
|
3497
|
+
const key = tabKey(tab, index);
|
|
3498
|
+
const isBuiltIn = isBuiltInMarketTab(tab);
|
|
3499
|
+
const meta = isBuiltIn ? builtInMeta[tab.type] : void 0;
|
|
3500
|
+
if (isBuiltIn && meta) {
|
|
3501
|
+
const title = tab.type === "favorites" ? composeTabTitle(tab.name, {
|
|
3502
|
+
icon: resolveTabTriggerIcon(tab, /* @__PURE__ */ jsxRuntime.jsx(FavoritesIcon, {})),
|
|
3503
|
+
suffix: tab.suffix
|
|
3504
|
+
}) : tab.type === "rwa" ? resolveTabTitle(tab, {}, /* @__PURE__ */ jsxRuntime.jsx(RwaIconTab, {})) : composeTabTitle(tab.name ?? meta.title, {
|
|
3505
|
+
suffix: tab.suffix
|
|
3506
|
+
});
|
|
3507
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3508
|
+
ui.TabPanel,
|
|
3509
|
+
{
|
|
3510
|
+
classNames: {
|
|
3511
|
+
trigger: `oui-tabs-${meta.value}-trigger`,
|
|
3512
|
+
content: `oui-tabs-${meta.value}-content`
|
|
3513
|
+
},
|
|
3514
|
+
title,
|
|
3515
|
+
icon: tab.type === "favorites" || tab.type === "rwa" ? void 0 : resolveTabTriggerIcon(tab, meta.icon),
|
|
3516
|
+
value: meta.value,
|
|
3517
|
+
testid: meta.testid,
|
|
3518
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Suspense, { fallback: null, children: tab.type === "favorites" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3519
|
+
LazyFavoritesListFullWidget,
|
|
3520
|
+
{
|
|
3521
|
+
emptyView: !searchValue && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3522
|
+
FavoritesEmpty,
|
|
3523
|
+
{
|
|
3524
|
+
onClick: () => onTabChange("all" /* All */)
|
|
3525
|
+
}
|
|
3526
|
+
)
|
|
3527
|
+
}
|
|
3528
|
+
) : tab.type === "community" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3529
|
+
CommunityBrokerTabs,
|
|
3530
|
+
{
|
|
3531
|
+
storageKey: "orderly_markets_datalist_community_sel_sub_tab",
|
|
3532
|
+
size: "md",
|
|
3533
|
+
classNames: {
|
|
3534
|
+
tabsList: "oui-px-3 oui-pt-1 oui-pb-2",
|
|
3535
|
+
tabsContent: "oui-h-full"
|
|
3536
|
+
},
|
|
3537
|
+
className: "oui-marketsDataList-community-tabs",
|
|
3538
|
+
showScrollIndicator: true,
|
|
3539
|
+
renderPanel: (selected) => /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3540
|
+
LazyMarketsListFullWidget,
|
|
3541
|
+
{
|
|
3542
|
+
type: "all",
|
|
3543
|
+
initialSort: meta.initialSort,
|
|
3544
|
+
dataFilter: createCommunityBrokerFilter(selected)
|
|
3545
|
+
}
|
|
3546
|
+
) })
|
|
3547
|
+
}
|
|
3548
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
3549
|
+
LazyMarketsListFullWidget,
|
|
3550
|
+
{
|
|
3551
|
+
type: meta.listType,
|
|
3552
|
+
initialSort: meta.initialSort
|
|
3553
|
+
}
|
|
3554
|
+
) })
|
|
3104
3555
|
},
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
LazyFavoritesListFullWidget,
|
|
3110
|
-
{
|
|
3111
|
-
emptyView: !searchValue && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3112
|
-
FavoritesEmpty,
|
|
3113
|
-
{
|
|
3114
|
-
onClick: () => onTabChange("all" /* All */)
|
|
3115
|
-
}
|
|
3116
|
-
)
|
|
3117
|
-
}
|
|
3118
|
-
) })
|
|
3119
|
-
}
|
|
3120
|
-
),
|
|
3121
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3556
|
+
key
|
|
3557
|
+
);
|
|
3558
|
+
}
|
|
3559
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3122
3560
|
ui.TabPanel,
|
|
3123
3561
|
{
|
|
3124
3562
|
classNames: {
|
|
3125
|
-
trigger:
|
|
3126
|
-
content:
|
|
3563
|
+
trigger: `oui-tabs-${key}-trigger`,
|
|
3564
|
+
content: `oui-tabs-${key}-content`
|
|
3127
3565
|
},
|
|
3128
|
-
title:
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3566
|
+
title: composeTabTitle(tab.name ?? key, {
|
|
3567
|
+
icon: resolveTabTriggerIcon(tab),
|
|
3568
|
+
suffix: tab.suffix
|
|
3569
|
+
}),
|
|
3570
|
+
value: key,
|
|
3132
3571
|
children: /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3133
3572
|
LazyMarketsListFullWidget,
|
|
3134
3573
|
{
|
|
3135
3574
|
type: "all",
|
|
3136
|
-
initialSort:
|
|
3575
|
+
initialSort: DEFAULT_SORT,
|
|
3576
|
+
dataFilter: tabDataFilters[key]
|
|
3137
3577
|
}
|
|
3138
3578
|
) })
|
|
3139
|
-
}
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
{
|
|
3144
|
-
classNames: {
|
|
3145
|
-
trigger: "oui-tabs-rwa-trigger",
|
|
3146
|
-
content: "oui-tabs-rwa-content"
|
|
3147
|
-
},
|
|
3148
|
-
title: /* @__PURE__ */ jsxRuntime.jsx(RwaIconTab, {}),
|
|
3149
|
-
value: "rwa",
|
|
3150
|
-
testid: "oui-testid-markets-rwa-tab",
|
|
3151
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3152
|
-
LazyMarketsListFullWidget,
|
|
3153
|
-
{
|
|
3154
|
-
type: "rwa",
|
|
3155
|
-
initialSort: { sortKey: "24h_amount", sortOrder: "desc" }
|
|
3156
|
-
}
|
|
3157
|
-
) })
|
|
3158
|
-
}
|
|
3159
|
-
),
|
|
3160
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3161
|
-
ui.TabPanel,
|
|
3162
|
-
{
|
|
3163
|
-
classNames: {
|
|
3164
|
-
trigger: "oui-tabs-newListings-trigger",
|
|
3165
|
-
content: "oui-tabs-newListings-content"
|
|
3166
|
-
},
|
|
3167
|
-
title: t("markets.newListings"),
|
|
3168
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(NewListingsIcon, {}),
|
|
3169
|
-
value: "new",
|
|
3170
|
-
testid: "oui-testid-markets-newListings-tab",
|
|
3171
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3172
|
-
LazyMarketsListFullWidget,
|
|
3173
|
-
{
|
|
3174
|
-
type: "new",
|
|
3175
|
-
initialSort: { sortKey: "created_time", sortOrder: "desc" }
|
|
3176
|
-
}
|
|
3177
|
-
) })
|
|
3178
|
-
}
|
|
3179
|
-
)
|
|
3180
|
-
]
|
|
3579
|
+
},
|
|
3580
|
+
key
|
|
3581
|
+
);
|
|
3582
|
+
})
|
|
3181
3583
|
}
|
|
3182
3584
|
) });
|
|
3183
3585
|
};
|
|
@@ -3214,10 +3616,13 @@ var init_marketsDataList = __esm({
|
|
|
3214
3616
|
var LazySearchInput2, LazyMarketsListWidget, cls; exports.ExpandMarkets = void 0;
|
|
3215
3617
|
var init_expandMarkets_ui = __esm({
|
|
3216
3618
|
"src/components/expandMarkets/expandMarkets.ui.tsx"() {
|
|
3217
|
-
|
|
3619
|
+
init_useCommunityTabs();
|
|
3218
3620
|
init_type();
|
|
3621
|
+
init_communityBrokerTabs();
|
|
3622
|
+
init_marketsProvider();
|
|
3219
3623
|
init_rwaTab();
|
|
3220
3624
|
init_useFavoritesExtraProps();
|
|
3625
|
+
init_tabUtils();
|
|
3221
3626
|
LazySearchInput2 = React6__default.default.lazy(
|
|
3222
3627
|
() => Promise.resolve().then(() => (init_searchInput(), searchInput_exports)).then((mod) => {
|
|
3223
3628
|
return { default: mod.SearchInput };
|
|
@@ -3231,25 +3636,28 @@ var init_expandMarkets_ui = __esm({
|
|
|
3231
3636
|
cls = "oui-h-[calc(100%_-_36px)]";
|
|
3232
3637
|
exports.ExpandMarkets = (props) => {
|
|
3233
3638
|
const { activeTab, onTabChange, tabSort, onTabSort } = props;
|
|
3234
|
-
const { t } = i18n.useTranslation();
|
|
3235
3639
|
const { getFavoritesProps, renderEmptyView } = useFavoritesProps();
|
|
3236
|
-
const
|
|
3640
|
+
const builtInTitles = useBuiltInTitles();
|
|
3641
|
+
const { tabs } = useMarketsContext();
|
|
3642
|
+
const tabDataFilters = useCustomTabDataFilters(tabs);
|
|
3643
|
+
const renderBuiltInContent = (type) => {
|
|
3644
|
+
const tabType = type;
|
|
3237
3645
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cls, children: /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3238
3646
|
LazyMarketsListWidget,
|
|
3239
3647
|
{
|
|
3240
|
-
type,
|
|
3648
|
+
type: tabType,
|
|
3241
3649
|
initialSort: tabSort[type],
|
|
3242
|
-
onSort: onTabSort(
|
|
3650
|
+
onSort: onTabSort(tabType),
|
|
3243
3651
|
tableClassNames: {
|
|
3244
3652
|
root: "oui-expandMarkets-list",
|
|
3245
3653
|
scroll: ui.cn(
|
|
3246
3654
|
"oui-px-1",
|
|
3247
|
-
|
|
3655
|
+
tabType === "favorites" /* Favorites */ ? "oui-pb-9" : "oui-pb-2"
|
|
3248
3656
|
)
|
|
3249
3657
|
},
|
|
3250
|
-
...getFavoritesProps(
|
|
3658
|
+
...getFavoritesProps(tabType),
|
|
3251
3659
|
emptyView: renderEmptyView({
|
|
3252
|
-
type,
|
|
3660
|
+
type: tabType,
|
|
3253
3661
|
onClick: () => {
|
|
3254
3662
|
onTabChange("all" /* All */);
|
|
3255
3663
|
}
|
|
@@ -3257,6 +3665,48 @@ var init_expandMarkets_ui = __esm({
|
|
|
3257
3665
|
}
|
|
3258
3666
|
) }) });
|
|
3259
3667
|
};
|
|
3668
|
+
const renderCommunityContent = () => {
|
|
3669
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3670
|
+
CommunityBrokerTabs,
|
|
3671
|
+
{
|
|
3672
|
+
storageKey: "orderly_expand_markets_community_sel_sub_tab",
|
|
3673
|
+
classNames: {
|
|
3674
|
+
tabsList: "oui-px-3 oui-pt-1 oui-pb-2",
|
|
3675
|
+
tabsContent: "oui-h-full"
|
|
3676
|
+
},
|
|
3677
|
+
className: ui.cn("oui-expandMarkets-community-tabs", cls),
|
|
3678
|
+
showScrollIndicator: true,
|
|
3679
|
+
renderPanel: (selected) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cls, children: /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3680
|
+
LazyMarketsListWidget,
|
|
3681
|
+
{
|
|
3682
|
+
type: "all" /* All */,
|
|
3683
|
+
initialSort: tabSort["community" /* Community */],
|
|
3684
|
+
onSort: onTabSort("community" /* Community */),
|
|
3685
|
+
tableClassNames: {
|
|
3686
|
+
root: "oui-expandMarkets-list",
|
|
3687
|
+
scroll: ui.cn("oui-px-1", "oui-pb-2")
|
|
3688
|
+
},
|
|
3689
|
+
dataFilter: createCommunityBrokerFilter(selected)
|
|
3690
|
+
}
|
|
3691
|
+
) }) })
|
|
3692
|
+
}
|
|
3693
|
+
);
|
|
3694
|
+
};
|
|
3695
|
+
const renderCustomContent = (key) => {
|
|
3696
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cls, children: /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3697
|
+
LazyMarketsListWidget,
|
|
3698
|
+
{
|
|
3699
|
+
type: "all" /* All */,
|
|
3700
|
+
dataFilter: (data) => tabDataFilters[key]?.(data) ?? data,
|
|
3701
|
+
initialSort: tabSort[key],
|
|
3702
|
+
onSort: onTabSort(key),
|
|
3703
|
+
tableClassNames: {
|
|
3704
|
+
root: "oui-expandMarkets-list",
|
|
3705
|
+
scroll: ui.cn("oui-px-1", "oui-pb-2")
|
|
3706
|
+
}
|
|
3707
|
+
}
|
|
3708
|
+
) }) });
|
|
3709
|
+
};
|
|
3260
3710
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3261
3711
|
ui.Box,
|
|
3262
3712
|
{
|
|
@@ -3272,7 +3722,7 @@ var init_expandMarkets_ui = __esm({
|
|
|
3272
3722
|
classNames: { root: "oui-expandMarkets-search-input" }
|
|
3273
3723
|
}
|
|
3274
3724
|
) }) }),
|
|
3275
|
-
/* @__PURE__ */ jsxRuntime.
|
|
3725
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3276
3726
|
ui.Tabs,
|
|
3277
3727
|
{
|
|
3278
3728
|
variant: "contained",
|
|
@@ -3286,68 +3736,24 @@ var init_expandMarkets_ui = __esm({
|
|
|
3286
3736
|
},
|
|
3287
3737
|
className: ui.cn("oui-expandMarkets-tabs", cls),
|
|
3288
3738
|
showScrollIndicator: true,
|
|
3289
|
-
children:
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
trigger: "oui-tabs-favorites-trigger",
|
|
3295
|
-
content: "oui-tabs-favorites-content"
|
|
3296
|
-
},
|
|
3297
|
-
title: /* @__PURE__ */ jsxRuntime.jsx(FavoritesIcon, {}),
|
|
3298
|
-
value: "favorites" /* Favorites */,
|
|
3299
|
-
children: renderTab("favorites" /* Favorites */)
|
|
3300
|
-
}
|
|
3301
|
-
),
|
|
3302
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3303
|
-
ui.TabPanel,
|
|
3304
|
-
{
|
|
3305
|
-
classNames: {
|
|
3306
|
-
trigger: "oui-tabs-all-trigger",
|
|
3307
|
-
content: "oui-tabs-all-content"
|
|
3308
|
-
},
|
|
3309
|
-
title: t("common.all"),
|
|
3310
|
-
value: "all" /* All */,
|
|
3311
|
-
children: renderTab("all" /* All */)
|
|
3312
|
-
}
|
|
3313
|
-
),
|
|
3314
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3315
|
-
ui.TabPanel,
|
|
3316
|
-
{
|
|
3317
|
-
classNames: {
|
|
3318
|
-
trigger: "oui-tabs-rwa-trigger",
|
|
3319
|
-
content: "oui-tabs-rwa-content"
|
|
3320
|
-
},
|
|
3321
|
-
title: /* @__PURE__ */ jsxRuntime.jsx(RwaTab, {}),
|
|
3322
|
-
value: "rwa" /* Rwa */,
|
|
3323
|
-
children: renderTab("rwa" /* Rwa */)
|
|
3324
|
-
}
|
|
3325
|
-
),
|
|
3326
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3327
|
-
ui.TabPanel,
|
|
3328
|
-
{
|
|
3329
|
-
classNames: {
|
|
3330
|
-
trigger: "oui-tabs-newListings-trigger",
|
|
3331
|
-
content: "oui-tabs-newListings-content"
|
|
3332
|
-
},
|
|
3333
|
-
title: t("markets.newListings"),
|
|
3334
|
-
value: "newListing" /* NewListing */,
|
|
3335
|
-
children: renderTab("newListing" /* NewListing */)
|
|
3336
|
-
}
|
|
3337
|
-
),
|
|
3338
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3739
|
+
children: tabs?.map((tab, index) => {
|
|
3740
|
+
const key = tabKey(tab, index);
|
|
3741
|
+
const isBuiltIn = isBuiltInMarketTab(tab);
|
|
3742
|
+
const isCommunity = isBuiltIn && tab.type === "community" /* Community */;
|
|
3743
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3339
3744
|
ui.TabPanel,
|
|
3340
3745
|
{
|
|
3341
3746
|
classNames: {
|
|
3342
|
-
trigger:
|
|
3343
|
-
content:
|
|
3747
|
+
trigger: `oui-tabs-${key}-trigger`,
|
|
3748
|
+
content: `oui-tabs-${key}-content`
|
|
3344
3749
|
},
|
|
3345
|
-
title:
|
|
3346
|
-
value:
|
|
3347
|
-
children:
|
|
3348
|
-
}
|
|
3349
|
-
|
|
3350
|
-
|
|
3750
|
+
title: resolveTabTitle(tab, builtInTitles, /* @__PURE__ */ jsxRuntime.jsx(RwaTab, {})),
|
|
3751
|
+
value: key,
|
|
3752
|
+
children: isCommunity ? renderCommunityContent() : isBuiltIn ? renderBuiltInContent(tab.type) : renderCustomContent(key)
|
|
3753
|
+
},
|
|
3754
|
+
key
|
|
3755
|
+
);
|
|
3756
|
+
})
|
|
3351
3757
|
}
|
|
3352
3758
|
)
|
|
3353
3759
|
]
|
|
@@ -3404,10 +3810,94 @@ var init_expandMarkets_script = __esm({
|
|
|
3404
3810
|
init_useTabSort();
|
|
3405
3811
|
}
|
|
3406
3812
|
});
|
|
3813
|
+
|
|
3814
|
+
// src/registry/builtInTabRegistry.ts
|
|
3815
|
+
exports.builtInTabs = void 0; var componentDefaultTabs;
|
|
3816
|
+
var init_builtInTabRegistry = __esm({
|
|
3817
|
+
"src/registry/builtInTabRegistry.ts"() {
|
|
3818
|
+
exports.builtInTabs = {
|
|
3819
|
+
favorites: { type: "favorites" },
|
|
3820
|
+
community: {
|
|
3821
|
+
type: "community",
|
|
3822
|
+
isVisible: (symbolList) => {
|
|
3823
|
+
return symbolList.some((m) => Boolean(m?.broker_id));
|
|
3824
|
+
}
|
|
3825
|
+
},
|
|
3826
|
+
all: { type: "all" },
|
|
3827
|
+
rwa: { type: "rwa" },
|
|
3828
|
+
newListing: { type: "newListing" },
|
|
3829
|
+
recent: { type: "recent" }
|
|
3830
|
+
};
|
|
3831
|
+
componentDefaultTabs = {
|
|
3832
|
+
marketsSheet: [
|
|
3833
|
+
{ type: "favorites" },
|
|
3834
|
+
{ type: "all" },
|
|
3835
|
+
{ type: "rwa" },
|
|
3836
|
+
{ ...exports.builtInTabs.community }
|
|
3837
|
+
],
|
|
3838
|
+
expandMarkets: [
|
|
3839
|
+
{ type: "favorites" },
|
|
3840
|
+
{ type: "all" },
|
|
3841
|
+
{ type: "rwa" },
|
|
3842
|
+
{ ...exports.builtInTabs.community },
|
|
3843
|
+
{ type: "newListing" },
|
|
3844
|
+
{ type: "recent" }
|
|
3845
|
+
],
|
|
3846
|
+
dropDownMarkets: [
|
|
3847
|
+
{ type: "favorites" },
|
|
3848
|
+
{ type: "all" },
|
|
3849
|
+
{ type: "rwa" },
|
|
3850
|
+
{ ...exports.builtInTabs.community },
|
|
3851
|
+
{ type: "newListing" },
|
|
3852
|
+
{ type: "recent" }
|
|
3853
|
+
],
|
|
3854
|
+
subMenuMarkets: [
|
|
3855
|
+
{ type: "favorites" },
|
|
3856
|
+
{ type: "all" },
|
|
3857
|
+
{ type: "rwa" },
|
|
3858
|
+
{ ...exports.builtInTabs.community },
|
|
3859
|
+
{ type: "newListing" },
|
|
3860
|
+
{ type: "recent" }
|
|
3861
|
+
],
|
|
3862
|
+
marketsDataList: [
|
|
3863
|
+
{ type: "favorites" },
|
|
3864
|
+
{ type: "all" },
|
|
3865
|
+
{ type: "rwa" },
|
|
3866
|
+
{ ...exports.builtInTabs.community },
|
|
3867
|
+
{ type: "newListing" }
|
|
3868
|
+
],
|
|
3869
|
+
horizontalMarkets: [
|
|
3870
|
+
{ type: "all" },
|
|
3871
|
+
{ type: "recent" },
|
|
3872
|
+
{ type: "newListing" },
|
|
3873
|
+
{ type: "favorites" }
|
|
3874
|
+
]
|
|
3875
|
+
};
|
|
3876
|
+
}
|
|
3877
|
+
});
|
|
3878
|
+
function useMarketCategories(componentKey) {
|
|
3879
|
+
const marketTabs = hooks.useMarketCategoriesConfig();
|
|
3880
|
+
const { i18n: i18n2 } = i18n.useTranslation();
|
|
3881
|
+
const symbolList = hooks.useMarketList();
|
|
3882
|
+
const rwaSymbolsInfo = hooks.useRwaSymbolsInfo();
|
|
3883
|
+
return React6.useMemo(() => {
|
|
3884
|
+
const original = componentDefaultTabs[componentKey];
|
|
3885
|
+
const resolved = marketTabs ? marketTabs(original, { componentKey, builtIn: exports.builtInTabs }) : original;
|
|
3886
|
+
return resolved.filter(
|
|
3887
|
+
(tab) => tab.isVisible?.(symbolList, { rwaSymbolsInfo }) ?? true
|
|
3888
|
+
);
|
|
3889
|
+
}, [marketTabs, componentKey, i18n2.language, symbolList, rwaSymbolsInfo]);
|
|
3890
|
+
}
|
|
3891
|
+
var init_useMarketCategories = __esm({
|
|
3892
|
+
"src/components/shared/hooks/useMarketCategories.ts"() {
|
|
3893
|
+
init_builtInTabRegistry();
|
|
3894
|
+
}
|
|
3895
|
+
});
|
|
3407
3896
|
exports.ExpandMarketsWidget = void 0;
|
|
3408
3897
|
var init_expandMarkets_widget = __esm({
|
|
3409
3898
|
"src/components/expandMarkets/expandMarkets.widget.tsx"() {
|
|
3410
3899
|
init_marketsProvider();
|
|
3900
|
+
init_useMarketCategories();
|
|
3411
3901
|
init_expandMarkets_script();
|
|
3412
3902
|
init_expandMarkets_ui();
|
|
3413
3903
|
exports.ExpandMarketsWidget = (props) => {
|
|
@@ -3415,11 +3905,13 @@ var init_expandMarkets_widget = __esm({
|
|
|
3415
3905
|
activeTab: props.activeTab,
|
|
3416
3906
|
onTabChange: props.onTabChange
|
|
3417
3907
|
});
|
|
3908
|
+
const tabs = useMarketCategories("expandMarkets");
|
|
3418
3909
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3419
3910
|
exports.MarketsProvider,
|
|
3420
3911
|
{
|
|
3421
3912
|
symbol: props.symbol,
|
|
3422
3913
|
onSymbolChange: props.onSymbolChange,
|
|
3914
|
+
tabs,
|
|
3423
3915
|
children: /* @__PURE__ */ jsxRuntime.jsx(exports.ExpandMarkets, { ...state })
|
|
3424
3916
|
}
|
|
3425
3917
|
);
|
|
@@ -3464,7 +3956,7 @@ var init_columns = __esm({
|
|
|
3464
3956
|
title: t("markets.column.market"),
|
|
3465
3957
|
dataIndex: "symbol",
|
|
3466
3958
|
onSort: true,
|
|
3467
|
-
width:
|
|
3959
|
+
width: 180,
|
|
3468
3960
|
className: isMobile ? "oui-pl-0" : void 0,
|
|
3469
3961
|
render: (value, record) => {
|
|
3470
3962
|
if (isMobile) {
|
|
@@ -3854,7 +4346,7 @@ var init_columns2 = __esm({
|
|
|
3854
4346
|
{
|
|
3855
4347
|
title: t("markets.column.market"),
|
|
3856
4348
|
dataIndex: "symbol",
|
|
3857
|
-
width:
|
|
4349
|
+
width: 220,
|
|
3858
4350
|
onSort: true,
|
|
3859
4351
|
className: isMobile ? "oui-pl-0" : void 0,
|
|
3860
4352
|
render: (value, record) => {
|
|
@@ -4308,12 +4800,15 @@ var init_column4 = __esm({
|
|
|
4308
4800
|
exports.DropDownMarkets = void 0; exports.DropDownMarketsConetnt = void 0;
|
|
4309
4801
|
var init_dropDownMarkets_ui = __esm({
|
|
4310
4802
|
"src/components/dropDownMarkets/dropDownMarkets.ui.tsx"() {
|
|
4311
|
-
|
|
4803
|
+
init_useCommunityTabs();
|
|
4312
4804
|
init_type();
|
|
4805
|
+
init_communityBrokerTabs();
|
|
4313
4806
|
init_marketsList();
|
|
4807
|
+
init_marketsProvider();
|
|
4314
4808
|
init_rwaTab();
|
|
4315
4809
|
init_searchInput();
|
|
4316
4810
|
init_useFavoritesExtraProps();
|
|
4811
|
+
init_tabUtils();
|
|
4317
4812
|
init_column4();
|
|
4318
4813
|
exports.DropDownMarkets = (props) => {
|
|
4319
4814
|
return /* @__PURE__ */ jsxRuntime.jsxs(ui.DropdownMenuRoot, { open: props.open, onOpenChange: props.onOpenChange, children: [
|
|
@@ -4337,8 +4832,8 @@ var init_dropDownMarkets_ui = __esm({
|
|
|
4337
4832
|
};
|
|
4338
4833
|
exports.DropDownMarketsConetnt = (props) => {
|
|
4339
4834
|
const { activeTab, onTabChange, tabSort, onTabSort } = props;
|
|
4340
|
-
const { t } = i18n.useTranslation();
|
|
4341
4835
|
const getColumns = exports.useDropDownMarketsColumns();
|
|
4836
|
+
const builtInTitles = useBuiltInTitles();
|
|
4342
4837
|
const search = /* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { className: "oui-dropDownMarkets-search", mx: 3, gapX: 3, pt: 3, pb: 2, children: [
|
|
4343
4838
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4344
4839
|
SearchInput,
|
|
@@ -4360,22 +4855,24 @@ var init_dropDownMarkets_ui = __esm({
|
|
|
4360
4855
|
] });
|
|
4361
4856
|
const cls3 = "oui-h-[calc(100%_-_36px)]";
|
|
4362
4857
|
const { getFavoritesProps, renderEmptyView } = useFavoritesProps();
|
|
4363
|
-
const
|
|
4858
|
+
const { tabs } = useMarketsContext();
|
|
4859
|
+
const tabDataFilters = useCustomTabDataFilters(tabs);
|
|
4860
|
+
const renderBuiltInContent = (tabType) => {
|
|
4364
4861
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cls3, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4365
4862
|
exports.MarketsListWidget,
|
|
4366
4863
|
{
|
|
4367
|
-
type,
|
|
4368
|
-
initialSort: tabSort[
|
|
4369
|
-
onSort: onTabSort(
|
|
4864
|
+
type: tabType,
|
|
4865
|
+
initialSort: tabSort[tabType],
|
|
4866
|
+
onSort: onTabSort(tabType),
|
|
4370
4867
|
getColumns,
|
|
4371
4868
|
tableClassNames: {
|
|
4372
4869
|
root: ui.cn("oui-dropDownMarkets-list", "!oui-bg-base-8"),
|
|
4373
4870
|
scroll: "oui-pb-5 oui-px-1"
|
|
4374
4871
|
},
|
|
4375
4872
|
rowClassName: "!oui-h-[34px]",
|
|
4376
|
-
...getFavoritesProps(
|
|
4873
|
+
...getFavoritesProps(tabType),
|
|
4377
4874
|
emptyView: renderEmptyView({
|
|
4378
|
-
type,
|
|
4875
|
+
type: tabType,
|
|
4379
4876
|
onClick: () => {
|
|
4380
4877
|
onTabChange("all" /* All */);
|
|
4381
4878
|
}
|
|
@@ -4383,6 +4880,52 @@ var init_dropDownMarkets_ui = __esm({
|
|
|
4383
4880
|
}
|
|
4384
4881
|
) });
|
|
4385
4882
|
};
|
|
4883
|
+
const renderCommunityContent = () => {
|
|
4884
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4885
|
+
CommunityBrokerTabs,
|
|
4886
|
+
{
|
|
4887
|
+
storageKey: "orderly_dropdown_markets_community_sel_sub_tab",
|
|
4888
|
+
classNames: {
|
|
4889
|
+
tabsList: "oui-px-3 oui-pt-1 oui-pb-2",
|
|
4890
|
+
tabsContent: "oui-h-full"
|
|
4891
|
+
},
|
|
4892
|
+
className: ui.cn("oui-dropDownMarkets-community-tabs", cls3),
|
|
4893
|
+
showScrollIndicator: true,
|
|
4894
|
+
renderPanel: (selected) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cls3, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4895
|
+
exports.MarketsListWidget,
|
|
4896
|
+
{
|
|
4897
|
+
type: "all" /* All */,
|
|
4898
|
+
initialSort: tabSort["community" /* Community */],
|
|
4899
|
+
onSort: onTabSort("community" /* Community */),
|
|
4900
|
+
getColumns,
|
|
4901
|
+
tableClassNames: {
|
|
4902
|
+
root: ui.cn("oui-dropDownMarkets-list", "!oui-bg-base-8"),
|
|
4903
|
+
scroll: "oui-pb-5 oui-px-1"
|
|
4904
|
+
},
|
|
4905
|
+
rowClassName: "!oui-h-[34px]",
|
|
4906
|
+
dataFilter: createCommunityBrokerFilter(selected)
|
|
4907
|
+
}
|
|
4908
|
+
) })
|
|
4909
|
+
}
|
|
4910
|
+
);
|
|
4911
|
+
};
|
|
4912
|
+
const renderCustomContent = (key) => {
|
|
4913
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cls3, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4914
|
+
exports.MarketsListWidget,
|
|
4915
|
+
{
|
|
4916
|
+
type: "all" /* All */,
|
|
4917
|
+
dataFilter: (data) => tabDataFilters[key]?.(data) ?? data,
|
|
4918
|
+
initialSort: tabSort[key],
|
|
4919
|
+
onSort: onTabSort(key),
|
|
4920
|
+
getColumns,
|
|
4921
|
+
tableClassNames: {
|
|
4922
|
+
root: ui.cn("oui-dropDownMarkets-list", "!oui-bg-base-8"),
|
|
4923
|
+
scroll: "oui-pb-5 oui-px-1"
|
|
4924
|
+
},
|
|
4925
|
+
rowClassName: "!oui-h-[34px]"
|
|
4926
|
+
}
|
|
4927
|
+
) });
|
|
4928
|
+
};
|
|
4386
4929
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4387
4930
|
ui.Box,
|
|
4388
4931
|
{
|
|
@@ -4394,7 +4937,7 @@ var init_dropDownMarkets_ui = __esm({
|
|
|
4394
4937
|
intensity: 800,
|
|
4395
4938
|
children: [
|
|
4396
4939
|
search,
|
|
4397
|
-
/* @__PURE__ */ jsxRuntime.
|
|
4940
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4398
4941
|
ui.Tabs,
|
|
4399
4942
|
{
|
|
4400
4943
|
variant: "contained",
|
|
@@ -4402,72 +4945,31 @@ var init_dropDownMarkets_ui = __esm({
|
|
|
4402
4945
|
value: activeTab,
|
|
4403
4946
|
onValueChange: onTabChange,
|
|
4404
4947
|
classNames: {
|
|
4405
|
-
|
|
4406
|
-
|
|
4948
|
+
tabsListContainer: "oui-px-3",
|
|
4949
|
+
tabsList: "oui-my-[6px]",
|
|
4950
|
+
tabsContent: "oui-h-full",
|
|
4951
|
+
scrollIndicator: "oui-mx-0"
|
|
4407
4952
|
},
|
|
4408
4953
|
className: ui.cn("oui-dropDownMarkets-tabs", cls3),
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
content: "oui-tabs-favorites-content"
|
|
4416
|
-
},
|
|
4417
|
-
title: /* @__PURE__ */ jsxRuntime.jsx(FavoritesIcon, {}),
|
|
4418
|
-
value: "favorites" /* Favorites */,
|
|
4419
|
-
children: renderTab("favorites" /* Favorites */)
|
|
4420
|
-
}
|
|
4421
|
-
),
|
|
4422
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4423
|
-
ui.TabPanel,
|
|
4424
|
-
{
|
|
4425
|
-
classNames: {
|
|
4426
|
-
trigger: "oui-tabs-all-trigger",
|
|
4427
|
-
content: "oui-tabs-all-content"
|
|
4428
|
-
},
|
|
4429
|
-
title: t("common.all"),
|
|
4430
|
-
value: "all" /* All */,
|
|
4431
|
-
children: renderTab("all" /* All */)
|
|
4432
|
-
}
|
|
4433
|
-
),
|
|
4434
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4435
|
-
ui.TabPanel,
|
|
4436
|
-
{
|
|
4437
|
-
classNames: {
|
|
4438
|
-
trigger: "oui-tabs-rwa-trigger",
|
|
4439
|
-
content: "oui-tabs-rwa-content"
|
|
4440
|
-
},
|
|
4441
|
-
title: /* @__PURE__ */ jsxRuntime.jsx(RwaTab, {}),
|
|
4442
|
-
value: "rwa" /* Rwa */,
|
|
4443
|
-
children: renderTab("rwa" /* Rwa */)
|
|
4444
|
-
}
|
|
4445
|
-
),
|
|
4446
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4447
|
-
ui.TabPanel,
|
|
4448
|
-
{
|
|
4449
|
-
classNames: {
|
|
4450
|
-
trigger: "oui-tabs-newListings-trigger",
|
|
4451
|
-
content: "oui-tabs-newListings-content"
|
|
4452
|
-
},
|
|
4453
|
-
title: t("markets.newListings"),
|
|
4454
|
-
value: "newListing" /* NewListing */,
|
|
4455
|
-
children: renderTab("newListing" /* NewListing */)
|
|
4456
|
-
}
|
|
4457
|
-
),
|
|
4458
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4954
|
+
showScrollIndicator: true,
|
|
4955
|
+
children: tabs?.map((tab, index) => {
|
|
4956
|
+
const key = tabKey(tab, index);
|
|
4957
|
+
const isBuiltIn = isBuiltInMarketTab(tab);
|
|
4958
|
+
const isCommunity = isBuiltIn && tab.type === "community" /* Community */;
|
|
4959
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4459
4960
|
ui.TabPanel,
|
|
4460
4961
|
{
|
|
4461
4962
|
classNames: {
|
|
4462
|
-
trigger:
|
|
4463
|
-
content:
|
|
4963
|
+
trigger: `oui-tabs-${key}-trigger`,
|
|
4964
|
+
content: `oui-tabs-${key}-content`
|
|
4464
4965
|
},
|
|
4465
|
-
title:
|
|
4466
|
-
value:
|
|
4467
|
-
children:
|
|
4468
|
-
}
|
|
4469
|
-
|
|
4470
|
-
|
|
4966
|
+
title: resolveTabTitle(tab, builtInTitles, /* @__PURE__ */ jsxRuntime.jsx(RwaTab, {})),
|
|
4967
|
+
value: key,
|
|
4968
|
+
children: isCommunity ? renderCommunityContent() : isBuiltIn ? renderBuiltInContent(tab.type) : renderCustomContent(key)
|
|
4969
|
+
},
|
|
4970
|
+
key
|
|
4971
|
+
);
|
|
4972
|
+
})
|
|
4471
4973
|
}
|
|
4472
4974
|
)
|
|
4473
4975
|
]
|
|
@@ -4516,15 +5018,18 @@ exports.DropDownMarketsWidget = void 0;
|
|
|
4516
5018
|
var init_dropDownMarkets_widget = __esm({
|
|
4517
5019
|
"src/components/dropDownMarkets/dropDownMarkets.widget.tsx"() {
|
|
4518
5020
|
init_marketsProvider();
|
|
5021
|
+
init_useMarketCategories();
|
|
4519
5022
|
init_dropDownMarkets_script();
|
|
4520
5023
|
init_dropDownMarkets_ui();
|
|
4521
5024
|
exports.DropDownMarketsWidget = (props) => {
|
|
4522
5025
|
const state = useDropDownMarketsScript();
|
|
5026
|
+
const tabs = useMarketCategories("dropDownMarkets");
|
|
4523
5027
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4524
5028
|
exports.MarketsProvider,
|
|
4525
5029
|
{
|
|
4526
5030
|
symbol: props.symbol,
|
|
4527
5031
|
onSymbolChange: props.onSymbolChange,
|
|
5032
|
+
tabs,
|
|
4528
5033
|
children: /* @__PURE__ */ jsxRuntime.jsx(exports.DropDownMarkets, { ...state, contentClassName: props.contentClassName, children: props.children })
|
|
4529
5034
|
}
|
|
4530
5035
|
);
|
|
@@ -4665,26 +5170,47 @@ var init_marketItem_ui = __esm({
|
|
|
4665
5170
|
exports.MarketItem.displayName = "MarketItem";
|
|
4666
5171
|
}
|
|
4667
5172
|
});
|
|
4668
|
-
|
|
5173
|
+
exports.MarketTypeFilter = void 0;
|
|
4669
5174
|
var init_marketTypeFilter_ui = __esm({
|
|
4670
5175
|
"src/components/horizontalMarkets/marketTypeFilter.ui.tsx"() {
|
|
4671
5176
|
init_icons();
|
|
4672
|
-
|
|
4673
|
-
{ value: "recent", label: "Recent", translationKey: "Recent" },
|
|
4674
|
-
{ value: "all", label: "All Markets", translationKey: "All" },
|
|
4675
|
-
{ value: "newListing", label: "New Listing", translationKey: "New listing" }
|
|
4676
|
-
];
|
|
5177
|
+
init_tabUtils();
|
|
4677
5178
|
exports.MarketTypeFilter = (props) => {
|
|
4678
5179
|
const {
|
|
4679
5180
|
selectedMarketType,
|
|
4680
5181
|
onMarketTypeChange,
|
|
4681
5182
|
className,
|
|
4682
|
-
position = "bottom"
|
|
5183
|
+
position = "bottom",
|
|
5184
|
+
tabs
|
|
4683
5185
|
} = props;
|
|
5186
|
+
const { t } = i18n.useTranslation();
|
|
5187
|
+
const orderedOptions = React6__default.default.useMemo(() => {
|
|
5188
|
+
if (!tabs) return [];
|
|
5189
|
+
return tabs.filter(
|
|
5190
|
+
(tab) => isCustomMarketTab(tab) || isBuiltInMarketTab(tab) && tab.type !== "favorites"
|
|
5191
|
+
);
|
|
5192
|
+
}, [tabs]);
|
|
5193
|
+
const hasFavoritesTab = React6__default.default.useMemo(() => {
|
|
5194
|
+
return tabs?.some(
|
|
5195
|
+
(tab) => isBuiltInMarketTab(tab) && tab.type === "favorites"
|
|
5196
|
+
);
|
|
5197
|
+
}, [tabs]);
|
|
4684
5198
|
const [isOpen, setIsOpen] = React6.useState(false);
|
|
4685
5199
|
const dropdownRef = React6.useRef(null);
|
|
4686
5200
|
const [, favorite] = hooks.useMarkets(hooks.MarketsType.FAVORITES);
|
|
4687
5201
|
const hasFavorites = (favorite?.favorites?.length || 0) > 0;
|
|
5202
|
+
const titleOverrides = React6__default.default.useMemo(
|
|
5203
|
+
() => ({
|
|
5204
|
+
all: t("markets.allMarkets"),
|
|
5205
|
+
newListing: t("markets.newListings"),
|
|
5206
|
+
recent: t("markets.recent")
|
|
5207
|
+
}),
|
|
5208
|
+
[t]
|
|
5209
|
+
);
|
|
5210
|
+
const getOptionLabel = React6.useCallback(
|
|
5211
|
+
(tab) => resolveTabTitle(tab, titleOverrides, t("common.rwa")),
|
|
5212
|
+
[t, titleOverrides]
|
|
5213
|
+
);
|
|
4688
5214
|
React6.useEffect(() => {
|
|
4689
5215
|
const handleClickOutside = (event) => {
|
|
4690
5216
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
@@ -4750,41 +5276,46 @@ var init_marketTypeFilter_ui = __esm({
|
|
|
4750
5276
|
wrap: "wrap",
|
|
4751
5277
|
gapY: 1,
|
|
4752
5278
|
className: "oui-gap-x-2 md:oui-gap-x-3",
|
|
4753
|
-
children:
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
5279
|
+
children: orderedOptions.map((tab) => {
|
|
5280
|
+
const optionValue = isCustomMarketTab(tab) ? tab.id : tab.type;
|
|
5281
|
+
const isActive = selectedMarketType === optionValue;
|
|
5282
|
+
const htmlId = `toggle_market_type_${optionValue}`;
|
|
5283
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5284
|
+
ui.Flex,
|
|
5285
|
+
{
|
|
5286
|
+
className: ui.cn("oui-cursor-pointer"),
|
|
5287
|
+
itemAlign: "center",
|
|
5288
|
+
onClick: () => handleOptionClick(optionValue),
|
|
5289
|
+
children: [
|
|
5290
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5291
|
+
ui.Checkbox,
|
|
5292
|
+
{
|
|
5293
|
+
"data-testid": `oui-testid-marketType-${optionValue}-checkBox`,
|
|
5294
|
+
id: htmlId,
|
|
5295
|
+
className: "oui-peer",
|
|
5296
|
+
color: "white",
|
|
5297
|
+
checked: isActive
|
|
5298
|
+
}
|
|
5299
|
+
),
|
|
5300
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5301
|
+
"label",
|
|
5302
|
+
{
|
|
5303
|
+
htmlFor: htmlId,
|
|
5304
|
+
className: ui.cn(
|
|
5305
|
+
"oui-text-2xs oui-ml-1",
|
|
5306
|
+
"oui-break-normal oui-whitespace-nowrap oui-cursor-pointer"
|
|
5307
|
+
),
|
|
5308
|
+
children: getOptionLabel(tab)
|
|
5309
|
+
}
|
|
5310
|
+
)
|
|
5311
|
+
]
|
|
5312
|
+
},
|
|
5313
|
+
optionValue
|
|
5314
|
+
);
|
|
5315
|
+
})
|
|
4785
5316
|
}
|
|
4786
5317
|
),
|
|
4787
|
-
hasFavorites && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5318
|
+
hasFavoritesTab && hasFavorites && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4788
5319
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4789
5320
|
ui.Divider,
|
|
4790
5321
|
{
|
|
@@ -4863,6 +5394,7 @@ __export(horizontalMarkets_ui_exports, {
|
|
|
4863
5394
|
exports.HorizontalMarkets = void 0;
|
|
4864
5395
|
var init_horizontalMarkets_ui = __esm({
|
|
4865
5396
|
"src/components/horizontalMarkets/horizontalMarkets.ui.tsx"() {
|
|
5397
|
+
init_marketsProvider();
|
|
4866
5398
|
init_marketItem_ui();
|
|
4867
5399
|
init_marketTypeFilter_ui();
|
|
4868
5400
|
exports.HorizontalMarkets = React6__default.default.memo((props) => {
|
|
@@ -4876,6 +5408,7 @@ var init_horizontalMarkets_ui = __esm({
|
|
|
4876
5408
|
className,
|
|
4877
5409
|
dropdownPos
|
|
4878
5410
|
} = props;
|
|
5411
|
+
const { tabs } = useMarketsContext();
|
|
4879
5412
|
const renderMarketItem = React6__default.default.useCallback(
|
|
4880
5413
|
(symbol, index) => {
|
|
4881
5414
|
const data = tickerData[symbol];
|
|
@@ -4934,7 +5467,8 @@ var init_horizontalMarkets_ui = __esm({
|
|
|
4934
5467
|
{
|
|
4935
5468
|
selectedMarketType,
|
|
4936
5469
|
onMarketTypeChange,
|
|
4937
|
-
position: dropdownPos
|
|
5470
|
+
position: dropdownPos,
|
|
5471
|
+
tabs
|
|
4938
5472
|
}
|
|
4939
5473
|
),
|
|
4940
5474
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5151,12 +5685,15 @@ init_favoritesTabs();
|
|
|
5151
5685
|
init_expandMarkets();
|
|
5152
5686
|
|
|
5153
5687
|
// src/components/subMenuMarkets/subMenuMarkets.ui.tsx
|
|
5154
|
-
|
|
5688
|
+
init_useCommunityTabs();
|
|
5155
5689
|
init_type();
|
|
5690
|
+
init_communityBrokerTabs();
|
|
5156
5691
|
init_favoritesTabs();
|
|
5157
5692
|
init_marketsList();
|
|
5693
|
+
init_marketsProvider();
|
|
5158
5694
|
init_rwaTab();
|
|
5159
5695
|
init_useFavoritesExtraProps();
|
|
5696
|
+
init_tabUtils();
|
|
5160
5697
|
init_symbolDisplay();
|
|
5161
5698
|
var LIST_ROW_COMPACT = "oui-h-auto";
|
|
5162
5699
|
var TABLE_CLASSNAMES = {
|
|
@@ -5193,8 +5730,10 @@ var MarketTabPanel = ({
|
|
|
5193
5730
|
};
|
|
5194
5731
|
var SubMenuMarkets = (props) => {
|
|
5195
5732
|
const { activeTab, onTabChange, className, tabSort, onTabSort } = props;
|
|
5196
|
-
const { t } = i18n.useTranslation();
|
|
5197
5733
|
const { getFavoritesProps } = useFavoritesProps();
|
|
5734
|
+
const builtInTitles = useBuiltInTitles();
|
|
5735
|
+
const { tabs } = useMarketsContext();
|
|
5736
|
+
const tabDataFilters = useCustomTabDataFilters(tabs);
|
|
5198
5737
|
const getColumns = (_favorite, _isFavoritesList) => {
|
|
5199
5738
|
return [
|
|
5200
5739
|
{
|
|
@@ -5214,6 +5753,71 @@ var SubMenuMarkets = (props) => {
|
|
|
5214
5753
|
}
|
|
5215
5754
|
];
|
|
5216
5755
|
};
|
|
5756
|
+
const renderBuiltInContent = (tabType) => {
|
|
5757
|
+
if (tabType === "favorites" /* Favorites */) {
|
|
5758
|
+
const favProps = getFavoritesProps("favorites" /* Favorites */);
|
|
5759
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5760
|
+
MarketTabPanel,
|
|
5761
|
+
{
|
|
5762
|
+
type: "favorites" /* Favorites */,
|
|
5763
|
+
getColumns,
|
|
5764
|
+
dataFilter: favProps?.dataFilter,
|
|
5765
|
+
renderHeader: (favorite) => /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { className: "oui-px-1 oui-my-1", children: /* @__PURE__ */ jsxRuntime.jsx(exports.FavoritesTabWidget, { favorite, size: "sm" }) }),
|
|
5766
|
+
initialSort: tabSort["favorites" /* Favorites */],
|
|
5767
|
+
onSort: onTabSort("favorites" /* Favorites */),
|
|
5768
|
+
emptyView: /* @__PURE__ */ jsxRuntime.jsx(ui.EmptyDataState, {})
|
|
5769
|
+
}
|
|
5770
|
+
);
|
|
5771
|
+
}
|
|
5772
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5773
|
+
MarketTabPanel,
|
|
5774
|
+
{
|
|
5775
|
+
type: tabType,
|
|
5776
|
+
getColumns,
|
|
5777
|
+
initialSort: tabSort[tabType],
|
|
5778
|
+
onSort: onTabSort(tabType)
|
|
5779
|
+
}
|
|
5780
|
+
);
|
|
5781
|
+
};
|
|
5782
|
+
const renderCommunityContent = () => {
|
|
5783
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5784
|
+
CommunityBrokerTabs,
|
|
5785
|
+
{
|
|
5786
|
+
storageKey: "orderly_submenu_markets_community_sel_sub_tab",
|
|
5787
|
+
classNames: {
|
|
5788
|
+
tabsList: "oui-px-1 oui-pt-1 oui-pb-2",
|
|
5789
|
+
tabsContent: "oui-h-full",
|
|
5790
|
+
scrollIndicator: "oui-mx-1"
|
|
5791
|
+
},
|
|
5792
|
+
className: ui.cn("oui-subMenuMarkets-community-tabs", cls2),
|
|
5793
|
+
showScrollIndicator: true,
|
|
5794
|
+
renderPanel: (selected) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5795
|
+
MarketTabPanel,
|
|
5796
|
+
{
|
|
5797
|
+
type: "all" /* All */,
|
|
5798
|
+
getColumns,
|
|
5799
|
+
dataFilter: createCommunityBrokerFilter(selected),
|
|
5800
|
+
initialSort: tabSort["community" /* Community */],
|
|
5801
|
+
onSort: onTabSort("community" /* Community */)
|
|
5802
|
+
}
|
|
5803
|
+
)
|
|
5804
|
+
}
|
|
5805
|
+
);
|
|
5806
|
+
};
|
|
5807
|
+
const renderCustomContent = (key) => {
|
|
5808
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cls2, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5809
|
+
exports.MarketsListWidget,
|
|
5810
|
+
{
|
|
5811
|
+
type: "all" /* All */,
|
|
5812
|
+
getColumns,
|
|
5813
|
+
tableClassNames: TABLE_CLASSNAMES,
|
|
5814
|
+
rowClassName: LIST_ROW_COMPACT,
|
|
5815
|
+
dataFilter: (data) => tabDataFilters[key]?.(data) ?? data,
|
|
5816
|
+
initialSort: tabSort[key],
|
|
5817
|
+
onSort: onTabSort(key)
|
|
5818
|
+
}
|
|
5819
|
+
) });
|
|
5820
|
+
};
|
|
5217
5821
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5218
5822
|
ui.Box,
|
|
5219
5823
|
{
|
|
@@ -5224,7 +5828,7 @@ var SubMenuMarkets = (props) => {
|
|
|
5224
5828
|
height: "100%",
|
|
5225
5829
|
children: [
|
|
5226
5830
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Box, { className: "oui-p-1", children: /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(LazySearchInput3, {}) }) }),
|
|
5227
|
-
/* @__PURE__ */ jsxRuntime.
|
|
5831
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5228
5832
|
ui.Tabs,
|
|
5229
5833
|
{
|
|
5230
5834
|
variant: "contained",
|
|
@@ -5238,114 +5842,24 @@ var SubMenuMarkets = (props) => {
|
|
|
5238
5842
|
},
|
|
5239
5843
|
className: ui.cn(cls2, "oui-subMenuMarkets-tabs oui-my-1.5"),
|
|
5240
5844
|
showScrollIndicator: true,
|
|
5241
|
-
children:
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
trigger: "oui-tabs-favorites-trigger",
|
|
5247
|
-
content: "oui-tabs-favorites-content"
|
|
5248
|
-
},
|
|
5249
|
-
title: /* @__PURE__ */ jsxRuntime.jsx(FavoritesIcon, {}),
|
|
5250
|
-
value: "favorites" /* Favorites */,
|
|
5251
|
-
children: (() => {
|
|
5252
|
-
const favProps = getFavoritesProps("favorites" /* Favorites */);
|
|
5253
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5254
|
-
MarketTabPanel,
|
|
5255
|
-
{
|
|
5256
|
-
type: "favorites" /* Favorites */,
|
|
5257
|
-
getColumns,
|
|
5258
|
-
dataFilter: favProps?.dataFilter,
|
|
5259
|
-
renderHeader: (favorite) => /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { className: "oui-px-1 oui-my-1", children: /* @__PURE__ */ jsxRuntime.jsx(exports.FavoritesTabWidget, { favorite, size: "sm" }) }),
|
|
5260
|
-
initialSort: tabSort["favorites" /* Favorites */],
|
|
5261
|
-
onSort: onTabSort("favorites" /* Favorites */),
|
|
5262
|
-
emptyView: /* @__PURE__ */ jsxRuntime.jsx(ui.EmptyDataState, {})
|
|
5263
|
-
}
|
|
5264
|
-
);
|
|
5265
|
-
})()
|
|
5266
|
-
}
|
|
5267
|
-
),
|
|
5268
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5269
|
-
ui.TabPanel,
|
|
5270
|
-
{
|
|
5271
|
-
classNames: {
|
|
5272
|
-
trigger: "oui-tabs-all-trigger",
|
|
5273
|
-
content: "oui-tabs-all-content"
|
|
5274
|
-
},
|
|
5275
|
-
title: t("common.all"),
|
|
5276
|
-
value: "all" /* All */,
|
|
5277
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5278
|
-
MarketTabPanel,
|
|
5279
|
-
{
|
|
5280
|
-
type: "all" /* All */,
|
|
5281
|
-
getColumns,
|
|
5282
|
-
initialSort: tabSort["all" /* All */],
|
|
5283
|
-
onSort: onTabSort("all" /* All */)
|
|
5284
|
-
}
|
|
5285
|
-
)
|
|
5286
|
-
}
|
|
5287
|
-
),
|
|
5288
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5289
|
-
ui.TabPanel,
|
|
5290
|
-
{
|
|
5291
|
-
classNames: {
|
|
5292
|
-
trigger: "oui-tabs-rwa-trigger",
|
|
5293
|
-
content: "oui-tabs-rwa-content"
|
|
5294
|
-
},
|
|
5295
|
-
title: /* @__PURE__ */ jsxRuntime.jsx(RwaIconTab, {}),
|
|
5296
|
-
value: "rwa" /* Rwa */,
|
|
5297
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5298
|
-
MarketTabPanel,
|
|
5299
|
-
{
|
|
5300
|
-
type: "rwa" /* Rwa */,
|
|
5301
|
-
getColumns,
|
|
5302
|
-
initialSort: tabSort["rwa" /* Rwa */],
|
|
5303
|
-
onSort: onTabSort("rwa" /* Rwa */)
|
|
5304
|
-
}
|
|
5305
|
-
)
|
|
5306
|
-
}
|
|
5307
|
-
),
|
|
5308
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5309
|
-
ui.TabPanel,
|
|
5310
|
-
{
|
|
5311
|
-
classNames: {
|
|
5312
|
-
trigger: "oui-tabs-newListings-trigger",
|
|
5313
|
-
content: "oui-tabs-newListings-content"
|
|
5314
|
-
},
|
|
5315
|
-
title: t("markets.newListings"),
|
|
5316
|
-
value: "newListing" /* NewListing */,
|
|
5317
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5318
|
-
MarketTabPanel,
|
|
5319
|
-
{
|
|
5320
|
-
type: "newListing" /* NewListing */,
|
|
5321
|
-
getColumns,
|
|
5322
|
-
initialSort: tabSort["newListing" /* NewListing */],
|
|
5323
|
-
onSort: onTabSort("newListing" /* NewListing */)
|
|
5324
|
-
}
|
|
5325
|
-
)
|
|
5326
|
-
}
|
|
5327
|
-
),
|
|
5328
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5845
|
+
children: tabs?.map((tab, index) => {
|
|
5846
|
+
const key = tabKey(tab, index);
|
|
5847
|
+
const isBuiltIn = isBuiltInMarketTab(tab);
|
|
5848
|
+
const isCommunity = isBuiltIn && tab.type === "community" /* Community */;
|
|
5849
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5329
5850
|
ui.TabPanel,
|
|
5330
5851
|
{
|
|
5331
5852
|
classNames: {
|
|
5332
|
-
trigger:
|
|
5333
|
-
content:
|
|
5853
|
+
trigger: `oui-tabs-${key}-trigger`,
|
|
5854
|
+
content: `oui-tabs-${key}-content`
|
|
5334
5855
|
},
|
|
5335
|
-
title:
|
|
5336
|
-
value:
|
|
5337
|
-
children:
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
|
|
5342
|
-
initialSort: tabSort["recent" /* Recent */],
|
|
5343
|
-
onSort: onTabSort("recent" /* Recent */)
|
|
5344
|
-
}
|
|
5345
|
-
)
|
|
5346
|
-
}
|
|
5347
|
-
)
|
|
5348
|
-
]
|
|
5856
|
+
title: resolveTabTitle(tab, builtInTitles, /* @__PURE__ */ jsxRuntime.jsx(RwaIconTab, {})),
|
|
5857
|
+
value: key,
|
|
5858
|
+
children: isCommunity ? renderCommunityContent() : isBuiltIn ? renderBuiltInContent(tab.type) : renderCustomContent(key)
|
|
5859
|
+
},
|
|
5860
|
+
key
|
|
5861
|
+
);
|
|
5862
|
+
})
|
|
5349
5863
|
}
|
|
5350
5864
|
)
|
|
5351
5865
|
]
|
|
@@ -5355,6 +5869,7 @@ var SubMenuMarkets = (props) => {
|
|
|
5355
5869
|
|
|
5356
5870
|
// src/components/subMenuMarkets/subMenuMarkets.widget.tsx
|
|
5357
5871
|
init_marketsProvider();
|
|
5872
|
+
init_useMarketCategories();
|
|
5358
5873
|
|
|
5359
5874
|
// src/components/subMenuMarkets/subMenuMarkets.script.ts
|
|
5360
5875
|
init_constant();
|
|
@@ -5399,11 +5914,13 @@ var SubMenuMarketsWidget = (props) => {
|
|
|
5399
5914
|
activeTab: props.activeTab,
|
|
5400
5915
|
onTabChange: props.onTabChange
|
|
5401
5916
|
});
|
|
5917
|
+
const tabs = useMarketCategories("subMenuMarkets");
|
|
5402
5918
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5403
5919
|
exports.MarketsProvider,
|
|
5404
5920
|
{
|
|
5405
5921
|
symbol: props.symbol,
|
|
5406
5922
|
onSymbolChange: props.onSymbolChange,
|
|
5923
|
+
tabs,
|
|
5407
5924
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5408
5925
|
SubMenuMarkets,
|
|
5409
5926
|
{
|
|
@@ -5482,12 +5999,15 @@ var SideMarketsWidget = (props) => {
|
|
|
5482
5999
|
init_dropDownMarkets();
|
|
5483
6000
|
|
|
5484
6001
|
// src/components/marketsSheet/marketsSheet.ui.tsx
|
|
5485
|
-
|
|
6002
|
+
init_useCommunityTabs();
|
|
5486
6003
|
init_type();
|
|
6004
|
+
init_communityBrokerTabs();
|
|
5487
6005
|
init_marketsList();
|
|
6006
|
+
init_marketsProvider();
|
|
5488
6007
|
init_rwaTab();
|
|
5489
6008
|
init_searchInput();
|
|
5490
6009
|
init_useFavoritesExtraProps();
|
|
6010
|
+
init_tabUtils();
|
|
5491
6011
|
|
|
5492
6012
|
// src/components/marketsSheet/column.tsx
|
|
5493
6013
|
init_column();
|
|
@@ -5504,14 +6024,17 @@ var MarketsSheet = (props) => {
|
|
|
5504
6024
|
const { className, tabSort, onTabSort } = props;
|
|
5505
6025
|
const { t } = i18n.useTranslation();
|
|
5506
6026
|
const { getFavoritesProps, renderEmptyView } = useFavoritesProps();
|
|
5507
|
-
const
|
|
5508
|
-
|
|
6027
|
+
const { tabs } = useMarketsContext();
|
|
6028
|
+
const builtInTitles = useBuiltInTitles();
|
|
6029
|
+
const tabDataFilters = useCustomTabDataFilters(tabs);
|
|
6030
|
+
const renderBuiltInContent = (tabType) => {
|
|
6031
|
+
const isFavorites = tabType === "favorites" /* Favorites */;
|
|
5509
6032
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5510
6033
|
exports.MarketsListWidget,
|
|
5511
6034
|
{
|
|
5512
|
-
type,
|
|
5513
|
-
initialSort: tabSort[
|
|
5514
|
-
onSort: onTabSort(
|
|
6035
|
+
type: tabType,
|
|
6036
|
+
initialSort: tabSort[tabType],
|
|
6037
|
+
onSort: onTabSort(tabType),
|
|
5515
6038
|
getColumns: getMarketsSheetColumns,
|
|
5516
6039
|
tableClassNames: {
|
|
5517
6040
|
root: ui.cn("oui-marketsSheet-list", "!oui-bg-base-8"),
|
|
@@ -5521,12 +6044,65 @@ var MarketsSheet = (props) => {
|
|
|
5521
6044
|
)
|
|
5522
6045
|
},
|
|
5523
6046
|
emptyView: renderEmptyView({
|
|
5524
|
-
type,
|
|
6047
|
+
type: tabType,
|
|
5525
6048
|
onClick: () => {
|
|
5526
6049
|
props.onTabChange("all" /* All */);
|
|
5527
6050
|
}
|
|
5528
6051
|
}),
|
|
5529
|
-
...getFavoritesProps(
|
|
6052
|
+
...getFavoritesProps(tabType)
|
|
6053
|
+
}
|
|
6054
|
+
);
|
|
6055
|
+
};
|
|
6056
|
+
const renderCommunityContent = () => {
|
|
6057
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6058
|
+
CommunityBrokerTabs,
|
|
6059
|
+
{
|
|
6060
|
+
storageKey: "orderly_markets_sheet_community_sel_sub_tab",
|
|
6061
|
+
classNames: {
|
|
6062
|
+
tabsList: "oui-px-3 oui-pt-1 oui-pb-2",
|
|
6063
|
+
tabsContent: "oui-h-full"
|
|
6064
|
+
},
|
|
6065
|
+
className: ui.cn(
|
|
6066
|
+
"oui-marketsSheet-community-tabs",
|
|
6067
|
+
"oui-h-[calc(100%_-_36px)]"
|
|
6068
|
+
),
|
|
6069
|
+
showScrollIndicator: true,
|
|
6070
|
+
renderPanel: (selected) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6071
|
+
exports.MarketsListWidget,
|
|
6072
|
+
{
|
|
6073
|
+
type: "all" /* All */,
|
|
6074
|
+
initialSort: tabSort["community" /* Community */],
|
|
6075
|
+
onSort: onTabSort("community" /* Community */),
|
|
6076
|
+
getColumns: getMarketsSheetColumns,
|
|
6077
|
+
tableClassNames: {
|
|
6078
|
+
root: ui.cn("oui-marketsSheet-list", "!oui-bg-base-8"),
|
|
6079
|
+
scroll: ui.cn(
|
|
6080
|
+
"oui-pb-[env(safe-area-inset-bottom,_20px)]",
|
|
6081
|
+
"oui-h-[calc(100%_-_40px)]"
|
|
6082
|
+
)
|
|
6083
|
+
},
|
|
6084
|
+
dataFilter: createCommunityBrokerFilter(selected)
|
|
6085
|
+
}
|
|
6086
|
+
)
|
|
6087
|
+
}
|
|
6088
|
+
);
|
|
6089
|
+
};
|
|
6090
|
+
const renderCustomContent = (key) => {
|
|
6091
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6092
|
+
exports.MarketsListWidget,
|
|
6093
|
+
{
|
|
6094
|
+
type: "all" /* All */,
|
|
6095
|
+
dataFilter: (data) => tabDataFilters[key]?.(data) ?? data,
|
|
6096
|
+
initialSort: tabSort[key],
|
|
6097
|
+
onSort: onTabSort(key),
|
|
6098
|
+
getColumns: getMarketsSheetColumns,
|
|
6099
|
+
tableClassNames: {
|
|
6100
|
+
root: ui.cn("oui-marketsSheet-list", "!oui-bg-base-8"),
|
|
6101
|
+
scroll: ui.cn(
|
|
6102
|
+
"oui-pb-[env(safe-area-inset-bottom,_20px)]",
|
|
6103
|
+
"oui-h-[calc(100%_-_40px)]"
|
|
6104
|
+
)
|
|
6105
|
+
}
|
|
5530
6106
|
}
|
|
5531
6107
|
);
|
|
5532
6108
|
};
|
|
@@ -5545,7 +6121,7 @@ var MarketsSheet = (props) => {
|
|
|
5545
6121
|
}
|
|
5546
6122
|
)
|
|
5547
6123
|
] }),
|
|
5548
|
-
/* @__PURE__ */ jsxRuntime.
|
|
6124
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5549
6125
|
ui.Tabs,
|
|
5550
6126
|
{
|
|
5551
6127
|
variant: "contained",
|
|
@@ -5559,44 +6135,24 @@ var MarketsSheet = (props) => {
|
|
|
5559
6135
|
},
|
|
5560
6136
|
className: ui.cn("oui-marketsSheet-tabs", "oui-h-[calc(100%_-_92px)]"),
|
|
5561
6137
|
showScrollIndicator: true,
|
|
5562
|
-
children:
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
|
|
5566
|
-
|
|
5567
|
-
trigger: "oui-tabs-favorites-trigger",
|
|
5568
|
-
content: "oui-tabs-favorites-content"
|
|
5569
|
-
},
|
|
5570
|
-
title: /* @__PURE__ */ jsxRuntime.jsx(FavoritesIcon, {}),
|
|
5571
|
-
value: "favorites" /* Favorites */,
|
|
5572
|
-
children: renderTab("favorites" /* Favorites */)
|
|
5573
|
-
}
|
|
5574
|
-
),
|
|
5575
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5576
|
-
ui.TabPanel,
|
|
5577
|
-
{
|
|
5578
|
-
classNames: {
|
|
5579
|
-
trigger: "oui-tabs-all-trigger",
|
|
5580
|
-
content: "oui-tabs-all-content"
|
|
5581
|
-
},
|
|
5582
|
-
title: t("common.all"),
|
|
5583
|
-
value: "all" /* All */,
|
|
5584
|
-
children: renderTab("all" /* All */)
|
|
5585
|
-
}
|
|
5586
|
-
),
|
|
5587
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6138
|
+
children: tabs?.map((tab, index) => {
|
|
6139
|
+
const key = tabKey(tab, index);
|
|
6140
|
+
const isBuiltIn = isBuiltInMarketTab(tab);
|
|
6141
|
+
const isCommunity = isBuiltIn && tab.type === "community" /* Community */;
|
|
6142
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5588
6143
|
ui.TabPanel,
|
|
5589
6144
|
{
|
|
5590
6145
|
classNames: {
|
|
5591
|
-
trigger:
|
|
5592
|
-
content:
|
|
6146
|
+
trigger: `oui-tabs-${key}-trigger`,
|
|
6147
|
+
content: `oui-tabs-${key}-content`
|
|
5593
6148
|
},
|
|
5594
|
-
title: /* @__PURE__ */ jsxRuntime.jsx(RwaTab, {}),
|
|
5595
|
-
value:
|
|
5596
|
-
children:
|
|
5597
|
-
}
|
|
5598
|
-
|
|
5599
|
-
|
|
6149
|
+
title: resolveTabTitle(tab, builtInTitles, /* @__PURE__ */ jsxRuntime.jsx(RwaTab, {})),
|
|
6150
|
+
value: key,
|
|
6151
|
+
children: isCommunity ? renderCommunityContent() : isBuiltIn ? renderBuiltInContent(tab.type) : renderCustomContent(key)
|
|
6152
|
+
},
|
|
6153
|
+
key
|
|
6154
|
+
);
|
|
6155
|
+
})
|
|
5600
6156
|
}
|
|
5601
6157
|
)
|
|
5602
6158
|
]
|
|
@@ -5627,13 +6183,16 @@ function useMarketsSheetScript() {
|
|
|
5627
6183
|
|
|
5628
6184
|
// src/components/marketsSheet/marketsSheet.widget.tsx
|
|
5629
6185
|
init_marketsProvider();
|
|
6186
|
+
init_useMarketCategories();
|
|
5630
6187
|
var MarketsSheetWidget = (props) => {
|
|
5631
6188
|
const state = useMarketsSheetScript();
|
|
6189
|
+
const tabs = useMarketCategories("marketsSheet");
|
|
5632
6190
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5633
6191
|
exports.MarketsProvider,
|
|
5634
6192
|
{
|
|
5635
6193
|
symbol: props.symbol,
|
|
5636
6194
|
onSymbolChange: props.onSymbolChange,
|
|
6195
|
+
tabs,
|
|
5637
6196
|
children: /* @__PURE__ */ jsxRuntime.jsx(MarketsSheet, { ...state, className: props.className })
|
|
5638
6197
|
}
|
|
5639
6198
|
);
|
|
@@ -5641,6 +6200,7 @@ var MarketsSheetWidget = (props) => {
|
|
|
5641
6200
|
|
|
5642
6201
|
// src/components/symbolInfoBar/symbolInfoBar.ui.tsx
|
|
5643
6202
|
init_icons();
|
|
6203
|
+
init_symbolBadge();
|
|
5644
6204
|
init_symbolDisplay();
|
|
5645
6205
|
var RwaTooltip = (props) => {
|
|
5646
6206
|
const { isRwa, open, closeTimeInterval, openTimeInterval } = props;
|
|
@@ -5797,7 +6357,7 @@ var SymbolInfoBar = (props) => {
|
|
|
5797
6357
|
className: "oui-h-5 oui-cursor-pointer oui-gap-x-[6px]",
|
|
5798
6358
|
onClick: onSymbol,
|
|
5799
6359
|
children: [
|
|
5800
|
-
/* @__PURE__ */ jsxRuntime.jsx(exports.SymbolDisplay, { formatString: "base", size: "sm", children: symbol }),
|
|
6360
|
+
/* @__PURE__ */ jsxRuntime.jsx(exports.SymbolDisplay, { formatString: "base", size: "sm", showBadge: false, children: symbol }),
|
|
5801
6361
|
/* @__PURE__ */ jsxRuntime.jsx(TriangleDownIcon, { className: "oui-size-[14px] oui-text-base-contrast-54" })
|
|
5802
6362
|
]
|
|
5803
6363
|
}
|
|
@@ -5805,32 +6365,37 @@ var SymbolInfoBar = (props) => {
|
|
|
5805
6365
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5806
6366
|
ui.Flex,
|
|
5807
6367
|
{
|
|
6368
|
+
intensity: 900,
|
|
6369
|
+
mx: 1,
|
|
6370
|
+
px: 3,
|
|
6371
|
+
py: 2,
|
|
5808
6372
|
className: ui.cn(
|
|
5809
6373
|
"oui-symbol-info-bar-mobile",
|
|
5810
|
-
"oui-h-full oui-font-semibold",
|
|
6374
|
+
"oui-h-full oui-font-semibold oui-rounded-xl",
|
|
5811
6375
|
props.className
|
|
5812
6376
|
),
|
|
5813
6377
|
children: [
|
|
5814
6378
|
/* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { gapX: 3, className: "oui-h-full oui-flex-1 oui-overflow-hidden", children: [
|
|
5815
6379
|
/* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { gapX: 3, children: [
|
|
5816
6380
|
/* @__PURE__ */ jsxRuntime.jsx(ui.TokenIcon, { symbol, size: "xs" }),
|
|
5817
|
-
/* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { direction: "column", itemAlign: "start", children: [
|
|
6381
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { direction: "column", itemAlign: "start", gap: 1, children: [
|
|
5818
6382
|
symbolView,
|
|
5819
6383
|
/* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { gap: 1, children: [
|
|
5820
6384
|
/* @__PURE__ */ jsxRuntime.jsxs(ui.Badge, { size: "xs", color: "primary", children: [
|
|
5821
6385
|
leverage,
|
|
5822
6386
|
"x"
|
|
5823
6387
|
] }),
|
|
5824
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
6388
|
+
/* @__PURE__ */ jsxRuntime.jsx(SymbolBadge, { symbol })
|
|
6389
|
+
] }),
|
|
6390
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6391
|
+
RwaTooltip,
|
|
6392
|
+
{
|
|
6393
|
+
isRwa,
|
|
6394
|
+
open,
|
|
6395
|
+
closeTimeInterval,
|
|
6396
|
+
openTimeInterval
|
|
6397
|
+
}
|
|
6398
|
+
)
|
|
5834
6399
|
] })
|
|
5835
6400
|
] }),
|
|
5836
6401
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Divider, { className: "oui-h-[38px]", direction: "vertical", intensity: 8 }),
|
|
@@ -6040,6 +6605,7 @@ var FundingRateHintWidget = (props) => {
|
|
|
6040
6605
|
};
|
|
6041
6606
|
|
|
6042
6607
|
// src/components/symbolInfoBarFull/symbolInfoBarFull.ui.tsx
|
|
6608
|
+
init_symbolBadge();
|
|
6043
6609
|
init_symbolDisplay();
|
|
6044
6610
|
var LazyDropDownMarketsWidget = React6__default.default.lazy(
|
|
6045
6611
|
() => Promise.resolve().then(() => (init_dropDownMarkets(), dropDownMarkets_exports)).then((mod) => {
|
|
@@ -6056,6 +6622,92 @@ var LazyDataItem = React6__default.default.lazy(
|
|
|
6056
6622
|
return { default: mod.DataItem };
|
|
6057
6623
|
})
|
|
6058
6624
|
);
|
|
6625
|
+
var RISK_NOTICE_LEARN_MORE_URL = "https://orderly.network";
|
|
6626
|
+
var SymbolInfoBarRiskNotice = ({ className, visible, symbolWithBroker, brokerName, autoHeight }) => {
|
|
6627
|
+
const { t } = i18n.useTranslation();
|
|
6628
|
+
if (!visible) return null;
|
|
6629
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6630
|
+
"a",
|
|
6631
|
+
{
|
|
6632
|
+
href: RISK_NOTICE_LEARN_MORE_URL,
|
|
6633
|
+
target: "_blank",
|
|
6634
|
+
rel: "noopener noreferrer",
|
|
6635
|
+
className: ui.cn(
|
|
6636
|
+
"oui-symbol-info-bar-risk-notice oui-w-full oui-bg-warning-darken/10 oui-rounded-none oui-text-warning-darken hover:oui-cursor-pointer oui-block",
|
|
6637
|
+
className
|
|
6638
|
+
),
|
|
6639
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6640
|
+
ui.Flex,
|
|
6641
|
+
{
|
|
6642
|
+
itemAlign: "center",
|
|
6643
|
+
gap: 2,
|
|
6644
|
+
className: autoHeight ? "oui-min-h-0 oui-py-2 oui-px-2" : "oui-h-[46px] oui-px-3",
|
|
6645
|
+
children: [
|
|
6646
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.WarningIcon, { className: "oui-shrink-0 oui-size-4 oui-text-warning-darken" }),
|
|
6647
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.Text, { size: "xs", className: "oui-text-warning-darken oui-flex-1", children: [
|
|
6648
|
+
t("markets.symbolInfoBar.riskNotice.content", {
|
|
6649
|
+
symbolWithBroker,
|
|
6650
|
+
brokerName
|
|
6651
|
+
}),
|
|
6652
|
+
" ",
|
|
6653
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "oui-underline", children: t("common.learnMore") })
|
|
6654
|
+
] })
|
|
6655
|
+
]
|
|
6656
|
+
}
|
|
6657
|
+
)
|
|
6658
|
+
}
|
|
6659
|
+
);
|
|
6660
|
+
};
|
|
6661
|
+
var SymbolInfoBarDesktop = ({
|
|
6662
|
+
className,
|
|
6663
|
+
trailing,
|
|
6664
|
+
leftSection,
|
|
6665
|
+
priceSection,
|
|
6666
|
+
scrollableContent,
|
|
6667
|
+
containerRef,
|
|
6668
|
+
leadingVisible,
|
|
6669
|
+
tailingVisible,
|
|
6670
|
+
onScroll
|
|
6671
|
+
}) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6672
|
+
ui.Flex,
|
|
6673
|
+
{
|
|
6674
|
+
intensity: 900,
|
|
6675
|
+
r: "2xl",
|
|
6676
|
+
mt: 1,
|
|
6677
|
+
px: 3,
|
|
6678
|
+
className: ui.cn(
|
|
6679
|
+
"oui-symbol-info-bar-desktop",
|
|
6680
|
+
"oui-font-semibold",
|
|
6681
|
+
"oui-flex-1 oui-w-full",
|
|
6682
|
+
"oui-py-2",
|
|
6683
|
+
className
|
|
6684
|
+
),
|
|
6685
|
+
style: {
|
|
6686
|
+
transform: "translateZ(0)",
|
|
6687
|
+
willChange: "transform"
|
|
6688
|
+
},
|
|
6689
|
+
children: [
|
|
6690
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { gapX: 6, className: "oui-h-full oui-flex-1 oui-overflow-hidden", children: [
|
|
6691
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Flex, { gapX: 1, className: "oui-flex-none oui-shrink-0", children: leftSection }),
|
|
6692
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Divider, { className: "oui-h-[26px]", direction: "vertical", intensity: 8 }),
|
|
6693
|
+
priceSection,
|
|
6694
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "oui-relative oui-h-full oui-overflow-hidden", children: [
|
|
6695
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6696
|
+
"div",
|
|
6697
|
+
{
|
|
6698
|
+
ref: containerRef,
|
|
6699
|
+
className: "oui-hide-scrollbar oui-h-full oui-overflow-x-auto",
|
|
6700
|
+
children: scrollableContent
|
|
6701
|
+
}
|
|
6702
|
+
),
|
|
6703
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScrollIndicator2, { leading: true, onClick: onScroll, visible: leadingVisible }),
|
|
6704
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScrollIndicator2, { tailing: true, onClick: onScroll, visible: tailingVisible })
|
|
6705
|
+
] })
|
|
6706
|
+
] }),
|
|
6707
|
+
trailing
|
|
6708
|
+
]
|
|
6709
|
+
}
|
|
6710
|
+
);
|
|
6059
6711
|
var SymbolInfoBarFull = (props) => {
|
|
6060
6712
|
const {
|
|
6061
6713
|
symbol,
|
|
@@ -6081,6 +6733,10 @@ var SymbolInfoBarFull = (props) => {
|
|
|
6081
6733
|
showCountdown
|
|
6082
6734
|
} = props;
|
|
6083
6735
|
const { t } = i18n.useTranslation();
|
|
6736
|
+
const { brokerId, brokerName, brokerNameRaw, displayName } = hooks.useBadgeBySymbol(symbol);
|
|
6737
|
+
const isCommunityListed = Boolean(brokerId ?? brokerName);
|
|
6738
|
+
const baseFromSymbol = symbol?.split("_")[1] ?? symbol;
|
|
6739
|
+
const symbolWithBroker = brokerName != null ? `${baseFromSymbol}-${brokerNameRaw}` : displayName ?? symbol;
|
|
6084
6740
|
const favoriteIcon = /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(LazyFavoritesDropdownMenuWidget, { row: { symbol }, favorite, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6085
6741
|
ui.Flex,
|
|
6086
6742
|
{
|
|
@@ -6105,7 +6761,7 @@ var SymbolInfoBarFull = (props) => {
|
|
|
6105
6761
|
contentClassName: "oui-w-[580px] oui-h-[496px]",
|
|
6106
6762
|
symbol: props.symbol,
|
|
6107
6763
|
onSymbolChange: props.onSymbolChange,
|
|
6108
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { gapX: 1, className: "oui-cursor-pointer", children: [
|
|
6764
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ui.Flex, { direction: "column", gap: 1, children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { gapX: 1, className: "oui-cursor-pointer", children: [
|
|
6109
6765
|
/* @__PURE__ */ jsxRuntime.jsx(ui.TokenIcon, { symbol, className: "oui-size-4" }),
|
|
6110
6766
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6111
6767
|
exports.SymbolDisplay,
|
|
@@ -6113,22 +6769,26 @@ var SymbolInfoBarFull = (props) => {
|
|
|
6113
6769
|
formatString: "base",
|
|
6114
6770
|
size: "xs",
|
|
6115
6771
|
className: "oui-text-base-contrast",
|
|
6772
|
+
showBadge: false,
|
|
6116
6773
|
children: symbol
|
|
6117
6774
|
}
|
|
6118
6775
|
),
|
|
6119
6776
|
/* @__PURE__ */ jsxRuntime.jsx(TriangleDownIcon, { className: "oui-text-base-contrast-54" })
|
|
6120
|
-
] })
|
|
6777
|
+
] }) })
|
|
6121
6778
|
}
|
|
6122
6779
|
),
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6780
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { gap: 1, children: [
|
|
6781
|
+
/* @__PURE__ */ jsxRuntime.jsx(SymbolBadge, { symbol }),
|
|
6782
|
+
isRwa && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6783
|
+
RwaTooltip,
|
|
6784
|
+
{
|
|
6785
|
+
isRwa,
|
|
6786
|
+
open,
|
|
6787
|
+
closeTimeInterval,
|
|
6788
|
+
openTimeInterval
|
|
6789
|
+
}
|
|
6790
|
+
)
|
|
6791
|
+
] })
|
|
6132
6792
|
]
|
|
6133
6793
|
}
|
|
6134
6794
|
) });
|
|
@@ -6157,129 +6817,92 @@ var SymbolInfoBarFull = (props) => {
|
|
|
6157
6817
|
}
|
|
6158
6818
|
)
|
|
6159
6819
|
] });
|
|
6160
|
-
|
|
6161
|
-
|
|
6162
|
-
|
|
6820
|
+
const leftSection = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6821
|
+
favoriteIcon,
|
|
6822
|
+
symbolView
|
|
6823
|
+
] });
|
|
6824
|
+
const priceSection = /* @__PURE__ */ jsxRuntime.jsx(
|
|
6825
|
+
ui.Tooltip,
|
|
6826
|
+
{
|
|
6827
|
+
content: t("markets.symbolInfoBar.lastPrice.tooltip"),
|
|
6828
|
+
className: "oui-max-w-[240px]",
|
|
6829
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "oui-cursor-pointer oui-border-b oui-border-dashed oui-border-line-12 oui-inline-block", children: price })
|
|
6830
|
+
}
|
|
6831
|
+
);
|
|
6832
|
+
const scrollableContent = /* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { gapX: 8, height: "100%", children: [
|
|
6833
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: leadingElementRef, children: /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(LazyDataItem, { label: t("markets.column.24hChange"), value: change }) }) }),
|
|
6834
|
+
/* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6835
|
+
LazyDataItem,
|
|
6163
6836
|
{
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
|
|
6837
|
+
label: t("markets.symbolInfoBar.Mark"),
|
|
6838
|
+
value: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6839
|
+
ui.Text.numeral,
|
|
6840
|
+
{
|
|
6841
|
+
dp: quotoDp,
|
|
6842
|
+
"data-testid": "oui-testid-tokenInfo-markPrice-value",
|
|
6843
|
+
children: data?.["mark_price"]
|
|
6844
|
+
}
|
|
6169
6845
|
),
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
|
|
6187
|
-
|
|
6188
|
-
|
|
6189
|
-
|
|
6190
|
-
|
|
6191
|
-
|
|
6192
|
-
|
|
6193
|
-
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
|
|
6224
|
-
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
|
|
6228
|
-
|
|
6229
|
-
|
|
6230
|
-
hint: t("markets.symbolInfoBar.Index.tooltip")
|
|
6231
|
-
}
|
|
6232
|
-
) }),
|
|
6233
|
-
/* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6234
|
-
LazyDataItem,
|
|
6235
|
-
{
|
|
6236
|
-
label: t("markets.symbolInfoBar.24hVolume"),
|
|
6237
|
-
value: /* @__PURE__ */ jsxRuntime.jsx(ui.Text.numeral, { rule: "human", dp: 2, children: data?.["24h_amount"] }),
|
|
6238
|
-
hint: t("markets.symbolInfoBar.24hVolume.tooltip")
|
|
6239
|
-
}
|
|
6240
|
-
) }),
|
|
6241
|
-
/* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6242
|
-
LazyDataItem,
|
|
6243
|
-
{
|
|
6244
|
-
label: t("markets.symbolInfoBar.predFundingRate"),
|
|
6245
|
-
value: /* @__PURE__ */ jsxRuntime.jsx(FundingRate, { symbol }),
|
|
6246
|
-
hint: /* @__PURE__ */ jsxRuntime.jsx(FundingRateHintWidget, { symbol })
|
|
6247
|
-
}
|
|
6248
|
-
) }),
|
|
6249
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: tailingElementRef, children: /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6250
|
-
LazyDataItem,
|
|
6251
|
-
{
|
|
6252
|
-
label: t("markets.openInterest"),
|
|
6253
|
-
value: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6254
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Text.numeral, { rule: "human", dp: 2, children: openInterest }),
|
|
6255
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Text, { intensity: 36, children: ` USDC` })
|
|
6256
|
-
] }),
|
|
6257
|
-
hint: t("markets.openInterest.tooltip")
|
|
6258
|
-
}
|
|
6259
|
-
) }) })
|
|
6260
|
-
] })
|
|
6261
|
-
}
|
|
6262
|
-
),
|
|
6263
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6264
|
-
ScrollIndicator2,
|
|
6265
|
-
{
|
|
6266
|
-
leading: true,
|
|
6267
|
-
onClick: onScoll,
|
|
6268
|
-
visible: leadingVisible
|
|
6269
|
-
}
|
|
6270
|
-
),
|
|
6271
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6272
|
-
ScrollIndicator2,
|
|
6273
|
-
{
|
|
6274
|
-
tailing: true,
|
|
6275
|
-
onClick: onScoll,
|
|
6276
|
-
visible: tailingVisible
|
|
6277
|
-
}
|
|
6278
|
-
)
|
|
6279
|
-
] })
|
|
6280
|
-
] }),
|
|
6281
|
-
props.trailing
|
|
6282
|
-
]
|
|
6846
|
+
hint: t("markets.symbolInfoBar.Mark.tooltip")
|
|
6847
|
+
}
|
|
6848
|
+
) }),
|
|
6849
|
+
/* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6850
|
+
LazyDataItem,
|
|
6851
|
+
{
|
|
6852
|
+
label: t("markets.symbolInfoBar.Index"),
|
|
6853
|
+
value: /* @__PURE__ */ jsxRuntime.jsx(ui.Text.numeral, { dp: quotoDp, children: data?.["index_price"] }),
|
|
6854
|
+
hint: t("markets.symbolInfoBar.Index.tooltip")
|
|
6855
|
+
}
|
|
6856
|
+
) }),
|
|
6857
|
+
/* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6858
|
+
LazyDataItem,
|
|
6859
|
+
{
|
|
6860
|
+
label: t("markets.symbolInfoBar.24hVolume"),
|
|
6861
|
+
value: /* @__PURE__ */ jsxRuntime.jsx(ui.Text.numeral, { rule: "human", dp: 2, children: data?.["24h_amount"] }),
|
|
6862
|
+
hint: t("markets.symbolInfoBar.24hVolume.tooltip")
|
|
6863
|
+
}
|
|
6864
|
+
) }),
|
|
6865
|
+
/* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6866
|
+
LazyDataItem,
|
|
6867
|
+
{
|
|
6868
|
+
label: t("markets.symbolInfoBar.predFundingRate"),
|
|
6869
|
+
value: /* @__PURE__ */ jsxRuntime.jsx(FundingRate, { symbol }),
|
|
6870
|
+
hint: /* @__PURE__ */ jsxRuntime.jsx(FundingRateHintWidget, { symbol })
|
|
6871
|
+
}
|
|
6872
|
+
) }),
|
|
6873
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: tailingElementRef, children: /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6874
|
+
LazyDataItem,
|
|
6875
|
+
{
|
|
6876
|
+
label: t("markets.openInterest"),
|
|
6877
|
+
value: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6878
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Text.numeral, { rule: "human", dp: 2, children: openInterest }),
|
|
6879
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Text, { intensity: 36, children: ` USDC` })
|
|
6880
|
+
] }),
|
|
6881
|
+
hint: t("markets.openInterest.tooltip")
|
|
6882
|
+
}
|
|
6883
|
+
) }) })
|
|
6884
|
+
] });
|
|
6885
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { direction: "column", className: "oui-h-full oui-w-full", gapY: 1, children: [
|
|
6886
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6887
|
+
SymbolInfoBarRiskNotice,
|
|
6888
|
+
{
|
|
6889
|
+
visible: isCommunityListed,
|
|
6890
|
+
symbolWithBroker,
|
|
6891
|
+
brokerName: brokerNameRaw ?? brokerName ?? ""
|
|
6892
|
+
}
|
|
6893
|
+
),
|
|
6894
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6895
|
+
SymbolInfoBarDesktop,
|
|
6896
|
+
{
|
|
6897
|
+
className: props.className,
|
|
6898
|
+
trailing: props.trailing,
|
|
6899
|
+
leftSection,
|
|
6900
|
+
priceSection,
|
|
6901
|
+
scrollableContent,
|
|
6902
|
+
containerRef,
|
|
6903
|
+
leadingVisible,
|
|
6904
|
+
tailingVisible,
|
|
6905
|
+
onScroll: onScoll
|
|
6283
6906
|
}
|
|
6284
6907
|
),
|
|
6285
6908
|
showCountdown && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6480,34 +7103,57 @@ var SymbolInfoBarFullWidget = (props) => {
|
|
|
6480
7103
|
|
|
6481
7104
|
// src/components/horizontalMarkets/horizontalMarkets.widget.tsx
|
|
6482
7105
|
init_marketsProvider();
|
|
7106
|
+
init_useMarketCategories();
|
|
6483
7107
|
|
|
6484
7108
|
// src/components/horizontalMarkets/horizontalMarkets.script.ts
|
|
6485
7109
|
init_constant();
|
|
6486
7110
|
init_utils();
|
|
6487
7111
|
init_marketsProvider();
|
|
6488
7112
|
init_useTabSort();
|
|
7113
|
+
init_tabUtils();
|
|
6489
7114
|
var useHorizontalMarketsScript = (options) => {
|
|
6490
7115
|
const {
|
|
6491
7116
|
symbols: optionSymbols,
|
|
6492
7117
|
maxItems: optionMaxItems,
|
|
6493
7118
|
defaultMarketType
|
|
6494
7119
|
} = options || {};
|
|
6495
|
-
const { symbol: currentSymbol, onSymbolChange } = useMarketsContext();
|
|
7120
|
+
const { symbol: currentSymbol, onSymbolChange, tabs } = useMarketsContext();
|
|
6496
7121
|
const [selectedMarketType, setSelectedMarketType] = hooks.useLocalStorage(
|
|
6497
7122
|
SIDE_MARKETS_SEL_TAB_KEY,
|
|
6498
7123
|
defaultMarketType || "all"
|
|
6499
7124
|
);
|
|
7125
|
+
const availableMarketTypes = React6.useMemo(
|
|
7126
|
+
() => tabs?.map((tab, index) => tabKey(tab, index)) ?? ["all"],
|
|
7127
|
+
[tabs]
|
|
7128
|
+
);
|
|
6500
7129
|
const MarketsTypeMap3 = {
|
|
6501
7130
|
all: hooks.MarketsType.ALL,
|
|
6502
7131
|
recent: hooks.MarketsType.RECENT,
|
|
6503
7132
|
newListing: hooks.MarketsType.NEW_LISTING,
|
|
6504
7133
|
favorites: hooks.MarketsType.FAVORITES
|
|
6505
7134
|
};
|
|
6506
|
-
const
|
|
7135
|
+
const isCustomCategory = typeof selectedMarketType === "string" && !MarketsTypeMap3[selectedMarketType];
|
|
7136
|
+
const marketTypeKey = isCustomCategory ? "all" : selectedMarketType || "all";
|
|
6507
7137
|
const [markets, favorite] = hooks.useMarkets(
|
|
6508
7138
|
MarketsTypeMap3[marketTypeKey] || hooks.MarketsType.ALL
|
|
6509
7139
|
);
|
|
7140
|
+
React6.useEffect(() => {
|
|
7141
|
+
if (!availableMarketTypes.includes(selectedMarketType)) {
|
|
7142
|
+
setSelectedMarketType(availableMarketTypes[0] ?? "all");
|
|
7143
|
+
}
|
|
7144
|
+
}, [availableMarketTypes, selectedMarketType, setSelectedMarketType]);
|
|
7145
|
+
const customCategoryFilter = React6.useMemo(() => {
|
|
7146
|
+
if (!isCustomCategory || !tabs) return null;
|
|
7147
|
+
const customTabs = tabs.filter(isCustomMarketTab);
|
|
7148
|
+
const tab = customTabs.find(
|
|
7149
|
+
(item, index) => tabKey(item, index) === selectedMarketType
|
|
7150
|
+
);
|
|
7151
|
+
return tab ? getCustomTabDataFilter(tab) ?? null : null;
|
|
7152
|
+
}, [isCustomCategory, tabs, selectedMarketType]);
|
|
6510
7153
|
const filteredMarkets = React6.useMemo(() => {
|
|
7154
|
+
if (isCustomCategory && customCategoryFilter) {
|
|
7155
|
+
return customCategoryFilter(markets);
|
|
7156
|
+
}
|
|
6511
7157
|
if (selectedMarketType === "favorites") {
|
|
6512
7158
|
const { favorites, selectedFavoriteTab } = favorite;
|
|
6513
7159
|
const symbolsInTab = favorites?.filter(
|
|
@@ -6529,7 +7175,9 @@ var useHorizontalMarketsScript = (options) => {
|
|
|
6529
7175
|
favorite.favorites,
|
|
6530
7176
|
favorite.selectedFavoriteTab,
|
|
6531
7177
|
favorite.recent,
|
|
6532
|
-
selectedMarketType
|
|
7178
|
+
selectedMarketType,
|
|
7179
|
+
isCustomCategory,
|
|
7180
|
+
customCategoryFilter
|
|
6533
7181
|
]);
|
|
6534
7182
|
const { tabSort } = useTabSort({
|
|
6535
7183
|
storageKey: SIDE_MARKETS_TAB_SORT_STORAGE_KEY
|
|
@@ -6614,7 +7262,8 @@ var HorizontalMarketsWidget = (props) => {
|
|
|
6614
7262
|
dropdownPos,
|
|
6615
7263
|
...providerProps
|
|
6616
7264
|
} = props;
|
|
6617
|
-
|
|
7265
|
+
const tabs = useMarketCategories("horizontalMarkets");
|
|
7266
|
+
return /* @__PURE__ */ jsxRuntime.jsx(exports.MarketsProvider, { ...providerProps, tabs, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6618
7267
|
HorizontalMarketsInner,
|
|
6619
7268
|
{
|
|
6620
7269
|
symbols,
|
|
@@ -6854,6 +7503,7 @@ init_type();
|
|
|
6854
7503
|
|
|
6855
7504
|
// src/pages/home/page.tsx
|
|
6856
7505
|
init_marketsProvider();
|
|
7506
|
+
init_useMarketCategories();
|
|
6857
7507
|
init_type();
|
|
6858
7508
|
var LazyMarketsHeaderWidget = React6__default.default.lazy(
|
|
6859
7509
|
() => Promise.resolve().then(() => (init_marketsHeader_widget(), marketsHeader_widget_exports)).then((mod) => {
|
|
@@ -6875,6 +7525,7 @@ var MarketsHomePage = (props) => {
|
|
|
6875
7525
|
const [activeTab, setActiveTab] = React6.useState(
|
|
6876
7526
|
"markets" /* Markets */
|
|
6877
7527
|
);
|
|
7528
|
+
const tabs = useMarketCategories("marketsDataList");
|
|
6878
7529
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6879
7530
|
exports.MarketsProvider,
|
|
6880
7531
|
{
|
|
@@ -6882,6 +7533,7 @@ var MarketsHomePage = (props) => {
|
|
|
6882
7533
|
onSymbolChange: props.onSymbolChange,
|
|
6883
7534
|
navProps: props.navProps,
|
|
6884
7535
|
comparisonProps: props.comparisonProps,
|
|
7536
|
+
tabs,
|
|
6885
7537
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6886
7538
|
"div",
|
|
6887
7539
|
{
|
|
@@ -7005,6 +7657,7 @@ var MarketsMobileContent = (props) => {
|
|
|
7005
7657
|
// src/index.ts
|
|
7006
7658
|
init_marketsProvider();
|
|
7007
7659
|
init_symbolDisplay();
|
|
7660
|
+
init_builtInTabRegistry();
|
|
7008
7661
|
|
|
7009
7662
|
exports.FavoritesList = FavoritesList;
|
|
7010
7663
|
exports.FavoritesListWidget = FavoritesListWidget;
|
|
@@ -7022,6 +7675,7 @@ exports.SubMenuMarketsWidget = SubMenuMarketsWidget;
|
|
|
7022
7675
|
exports.SymbolInfoBar = SymbolInfoBar;
|
|
7023
7676
|
exports.SymbolInfoBarFull = SymbolInfoBarFull;
|
|
7024
7677
|
exports.SymbolInfoBarFullWidget = SymbolInfoBarFullWidget;
|
|
7678
|
+
exports.SymbolInfoBarRiskNotice = SymbolInfoBarRiskNotice;
|
|
7025
7679
|
exports.SymbolInfoBarWidget = SymbolInfoBarWidget;
|
|
7026
7680
|
exports.useDropDownMarketsScript = useDropDownMarketsScript;
|
|
7027
7681
|
exports.useExpandMarketsScript = useExpandMarketsScript;
|