@oanda/labs-live-rates-table-widget 1.0.35 → 1.0.36
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/CHANGELOG.md +148 -0
- package/dist/main/LiveRatesTableWidget/LiveRatesTableWidget.js +10 -5
- package/dist/main/LiveRatesTableWidget/LiveRatesTableWidget.js.map +1 -1
- package/dist/main/LiveRatesTableWidget/types.js.map +1 -1
- package/dist/module/LiveRatesTableWidget/LiveRatesTableWidget.js +11 -6
- package/dist/module/LiveRatesTableWidget/LiveRatesTableWidget.js.map +1 -1
- package/dist/module/LiveRatesTableWidget/types.js.map +1 -1
- package/dist/types/LiveRatesTableWidget/LiveRatesTableWidget.d.ts +1 -1
- package/dist/types/LiveRatesTableWidget/types.d.ts +2 -7
- package/package.json +3 -3
- package/src/LiveRatesTableWidget/LiveRatesTableWidget.tsx +11 -5
- package/src/LiveRatesTableWidget/types.tsx +2 -7
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,154 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 1.0.36 (2024-11-28)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## 1.0.169 (2024-11-20)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 1.0.168 (2024-11-19)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## 1.0.167 (2024-10-14)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## 1.0.166 (2024-10-07)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## 1.0.165 (2024-10-03)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## 1.0.164 (2024-09-26)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## 1.0.163 (2024-09-18)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## 1.0.162 (2024-09-12)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
## 1.0.161 (2024-09-11)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## 1.0.160 (2024-09-10)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
## 1.0.159 (2024-09-09)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## 1.0.158 (2024-09-04)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## 1.0.157 (2024-09-04)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
## 1.0.156 (2024-09-02)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
## 1.0.155 (2024-08-29)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## 1.0.154 (2024-08-29)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
## 1.0.153 (2024-08-23)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
## 1.0.152 (2024-08-23)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
## 1.0.151 (2024-08-20)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
## 1.0.150 (2024-08-19)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
## 1.0.149 (2024-08-07)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
## 1.0.148 (2024-08-01)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
## 1.0.147 (2024-08-01)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
## 1.0.146 (2024-07-26)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
## 1.0.145 (2024-07-25)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
## 1.0.144 (2024-07-22)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
## 1.0.143 (2024-07-19)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
## 1.0.142 (2024-07-16)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
## 1.0.141 (2024-07-16)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
## 1.0.140 (2024-07-12)
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
## 1.0.139 (2024-07-12)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
## 1.0.138 (2024-07-10)
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
## 1.0.137 (2024-07-05)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
## 1.0.136 (2024-07-03)
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
## 1.0.135 (2024-07-03)
|
|
147
|
+
|
|
148
|
+
**Note:** Version bump only for package @oanda/labs-live-rates-table-widget
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
6
154
|
## 1.0.35 (2024-11-20)
|
|
7
155
|
|
|
8
156
|
|
|
@@ -24,7 +24,8 @@ const LiveRatesTableWidget = _ref => {
|
|
|
24
24
|
theme,
|
|
25
25
|
isParamError,
|
|
26
26
|
removePadding,
|
|
27
|
-
view
|
|
27
|
+
view,
|
|
28
|
+
logoLink
|
|
28
29
|
} = _ref;
|
|
29
30
|
const client = new _client.ApolloClient({
|
|
30
31
|
uri: graphqlUrl,
|
|
@@ -49,10 +50,14 @@ const LiveRatesTableWidget = _ref => {
|
|
|
49
50
|
client: client
|
|
50
51
|
}, isParamError ? _react.default.createElement("div", {
|
|
51
52
|
className: "lw-flex lw-h-[425px] lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary"
|
|
52
|
-
}, _react.default.createElement(_labsWidgetCommon.ChartError, null)) :
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
}, _react.default.createElement(_labsWidgetCommon.ChartError, null)) : (0, _labsWidgetCommon.renderComponent)({
|
|
54
|
+
Component: _react.default.createElement(_Main.Main, {
|
|
55
|
+
instruments: instruments,
|
|
56
|
+
division: division,
|
|
57
|
+
columns: columns
|
|
58
|
+
}),
|
|
59
|
+
logoLink,
|
|
60
|
+
linkArea: 'logo'
|
|
56
61
|
})))));
|
|
57
62
|
};
|
|
58
63
|
exports.LiveRatesTableWidget = LiveRatesTableWidget;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LiveRatesTableWidget.js","names":["_react","_interopRequireDefault","require","_client","_monoI18n","_labsWidgetCommon","_translations","_Main","_types","_config","e","__esModule","default","LiveRatesTableWidget","_ref","graphqlUrl","liveRatesUrl","instruments","division","columns","locale","theme","isParamError","removePadding","view","client","ApolloClient","uri","cache","InMemoryCache","divisionCode","Division","Opt","Ogm","dataSource","createElement","ThemeProvider","size","sizeConfig","LocaleProvider","getLocale","translations","LiveRatesProvider","url","options","ApolloProvider","className","ChartError","Main","exports"],"sources":["../../../src/LiveRatesTableWidget/LiveRatesTableWidget.tsx"],"sourcesContent":["import React from 'react';\nimport { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';\nimport { LocaleProvider } from '@oanda/mono-i18n';\nimport {\n ChartError, LiveRatesProvider, ThemeProvider, getLocale,\n} from '@oanda/labs-widget-common';\nimport { translations } from '../translations';\nimport { Main } from './Main';\nimport { Division, LiveRatesTableConfig } from './types';\nimport { sizeConfig } from './config';\n\nconst LiveRatesTableWidget = ({\n graphqlUrl,\n liveRatesUrl,\n instruments,\n division,\n columns,\n locale,\n theme,\n isParamError,\n removePadding,\n view,\n}: LiveRatesTableConfig) => {\n const client = new ApolloClient({\n uri: graphqlUrl,\n cache: new InMemoryCache(),\n });\n\n const divisionCode = division === Division.Opt ? Division.Ogm : division;\n const dataSource = divisionCode === Division.Ogm ? 'MT5' : 'V20';\n\n return (\n <ThemeProvider removePadding={removePadding} theme={theme} size={view && sizeConfig[view]}>\n <LocaleProvider locale={getLocale(locale)} translations={translations}>\n <LiveRatesProvider\n url={liveRatesUrl}\n options={{ divisionCode, dataSource }}\n >\n <ApolloProvider client={client}>\n {isParamError ? (\n <div className=\"lw-flex lw-h-[425px] lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary\">\n <ChartError />\n </div>\n )\n : (\n <Main\n
|
|
1
|
+
{"version":3,"file":"LiveRatesTableWidget.js","names":["_react","_interopRequireDefault","require","_client","_monoI18n","_labsWidgetCommon","_translations","_Main","_types","_config","e","__esModule","default","LiveRatesTableWidget","_ref","graphqlUrl","liveRatesUrl","instruments","division","columns","locale","theme","isParamError","removePadding","view","logoLink","client","ApolloClient","uri","cache","InMemoryCache","divisionCode","Division","Opt","Ogm","dataSource","createElement","ThemeProvider","size","sizeConfig","LocaleProvider","getLocale","translations","LiveRatesProvider","url","options","ApolloProvider","className","ChartError","renderComponent","Component","Main","linkArea","exports"],"sources":["../../../src/LiveRatesTableWidget/LiveRatesTableWidget.tsx"],"sourcesContent":["import React from 'react';\nimport { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';\nimport { LocaleProvider } from '@oanda/mono-i18n';\nimport {\n ChartError, LiveRatesProvider, ThemeProvider, getLocale,\n renderComponent,\n} from '@oanda/labs-widget-common';\nimport { translations } from '../translations';\nimport { Main } from './Main';\nimport { Division, LiveRatesTableConfig } from './types';\nimport { sizeConfig } from './config';\n\nconst LiveRatesTableWidget = ({\n graphqlUrl,\n liveRatesUrl,\n instruments,\n division,\n columns,\n locale,\n theme,\n isParamError,\n removePadding,\n view,\n logoLink,\n}: LiveRatesTableConfig) => {\n const client = new ApolloClient({\n uri: graphqlUrl,\n cache: new InMemoryCache(),\n });\n\n const divisionCode = division === Division.Opt ? Division.Ogm : division;\n const dataSource = divisionCode === Division.Ogm ? 'MT5' : 'V20';\n\n return (\n <ThemeProvider removePadding={removePadding} theme={theme} size={view && sizeConfig[view]}>\n <LocaleProvider locale={getLocale(locale)} translations={translations}>\n <LiveRatesProvider\n url={liveRatesUrl}\n options={{ divisionCode, dataSource }}\n >\n <ApolloProvider client={client}>\n {isParamError ? (\n <div className=\"lw-flex lw-h-[425px] lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary\">\n <ChartError />\n </div>\n )\n : (\n renderComponent({\n Component: <Main\n instruments={instruments}\n division={division}\n columns={columns}\n />,\n logoLink,\n linkArea: 'logo',\n })\n )}\n </ApolloProvider>\n </LiveRatesProvider>\n </LocaleProvider>\n </ThemeProvider>\n );\n};\n\nexport { LiveRatesTableWidget };\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AAIA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AAAsC,SAAAD,uBAAAS,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEtC,MAAMG,oBAAoB,GAAGC,IAAA,IAYD;EAAA,IAZE;IAC5BC,UAAU;IACVC,YAAY;IACZC,WAAW;IACXC,QAAQ;IACRC,OAAO;IACPC,MAAM;IACNC,KAAK;IACLC,YAAY;IACZC,aAAa;IACbC,IAAI;IACJC;EACoB,CAAC,GAAAX,IAAA;EACrB,MAAMY,MAAM,GAAG,IAAIC,oBAAY,CAAC;IAC9BC,GAAG,EAAEb,UAAU;IACfc,KAAK,EAAE,IAAIC,qBAAa,CAAC;EAC3B,CAAC,CAAC;EAEF,MAAMC,YAAY,GAAGb,QAAQ,KAAKc,eAAQ,CAACC,GAAG,GAAGD,eAAQ,CAACE,GAAG,GAAGhB,QAAQ;EACxE,MAAMiB,UAAU,GAAGJ,YAAY,KAAKC,eAAQ,CAACE,GAAG,GAAG,KAAK,GAAG,KAAK;EAEhE,OACElC,MAAA,CAAAY,OAAA,CAAAwB,aAAA,CAAC/B,iBAAA,CAAAgC,aAAa;IAACd,aAAa,EAAEA,aAAc;IAACF,KAAK,EAAEA,KAAM;IAACiB,IAAI,EAAEd,IAAI,IAAIe,kBAAU,CAACf,IAAI;EAAE,GACxFxB,MAAA,CAAAY,OAAA,CAAAwB,aAAA,CAAChC,SAAA,CAAAoC,cAAc;IAACpB,MAAM,EAAE,IAAAqB,2BAAS,EAACrB,MAAM,CAAE;IAACsB,YAAY,EAAEA;EAAa,GACpE1C,MAAA,CAAAY,OAAA,CAAAwB,aAAA,CAAC/B,iBAAA,CAAAsC,iBAAiB;IAChBC,GAAG,EAAE5B,YAAa;IAClB6B,OAAO,EAAE;MAAEd,YAAY;MAAEI;IAAW;EAAE,GAEtCnC,MAAA,CAAAY,OAAA,CAAAwB,aAAA,CAACjC,OAAA,CAAA2C,cAAc;IAACpB,MAAM,EAAEA;EAAO,GAC5BJ,YAAY,GACXtB,MAAA,CAAAY,OAAA,CAAAwB,aAAA;IAAKW,SAAS,EAAC;EAAmG,GAChH/C,MAAA,CAAAY,OAAA,CAAAwB,aAAA,CAAC/B,iBAAA,CAAA2C,UAAU,MAAE,CACV,CAAC,GAGJ,IAAAC,iCAAe,EAAC;IACdC,SAAS,EAAElD,MAAA,CAAAY,OAAA,CAAAwB,aAAA,CAAC7B,KAAA,CAAA4C,IAAI;MACdlC,WAAW,EAAEA,WAAY;MACzBC,QAAQ,EAAEA,QAAS;MACnBC,OAAO,EAAEA;IAAQ,CAClB,CAAC;IACFM,QAAQ;IACR2B,QAAQ,EAAE;EACZ,CAAC,CAES,CACC,CACL,CACH,CAAC;AAEpB,CAAC;AAACC,OAAA,CAAAxC,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["_monoI18n","require","_graphql","View","exports","ColumnsNames"],"sources":["../../../src/LiveRatesTableWidget/types.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"types.js","names":["_monoI18n","require","_graphql","View","exports","ColumnsNames"],"sources":["../../../src/LiveRatesTableWidget/types.tsx"],"sourcesContent":["import { WidgetConfig } from '@oanda/labs-widget-common';\nimport { Division } from '../gql/types/graphql';\n\nexport { Locale } from '@oanda/mono-i18n';\nexport { Division } from '../gql/types/graphql';\n\nexport enum View {\n TABLE = 'table',\n CARDS = 'cards',\n}\n\nexport interface LiveRatesTableConfig extends WidgetConfig {\n division: Division;\n liveRatesUrl: string;\n instruments: string[];\n columns?: ColumnsNames[];\n removePadding?: boolean;\n view?: View;\n}\n\nexport enum ColumnsNames {\n INSTRUMENT = 'instrument',\n SELL = 'sell',\n BUY = 'buy',\n DAILY_CHANGE = 'dailyChange',\n CHART = 'chart',\n SPREAD = 'spread',\n}\n\nexport interface MainProps {\n instruments: string[];\n division: Division;\n columns?: ColumnsNames[];\n}\n\nexport interface Sentiment {\n shortPercent: number;\n longPercent: number;\n}\n\nexport type EmptyRecord = Record<any, never>;\n\nexport interface DataRecord {\n [key: string]: string | number | undefined;\n instrument: string;\n displayName: string;\n buy?: number;\n sell?: number;\n spread?: number;\n sellPriceMovement?: number;\n buyPriceMovement?: number;\n dailyPercentChange?: string;\n displayPrecision?: number;\n}\n\nexport interface RowWithDataProps {\n loading: boolean;\n record: DataRecord;\n hasBackgroundColor: boolean;\n target: EventTarget | null;\n activeColumns: ColumnsNames[];\n division: Division;\n isScrolled?: boolean;\n}\n\nexport interface CardWithDataProps {\n index: number;\n isLoading?: boolean;\n isError?: boolean;\n record: DataRecord;\n target: EventTarget | null;\n activeColumns: ColumnsNames[];\n division: Division;\n isLast?: boolean;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAAgD,IAEpCE,IAAI,GAAAC,OAAA,CAAAD,IAAA,aAAJA,IAAI;EAAJA,IAAI;EAAJA,IAAI;EAAA,OAAJA,IAAI;AAAA;AAAA,IAcJE,YAAY,GAAAD,OAAA,CAAAC,YAAA,aAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';
|
|
3
3
|
import { LocaleProvider } from '@oanda/mono-i18n';
|
|
4
|
-
import { ChartError, LiveRatesProvider, ThemeProvider, getLocale } from '@oanda/labs-widget-common';
|
|
4
|
+
import { ChartError, LiveRatesProvider, ThemeProvider, getLocale, renderComponent } from '@oanda/labs-widget-common';
|
|
5
5
|
import { translations } from '../translations';
|
|
6
6
|
import { Main } from './Main';
|
|
7
7
|
import { Division } from './types';
|
|
@@ -17,7 +17,8 @@ const LiveRatesTableWidget = _ref => {
|
|
|
17
17
|
theme,
|
|
18
18
|
isParamError,
|
|
19
19
|
removePadding,
|
|
20
|
-
view
|
|
20
|
+
view,
|
|
21
|
+
logoLink
|
|
21
22
|
} = _ref;
|
|
22
23
|
const client = new ApolloClient({
|
|
23
24
|
uri: graphqlUrl,
|
|
@@ -42,10 +43,14 @@ const LiveRatesTableWidget = _ref => {
|
|
|
42
43
|
client: client
|
|
43
44
|
}, isParamError ? React.createElement("div", {
|
|
44
45
|
className: "lw-flex lw-h-[425px] lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary"
|
|
45
|
-
}, React.createElement(ChartError, null)) :
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
}, React.createElement(ChartError, null)) : renderComponent({
|
|
47
|
+
Component: React.createElement(Main, {
|
|
48
|
+
instruments: instruments,
|
|
49
|
+
division: division,
|
|
50
|
+
columns: columns
|
|
51
|
+
}),
|
|
52
|
+
logoLink,
|
|
53
|
+
linkArea: 'logo'
|
|
49
54
|
})))));
|
|
50
55
|
};
|
|
51
56
|
export { LiveRatesTableWidget };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LiveRatesTableWidget.js","names":["React","ApolloClient","InMemoryCache","ApolloProvider","LocaleProvider","ChartError","LiveRatesProvider","ThemeProvider","getLocale","translations","Main","Division","sizeConfig","LiveRatesTableWidget","_ref","graphqlUrl","liveRatesUrl","instruments","division","columns","locale","theme","isParamError","removePadding","view","client","uri","cache","divisionCode","Opt","Ogm","dataSource","createElement","size","url","options","className"],"sources":["../../../src/LiveRatesTableWidget/LiveRatesTableWidget.tsx"],"sourcesContent":["import React from 'react';\nimport { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';\nimport { LocaleProvider } from '@oanda/mono-i18n';\nimport {\n ChartError, LiveRatesProvider, ThemeProvider, getLocale,\n} from '@oanda/labs-widget-common';\nimport { translations } from '../translations';\nimport { Main } from './Main';\nimport { Division, LiveRatesTableConfig } from './types';\nimport { sizeConfig } from './config';\n\nconst LiveRatesTableWidget = ({\n graphqlUrl,\n liveRatesUrl,\n instruments,\n division,\n columns,\n locale,\n theme,\n isParamError,\n removePadding,\n view,\n}: LiveRatesTableConfig) => {\n const client = new ApolloClient({\n uri: graphqlUrl,\n cache: new InMemoryCache(),\n });\n\n const divisionCode = division === Division.Opt ? Division.Ogm : division;\n const dataSource = divisionCode === Division.Ogm ? 'MT5' : 'V20';\n\n return (\n <ThemeProvider removePadding={removePadding} theme={theme} size={view && sizeConfig[view]}>\n <LocaleProvider locale={getLocale(locale)} translations={translations}>\n <LiveRatesProvider\n url={liveRatesUrl}\n options={{ divisionCode, dataSource }}\n >\n <ApolloProvider client={client}>\n {isParamError ? (\n <div className=\"lw-flex lw-h-[425px] lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary\">\n <ChartError />\n </div>\n )\n : (\n <Main\n
|
|
1
|
+
{"version":3,"file":"LiveRatesTableWidget.js","names":["React","ApolloClient","InMemoryCache","ApolloProvider","LocaleProvider","ChartError","LiveRatesProvider","ThemeProvider","getLocale","renderComponent","translations","Main","Division","sizeConfig","LiveRatesTableWidget","_ref","graphqlUrl","liveRatesUrl","instruments","division","columns","locale","theme","isParamError","removePadding","view","logoLink","client","uri","cache","divisionCode","Opt","Ogm","dataSource","createElement","size","url","options","className","Component","linkArea"],"sources":["../../../src/LiveRatesTableWidget/LiveRatesTableWidget.tsx"],"sourcesContent":["import React from 'react';\nimport { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';\nimport { LocaleProvider } from '@oanda/mono-i18n';\nimport {\n ChartError, LiveRatesProvider, ThemeProvider, getLocale,\n renderComponent,\n} from '@oanda/labs-widget-common';\nimport { translations } from '../translations';\nimport { Main } from './Main';\nimport { Division, LiveRatesTableConfig } from './types';\nimport { sizeConfig } from './config';\n\nconst LiveRatesTableWidget = ({\n graphqlUrl,\n liveRatesUrl,\n instruments,\n division,\n columns,\n locale,\n theme,\n isParamError,\n removePadding,\n view,\n logoLink,\n}: LiveRatesTableConfig) => {\n const client = new ApolloClient({\n uri: graphqlUrl,\n cache: new InMemoryCache(),\n });\n\n const divisionCode = division === Division.Opt ? Division.Ogm : division;\n const dataSource = divisionCode === Division.Ogm ? 'MT5' : 'V20';\n\n return (\n <ThemeProvider removePadding={removePadding} theme={theme} size={view && sizeConfig[view]}>\n <LocaleProvider locale={getLocale(locale)} translations={translations}>\n <LiveRatesProvider\n url={liveRatesUrl}\n options={{ divisionCode, dataSource }}\n >\n <ApolloProvider client={client}>\n {isParamError ? (\n <div className=\"lw-flex lw-h-[425px] lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary\">\n <ChartError />\n </div>\n )\n : (\n renderComponent({\n Component: <Main\n instruments={instruments}\n division={division}\n columns={columns}\n />,\n logoLink,\n linkArea: 'logo',\n })\n )}\n </ApolloProvider>\n </LiveRatesProvider>\n </LocaleProvider>\n </ThemeProvider>\n );\n};\n\nexport { LiveRatesTableWidget };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,YAAY,EAAEC,aAAa,EAAEC,cAAc,QAAQ,gBAAgB;AAC5E,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SACEC,UAAU,EAAEC,iBAAiB,EAAEC,aAAa,EAAEC,SAAS,EACvDC,eAAe,QACV,2BAA2B;AAClC,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,IAAI,QAAQ,QAAQ;AAC7B,SAASC,QAAQ,QAA8B,SAAS;AACxD,SAASC,UAAU,QAAQ,UAAU;AAErC,MAAMC,oBAAoB,GAAGC,IAAA,IAYD;EAAA,IAZE;IAC5BC,UAAU;IACVC,YAAY;IACZC,WAAW;IACXC,QAAQ;IACRC,OAAO;IACPC,MAAM;IACNC,KAAK;IACLC,YAAY;IACZC,aAAa;IACbC,IAAI;IACJC;EACoB,CAAC,GAAAX,IAAA;EACrB,MAAMY,MAAM,GAAG,IAAI1B,YAAY,CAAC;IAC9B2B,GAAG,EAAEZ,UAAU;IACfa,KAAK,EAAE,IAAI3B,aAAa,CAAC;EAC3B,CAAC,CAAC;EAEF,MAAM4B,YAAY,GAAGX,QAAQ,KAAKP,QAAQ,CAACmB,GAAG,GAAGnB,QAAQ,CAACoB,GAAG,GAAGb,QAAQ;EACxE,MAAMc,UAAU,GAAGH,YAAY,KAAKlB,QAAQ,CAACoB,GAAG,GAAG,KAAK,GAAG,KAAK;EAEhE,OACEhC,KAAA,CAAAkC,aAAA,CAAC3B,aAAa;IAACiB,aAAa,EAAEA,aAAc;IAACF,KAAK,EAAEA,KAAM;IAACa,IAAI,EAAEV,IAAI,IAAIZ,UAAU,CAACY,IAAI;EAAE,GACxFzB,KAAA,CAAAkC,aAAA,CAAC9B,cAAc;IAACiB,MAAM,EAAEb,SAAS,CAACa,MAAM,CAAE;IAACX,YAAY,EAAEA;EAAa,GACpEV,KAAA,CAAAkC,aAAA,CAAC5B,iBAAiB;IAChB8B,GAAG,EAAEnB,YAAa;IAClBoB,OAAO,EAAE;MAAEP,YAAY;MAAEG;IAAW;EAAE,GAEtCjC,KAAA,CAAAkC,aAAA,CAAC/B,cAAc;IAACwB,MAAM,EAAEA;EAAO,GAC5BJ,YAAY,GACXvB,KAAA,CAAAkC,aAAA;IAAKI,SAAS,EAAC;EAAmG,GAChHtC,KAAA,CAAAkC,aAAA,CAAC7B,UAAU,MAAE,CACV,CAAC,GAGJI,eAAe,CAAC;IACd8B,SAAS,EAAEvC,KAAA,CAAAkC,aAAA,CAACvB,IAAI;MACdO,WAAW,EAAEA,WAAY;MACzBC,QAAQ,EAAEA,QAAS;MACnBC,OAAO,EAAEA;IAAQ,CAClB,CAAC;IACFM,QAAQ;IACRc,QAAQ,EAAE;EACZ,CAAC,CAES,CACC,CACL,CACH,CAAC;AAEpB,CAAC;AAED,SAAS1B,oBAAoB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["Locale","Division","View","ColumnsNames"],"sources":["../../../src/LiveRatesTableWidget/types.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"types.js","names":["Locale","Division","View","ColumnsNames"],"sources":["../../../src/LiveRatesTableWidget/types.tsx"],"sourcesContent":["import { WidgetConfig } from '@oanda/labs-widget-common';\nimport { Division } from '../gql/types/graphql';\n\nexport { Locale } from '@oanda/mono-i18n';\nexport { Division } from '../gql/types/graphql';\n\nexport enum View {\n TABLE = 'table',\n CARDS = 'cards',\n}\n\nexport interface LiveRatesTableConfig extends WidgetConfig {\n division: Division;\n liveRatesUrl: string;\n instruments: string[];\n columns?: ColumnsNames[];\n removePadding?: boolean;\n view?: View;\n}\n\nexport enum ColumnsNames {\n INSTRUMENT = 'instrument',\n SELL = 'sell',\n BUY = 'buy',\n DAILY_CHANGE = 'dailyChange',\n CHART = 'chart',\n SPREAD = 'spread',\n}\n\nexport interface MainProps {\n instruments: string[];\n division: Division;\n columns?: ColumnsNames[];\n}\n\nexport interface Sentiment {\n shortPercent: number;\n longPercent: number;\n}\n\nexport type EmptyRecord = Record<any, never>;\n\nexport interface DataRecord {\n [key: string]: string | number | undefined;\n instrument: string;\n displayName: string;\n buy?: number;\n sell?: number;\n spread?: number;\n sellPriceMovement?: number;\n buyPriceMovement?: number;\n dailyPercentChange?: string;\n displayPrecision?: number;\n}\n\nexport interface RowWithDataProps {\n loading: boolean;\n record: DataRecord;\n hasBackgroundColor: boolean;\n target: EventTarget | null;\n activeColumns: ColumnsNames[];\n division: Division;\n isScrolled?: boolean;\n}\n\nexport interface CardWithDataProps {\n index: number;\n isLoading?: boolean;\n isError?: boolean;\n record: DataRecord;\n target: EventTarget | null;\n activeColumns: ColumnsNames[];\n division: Division;\n isLast?: boolean;\n}\n"],"mappings":"AAGA,SAASA,MAAM,QAAQ,kBAAkB;AACzC,SAASC,QAAQ,QAAQ,sBAAsB;AAE/C,WAAYC,IAAI,aAAJA,IAAI;EAAJA,IAAI;EAAJA,IAAI;EAAA,OAAJA,IAAI;AAAA;AAchB,WAAYC,YAAY,aAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LiveRatesTableConfig } from './types';
|
|
3
|
-
declare const LiveRatesTableWidget: ({ graphqlUrl, liveRatesUrl, instruments, division, columns, locale, theme, isParamError, removePadding, view, }: LiveRatesTableConfig) => React.JSX.Element;
|
|
3
|
+
declare const LiveRatesTableWidget: ({ graphqlUrl, liveRatesUrl, instruments, division, columns, locale, theme, isParamError, removePadding, view, logoLink, }: LiveRatesTableConfig) => React.JSX.Element;
|
|
4
4
|
export { LiveRatesTableWidget };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Theme } from '@oanda/labs-widget-common';
|
|
1
|
+
import { WidgetConfig } from '@oanda/labs-widget-common';
|
|
3
2
|
import { Division } from '../gql/types/graphql';
|
|
4
3
|
export { Locale } from '@oanda/mono-i18n';
|
|
5
4
|
export { Division } from '../gql/types/graphql';
|
|
@@ -7,15 +6,11 @@ export declare enum View {
|
|
|
7
6
|
TABLE = "table",
|
|
8
7
|
CARDS = "cards"
|
|
9
8
|
}
|
|
10
|
-
export interface LiveRatesTableConfig {
|
|
11
|
-
graphqlUrl: string;
|
|
9
|
+
export interface LiveRatesTableConfig extends WidgetConfig {
|
|
12
10
|
division: Division;
|
|
13
11
|
liveRatesUrl: string;
|
|
14
12
|
instruments: string[];
|
|
15
13
|
columns?: ColumnsNames[];
|
|
16
|
-
locale: Locale;
|
|
17
|
-
theme?: Theme;
|
|
18
|
-
isParamError?: boolean;
|
|
19
14
|
removePadding?: boolean;
|
|
20
15
|
view?: View;
|
|
21
16
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oanda/labs-live-rates-table-widget",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.36",
|
|
4
4
|
"description": "Labs Live Rates Table Widget",
|
|
5
5
|
"main": "dist/main/index.js",
|
|
6
6
|
"module": "dist/module/index.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"author": "OANDA",
|
|
13
13
|
"license": "UNLICENSED",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@oanda/labs-widget-common": "^1.0.
|
|
15
|
+
"@oanda/labs-widget-common": "^1.0.170",
|
|
16
16
|
"@oanda/mono-i18n": "10.0.1",
|
|
17
17
|
"graphql": "16.8.1"
|
|
18
18
|
},
|
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
"@graphql-codegen/cli": "5.0.0",
|
|
21
21
|
"@graphql-codegen/client-preset": "4.1.0"
|
|
22
22
|
},
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "cfcc2eb4d59e16d25ec3da37e01767b476477125"
|
|
24
24
|
}
|
|
@@ -3,6 +3,7 @@ import { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';
|
|
|
3
3
|
import { LocaleProvider } from '@oanda/mono-i18n';
|
|
4
4
|
import {
|
|
5
5
|
ChartError, LiveRatesProvider, ThemeProvider, getLocale,
|
|
6
|
+
renderComponent,
|
|
6
7
|
} from '@oanda/labs-widget-common';
|
|
7
8
|
import { translations } from '../translations';
|
|
8
9
|
import { Main } from './Main';
|
|
@@ -20,6 +21,7 @@ const LiveRatesTableWidget = ({
|
|
|
20
21
|
isParamError,
|
|
21
22
|
removePadding,
|
|
22
23
|
view,
|
|
24
|
+
logoLink,
|
|
23
25
|
}: LiveRatesTableConfig) => {
|
|
24
26
|
const client = new ApolloClient({
|
|
25
27
|
uri: graphqlUrl,
|
|
@@ -43,11 +45,15 @@ const LiveRatesTableWidget = ({
|
|
|
43
45
|
</div>
|
|
44
46
|
)
|
|
45
47
|
: (
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
renderComponent({
|
|
49
|
+
Component: <Main
|
|
50
|
+
instruments={instruments}
|
|
51
|
+
division={division}
|
|
52
|
+
columns={columns}
|
|
53
|
+
/>,
|
|
54
|
+
logoLink,
|
|
55
|
+
linkArea: 'logo',
|
|
56
|
+
})
|
|
51
57
|
)}
|
|
52
58
|
</ApolloProvider>
|
|
53
59
|
</LiveRatesProvider>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Theme } from '@oanda/labs-widget-common';
|
|
1
|
+
import { WidgetConfig } from '@oanda/labs-widget-common';
|
|
3
2
|
import { Division } from '../gql/types/graphql';
|
|
4
3
|
|
|
5
4
|
export { Locale } from '@oanda/mono-i18n';
|
|
@@ -10,15 +9,11 @@ export enum View {
|
|
|
10
9
|
CARDS = 'cards',
|
|
11
10
|
}
|
|
12
11
|
|
|
13
|
-
export interface LiveRatesTableConfig {
|
|
14
|
-
graphqlUrl: string;
|
|
12
|
+
export interface LiveRatesTableConfig extends WidgetConfig {
|
|
15
13
|
division: Division;
|
|
16
14
|
liveRatesUrl: string;
|
|
17
15
|
instruments: string[];
|
|
18
16
|
columns?: ColumnsNames[];
|
|
19
|
-
locale: Locale;
|
|
20
|
-
theme?: Theme;
|
|
21
|
-
isParamError?: boolean;
|
|
22
17
|
removePadding?: boolean;
|
|
23
18
|
view?: View;
|
|
24
19
|
}
|