@oanda/labs-widget-common 1.0.252 → 1.0.253
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 +1241 -62993
- package/dist/main/components/style.css +1 -1
- package/dist/module/chart/BaseChart.js +15 -7
- package/dist/module/chart/BaseChart.js.map +1 -1
- package/dist/module/chart/formatters.js +12 -3
- package/dist/module/chart/formatters.js.map +1 -1
- package/dist/module/chart/getGridLines.js +16 -9
- package/dist/module/chart/getGridLines.js.map +1 -1
- package/dist/module/chart/getTheme.js +38 -31
- package/dist/module/chart/getTheme.js.map +1 -1
- package/dist/module/chart/getZoomControls.js +12 -5
- package/dist/module/chart/getZoomControls.js.map +1 -1
- package/dist/module/chart/index.js +82 -7
- package/dist/module/chart/index.js.map +1 -1
- package/dist/module/chart/sharedOptions.js +11 -4
- package/dist/module/chart/sharedOptions.js.map +1 -1
- package/dist/module/chart/types.js +5 -1
- package/dist/module/components/Button/Button.js +18 -11
- package/dist/module/components/Button/Button.js.map +1 -1
- package/dist/module/components/Button/index.js +27 -2
- package/dist/module/components/Button/index.js.map +1 -1
- package/dist/module/components/Button/types.js +8 -2
- package/dist/module/components/Button/types.js.map +1 -1
- package/dist/module/components/Card/Card.js +24 -16
- package/dist/module/components/Card/Card.js.map +1 -1
- package/dist/module/components/Card/CardHeader.js +21 -14
- package/dist/module/components/Card/CardHeader.js.map +1 -1
- package/dist/module/components/Card/index.js +38 -3
- package/dist/module/components/Card/index.js.map +1 -1
- package/dist/module/components/Card/rows/DailyChangeCardRow.js +15 -7
- package/dist/module/components/Card/rows/DailyChangeCardRow.js.map +1 -1
- package/dist/module/components/Card/rows/LineChartCardRow.js +17 -10
- package/dist/module/components/Card/rows/LineChartCardRow.js.map +1 -1
- package/dist/module/components/Card/rows/PriceCardRow.js +16 -8
- package/dist/module/components/Card/rows/PriceCardRow.js.map +1 -1
- package/dist/module/components/Card/rows/SentimentCardRow.js +18 -10
- package/dist/module/components/Card/rows/SentimentCardRow.js.map +1 -1
- package/dist/module/components/Card/rows/SpreadCardRow.js +15 -7
- package/dist/module/components/Card/rows/SpreadCardRow.js.map +1 -1
- package/dist/module/components/Card/rows/index.js +60 -5
- package/dist/module/components/Card/rows/index.js.map +1 -1
- package/dist/module/components/Card/types.js +5 -1
- package/dist/module/components/Disclaimer/Disclaimer.js +32 -24
- package/dist/module/components/Disclaimer/Disclaimer.js.map +1 -1
- package/dist/module/components/Disclaimer/index.js +16 -1
- package/dist/module/components/Disclaimer/index.js.map +1 -1
- package/dist/module/components/Error/Error.js +27 -18
- package/dist/module/components/Error/Error.js.map +1 -1
- package/dist/module/components/Error/index.js +16 -1
- package/dist/module/components/Error/index.js.map +1 -1
- package/dist/module/components/InfoBox/InfoBox.js +10 -3
- package/dist/module/components/InfoBox/InfoBox.js.map +1 -1
- package/dist/module/components/InfoBox/index.js +27 -2
- package/dist/module/components/InfoBox/index.js.map +1 -1
- package/dist/module/components/InfoBox/types.js +5 -1
- package/dist/module/components/Input/NumberInput.js +21 -13
- package/dist/module/components/Input/NumberInput.js.map +1 -1
- package/dist/module/components/Input/index.js +38 -3
- package/dist/module/components/Input/index.js.map +1 -1
- package/dist/module/components/Input/types.js +5 -1
- package/dist/module/components/Input/useNumberFormat.js +11 -4
- package/dist/module/components/Input/useNumberFormat.js.map +1 -1
- package/dist/module/components/InstrumentRate/InstrumentRate.js +37 -30
- package/dist/module/components/InstrumentRate/InstrumentRate.js.map +1 -1
- package/dist/module/components/InstrumentRate/InstrumentRateWithChart.js +19 -13
- package/dist/module/components/InstrumentRate/InstrumentRateWithChart.js.map +1 -1
- package/dist/module/components/InstrumentRate/index.js +38 -3
- package/dist/module/components/InstrumentRate/index.js.map +1 -1
- package/dist/module/components/InstrumentRate/types.js +5 -1
- package/dist/module/components/InstrumentRate/utils.js +13 -6
- package/dist/module/components/InstrumentRate/utils.js.map +1 -1
- package/dist/module/components/Label/Label.js +12 -6
- package/dist/module/components/Label/Label.js.map +1 -1
- package/dist/module/components/Label/index.js +16 -1
- package/dist/module/components/Label/index.js.map +1 -1
- package/dist/module/components/LabelWrapper/LabelWrapper.js +24 -17
- package/dist/module/components/LabelWrapper/LabelWrapper.js.map +1 -1
- package/dist/module/components/LabelWrapper/index.js +27 -2
- package/dist/module/components/LabelWrapper/index.js.map +1 -1
- package/dist/module/components/LabelWrapper/types.js +7 -1
- package/dist/module/components/LabelWrapper/types.js.map +1 -1
- package/dist/module/components/LastUpdated/LastUpdated.js +13 -6
- package/dist/module/components/LastUpdated/LastUpdated.js.map +1 -1
- package/dist/module/components/LastUpdated/index.js +27 -2
- package/dist/module/components/LastUpdated/index.js.map +1 -1
- package/dist/module/components/LastUpdated/types.js +5 -1
- package/dist/module/components/LineChart/LineChart.js +18 -11
- package/dist/module/components/LineChart/LineChart.js.map +1 -1
- package/dist/module/components/LineChart/LineChartWithData.js +14 -8
- package/dist/module/components/LineChart/LineChartWithData.js.map +1 -1
- package/dist/module/components/LineChart/index.js +49 -4
- package/dist/module/components/LineChart/index.js.map +1 -1
- package/dist/module/components/LineChart/types.js +7 -1
- package/dist/module/components/LineChart/types.js.map +1 -1
- package/dist/module/components/LineChart/utils.js +16 -8
- package/dist/module/components/LineChart/utils.js.map +1 -1
- package/dist/module/components/Loader/Loader.js +18 -11
- package/dist/module/components/Loader/Loader.js.map +1 -1
- package/dist/module/components/Loader/index.js +27 -2
- package/dist/module/components/Loader/index.js.map +1 -1
- package/dist/module/components/Loader/types.js +7 -1
- package/dist/module/components/Loader/types.js.map +1 -1
- package/dist/module/components/Pagination/Pagination.js +40 -33
- package/dist/module/components/Pagination/Pagination.js.map +1 -1
- package/dist/module/components/Pagination/index.js +27 -2
- package/dist/module/components/Pagination/index.js.map +1 -1
- package/dist/module/components/Pagination/types.js +5 -1
- package/dist/module/components/Pagination/utils.js +8 -1
- package/dist/module/components/Pagination/utils.js.map +1 -1
- package/dist/module/components/Price/Price.js +23 -15
- package/dist/module/components/Price/Price.js.map +1 -1
- package/dist/module/components/Price/index.js +27 -2
- package/dist/module/components/Price/index.js.map +1 -1
- package/dist/module/components/Price/types.js +7 -1
- package/dist/module/components/Price/types.js.map +1 -1
- package/dist/module/components/SearchInput/SearchInput.js +12 -5
- package/dist/module/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/module/components/SearchInput/index.js +27 -2
- package/dist/module/components/SearchInput/index.js.map +1 -1
- package/dist/module/components/SearchInput/types.js +5 -1
- package/dist/module/components/Select/Select.js +44 -36
- package/dist/module/components/Select/Select.js.map +1 -1
- package/dist/module/components/Select/index.js +27 -2
- package/dist/module/components/Select/index.js.map +1 -1
- package/dist/module/components/Select/types.js +5 -1
- package/dist/module/components/Sentiment/Sentiment.js +28 -20
- package/dist/module/components/Sentiment/Sentiment.js.map +1 -1
- package/dist/module/components/Sentiment/SentimentError.js +17 -10
- package/dist/module/components/Sentiment/SentimentError.js.map +1 -1
- package/dist/module/components/Sentiment/SentimentLoader.js +17 -10
- package/dist/module/components/Sentiment/SentimentLoader.js.map +1 -1
- package/dist/module/components/Sentiment/index.js +38 -3
- package/dist/module/components/Sentiment/index.js.map +1 -1
- package/dist/module/components/Sentiment/types.js +7 -1
- package/dist/module/components/Sentiment/types.js.map +1 -1
- package/dist/module/components/Sentiment/utils.js +7 -1
- package/dist/module/components/Sentiment/utils.js.map +1 -1
- package/dist/module/components/Spinner/Spinner.js +18 -10
- package/dist/module/components/Spinner/Spinner.js.map +1 -1
- package/dist/module/components/Spinner/index.js +27 -2
- package/dist/module/components/Spinner/index.js.map +1 -1
- package/dist/module/components/Spinner/types.js +7 -1
- package/dist/module/components/Spinner/types.js.map +1 -1
- package/dist/module/components/Switch/Switch.js +26 -18
- package/dist/module/components/Switch/Switch.js.map +1 -1
- package/dist/module/components/Switch/SwitchItem.js +18 -10
- package/dist/module/components/Switch/SwitchItem.js.map +1 -1
- package/dist/module/components/Switch/constants.js +7 -1
- package/dist/module/components/Switch/constants.js.map +1 -1
- package/dist/module/components/Switch/index.js +16 -1
- package/dist/module/components/Switch/index.js.map +1 -1
- package/dist/module/components/Switch/types.js +5 -1
- package/dist/module/components/Table/Table.js +21 -14
- package/dist/module/components/Table/Table.js.map +1 -1
- package/dist/module/components/Table/TableCell.js +19 -12
- package/dist/module/components/Table/TableCell.js.map +1 -1
- package/dist/module/components/Table/TableHeader.js +20 -13
- package/dist/module/components/Table/TableHeader.js.map +1 -1
- package/dist/module/components/Table/TableRow.js +15 -8
- package/dist/module/components/Table/TableRow.js.map +1 -1
- package/dist/module/components/Table/columns/ChartColumn.js +20 -12
- package/dist/module/components/Table/columns/ChartColumn.js.map +1 -1
- package/dist/module/components/Table/columns/DailyChangeColumn.js +15 -7
- package/dist/module/components/Table/columns/DailyChangeColumn.js.map +1 -1
- package/dist/module/components/Table/columns/InstrumentColumn.js +19 -11
- package/dist/module/components/Table/columns/InstrumentColumn.js.map +1 -1
- package/dist/module/components/Table/columns/PriceColumn.js +16 -8
- package/dist/module/components/Table/columns/PriceColumn.js.map +1 -1
- package/dist/module/components/Table/columns/SentimentColumn.js +16 -8
- package/dist/module/components/Table/columns/SentimentColumn.js.map +1 -1
- package/dist/module/components/Table/columns/SpreadColumn.js +17 -9
- package/dist/module/components/Table/columns/SpreadColumn.js.map +1 -1
- package/dist/module/components/Table/columns/index.js +71 -6
- package/dist/module/components/Table/columns/index.js.map +1 -1
- package/dist/module/components/Table/index.js +60 -5
- package/dist/module/components/Table/index.js.map +1 -1
- package/dist/module/components/Table/types.js +5 -1
- package/dist/module/components/TableWidget/CardRecordRow.js +22 -14
- package/dist/module/components/TableWidget/CardRecordRow.js.map +1 -1
- package/dist/module/components/TableWidget/CardRenderer.js +20 -12
- package/dist/module/components/TableWidget/CardRenderer.js.map +1 -1
- package/dist/module/components/TableWidget/Cards.js +14 -6
- package/dist/module/components/TableWidget/Cards.js.map +1 -1
- package/dist/module/components/TableWidget/ColumnRenderer.js +42 -34
- package/dist/module/components/TableWidget/ColumnRenderer.js.map +1 -1
- package/dist/module/components/TableWidget/DataRecordRow.js +20 -12
- package/dist/module/components/TableWidget/DataRecordRow.js.map +1 -1
- package/dist/module/components/TableWidget/TableWidget.js +34 -26
- package/dist/module/components/TableWidget/TableWidget.js.map +1 -1
- package/dist/module/components/TableWidget/index.js +27 -2
- package/dist/module/components/TableWidget/index.js.map +1 -1
- package/dist/module/components/TableWidget/types.js +5 -1
- package/dist/module/components/TableWidget/utils.js +12 -4
- package/dist/module/components/TableWidget/utils.js.map +1 -1
- package/dist/module/components/Tabs/Tab.js +16 -10
- package/dist/module/components/Tabs/Tab.js.map +1 -1
- package/dist/module/components/Tabs/Tabs.js +11 -5
- package/dist/module/components/Tabs/Tabs.js.map +1 -1
- package/dist/module/components/Tabs/index.js +16 -1
- package/dist/module/components/Tabs/index.js.map +1 -1
- package/dist/module/components/Tabs/types.js +5 -1
- package/dist/module/components/TextInput/TextInput.js +17 -10
- package/dist/module/components/TextInput/TextInput.js.map +1 -1
- package/dist/module/components/TextInput/index.js +16 -1
- package/dist/module/components/TextInput/index.js.map +1 -1
- package/dist/module/components/TimeUnitSwitch/TimeUnitSelect.js +14 -7
- package/dist/module/components/TimeUnitSwitch/TimeUnitSelect.js.map +1 -1
- package/dist/module/components/TimeUnitSwitch/TimeUnitSwitch.js +22 -15
- package/dist/module/components/TimeUnitSwitch/TimeUnitSwitch.js.map +1 -1
- package/dist/module/components/TimeUnitSwitch/index.js +16 -1
- package/dist/module/components/TimeUnitSwitch/index.js.map +1 -1
- package/dist/module/components/TimeUnitSwitch/types.js +5 -1
- package/dist/module/components/Tooltip/Tooltip.js +11 -4
- package/dist/module/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/module/components/Tooltip/index.js +27 -2
- package/dist/module/components/Tooltip/index.js.map +1 -1
- package/dist/module/components/Tooltip/types.js +5 -1
- package/dist/module/components/Truncate/Truncate.js +18 -11
- package/dist/module/components/Truncate/Truncate.js.map +1 -1
- package/dist/module/components/Truncate/index.js +27 -2
- package/dist/module/components/Truncate/index.js.map +1 -1
- package/dist/module/components/Truncate/types.js +5 -1
- package/dist/module/components/WidgetWrapper/WidgetWrapper.js +14 -6
- package/dist/module/components/WidgetWrapper/WidgetWrapper.js.map +1 -1
- package/dist/module/components/WidgetWrapper/index.js +16 -1
- package/dist/module/components/WidgetWrapper/index.js.map +1 -1
- package/dist/module/components/constant.js +8 -2
- package/dist/module/components/constant.js.map +1 -1
- package/dist/module/components/index.js +292 -27
- package/dist/module/components/index.js.map +1 -1
- package/dist/module/components/style.css +1 -1
- package/dist/module/constants/index.js +13 -7
- package/dist/module/constants/index.js.map +1 -1
- package/dist/module/fonts/index.js +27 -4
- package/dist/module/fonts/index.js.map +1 -1
- package/dist/module/hooks/index.js +71 -6
- package/dist/module/hooks/index.js.map +1 -1
- package/dist/module/hooks/useFetchCombinedDataRecords.js +14 -7
- package/dist/module/hooks/useFetchCombinedDataRecords.js.map +1 -1
- package/dist/module/hooks/useLiveRates.js +12 -5
- package/dist/module/hooks/useLiveRates.js.map +1 -1
- package/dist/module/hooks/useLiveRatesMessage.js +26 -19
- package/dist/module/hooks/useLiveRatesMessage.js.map +1 -1
- package/dist/module/hooks/useLiveRatesQuery.js +12 -5
- package/dist/module/hooks/useLiveRatesQuery.js.map +1 -1
- package/dist/module/hooks/useRecords.js +13 -7
- package/dist/module/hooks/useRecords.js.map +1 -1
- package/dist/module/hooks/useVisibleLiveDataRecord.js +16 -9
- package/dist/module/hooks/useVisibleLiveDataRecord.js.map +1 -1
- package/dist/module/images/index.js +111 -16
- package/dist/module/images/index.js.map +1 -1
- package/dist/module/index.js +126 -11
- package/dist/module/index.js.map +1 -1
- package/dist/module/providers/ConditionalProvider.js +11 -3
- package/dist/module/providers/ConditionalProvider.js.map +1 -1
- package/dist/module/providers/Layout/LayoutContext.js +12 -4
- package/dist/module/providers/Layout/LayoutContext.js.map +1 -1
- package/dist/module/providers/Layout/LayoutProvider.js +30 -22
- package/dist/module/providers/Layout/LayoutProvider.js.map +1 -1
- package/dist/module/providers/Layout/LayoutProvider.test.js +61 -58
- package/dist/module/providers/Layout/LayoutProvider.test.js.map +1 -1
- package/dist/module/providers/Layout/index.js +27 -2
- package/dist/module/providers/Layout/index.js.map +1 -1
- package/dist/module/providers/LiveRates/LiveRatesContext.js +11 -4
- package/dist/module/providers/LiveRates/LiveRatesContext.js.map +1 -1
- package/dist/module/providers/LiveRates/LiveRatesProvider.js +37 -29
- package/dist/module/providers/LiveRates/LiveRatesProvider.js.map +1 -1
- package/dist/module/providers/LiveRates/index.js +27 -2
- package/dist/module/providers/LiveRates/index.js.map +1 -1
- package/dist/module/providers/Widget/WidgetProvider.js +26 -18
- package/dist/module/providers/Widget/WidgetProvider.js.map +1 -1
- package/dist/module/providers/Widget/index.js +16 -1
- package/dist/module/providers/Widget/index.js.map +1 -1
- package/dist/module/providers/index.js +38 -3
- package/dist/module/providers/index.js.map +1 -1
- package/dist/module/tailwind/cn.js +11 -4
- package/dist/module/tailwind/cn.js.map +1 -1
- package/dist/module/tailwind/colors.js +9 -3
- package/dist/module/tailwind/colors.js.map +1 -1
- package/dist/module/tailwind/index.js +39 -3
- package/dist/module/tailwind/index.js.map +1 -1
- package/dist/module/tailwind/preset.js +11 -5
- package/dist/module/tailwind/preset.js.map +1 -1
- package/dist/module/tailwind/themes/background.js +14 -8
- package/dist/module/tailwind/themes/background.js.map +1 -1
- package/dist/module/tailwind/themes/border.js +10 -4
- package/dist/module/tailwind/themes/border.js.map +1 -1
- package/dist/module/tailwind/themes/index.js +12 -6
- package/dist/module/tailwind/themes/index.js.map +1 -1
- package/dist/module/tailwind/themes/text.js +18 -12
- package/dist/module/tailwind/themes/text.js.map +1 -1
- package/dist/module/tailwind/themes/themeColors.js +26 -20
- package/dist/module/tailwind/themes/themeColors.js.map +1 -1
- package/dist/module/tailwind/types.js +5 -1
- package/dist/module/tailwind/utils.js +8 -1
- package/dist/module/tailwind/utils.js.map +1 -1
- package/dist/module/testUtils/index.js +15 -7
- package/dist/module/testUtils/index.js.map +1 -1
- package/dist/module/translations/index.js +15 -8
- package/dist/module/translations/index.js.map +1 -1
- package/dist/module/translations/translations.js +7 -1
- package/dist/module/translations/translations.js.map +1 -1
- package/dist/module/types/dataTypes.js +7 -1
- package/dist/module/types/dataTypes.js.map +1 -1
- package/dist/module/types/index.js +36 -4
- package/dist/module/types/index.js.map +1 -1
- package/dist/module/types/liveRatesTypes.js +5 -1
- package/dist/module/utils/dateUtils.js +9 -1
- package/dist/module/utils/dateUtils.js.map +1 -1
- package/dist/module/utils/getLocale.js +20 -13
- package/dist/module/utils/getLocale.js.map +1 -1
- package/dist/module/utils/index.js +38 -3
- package/dist/module/utils/index.js.map +1 -1
- package/dist/module/utils/liveRates/buildUrl.js +8 -1
- package/dist/module/utils/liveRates/buildUrl.js.map +1 -1
- package/dist/module/utils/liveRates/calculatePipsChangeFromOpen.js +7 -1
- package/dist/module/utils/liveRates/calculatePipsChangeFromOpen.js.map +1 -1
- package/dist/module/utils/liveRates/calculatePriceChange.js +8 -1
- package/dist/module/utils/liveRates/calculatePriceChange.js.map +1 -1
- package/dist/module/utils/liveRates/calculatePriceChangeFromOpen.js +8 -1
- package/dist/module/utils/liveRates/calculatePriceChangeFromOpen.js.map +1 -1
- package/dist/module/utils/liveRates/calculateSpread.js +8 -1
- package/dist/module/utils/liveRates/calculateSpread.js.map +1 -1
- package/dist/module/utils/liveRates/decodeLiveRateMessage.js +9 -2
- package/dist/module/utils/liveRates/decodeLiveRateMessage.js.map +1 -1
- package/dist/module/utils/liveRates/decodeUtilities.js +18 -6
- package/dist/module/utils/liveRates/decodeUtilities.js.map +1 -1
- package/dist/module/utils/liveRates/index.js +82 -7
- package/dist/module/utils/liveRates/index.js.map +1 -1
- package/dist/module/utils/validateToolParams.js +7 -1
- package/dist/module/utils/validateToolParams.js.map +1 -1
- package/package.json +9 -4
- package/src/components/style.css +1 -1
- package/tsconfig.types.json +2 -4
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CardRecordRow = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _hooks = require("../../hooks");
|
|
9
|
+
var _types = require("../../types");
|
|
10
|
+
var _Card = require("../Card");
|
|
11
|
+
var _rows = require("../Card/rows");
|
|
12
|
+
var _Truncate = require("../Truncate");
|
|
13
|
+
var _CardRenderer = require("./CardRenderer");
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
const CardRecordRow = _ref => {
|
|
9
16
|
let {
|
|
10
17
|
record,
|
|
11
18
|
target,
|
|
@@ -20,27 +27,28 @@ export const CardRecordRow = _ref => {
|
|
|
20
27
|
updatedRecord,
|
|
21
28
|
error,
|
|
22
29
|
ref
|
|
23
|
-
} = useVisibleLiveDataRecord(record, record.instrument ? target : null);
|
|
24
|
-
return
|
|
30
|
+
} = (0, _hooks.useVisibleLiveDataRecord)(record, record.instrument ? target : null);
|
|
31
|
+
return _react.default.createElement(_Card.Card, {
|
|
25
32
|
ref: ref,
|
|
26
33
|
"data-testid": "card",
|
|
27
34
|
withoutBottomBorder: !isLast
|
|
28
|
-
},
|
|
35
|
+
}, _react.default.createElement(_Card.CardHeader, {
|
|
29
36
|
isLoading: isLoading,
|
|
30
37
|
number: index,
|
|
31
|
-
title:
|
|
38
|
+
title: _react.default.createElement(_Truncate.Truncate, {
|
|
32
39
|
text: record.displayName,
|
|
33
40
|
tooltipId: tooltipId
|
|
34
41
|
})
|
|
35
|
-
}, activeColumns.includes(DataRecordType.CHART) &&
|
|
42
|
+
}, activeColumns.includes(_types.DataRecordType.CHART) && _react.default.createElement(_rows.LineChartCardRow, {
|
|
36
43
|
chart: record.chart ?? [],
|
|
37
44
|
isLoading: !!isChartLoading,
|
|
38
45
|
percentChange: updatedRecord.dailyPercentChange
|
|
39
|
-
})),
|
|
46
|
+
})), _react.default.createElement(_CardRenderer.CardRenderer, {
|
|
40
47
|
activeColumns: activeColumns,
|
|
41
48
|
isError: !!error,
|
|
42
49
|
isLoading: isLoading,
|
|
43
50
|
record: updatedRecord
|
|
44
51
|
}));
|
|
45
52
|
};
|
|
53
|
+
exports.CardRecordRow = CardRecordRow;
|
|
46
54
|
//# sourceMappingURL=CardRecordRow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardRecordRow.js","names":["
|
|
1
|
+
{"version":3,"file":"CardRecordRow.js","names":["_react","_interopRequireDefault","require","_hooks","_types","_Card","_rows","_Truncate","_CardRenderer","e","__esModule","default","CardRecordRow","_ref","record","target","isLast","isLoading","isChartLoading","activeColumns","tooltipId","index","updatedRecord","error","ref","useVisibleLiveDataRecord","instrument","createElement","Card","withoutBottomBorder","CardHeader","number","title","Truncate","text","displayName","includes","DataRecordType","CHART","LineChartCardRow","chart","percentChange","dailyPercentChange","CardRenderer","isError","exports"],"sources":["../../../../src/components/TableWidget/CardRecordRow.tsx"],"sourcesContent":["import React from 'react';\n\nimport { useVisibleLiveDataRecord } from '../../hooks';\nimport type { DataRecord, EmptyRecord } from '../../types';\nimport { DataRecordType } from '../../types';\nimport { Card, CardHeader } from '../Card';\nimport { LineChartCardRow } from '../Card/rows';\nimport { Truncate } from '../Truncate';\nimport { CardRenderer } from './CardRenderer';\n\nexport interface DataRecordRowProps {\n record: DataRecord | EmptyRecord;\n target: EventTarget | null;\n activeColumns: DataRecordType[];\n isLast?: boolean;\n isLoading?: boolean;\n isChartLoading?: boolean;\n tooltipId: string;\n index: number;\n}\n\nexport const CardRecordRow = ({\n record,\n target,\n isLast,\n isLoading,\n isChartLoading,\n activeColumns,\n tooltipId,\n index,\n}: DataRecordRowProps) => {\n const { updatedRecord, error, ref } = useVisibleLiveDataRecord(\n record,\n record.instrument ? target : null\n );\n\n return (\n <Card ref={ref} data-testid=\"card\" withoutBottomBorder={!isLast}>\n <CardHeader\n isLoading={isLoading}\n number={index}\n title={<Truncate text={record.displayName} tooltipId={tooltipId} />}\n >\n {activeColumns.includes(DataRecordType.CHART) && (\n <LineChartCardRow\n chart={record.chart ?? []}\n isLoading={!!isChartLoading}\n percentChange={updatedRecord.dailyPercentChange}\n />\n )}\n </CardHeader>\n <CardRenderer\n activeColumns={activeColumns}\n isError={!!error}\n isLoading={isLoading}\n record={updatedRecord}\n />\n </Card>\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AAA8C,SAAAD,uBAAAQ,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAavC,MAAMG,aAAa,GAAGC,IAAA,IASH;EAAA,IATI;IAC5BC,MAAM;IACNC,MAAM;IACNC,MAAM;IACNC,SAAS;IACTC,cAAc;IACdC,aAAa;IACbC,SAAS;IACTC;EACkB,CAAC,GAAAR,IAAA;EACnB,MAAM;IAAES,aAAa;IAAEC,KAAK;IAAEC;EAAI,CAAC,GAAG,IAAAC,+BAAwB,EAC5DX,MAAM,EACNA,MAAM,CAACY,UAAU,GAAGX,MAAM,GAAG,IAC/B,CAAC;EAED,OACEf,MAAA,CAAAW,OAAA,CAAAgB,aAAA,CAACtB,KAAA,CAAAuB,IAAI;IAACJ,GAAG,EAAEA,GAAI;IAAC,eAAY,MAAM;IAACK,mBAAmB,EAAE,CAACb;EAAO,GAC9DhB,MAAA,CAAAW,OAAA,CAAAgB,aAAA,CAACtB,KAAA,CAAAyB,UAAU;IACTb,SAAS,EAAEA,SAAU;IACrBc,MAAM,EAAEV,KAAM;IACdW,KAAK,EAAEhC,MAAA,CAAAW,OAAA,CAAAgB,aAAA,CAACpB,SAAA,CAAA0B,QAAQ;MAACC,IAAI,EAAEpB,MAAM,CAACqB,WAAY;MAACf,SAAS,EAAEA;IAAU,CAAE;EAAE,GAEnED,aAAa,CAACiB,QAAQ,CAACC,qBAAc,CAACC,KAAK,CAAC,IAC3CtC,MAAA,CAAAW,OAAA,CAAAgB,aAAA,CAACrB,KAAA,CAAAiC,gBAAgB;IACfC,KAAK,EAAE1B,MAAM,CAAC0B,KAAK,IAAI,EAAG;IAC1BvB,SAAS,EAAE,CAAC,CAACC,cAAe;IAC5BuB,aAAa,EAAEnB,aAAa,CAACoB;EAAmB,CACjD,CAEO,CAAC,EACb1C,MAAA,CAAAW,OAAA,CAAAgB,aAAA,CAACnB,aAAA,CAAAmC,YAAY;IACXxB,aAAa,EAAEA,aAAc;IAC7ByB,OAAO,EAAE,CAAC,CAACrB,KAAM;IACjBN,SAAS,EAAEA,SAAU;IACrBH,MAAM,EAAEQ;EAAc,CACvB,CACG,CAAC;AAEX,CAAC;AAACuB,OAAA,CAAAjC,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CardRenderer = void 0;
|
|
7
|
+
var _monoI18n = require("@oanda/mono-i18n");
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _types = require("../../types");
|
|
10
|
+
var _rows = require("../Card/rows");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
const CardRenderer = _ref => {
|
|
6
13
|
let {
|
|
7
14
|
activeColumns,
|
|
8
15
|
record,
|
|
@@ -11,9 +18,9 @@ export const CardRenderer = _ref => {
|
|
|
11
18
|
} = _ref;
|
|
12
19
|
const {
|
|
13
20
|
lang
|
|
14
|
-
} = useLocale();
|
|
21
|
+
} = (0, _monoI18n.useLocale)();
|
|
15
22
|
const allColumns = {
|
|
16
|
-
[DataRecordType.SELL]: () =>
|
|
23
|
+
[_types.DataRecordType.SELL]: () => _react.default.createElement(_rows.PriceCardRow, {
|
|
17
24
|
displayPrecision: record.displayPrecision,
|
|
18
25
|
isError: isError,
|
|
19
26
|
isLoading: isLoading,
|
|
@@ -21,7 +28,7 @@ export const CardRenderer = _ref => {
|
|
|
21
28
|
price: record.sell,
|
|
22
29
|
priceMovement: record.sellPriceMovement
|
|
23
30
|
}),
|
|
24
|
-
[DataRecordType.BUY]: () =>
|
|
31
|
+
[_types.DataRecordType.BUY]: () => _react.default.createElement(_rows.PriceCardRow, {
|
|
25
32
|
displayPrecision: record.displayPrecision,
|
|
26
33
|
isError: isError,
|
|
27
34
|
isLoading: isLoading,
|
|
@@ -29,26 +36,27 @@ export const CardRenderer = _ref => {
|
|
|
29
36
|
price: record.buy,
|
|
30
37
|
priceMovement: record.buyPriceMovement
|
|
31
38
|
}),
|
|
32
|
-
[DataRecordType.DAILY_CHANGE]: () =>
|
|
39
|
+
[_types.DataRecordType.DAILY_CHANGE]: () => _react.default.createElement(_rows.DailyChangeCardRow, {
|
|
33
40
|
dailyPercentChange: record.dailyPercentChange,
|
|
34
41
|
isError: isError,
|
|
35
42
|
isLoading: isLoading,
|
|
36
43
|
label: lang('daily_percent_change')
|
|
37
44
|
}),
|
|
38
|
-
[DataRecordType.SPREAD]: () =>
|
|
45
|
+
[_types.DataRecordType.SPREAD]: () => _react.default.createElement(_rows.SpreadCardRow, {
|
|
39
46
|
isError: isError,
|
|
40
47
|
isLoading: isLoading,
|
|
41
48
|
label: lang('spread'),
|
|
42
49
|
value: record.spread
|
|
43
50
|
}),
|
|
44
|
-
[DataRecordType.SENTIMENT]: () =>
|
|
51
|
+
[_types.DataRecordType.SENTIMENT]: () => _react.default.createElement(_rows.SentimentCardRow, {
|
|
45
52
|
isLoading: isLoading,
|
|
46
53
|
label: lang('sentiment'),
|
|
47
54
|
sentiment: record.sentiment
|
|
48
55
|
})
|
|
49
56
|
};
|
|
50
|
-
return activeColumns.map(item =>
|
|
57
|
+
return activeColumns.map(item => _react.default.createElement(_react.default.Fragment, {
|
|
51
58
|
key: item
|
|
52
59
|
}, allColumns[item]?.() ?? null));
|
|
53
60
|
};
|
|
61
|
+
exports.CardRenderer = CardRenderer;
|
|
54
62
|
//# sourceMappingURL=CardRenderer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardRenderer.js","names":["
|
|
1
|
+
{"version":3,"file":"CardRenderer.js","names":["_monoI18n","require","_react","_interopRequireDefault","_types","_rows","e","__esModule","default","CardRenderer","_ref","activeColumns","record","isError","isLoading","lang","useLocale","allColumns","DataRecordType","SELL","createElement","PriceCardRow","displayPrecision","label","price","sell","priceMovement","sellPriceMovement","BUY","buy","buyPriceMovement","DAILY_CHANGE","DailyChangeCardRow","dailyPercentChange","SPREAD","SpreadCardRow","value","spread","SENTIMENT","SentimentCardRow","sentiment","map","item","Fragment","key","exports"],"sources":["../../../../src/components/TableWidget/CardRenderer.tsx"],"sourcesContent":["import { useLocale } from '@oanda/mono-i18n';\nimport React from 'react';\n\nimport type { DataRecord, EmptyRecord } from '../../types';\nimport { DataRecordType } from '../../types';\nimport {\n DailyChangeCardRow,\n PriceCardRow,\n SentimentCardRow,\n SpreadCardRow,\n} from '../Card/rows';\n\ninterface CardRendererProps {\n record: DataRecord | EmptyRecord;\n isLoading?: boolean;\n isError: boolean;\n activeColumns: DataRecordType[];\n}\n\nexport const CardRenderer = ({\n activeColumns,\n record,\n isError,\n isLoading,\n}: CardRendererProps) => {\n const { lang } = useLocale();\n\n const allColumns: Partial<Record<DataRecordType, () => JSX.Element>> = {\n [DataRecordType.SELL]: () => (\n <PriceCardRow\n displayPrecision={record.displayPrecision}\n isError={isError}\n isLoading={isLoading}\n label={lang('sell_price')}\n price={record.sell}\n priceMovement={record.sellPriceMovement}\n />\n ),\n [DataRecordType.BUY]: () => (\n <PriceCardRow\n displayPrecision={record.displayPrecision}\n isError={isError}\n isLoading={isLoading}\n label={lang('buy_price')}\n price={record.buy}\n priceMovement={record.buyPriceMovement}\n />\n ),\n [DataRecordType.DAILY_CHANGE]: () => (\n <DailyChangeCardRow\n dailyPercentChange={record.dailyPercentChange}\n isError={isError}\n isLoading={isLoading}\n label={lang('daily_percent_change')}\n />\n ),\n [DataRecordType.SPREAD]: () => (\n <SpreadCardRow\n isError={isError}\n isLoading={isLoading}\n label={lang('spread')}\n value={record.spread}\n />\n ),\n [DataRecordType.SENTIMENT]: () => (\n <SentimentCardRow\n isLoading={isLoading}\n label={lang('sentiment')}\n sentiment={record.sentiment}\n />\n ),\n };\n\n return activeColumns.map((item) => (\n <React.Fragment key={item}>{allColumns[item]?.() ?? null}</React.Fragment>\n ));\n};\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKsB,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AASf,MAAMG,YAAY,GAAGC,IAAA,IAKH;EAAA,IALI;IAC3BC,aAAa;IACbC,MAAM;IACNC,OAAO;IACPC;EACiB,CAAC,GAAAJ,IAAA;EAClB,MAAM;IAAEK;EAAK,CAAC,GAAG,IAAAC,mBAAS,EAAC,CAAC;EAE5B,MAAMC,UAA8D,GAAG;IACrE,CAACC,qBAAc,CAACC,IAAI,GAAG,MACrBjB,MAAA,CAAAM,OAAA,CAAAY,aAAA,CAACf,KAAA,CAAAgB,YAAY;M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KAAK,EAAER,IAAI,CAAC,WAAW,CAAE;MACzByB,SAAS,EAAE5B,MAAM,CAAC4B;IAAU,CAC7B;EAEL,CAAC;EAED,OAAO7B,aAAa,CAAC8B,GAAG,CAAEC,IAAI,IAC5BxC,MAAA,CAAAM,OAAA,CAAAY,aAAA,CAAClB,MAAA,CAAAM,OAAK,CAACmC,QAAQ;IAACC,GAAG,EAAEF;EAAK,GAAEzB,UAAU,CAACyB,IAAI,CAAC,GAAG,CAAC,IAAI,IAAqB,CAC1E,CAAC;AACJ,CAAC;AAACG,OAAA,CAAApC,YAAA,GAAAA,YAAA","ignoreList":[]}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Cards = void 0;
|
|
7
|
+
var _labsWidgetCommon = require("@oanda/labs-widget-common");
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
const Cards = _ref => {
|
|
4
11
|
let {
|
|
5
12
|
records,
|
|
6
13
|
isError,
|
|
@@ -10,11 +17,11 @@ export const Cards = _ref => {
|
|
|
10
17
|
} = _ref;
|
|
11
18
|
const recordsOrEmptyRecords = records.length > 0 ? records : new Array(emptyCardsCount).fill({});
|
|
12
19
|
if (isError) {
|
|
13
|
-
return
|
|
20
|
+
return _react.default.createElement(_labsWidgetCommon.Card, null, _react.default.createElement("div", {
|
|
14
21
|
className: "lw-flex lw-h-[150px] lw-w-full lw-items-center lw-justify-center"
|
|
15
|
-
},
|
|
22
|
+
}, _react.default.createElement(_labsWidgetCommon.ChartError, null)));
|
|
16
23
|
}
|
|
17
|
-
return
|
|
24
|
+
return _react.default.createElement(_react.default.Fragment, null, recordsOrEmptyRecords.map((record, index) => _react.default.createElement("div", {
|
|
18
25
|
key: `card_${startIndex + index}`
|
|
19
26
|
}, renderCard({
|
|
20
27
|
record,
|
|
@@ -22,4 +29,5 @@ export const Cards = _ref => {
|
|
|
22
29
|
isLast: index + 1 === recordsOrEmptyRecords.length
|
|
23
30
|
}))));
|
|
24
31
|
};
|
|
32
|
+
exports.Cards = Cards;
|
|
25
33
|
//# sourceMappingURL=Cards.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cards.js","names":["
|
|
1
|
+
{"version":3,"file":"Cards.js","names":["_labsWidgetCommon","require","_react","_interopRequireDefault","e","__esModule","default","Cards","_ref","records","isError","emptyCardsCount","renderCard","startIndex","recordsOrEmptyRecords","length","Array","fill","createElement","Card","className","ChartError","Fragment","map","record","index","key","idx","isLast","exports"],"sources":["../../../../src/components/TableWidget/Cards.tsx"],"sourcesContent":["import { Card, ChartError } from '@oanda/labs-widget-common';\nimport React from 'react';\n\nimport type { DataRecord, EmptyRecord } from '../../types';\n\ninterface CardsProps {\n records: DataRecord[];\n isError?: boolean;\n emptyCardsCount?: number;\n startIndex?: number;\n renderCard: ({\n record,\n idx,\n isLast,\n }: {\n record: DataRecord | EmptyRecord;\n idx: number;\n isLast: boolean;\n }) => React.ReactNode;\n}\n\nexport const Cards = ({\n records,\n isError,\n emptyCardsCount,\n renderCard,\n startIndex = 0,\n}: CardsProps) => {\n const recordsOrEmptyRecords: DataRecord[] | EmptyRecord[] =\n records.length > 0 ? records : new Array(emptyCardsCount).fill({});\n\n if (isError) {\n return (\n <Card>\n <div className=\"lw-flex lw-h-[150px] lw-w-full lw-items-center lw-justify-center\">\n <ChartError />\n </div>\n </Card>\n );\n }\n\n return (\n <>\n {recordsOrEmptyRecords.map((record, index) => (\n <div key={`card_${startIndex + index}`}>\n {renderCard({\n record,\n idx: startIndex + index + 1,\n isLast: index + 1 === recordsOrEmptyRecords.length,\n })}\n </div>\n ))}\n </>\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAA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|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ColumnRenderer = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _types = require("../../types");
|
|
9
|
+
var _Loader = require("../Loader");
|
|
10
|
+
var _Table = require("../Table");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
const ColumnRenderer = _ref => {
|
|
6
13
|
let {
|
|
7
14
|
record,
|
|
8
15
|
isLoading,
|
|
@@ -12,76 +19,77 @@ export const ColumnRenderer = _ref => {
|
|
|
12
19
|
chart
|
|
13
20
|
} = _ref;
|
|
14
21
|
const allColumns = {
|
|
15
|
-
[DataRecordType.SELL]: () =>
|
|
16
|
-
column: DataRecordType.SELL,
|
|
22
|
+
[_types.DataRecordType.SELL]: () => _react.default.createElement(_Table.PriceColumn, {
|
|
23
|
+
column: _types.DataRecordType.SELL,
|
|
17
24
|
displayPrecision: record.displayPrecision,
|
|
18
25
|
isError: isError,
|
|
19
26
|
isLoading: isLoading,
|
|
20
27
|
price: record.sell,
|
|
21
28
|
priceMovement: record.sellPriceMovement
|
|
22
29
|
}),
|
|
23
|
-
[DataRecordType.BUY]: () =>
|
|
24
|
-
column: DataRecordType.BUY,
|
|
30
|
+
[_types.DataRecordType.BUY]: () => _react.default.createElement(_Table.PriceColumn, {
|
|
31
|
+
column: _types.DataRecordType.BUY,
|
|
25
32
|
displayPrecision: record.displayPrecision,
|
|
26
33
|
isError: isError,
|
|
27
34
|
isLoading: isLoading,
|
|
28
35
|
price: record.buy,
|
|
29
36
|
priceMovement: record.buyPriceMovement
|
|
30
37
|
}),
|
|
31
|
-
[DataRecordType.DAILY_CHANGE]: () =>
|
|
38
|
+
[_types.DataRecordType.DAILY_CHANGE]: () => _react.default.createElement(_Table.DailyChangeColumn, {
|
|
32
39
|
dailyPercentChange: record.dailyPercentChange,
|
|
33
40
|
isError: isError,
|
|
34
41
|
isLoading: isLoading
|
|
35
42
|
}),
|
|
36
|
-
[DataRecordType.CHART]: () =>
|
|
43
|
+
[_types.DataRecordType.CHART]: () => _react.default.createElement(_Table.ChartColumn, {
|
|
37
44
|
chart: chart ?? [],
|
|
38
45
|
isLoading: !!isChartLoading,
|
|
39
46
|
percentChange: record.dailyPercentChange
|
|
40
47
|
}),
|
|
41
|
-
[DataRecordType.SPREAD]: () =>
|
|
48
|
+
[_types.DataRecordType.SPREAD]: () => _react.default.createElement(_Table.SpreadColumn, {
|
|
42
49
|
isError: isError,
|
|
43
50
|
isLoading: isLoading,
|
|
44
51
|
value: record.spread
|
|
45
52
|
}),
|
|
46
|
-
[DataRecordType.SENTIMENT]: () =>
|
|
53
|
+
[_types.DataRecordType.SENTIMENT]: () => _react.default.createElement(_Table.SentimentColumn, {
|
|
47
54
|
isLoading: isLoading,
|
|
48
55
|
sentiment: record.sentiment
|
|
49
56
|
}),
|
|
50
|
-
[DataRecordType.HIGH]: () =>
|
|
51
|
-
key: DataRecordType.SPREAD,
|
|
57
|
+
[_types.DataRecordType.HIGH]: () => _react.default.createElement(_Table.TableCell, {
|
|
58
|
+
key: _types.DataRecordType.SPREAD,
|
|
52
59
|
isError: isError,
|
|
53
60
|
isLoading: isLoading || record.high === undefined && !isError,
|
|
54
|
-
loaderSize: LoaderSize.sm
|
|
55
|
-
},
|
|
56
|
-
[DataRecordType.LOW]: () =>
|
|
57
|
-
key: DataRecordType.LOW,
|
|
61
|
+
loaderSize: _Loader.LoaderSize.sm
|
|
62
|
+
}, _react.default.createElement("span", null, record.high)),
|
|
63
|
+
[_types.DataRecordType.LOW]: () => _react.default.createElement(_Table.TableCell, {
|
|
64
|
+
key: _types.DataRecordType.LOW,
|
|
58
65
|
isError: isError,
|
|
59
66
|
isLoading: isLoading || record.low === undefined && !isError,
|
|
60
|
-
loaderSize: LoaderSize.sm
|
|
61
|
-
},
|
|
62
|
-
[DataRecordType.SYMBOL]: () =>
|
|
63
|
-
key: DataRecordType.SYMBOL,
|
|
67
|
+
loaderSize: _Loader.LoaderSize.sm
|
|
68
|
+
}, _react.default.createElement("span", null, record.low)),
|
|
69
|
+
[_types.DataRecordType.SYMBOL]: () => _react.default.createElement(_Table.TableCell, {
|
|
70
|
+
key: _types.DataRecordType.SYMBOL,
|
|
64
71
|
isError: isError,
|
|
65
72
|
isLoading: isLoading,
|
|
66
|
-
loaderSize: LoaderSize.md,
|
|
73
|
+
loaderSize: _Loader.LoaderSize.md,
|
|
67
74
|
type: "textCentered"
|
|
68
|
-
},
|
|
69
|
-
[DataRecordType.TRADE_MODE]: () =>
|
|
70
|
-
key: DataRecordType.TRADE_MODE,
|
|
75
|
+
}, _react.default.createElement("span", null, record.instrument)),
|
|
76
|
+
[_types.DataRecordType.TRADE_MODE]: () => _react.default.createElement(_Table.TableCell, {
|
|
77
|
+
key: _types.DataRecordType.TRADE_MODE,
|
|
71
78
|
additionalPaddingRight: true,
|
|
72
79
|
isError: isError,
|
|
73
80
|
isLoading: isLoading,
|
|
74
|
-
loaderSize: LoaderSize.sm
|
|
75
|
-
},
|
|
76
|
-
[DataRecordType.DATA_SOURCE]: () =>
|
|
77
|
-
key: DataRecordType.TRADE_MODE,
|
|
81
|
+
loaderSize: _Loader.LoaderSize.sm
|
|
82
|
+
}, _react.default.createElement("span", null, record.tradeMode)),
|
|
83
|
+
[_types.DataRecordType.DATA_SOURCE]: () => _react.default.createElement(_Table.TableCell, {
|
|
84
|
+
key: _types.DataRecordType.TRADE_MODE,
|
|
78
85
|
isError: !record.dataSource,
|
|
79
86
|
isLoading: isLoading,
|
|
80
|
-
loaderSize: LoaderSize.sm
|
|
81
|
-
},
|
|
87
|
+
loaderSize: _Loader.LoaderSize.sm
|
|
88
|
+
}, _react.default.createElement("span", null, record.dataSource))
|
|
82
89
|
};
|
|
83
|
-
return activeColumns.map(item =>
|
|
90
|
+
return activeColumns.map(item => _react.default.createElement(_react.default.Fragment, {
|
|
84
91
|
key: item
|
|
85
92
|
}, allColumns[item]?.() ?? null));
|
|
86
93
|
};
|
|
94
|
+
exports.ColumnRenderer = ColumnRenderer;
|
|
87
95
|
//# sourceMappingURL=ColumnRenderer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColumnRenderer.js","names":["
|
|
1
|
+
{"version":3,"file":"ColumnRenderer.js","names":["_react","_interopRequireDefault","require","_types","_Loader","_Table","e","__esModule","default","ColumnRenderer","_ref","record","isLoading","isChartLoading","isError","activeColumns","chart","allColumns","DataRecordType","SELL","createElement","PriceColumn","column","displayPrecision","price","sell","priceMovement","sellPriceMovement","BUY","buy","buyPriceMovement","DAILY_CHANGE","DailyChangeColumn","dailyPercentChange","CHART","ChartColumn","percentChange","SPREAD","SpreadColumn","value","spread","SENTIMENT","SentimentColumn","sentiment","HIGH","TableCell","key","high","undefined","loaderSize","LoaderSize","sm","LOW","low","SYMBOL","md","type","instrument","TRADE_MODE","additionalPaddingRight","tradeMode","DATA_SOURCE","dataSource","map","item","Fragment","exports"],"sources":["../../../../src/components/TableWidget/ColumnRenderer.tsx"],"sourcesContent":["import React from 'react';\n\nimport { type DataRecord, DataRecordType } from '../../types';\nimport { LoaderSize } from '../Loader';\nimport {\n ChartColumn,\n DailyChangeColumn,\n PriceColumn,\n SentimentColumn,\n SpreadColumn,\n TableCell,\n} from '../Table';\n\ninterface ColumnRendererProps {\n record: DataRecord;\n chart?: number[];\n isLoading: boolean;\n isChartLoading?: boolean;\n isError: boolean;\n activeColumns: DataRecordType[];\n}\n\nexport const ColumnRenderer = ({\n record,\n isLoading,\n isChartLoading,\n isError,\n activeColumns,\n chart,\n}: ColumnRendererProps) => {\n const allColumns: Partial<Record<DataRecordType, () => JSX.Element>> = {\n [DataRecordType.SELL]: () => (\n <PriceColumn\n column={DataRecordType.SELL}\n displayPrecision={record.displayPrecision}\n isError={isError}\n isLoading={isLoading}\n price={record.sell}\n priceMovement={record.sellPriceMovement}\n />\n ),\n [DataRecordType.BUY]: () => (\n <PriceColumn\n column={DataRecordType.BUY}\n displayPrecision={record.displayPrecision}\n isError={isError}\n isLoading={isLoading}\n price={record.buy}\n priceMovement={record.buyPriceMovement}\n />\n ),\n [DataRecordType.DAILY_CHANGE]: () => (\n <DailyChangeColumn\n dailyPercentChange={record.dailyPercentChange}\n isError={isError}\n isLoading={isLoading}\n />\n ),\n [DataRecordType.CHART]: () => (\n <ChartColumn\n chart={chart ?? []}\n isLoading={!!isChartLoading}\n percentChange={record.dailyPercentChange}\n />\n ),\n [DataRecordType.SPREAD]: () => (\n <SpreadColumn\n isError={isError}\n isLoading={isLoading}\n value={record.spread}\n />\n ),\n [DataRecordType.SENTIMENT]: () => (\n <SentimentColumn isLoading={isLoading} sentiment={record.sentiment} />\n ),\n [DataRecordType.HIGH]: () => (\n <TableCell\n key={DataRecordType.SPREAD}\n isError={isError}\n isLoading={isLoading || (record.high === undefined && !isError)}\n loaderSize={LoaderSize.sm}\n >\n <span>{record.high}</span>\n </TableCell>\n ),\n [DataRecordType.LOW]: () => (\n <TableCell\n key={DataRecordType.LOW}\n isError={isError}\n isLoading={isLoading || (record.low === undefined && !isError)}\n loaderSize={LoaderSize.sm}\n >\n <span>{record.low}</span>\n </TableCell>\n ),\n [DataRecordType.SYMBOL]: () => (\n <TableCell\n key={DataRecordType.SYMBOL}\n isError={isError}\n isLoading={isLoading}\n loaderSize={LoaderSize.md}\n type=\"textCentered\"\n >\n <span>{record.instrument}</span>\n </TableCell>\n ),\n [DataRecordType.TRADE_MODE]: () => (\n <TableCell\n key={DataRecordType.TRADE_MODE}\n additionalPaddingRight={true}\n isError={isError}\n isLoading={isLoading}\n loaderSize={LoaderSize.sm}\n >\n <span>{record.tradeMode}</span>\n </TableCell>\n ),\n [DataRecordType.DATA_SOURCE]: () => (\n <TableCell\n key={DataRecordType.TRADE_MODE}\n isError={!record.dataSource}\n isLoading={isLoading}\n loaderSize={LoaderSize.sm}\n >\n <span>{record.dataSource}</span>\n </TableCell>\n ),\n };\n\n return activeColumns.map((item) => (\n <React.Fragment key={item}>{allColumns[item]?.() ?? null}</React.Fragment>\n ));\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAOkB,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAWX,MAAMG,cAAc,GAAGC,IAAA,IAOH;EAAA,IAPI;IAC7BC,MAAM;IACNC,SAAS;IACTC,cAAc;IACdC,OAAO;IACPC,aAAa;IACbC;EACmB,CAAC,GAAAN,IAAA;EACpB,MAAMO,UAA8D,GAAG;IACrE,CAACC,qBAAc,CAACC,IAAI,GAAG,MACrBnB,MAAA,CAAAQ,OAAA,CAAAY,aAAA,CAACf,MAAA,CAAAgB,WAAW;MACVC,MAAM,EAAEJ,qBAAc,CAACC,IAAK;MAC5BI,gBAAgB,EAAEZ,MAAM,CAACY,gBAAiB;MAC1CT,OAAO,EAAEA,OAAQ;MACjBF,SAAS,EAAEA,SAAU;MACrBY,KAAK,EAAEb,MAAM,CAACc,IAAK;MACnBC,aAAa,EAAEf,MAAM,CAACgB;IAAkB,CACzC,CACF;IACD,CAACT,qBAAc,CAACU,GAAG,GAAG,MACpB5B,MAAA,CAAAQ,OAAA,CAAAY,aAAA,CAACf,MAAA,CAAAgB,WAAW;MACVC,MAAM,EAAEJ,qBAAc,CAACU,GAAI;MAC3BL,gBAAgB,EAAEZ,MAAM,CAACY,gBAAiB;MAC1CT,OAAO,EAAEA,OAAQ;MACjBF,SAAS,EAAEA,SAAU;MACrBY,KAAK,EAAEb,MAAM,CAACkB,GAAI;MAClBH,aAAa,EAAEf,MAAM,CAACmB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f,MAAA,CAAAwC,SAAS;MACRC,GAAG,EAAE5B,qBAAc,CAACwC,UAAW;MAC/B5C,OAAO,EAAE,CAACH,MAAM,CAACmD,UAAW;MAC5BlD,SAAS,EAAEA,SAAU;MACrBqC,UAAU,EAAEC,kBAAU,CAACC;IAAG,GAE1BnD,MAAA,CAAAQ,OAAA,CAAAY,aAAA,eAAOT,MAAM,CAACmD,UAAiB,CACtB;EAEf,CAAC;EAED,OAAO/C,aAAa,CAACgD,GAAG,CAAEC,IAAI,IAC5BhE,MAAA,CAAAQ,OAAA,CAAAY,aAAA,CAACpB,MAAA,CAAAQ,OAAK,CAACyD,QAAQ;IAACnB,GAAG,EAAEkB;EAAK,GAAE/C,UAAU,CAAC+C,IAAI,CAAC,GAAG,CAAC,IAAI,IAAqB,CAC1E,CAAC;AACJ,CAAC;AAACE,OAAA,CAAAzD,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DataRecordRow = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _hooks = require("../../hooks");
|
|
9
|
+
var _providers = require("../../providers");
|
|
10
|
+
var _columns = require("../Table/columns");
|
|
11
|
+
var _TableRow = require("../Table/TableRow");
|
|
12
|
+
var _ColumnRenderer = require("./ColumnRenderer");
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
const DataRecordRow = _ref => {
|
|
8
15
|
let {
|
|
9
16
|
record,
|
|
10
17
|
isLoading,
|
|
@@ -18,24 +25,24 @@ export const DataRecordRow = _ref => {
|
|
|
18
25
|
} = _ref;
|
|
19
26
|
const {
|
|
20
27
|
isDark
|
|
21
|
-
} = useLayoutProvider();
|
|
28
|
+
} = (0, _providers.useLayoutProvider)();
|
|
22
29
|
const {
|
|
23
30
|
updatedRecord,
|
|
24
31
|
error,
|
|
25
32
|
ref
|
|
26
|
-
} = useVisibleLiveDataRecord(record, record.instrument ? target : null);
|
|
27
|
-
return
|
|
33
|
+
} = (0, _hooks.useVisibleLiveDataRecord)(record, record.instrument ? target : null);
|
|
34
|
+
return _react.default.createElement(_TableRow.TableRow, {
|
|
28
35
|
ref: ref,
|
|
29
36
|
hasBackgroundColor: hasBackgroundColor,
|
|
30
37
|
isScrolled: isScrolled
|
|
31
|
-
},
|
|
38
|
+
}, _react.default.createElement(_columns.InstrumentColumn, {
|
|
32
39
|
displayName: record.displayName,
|
|
33
40
|
isDark: isDark,
|
|
34
41
|
isLoading: isLoading,
|
|
35
42
|
isScrolled: isScrolled,
|
|
36
43
|
tooltipId: toolTipId,
|
|
37
44
|
width: instrumentColumnWidth
|
|
38
|
-
}),
|
|
45
|
+
}), _react.default.createElement(_ColumnRenderer.ColumnRenderer, {
|
|
39
46
|
activeColumns: activeColumns,
|
|
40
47
|
chart: record.chart,
|
|
41
48
|
isChartLoading: isChartLoading,
|
|
@@ -44,4 +51,5 @@ export const DataRecordRow = _ref => {
|
|
|
44
51
|
record: updatedRecord
|
|
45
52
|
}));
|
|
46
53
|
};
|
|
54
|
+
exports.DataRecordRow = DataRecordRow;
|
|
47
55
|
//# sourceMappingURL=DataRecordRow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataRecordRow.js","names":["
|
|
1
|
+
{"version":3,"file":"DataRecordRow.js","names":["_react","_interopRequireDefault","require","_hooks","_providers","_columns","_TableRow","_ColumnRenderer","e","__esModule","default","DataRecordRow","_ref","record","isLoading","isChartLoading","hasBackgroundColor","target","isScrolled","toolTipId","activeColumns","instrumentColumnWidth","isDark","useLayoutProvider","updatedRecord","error","ref","useVisibleLiveDataRecord","instrument","createElement","TableRow","InstrumentColumn","displayName","tooltipId","width","ColumnRenderer","chart","isError","exports"],"sources":["../../../../src/components/TableWidget/DataRecordRow.tsx"],"sourcesContent":["import React from 'react';\n\nimport { useVisibleLiveDataRecord } from '../../hooks';\nimport { useLayoutProvider } from '../../providers';\nimport type { DataRecord, DataRecordType } from '../../types';\nimport { InstrumentColumn } from '../Table/columns';\nimport { TableRow } from '../Table/TableRow';\nimport { ColumnRenderer } from './ColumnRenderer';\n\nexport interface DataRecordRowProps {\n isLoading: boolean;\n isChartLoading?: boolean;\n record: DataRecord;\n hasBackgroundColor: boolean;\n target: EventTarget | null;\n isScrolled?: boolean;\n toolTipId: string;\n instrumentColumnWidth?: string;\n activeColumns: DataRecordType[];\n}\n\nexport const DataRecordRow = ({\n record,\n isLoading,\n isChartLoading,\n hasBackgroundColor,\n target,\n isScrolled,\n toolTipId,\n activeColumns,\n instrumentColumnWidth,\n}: DataRecordRowProps) => {\n const { isDark } = useLayoutProvider();\n\n const { updatedRecord, error, ref } = useVisibleLiveDataRecord(\n record,\n record.instrument ? target : null\n );\n\n return (\n <TableRow\n ref={ref}\n hasBackgroundColor={hasBackgroundColor}\n isScrolled={isScrolled}\n >\n <InstrumentColumn\n displayName={record.displayName}\n isDark={isDark}\n isLoading={isLoading}\n isScrolled={isScrolled}\n tooltipId={toolTipId}\n width={instrumentColumnWidth}\n />\n <ColumnRenderer\n activeColumns={activeColumns}\n chart={record.chart}\n isChartLoading={isChartLoading}\n isError={!!error}\n isLoading={isLoading}\n record={updatedRecord}\n />\n </TableRow>\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAEA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,eAAA,GAAAL,OAAA;AAAkD,SAAAD,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,C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