@oanda/labs-widget-common 1.0.252 → 1.0.254
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 +774 -62520
- 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,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Select = void 0;
|
|
7
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _usehooksTs = require("usehooks-ts");
|
|
10
|
+
var _images = require("../../images");
|
|
11
|
+
var _providers = require("../../providers");
|
|
12
|
+
var _tailwind = require("../../tailwind");
|
|
13
|
+
var _SearchInput = require("../SearchInput");
|
|
14
|
+
var _Truncate = require("../Truncate");
|
|
15
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
17
|
const Select = _ref => {
|
|
10
18
|
let {
|
|
11
19
|
searchPlaceholder,
|
|
@@ -18,11 +26,11 @@ const Select = _ref => {
|
|
|
18
26
|
} = _ref;
|
|
19
27
|
const {
|
|
20
28
|
isDark
|
|
21
|
-
} = useLayoutProvider();
|
|
22
|
-
const ref = useRef(null);
|
|
23
|
-
const [open, setOpen] = useState(false);
|
|
24
|
-
const [active, setActive] = useState('');
|
|
25
|
-
const [searchValue, setSearchValue] = useState('');
|
|
29
|
+
} = (0, _providers.useLayoutProvider)();
|
|
30
|
+
const ref = (0, _react.useRef)(null);
|
|
31
|
+
const [open, setOpen] = (0, _react.useState)(false);
|
|
32
|
+
const [active, setActive] = (0, _react.useState)('');
|
|
33
|
+
const [searchValue, setSearchValue] = (0, _react.useState)('');
|
|
26
34
|
const singleSelect = options.length === 1;
|
|
27
35
|
const withSearch = options.length > 6;
|
|
28
36
|
const handleClickOutside = () => {
|
|
@@ -31,27 +39,27 @@ const Select = _ref => {
|
|
|
31
39
|
const handleSearch = value => {
|
|
32
40
|
setSearchValue(value);
|
|
33
41
|
};
|
|
34
|
-
useEffect(() => {
|
|
42
|
+
(0, _react.useEffect)(() => {
|
|
35
43
|
setSearchValue('');
|
|
36
44
|
}, [options]);
|
|
37
|
-
useOnClickOutside(ref, handleClickOutside);
|
|
38
|
-
return
|
|
39
|
-
className: cn('lw-relative lw-grow lw-text-text-primary', className),
|
|
45
|
+
(0, _usehooksTs.useOnClickOutside)(ref, handleClickOutside);
|
|
46
|
+
return _react.default.createElement(_react.default.Fragment, null, singleSelect ? _react.default.createElement("div", {
|
|
47
|
+
className: (0, _tailwind.cn)('lw-relative lw-grow lw-text-text-primary', className),
|
|
40
48
|
"data-testid": "single-option-select"
|
|
41
|
-
}, selectLabel &&
|
|
49
|
+
}, selectLabel && _react.default.createElement("span", {
|
|
42
50
|
className: "lw-text-base lw-font-bold"
|
|
43
|
-
}, `${selectLabel}:`),
|
|
51
|
+
}, `${selectLabel}:`), _react.default.createElement("div", {
|
|
44
52
|
className: "lw-flex lw-h-[50px] lw-w-full lw-items-center lw-rounded lw-border lw-px-3"
|
|
45
|
-
},
|
|
53
|
+
}, _react.default.createElement(_Truncate.Truncate, {
|
|
46
54
|
maxWidth: 190,
|
|
47
55
|
text: selectedOption.label
|
|
48
|
-
}))) :
|
|
56
|
+
}))) : _react.default.createElement("div", {
|
|
49
57
|
ref: ref,
|
|
50
|
-
className: cn('lw-relative lw-grow lw-text-text-primary', className),
|
|
58
|
+
className: (0, _tailwind.cn)('lw-relative lw-grow lw-text-text-primary', className),
|
|
51
59
|
"data-testid": "select"
|
|
52
|
-
}, selectLabel &&
|
|
60
|
+
}, selectLabel && _react.default.createElement("span", {
|
|
53
61
|
className: "lw-text-base lw-font-bold"
|
|
54
|
-
}, `${selectLabel}:`),
|
|
62
|
+
}, `${selectLabel}:`), _react.default.createElement("div", {
|
|
55
63
|
className: "lw-flex lw-w-full lw-items-center lw-justify-between lw-rounded lw-border lw-stroke-text-primary lw-px-3 lw-py-2 focus:lw-outline-primary",
|
|
56
64
|
role: "button",
|
|
57
65
|
tabIndex: 0,
|
|
@@ -61,30 +69,30 @@ const Select = _ref => {
|
|
|
61
69
|
setOpen(!open);
|
|
62
70
|
}
|
|
63
71
|
}
|
|
64
|
-
},
|
|
72
|
+
}, _react.default.createElement(_Truncate.Truncate, {
|
|
65
73
|
maxWidth: 190,
|
|
66
74
|
text: selectedOption.label
|
|
67
|
-
}),
|
|
68
|
-
className:
|
|
75
|
+
}), _react.default.createElement(_images.ChevronDown, {
|
|
76
|
+
className: (0, _classnames.default)('lw-transition lw-duration-200 lw-ease-linear', {
|
|
69
77
|
'lw-rotate-180': open
|
|
70
78
|
})
|
|
71
|
-
})), open &&
|
|
72
|
-
className: cn('lw-absolute lw-z-[100] lw-mx-0 lw-mt-2 lw-w-full lw-list-none lw-appearance-none lw-overflow-y-auto lw-overflow-x-hidden lw-bg-bg-secondary lw-p-4', !isDark && 'lw-shadow-lg', !maxHeight && 'lw-max-h-60'),
|
|
79
|
+
})), open && _react.default.createElement("ul", {
|
|
80
|
+
className: (0, _tailwind.cn)('lw-absolute lw-z-[100] lw-mx-0 lw-mt-2 lw-w-full lw-list-none lw-appearance-none lw-overflow-y-auto lw-overflow-x-hidden lw-bg-bg-secondary lw-p-4', !isDark && 'lw-shadow-lg', !maxHeight && 'lw-max-h-60'),
|
|
73
81
|
"data-testid": "select-options",
|
|
74
82
|
style: {
|
|
75
83
|
maxHeight
|
|
76
84
|
}
|
|
77
|
-
}, withSearch &&
|
|
85
|
+
}, withSearch && _react.default.createElement("li", null, _react.default.createElement(_SearchInput.SearchInput, {
|
|
78
86
|
autoFocus: true,
|
|
79
87
|
placeholder: searchPlaceholder,
|
|
80
88
|
value: searchValue,
|
|
81
89
|
onChange: handleSearch
|
|
82
|
-
})), options.filter(option => option.label.toLowerCase().includes(searchValue.toLowerCase())).map((option, index, array) =>
|
|
90
|
+
})), options.filter(option => option.label.toLowerCase().includes(searchValue.toLowerCase())).map((option, index, array) => _react.default.createElement("li", {
|
|
83
91
|
key: option.id,
|
|
84
92
|
className: "lw-mb-0 lw-font-sans",
|
|
85
93
|
value: option.id
|
|
86
|
-
},
|
|
87
|
-
className:
|
|
94
|
+
}, _react.default.createElement("button", {
|
|
95
|
+
className: (0, _classnames.default)('lw-w-full lw-cursor-pointer lw-text-left lw-text-sm focus:lw-outline-none', {
|
|
88
96
|
'lw-mb-4': array.length - 1 !== index,
|
|
89
97
|
'lw-text-primary': active === option.id
|
|
90
98
|
}),
|
|
@@ -97,11 +105,11 @@ const Select = _ref => {
|
|
|
97
105
|
onFocus: () => setActive(option.id),
|
|
98
106
|
onMouseOut: () => setActive(''),
|
|
99
107
|
onMouseOver: () => setActive(option.id)
|
|
100
|
-
},
|
|
101
|
-
className:
|
|
108
|
+
}, _react.default.createElement("span", {
|
|
109
|
+
className: (0, _classnames.default)({
|
|
102
110
|
'lw-font-bold': option.id === selectedOption.id
|
|
103
111
|
})
|
|
104
112
|
}, option.label)))))));
|
|
105
113
|
};
|
|
106
|
-
|
|
114
|
+
exports.Select = Select;
|
|
107
115
|
//# sourceMappingURL=Select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","names":["classnames","React","useEffect","useRef","useState","useOnClickOutside","ChevronDown","useLayoutProvider","cn","SearchInput","Truncate","Select","_ref","searchPlaceholder","selectLabel","options","selectedOption","setSelectedOption","className","maxHeight","isDark","ref","open","setOpen","active","setActive","searchValue","setSearchValue","singleSelect","length","withSearch","handleClickOutside","handleSearch","value","createElement","Fragment","maxWidth","text","label","role","tabIndex","onClick","onKeyDown","e","key","style","autoFocus","placeholder","onChange","filter","option","toLowerCase","includes","map","index","array","id","type","onBlur","onFocus","onMouseOut","onMouseOver"],"sources":["../../../../src/components/Select/Select.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { useOnClickOutside } from 'usehooks-ts';\n\nimport { ChevronDown } from '../../images';\nimport { useLayoutProvider } from '../../providers';\nimport { cn } from '../../tailwind';\nimport { SearchInput } from '../SearchInput';\nimport { Truncate } from '../Truncate';\nimport type { SelectProps } from './types';\n\nconst Select = ({\n searchPlaceholder,\n selectLabel,\n options,\n selectedOption,\n setSelectedOption,\n className,\n maxHeight,\n}: SelectProps) => {\n const { isDark } = useLayoutProvider();\n const ref = useRef(null);\n const [open, setOpen] = useState(false);\n const [active, setActive] = useState('');\n const [searchValue, setSearchValue] = useState('');\n const singleSelect = options.length === 1;\n const withSearch = options.length > 6;\n\n const handleClickOutside = () => {\n setOpen(false);\n };\n\n const handleSearch = (value: string) => {\n setSearchValue(value);\n };\n\n useEffect(() => {\n setSearchValue('');\n }, [options]);\n\n useOnClickOutside(ref, handleClickOutside);\n\n return (\n <>\n {singleSelect ? (\n <div\n className={cn('lw-relative lw-grow lw-text-text-primary', className)}\n data-testid=\"single-option-select\"\n >\n {selectLabel && (\n <span className=\"lw-text-base lw-font-bold\">{`${selectLabel}:`}</span>\n )}\n <div className=\"lw-flex lw-h-[50px] lw-w-full lw-items-center lw-rounded lw-border lw-px-3\">\n <Truncate maxWidth={190} text={selectedOption.label} />\n </div>\n </div>\n ) : (\n <div\n ref={ref}\n className={cn('lw-relative lw-grow lw-text-text-primary', className)}\n data-testid=\"select\"\n >\n {selectLabel && (\n <span className=\"lw-text-base lw-font-bold\">{`${selectLabel}:`}</span>\n )}\n <div\n className=\"lw-flex lw-w-full lw-items-center lw-justify-between lw-rounded lw-border lw-stroke-text-primary lw-px-3 lw-py-2 focus:lw-outline-primary\"\n role=\"button\"\n tabIndex={0}\n onClick={() => setOpen(!open)}\n onKeyDown={(e: React.KeyboardEvent) => {\n if (e.key === 'Enter') {\n setOpen(!open);\n }\n }}\n >\n <Truncate maxWidth={190} text={selectedOption.label} />\n <ChevronDown\n className={classnames(\n 'lw-transition lw-duration-200 lw-ease-linear',\n {\n 'lw-rotate-180': open,\n }\n )}\n />\n </div>\n {open && (\n <ul\n className={cn(\n 'lw-absolute lw-z-[100] lw-mx-0 lw-mt-2 lw-w-full lw-list-none lw-appearance-none lw-overflow-y-auto lw-overflow-x-hidden lw-bg-bg-secondary lw-p-4',\n !isDark && 'lw-shadow-lg',\n !maxHeight && 'lw-max-h-60'\n )}\n data-testid=\"select-options\"\n style={{ maxHeight }}\n >\n {withSearch && (\n <li>\n <SearchInput\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus\n placeholder={searchPlaceholder}\n value={searchValue}\n onChange={handleSearch}\n />\n </li>\n )}\n {options\n .filter((option) =>\n option.label.toLowerCase().includes(searchValue.toLowerCase())\n )\n .map((option, index, array) => (\n <li\n key={option.id}\n className=\"lw-mb-0 lw-font-sans\"\n value={option.id}\n >\n <button\n className={classnames(\n 'lw-w-full lw-cursor-pointer lw-text-left lw-text-sm focus:lw-outline-none',\n {\n 'lw-mb-4': array.length - 1 !== index,\n 'lw-text-primary': active === option.id,\n }\n )}\n type=\"button\"\n onBlur={() => setActive('')}\n onClick={() => {\n setSelectedOption(option);\n setOpen(false);\n }}\n onFocus={() => setActive(option.id)}\n onMouseOut={() => setActive('')}\n onMouseOver={() => setActive(option.id)}\n >\n <span\n className={classnames({\n 'lw-font-bold': option.id === selectedOption.id,\n })}\n >\n {option.label}\n </span>\n </button>\n </li>\n ))}\n </ul>\n )}\n </div>\n )}\n </>\n );\n};\n\nexport { Select };\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,IAAIC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC1D,SAASC,iBAAiB,QAAQ,aAAa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AAEA,CAAA,KAAMpC,SAAS,CAACyB,MAAM,CAACM,EAAE;EAAE,GAExCvD,KAAA,CAAAiC,aAAA;IACEhB,SAAS,EAAElB,UAAU,CAAC;MACpB,cAAc,EAAEkD,MAAM,CAACM,EAAE,KAAKxC,cAAc,CAACwC;IAC/C,CAAC;EAAE,GAEFN,MAAM,CAACZ,KACJ,CACA,CACN,CACL,CACD,CAEH,CAEP,CAAC;AAEP,CAAC;AAED,SAAS3B,MAAM","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Select.js","names":["_classnames","_interopRequireDefault","require","_react","_interopRequireWildcard","_usehooksTs","_images","_providers","_tailwind","_SearchInput","_Truncate","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","Select","_ref","searchPlaceholder","selectLabel","options","selectedOption","setSelectedOption","className","maxHeight","isDark","useLayoutProvider","ref","useRef","open","setOpen","useState","active","setActive","searchValue","setSearchValue","singleSelect","length","withSearch","handleClickOutside","handleSearch","value","useEffect","useOnClickOutside","createElement","Fragment","cn","Truncate","maxWidth","text","label","role","tabIndex","onClick","onKeyDown","key","ChevronDown","classnames","style","SearchInput","autoFocus","placeholder","onChange","filter","option","toLowerCase","includes","map","index","array","id","type","onBlur","onFocus","onMouseOut","onMouseOver","exports"],"sources":["../../../../src/components/Select/Select.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { useOnClickOutside } from 'usehooks-ts';\n\nimport { ChevronDown } from '../../images';\nimport { useLayoutProvider } from '../../providers';\nimport { cn } from '../../tailwind';\nimport { SearchInput } from '../SearchInput';\nimport { Truncate } from '../Truncate';\nimport type { SelectProps } from './types';\n\nconst Select = ({\n searchPlaceholder,\n selectLabel,\n options,\n selectedOption,\n setSelectedOption,\n className,\n maxHeight,\n}: SelectProps) => {\n const { isDark } = useLayoutProvider();\n const ref = useRef(null);\n const [open, setOpen] = useState(false);\n const [active, setActive] = useState('');\n const [searchValue, setSearchValue] = useState('');\n const singleSelect = options.length === 1;\n const withSearch = options.length > 6;\n\n const handleClickOutside = () => {\n setOpen(false);\n };\n\n const handleSearch = (value: string) => {\n setSearchValue(value);\n };\n\n useEffect(() => {\n setSearchValue('');\n }, [options]);\n\n useOnClickOutside(ref, handleClickOutside);\n\n return (\n <>\n {singleSelect ? (\n <div\n className={cn('lw-relative lw-grow lw-text-text-primary', className)}\n data-testid=\"single-option-select\"\n >\n {selectLabel && (\n <span className=\"lw-text-base lw-font-bold\">{`${selectLabel}:`}</span>\n )}\n <div className=\"lw-flex lw-h-[50px] lw-w-full lw-items-center lw-rounded lw-border lw-px-3\">\n <Truncate maxWidth={190} text={selectedOption.label} />\n </div>\n </div>\n ) : (\n <div\n ref={ref}\n className={cn('lw-relative lw-grow lw-text-text-primary', className)}\n data-testid=\"select\"\n >\n {selectLabel && (\n <span className=\"lw-text-base lw-font-bold\">{`${selectLabel}:`}</span>\n )}\n <div\n className=\"lw-flex lw-w-full lw-items-center lw-justify-between lw-rounded lw-border lw-stroke-text-primary lw-px-3 lw-py-2 focus:lw-outline-primary\"\n role=\"button\"\n tabIndex={0}\n onClick={() => setOpen(!open)}\n onKeyDown={(e: React.KeyboardEvent) => {\n if (e.key === 'Enter') {\n setOpen(!open);\n }\n }}\n >\n <Truncate maxWidth={190} text={selectedOption.label} />\n <ChevronDown\n className={classnames(\n 'lw-transition lw-duration-200 lw-ease-linear',\n {\n 'lw-rotate-180': open,\n }\n )}\n />\n </div>\n {open && (\n <ul\n className={cn(\n 'lw-absolute lw-z-[100] lw-mx-0 lw-mt-2 lw-w-full lw-list-none lw-appearance-none lw-overflow-y-auto lw-overflow-x-hidden lw-bg-bg-secondary lw-p-4',\n !isDark && 'lw-shadow-lg',\n !maxHeight && 'lw-max-h-60'\n )}\n data-testid=\"select-options\"\n style={{ maxHeight }}\n >\n {withSearch && (\n <li>\n <SearchInput\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus\n placeholder={searchPlaceholder}\n value={searchValue}\n onChange={handleSearch}\n />\n </li>\n )}\n {options\n .filter((option) =>\n option.label.toLowerCase().includes(searchValue.toLowerCase())\n )\n .map((option, index, array) => (\n <li\n key={option.id}\n className=\"lw-mb-0 lw-font-sans\"\n value={option.id}\n >\n <button\n className={classnames(\n 'lw-w-full lw-cursor-pointer lw-text-left lw-text-sm focus:lw-outline-none',\n {\n 'lw-mb-4': array.length - 1 !== index,\n 'lw-text-primary': active === option.id,\n }\n )}\n type=\"button\"\n onBlur={() => setActive('')}\n onClick={() => {\n setSelectedOption(option);\n setOpen(false);\n }}\n onFocus={() => setActive(option.id)}\n onMouseOut={() => setActive('')}\n onMouseOver={() => setActive(option.id)}\n >\n <span\n className={classnames({\n 'lw-font-bold': option.id === selectedOption.id,\n })}\n >\n {option.label}\n </span>\n </button>\n </li>\n ))}\n </ul>\n )}\n </div>\n )}\n </>\n );\n};\n\nexport { Select };\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAEA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AAAuC,SAAAE,wBAAAO,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAT,uBAAA,YAAAA,CAAAO,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,C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5D,MAAA,GAAAA,MAAA","ignoreList":[]}
|
|
@@ -1,3 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _Select = require("./Select");
|
|
7
|
+
Object.keys(_Select).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _Select[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _Select[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _types = require("./types");
|
|
18
|
+
Object.keys(_types).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _types[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _types[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
3
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/Select/index.ts"],"sourcesContent":["export * from './Select';\nexport * from './types';\n"],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["_Select","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_types"],"sources":["../../../../src/components/Select/index.ts"],"sourcesContent":["export * from './Select';\nexport * from './types';\n"],"mappings":";;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,OAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,OAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,OAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,MAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,MAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,MAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,MAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","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.Sentiment = void 0;
|
|
7
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _SentimentError = require("./SentimentError");
|
|
10
|
+
var _SentimentLoader = require("./SentimentLoader");
|
|
11
|
+
var _types = require("./types");
|
|
12
|
+
var _utils = require("./utils");
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
const Sentiment = _ref => {
|
|
8
15
|
let {
|
|
9
16
|
height,
|
|
10
17
|
sentiment,
|
|
@@ -15,40 +22,41 @@ export const Sentiment = _ref => {
|
|
|
15
22
|
} = _ref;
|
|
16
23
|
const short = Math.round(sentiment?.shortPercent || 0);
|
|
17
24
|
const long = Math.round(sentiment?.longPercent || 0);
|
|
18
|
-
const sentimentHeight = height || SentimentHeight.sm;
|
|
19
|
-
const hasData = sentimentHasData(sentiment);
|
|
20
|
-
return
|
|
25
|
+
const sentimentHeight = height || _types.SentimentHeight.sm;
|
|
26
|
+
const hasData = (0, _utils.sentimentHasData)(sentiment);
|
|
27
|
+
return _react.default.createElement("div", {
|
|
21
28
|
className: "lw-flex lw-w-full lw-flex-row lw-items-center"
|
|
22
|
-
}, withLoader && isLoading &&
|
|
29
|
+
}, withLoader && isLoading && _react.default.createElement(_SentimentLoader.SentimentLoader, {
|
|
23
30
|
height: sentimentHeight
|
|
24
|
-
}), !isLoading && hasData &&
|
|
25
|
-
className:
|
|
31
|
+
}), !isLoading && hasData && _react.default.createElement(_react.default.Fragment, null, _react.default.createElement("span", {
|
|
32
|
+
className: (0, _classnames.default)('lw-font-sans lw-font-normal lw-tracking-wide', {
|
|
26
33
|
'lw-w-5': compactMode,
|
|
27
34
|
'lw-w-8': !compactMode
|
|
28
35
|
})
|
|
29
|
-
}, `${short}%`),
|
|
36
|
+
}, `${short}%`), _react.default.createElement("div", {
|
|
30
37
|
className: "lw-mx-2 lw-my-0 lw-grow lw-p-px"
|
|
31
|
-
},
|
|
38
|
+
}, _react.default.createElement("div", {
|
|
32
39
|
className: `lw-flex lw-flex-row lw-justify-center lw-gap-0.5 lw-overflow-hidden lw-p-0 ${sentimentHeight}`,
|
|
33
40
|
"data-testid": "sentiment"
|
|
34
|
-
},
|
|
41
|
+
}, _react.default.createElement("div", {
|
|
35
42
|
className: "lw-bg-danger",
|
|
36
43
|
style: {
|
|
37
44
|
width: `${short}%`
|
|
38
45
|
}
|
|
39
|
-
}),
|
|
46
|
+
}), _react.default.createElement("div", {
|
|
40
47
|
className: "lw-bg-ok",
|
|
41
48
|
style: {
|
|
42
49
|
width: `${long}%`
|
|
43
50
|
}
|
|
44
|
-
}))),
|
|
45
|
-
className:
|
|
51
|
+
}))), _react.default.createElement("span", {
|
|
52
|
+
className: (0, _classnames.default)('lw-text-right lw-font-sans lw-font-normal lw-tracking-wide', {
|
|
46
53
|
'lw-w-5': compactMode,
|
|
47
54
|
'lw-w-8': !compactMode
|
|
48
55
|
})
|
|
49
|
-
}, `${long}%`)), withError && !isLoading && !hasData &&
|
|
56
|
+
}, `${long}%`)), withError && !isLoading && !hasData && _react.default.createElement(_SentimentError.SentimentError, {
|
|
50
57
|
compactMode: compactMode,
|
|
51
58
|
height: sentimentHeight
|
|
52
59
|
}));
|
|
53
60
|
};
|
|
61
|
+
exports.Sentiment = Sentiment;
|
|
54
62
|
//# sourceMappingURL=Sentiment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sentiment.js","names":["
|
|
1
|
+
{"version":3,"file":"Sentiment.js","names":["_classnames","_interopRequireDefault","require","_react","_SentimentError","_SentimentLoader","_types","_utils","e","__esModule","default","Sentiment","_ref","height","sentiment","compactMode","withLoader","withError","isLoading","short","Math","round","shortPercent","long","longPercent","sentimentHeight","SentimentHeight","sm","hasData","sentimentHasData","createElement","className","SentimentLoader","Fragment","classnames","style","width","SentimentError","exports"],"sources":["../../../../src/components/Sentiment/Sentiment.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport React from 'react';\n\nimport { SentimentError } from './SentimentError';\nimport { SentimentLoader } from './SentimentLoader';\nimport type { SentimentProps } from './types';\nimport { SentimentHeight } from './types';\nimport { sentimentHasData } from './utils';\n\nexport const Sentiment = ({\n height,\n sentiment,\n compactMode = false,\n withLoader = true,\n withError = true,\n isLoading,\n}: SentimentProps) => {\n const short = Math.round(sentiment?.shortPercent || 0);\n const long = Math.round(sentiment?.longPercent || 0);\n\n const sentimentHeight = height || SentimentHeight.sm;\n\n const hasData = sentimentHasData(sentiment);\n\n return (\n <div className=\"lw-flex lw-w-full lw-flex-row lw-items-center\">\n {withLoader && isLoading && <SentimentLoader height={sentimentHeight} />}\n {!isLoading && hasData && (\n <>\n <span\n className={classnames(\n 'lw-font-sans lw-font-normal lw-tracking-wide',\n {\n 'lw-w-5': compactMode,\n 'lw-w-8': !compactMode,\n }\n )}\n >\n {`${short}%`}\n </span>\n <div className=\"lw-mx-2 lw-my-0 lw-grow lw-p-px\">\n <div\n className={`lw-flex lw-flex-row lw-justify-center lw-gap-0.5 lw-overflow-hidden lw-p-0 ${sentimentHeight}`}\n data-testid=\"sentiment\"\n >\n <div className=\"lw-bg-danger\" style={{ width: `${short}%` }} />\n <div className=\"lw-bg-ok\" style={{ width: `${long}%` }} />\n </div>\n </div>\n <span\n className={classnames(\n 'lw-text-right lw-font-sans lw-font-normal lw-tracking-wide',\n {\n 'lw-w-5': compactMode,\n 'lw-w-8': !compactMode,\n }\n )}\n >\n {`${long}%`}\n </span>\n </>\n )}\n {withError && !isLoading && !hasData && (\n <SentimentError compactMode={compactMode} height={sentimentHeight} />\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AAEA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAA2C,SAAAD,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,MAAMG,SAAS,GAAGC,IAAA,IAOH;EAAA,IAPI;IACxBC,MAAM;IACNC,SAAS;IACTC,WAAW,GAAG,KAAK;IACnBC,UAAU,GAAG,IAAI;IACjBC,SAAS,GAAG,IAAI;IAChBC;EACc,CAAC,GAAAN,IAAA;EACf,MAAMO,KAAK,GAAGC,IAAI,CAACC,KAAK,CAACP,SAAS,EAAEQ,YAAY,IAAI,CAAC,CAAC;EACtD,MAAMC,IAAI,GAAGH,IAAI,CAACC,KAAK,CAACP,SAAS,EAAEU,WAAW,IAAI,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B,WAAW;MACrB,QAAQ,EAAE,CAACA;IACb,CACF;EAAE,GAED,GAAGQ,IAAI,GACJ,CACN,CACH,EACAN,SAAS,IAAI,CAACC,SAAS,IAAI,CAACU,OAAO,IAClCzB,MAAA,CAAAO,OAAA,CAAAoB,aAAA,CAAC1B,eAAA,CAAAiC,cAAc;IAACtB,WAAW,EAAEA,WAAY;IAACF,MAAM,EAAEY;EAAgB,CAAE,CAEnE,CAAC;AAEV,CAAC;AAACa,OAAA,CAAA3B,SAAA,GAAAA,SAAA","ignoreList":[]}
|
|
@@ -1,28 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SentimentError = void 0;
|
|
7
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
3
10
|
const SentimentError = _ref => {
|
|
4
11
|
let {
|
|
5
12
|
height,
|
|
6
13
|
compactMode
|
|
7
14
|
} = _ref;
|
|
8
|
-
return
|
|
9
|
-
className:
|
|
15
|
+
return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement("span", {
|
|
16
|
+
className: (0, _classnames.default)('lw-text-center lw-font-sans lw-font-normal lw-tracking-wide', {
|
|
10
17
|
'lw-w-5': compactMode,
|
|
11
18
|
'lw-w-8': !compactMode
|
|
12
19
|
})
|
|
13
|
-
}, '\u2014'),
|
|
20
|
+
}, '\u2014'), _react.default.createElement("div", {
|
|
14
21
|
className: "lw-mx-2 lw-mt-1 lw-grow lw-p-px"
|
|
15
|
-
},
|
|
22
|
+
}, _react.default.createElement("div", {
|
|
16
23
|
className: `lw-flex lw-flex-row lw-justify-center lw-gap-0.5 lw-overflow-hidden lw-p-0 ${height}`,
|
|
17
24
|
"data-testid": "no-data-sentiment"
|
|
18
|
-
},
|
|
25
|
+
}, _react.default.createElement("div", {
|
|
19
26
|
className: "lw-w-full lw-bg-border-primary"
|
|
20
|
-
}))),
|
|
21
|
-
className:
|
|
27
|
+
}))), _react.default.createElement("span", {
|
|
28
|
+
className: (0, _classnames.default)('lw-text-center lw-font-sans lw-font-normal lw-tracking-wide', {
|
|
22
29
|
'lw-w-5': compactMode,
|
|
23
30
|
'lw-w-8': !compactMode
|
|
24
31
|
})
|
|
25
32
|
}, '\u2014'));
|
|
26
33
|
};
|
|
27
|
-
|
|
34
|
+
exports.SentimentError = SentimentError;
|
|
28
35
|
//# sourceMappingURL=SentimentError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SentimentError.js","names":["
|
|
1
|
+
{"version":3,"file":"SentimentError.js","names":["_classnames","_interopRequireDefault","require","_react","e","__esModule","default","SentimentError","_ref","height","compactMode","createElement","Fragment","className","classnames","exports"],"sources":["../../../../src/components/Sentiment/SentimentError.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport React from 'react';\n\nimport type { SentimentErrorProps } from './types';\n\nconst SentimentError = ({ height, compactMode }: SentimentErrorProps) => (\n <>\n <span\n className={classnames(\n 'lw-text-center lw-font-sans lw-font-normal lw-tracking-wide',\n {\n 'lw-w-5': compactMode,\n 'lw-w-8': !compactMode,\n }\n )}\n >\n {'\\u2014'}\n </span>\n <div className=\"lw-mx-2 lw-mt-1 lw-grow lw-p-px\">\n <div\n className={`lw-flex lw-flex-row lw-justify-center lw-gap-0.5 lw-overflow-hidden lw-p-0 ${height}`}\n data-testid=\"no-data-sentiment\"\n >\n <div className=\"lw-w-full lw-bg-border-primary\" />\n </div>\n </div>\n <span\n className={classnames(\n 'lw-text-center lw-font-sans lw-font-normal lw-tracking-wide',\n {\n 'lw-w-5': compactMode,\n 'lw-w-8': !compactMode,\n }\n )}\n >\n {'\\u2014'}\n </span>\n </>\n);\n\nexport { SentimentError };\n"],"mappings":";;;;;;AAAA,IAAA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
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _Loader = require("../Loader");
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
3
10
|
const SentimentLoader = _ref => {
|
|
4
11
|
let {
|
|
5
12
|
height
|
|
6
13
|
} = _ref;
|
|
7
|
-
return
|
|
8
|
-
size: LoaderSize.md
|
|
9
|
-
}),
|
|
14
|
+
return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_Loader.Loader, {
|
|
15
|
+
size: _Loader.LoaderSize.md
|
|
16
|
+
}), _react.default.createElement("div", {
|
|
10
17
|
className: `${height} lw-mx-2 lw-w-full`
|
|
11
|
-
},
|
|
12
|
-
size: LoaderSize.full
|
|
13
|
-
})),
|
|
14
|
-
size: LoaderSize.md
|
|
18
|
+
}, _react.default.createElement(_Loader.Loader, {
|
|
19
|
+
size: _Loader.LoaderSize.full
|
|
20
|
+
})), _react.default.createElement(_Loader.Loader, {
|
|
21
|
+
size: _Loader.LoaderSize.md
|
|
15
22
|
}));
|
|
16
23
|
};
|
|
17
|
-
|
|
24
|
+
exports.SentimentLoader = SentimentLoader;
|
|
18
25
|
//# sourceMappingURL=SentimentLoader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SentimentLoader.js","names":["
|
|
1
|
+
{"version":3,"file":"SentimentLoader.js","names":["_react","_interopRequireDefault","require","_Loader","e","__esModule","default","SentimentLoader","_ref","height","createElement","Fragment","Loader","size","LoaderSize","md","className","full","exports"],"sources":["../../../../src/components/Sentiment/SentimentLoader.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Loader, LoaderSize } from '../Loader';\nimport type { SentimentLoaderProps } from './types';\n\nconst SentimentLoader = ({ height }: SentimentLoaderProps) => (\n <>\n <Loader size={LoaderSize.md} />\n <div className={`${height} lw-mx-2 lw-w-full`}>\n <Loader size={LoaderSize.full} />\n </div>\n <Loader size={LoaderSize.md} />\n </>\n);\n\nexport { SentimentLoader };\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AAA+C,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAG/C,MAAMG,eAAe,GAAGC,IAAA;EAAA,IAAC;IAAEC;EAA6B,CAAC,GAAAD,IAAA;EAAA,OACvDR,MAAA,CAAAM,OAAA,CAAAI,aAAA,CAAAV,MAAA,CAAAM,OAAA,CAAAK,QAAA,QACEX,MAAA,CAAAM,OAAA,CAAAI,aAAA,CAACP,OAAA,CAAAS,MAAM;IAACC,IAAI,EAAEC,kBAAU,CAACC;EAAG,CAAE,CAAC,EAC/Bf,MAAA,CAAAM,OAAA,CAAAI,aAAA;IAAKM,SAAS,EAAE,GAAGP,MAAM;EAAqB,GAC5CT,MAAA,CAAAM,OAAA,CAAAI,aAAA,CAACP,OAAA,CAAAS,MAAM;IAACC,IAAI,EAAEC,kBAAU,CAACG;EAAK,CAAE,CAC7B,CAAC,EACNjB,MAAA,CAAAM,OAAA,CAAAI,aAAA,CAACP,OAAA,CAAAS,MAAM;IAACC,IAAI,EAAEC,kBAAU,CAACC;EAAG,CAAE,CAC9B,CAAC;AAAA,CACJ;AAACG,OAAA,CAAAX,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -1,4 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _Sentiment = require("./Sentiment");
|
|
7
|
+
Object.keys(_Sentiment).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _Sentiment[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _Sentiment[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _types = require("./types");
|
|
18
|
+
Object.keys(_types).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _types[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _types[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _utils = require("./utils");
|
|
29
|
+
Object.keys(_utils).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _utils[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _utils[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
4
39
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/Sentiment/index.ts"],"sourcesContent":["export * from './Sentiment';\nexport * from './types';\nexport * from './utils';\n"],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["_Sentiment","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_types","_utils"],"sources":["../../../../src/components/Sentiment/index.ts"],"sourcesContent":["export * from './Sentiment';\nexport * from './types';\nexport * from './utils';\n"],"mappings":";;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,UAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,UAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,UAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,MAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,MAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,MAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,MAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,MAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,MAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,MAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,MAAA,CAAAN,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SentimentHeight = void 0;
|
|
7
|
+
let SentimentHeight = exports.SentimentHeight = function (SentimentHeight) {
|
|
2
8
|
SentimentHeight["sm"] = "lw-h-1";
|
|
3
9
|
SentimentHeight["md"] = "lw-h-2";
|
|
4
10
|
SentimentHeight["lg"] = "lw-h-3";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["SentimentHeight"],"sources":["../../../../src/components/Sentiment/types.ts"],"sourcesContent":["export interface SentimentProps {\n height?: SentimentHeight;\n compactMode?: boolean;\n isLoading?: boolean;\n sameWidthText?: boolean;\n sentiment?: SentimentPercentage;\n withLoader?: boolean;\n withError?: boolean;\n}\n\nexport interface SentimentLoaderProps {\n height: SentimentHeight;\n}\n\nexport interface SentimentErrorProps {\n height: SentimentHeight;\n compactMode: boolean;\n}\n\nexport interface SentimentPercentage {\n shortPercent?: number;\n longPercent?: number;\n}\n\nexport enum SentimentHeight {\n sm = 'lw-h-1',\n md = 'lw-h-2',\n lg = 'lw-h-3',\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","names":["SentimentHeight","exports"],"sources":["../../../../src/components/Sentiment/types.ts"],"sourcesContent":["export interface SentimentProps {\n height?: SentimentHeight;\n compactMode?: boolean;\n isLoading?: boolean;\n sameWidthText?: boolean;\n sentiment?: SentimentPercentage;\n withLoader?: boolean;\n withError?: boolean;\n}\n\nexport interface SentimentLoaderProps {\n height: SentimentHeight;\n}\n\nexport interface SentimentErrorProps {\n height: SentimentHeight;\n compactMode: boolean;\n}\n\nexport interface SentimentPercentage {\n shortPercent?: number;\n longPercent?: number;\n}\n\nexport enum SentimentHeight {\n sm = 'lw-h-1',\n md = 'lw-h-2',\n lg = 'lw-h-3',\n}\n"],"mappings":";;;;;;IAwBYA,eAAe,GAAAC,OAAA,CAAAD,eAAA,aAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA","ignoreList":[]}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.sentimentHasData = void 0;
|
|
1
7
|
const sentimentHasData = sentiment => {
|
|
2
8
|
const longPercent = sentiment?.longPercent !== undefined;
|
|
3
9
|
const shortPercent = sentiment?.shortPercent !== undefined;
|
|
4
10
|
const noData = sentiment?.shortPercent === 0 && sentiment?.longPercent === 0;
|
|
5
11
|
return longPercent && shortPercent && !noData;
|
|
6
12
|
};
|
|
7
|
-
|
|
13
|
+
exports.sentimentHasData = sentimentHasData;
|
|
8
14
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["sentimentHasData","sentiment","longPercent","undefined","shortPercent","noData"],"sources":["../../../../src/components/Sentiment/utils.ts"],"sourcesContent":["import type { SentimentPercentage } from './types';\n\nconst sentimentHasData = (sentiment: SentimentPercentage | undefined) => {\n const longPercent = sentiment?.longPercent !== undefined;\n const shortPercent = sentiment?.shortPercent !== undefined;\n const noData = sentiment?.shortPercent === 0 && sentiment?.longPercent === 0;\n\n return longPercent && shortPercent && !noData;\n};\n\nexport { sentimentHasData };\n"],"mappings":"AAEA,MAAMA,gBAAgB,GAAIC,SAA0C,IAAK;EACvE,MAAMC,WAAW,GAAGD,SAAS,EAAEC,WAAW,KAAKC,SAAS;EACxD,MAAMC,YAAY,GAAGH,SAAS,EAAEG,YAAY,KAAKD,SAAS;EAC1D,MAAME,MAAM,GAAGJ,SAAS,EAAEG,YAAY,KAAK,CAAC,IAAIH,SAAS,EAAEC,WAAW,KAAK,CAAC;EAE5E,OAAOA,WAAW,IAAIE,YAAY,IAAI,CAACC,MAAM;AAC/C,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.js","names":["sentimentHasData","sentiment","longPercent","undefined","shortPercent","noData","exports"],"sources":["../../../../src/components/Sentiment/utils.ts"],"sourcesContent":["import type { SentimentPercentage } from './types';\n\nconst sentimentHasData = (sentiment: SentimentPercentage | undefined) => {\n const longPercent = sentiment?.longPercent !== undefined;\n const shortPercent = sentiment?.shortPercent !== undefined;\n const noData = sentiment?.shortPercent === 0 && sentiment?.longPercent === 0;\n\n return longPercent && shortPercent && !noData;\n};\n\nexport { sentimentHasData };\n"],"mappings":";;;;;;AAEA,MAAMA,gBAAgB,GAAIC,SAA0C,IAAK;EACvE,MAAMC,WAAW,GAAGD,SAAS,EAAEC,WAAW,KAAKC,SAAS;EACxD,MAAMC,YAAY,GAAGH,SAAS,EAAEG,YAAY,KAAKD,SAAS;EAC1D,MAAME,MAAM,GAAGJ,SAAS,EAAEG,YAAY,KAAK,CAAC,IAAIH,SAAS,EAAEC,WAAW,KAAK,CAAC;EAE5E,OAAOA,WAAW,IAAIE,YAAY,IAAI,CAACC,MAAM;AAC/C,CAAC;AAACC,OAAA,CAAAN,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -1,19 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Spinner = void 0;
|
|
7
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _types = require("./types");
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
const Spinner = _ref => {
|
|
5
12
|
let {
|
|
6
13
|
size
|
|
7
14
|
} = _ref;
|
|
8
|
-
const spinnerSize = size === SpinnerSize.lg ? SpinnerSize.lg : SpinnerSize.sm;
|
|
9
|
-
return
|
|
15
|
+
const spinnerSize = size === _types.SpinnerSize.lg ? _types.SpinnerSize.lg : _types.SpinnerSize.sm;
|
|
16
|
+
return _react.default.createElement("div", {
|
|
10
17
|
className: "lw-flex lw-flex-1 lw-items-center lw-justify-center"
|
|
11
|
-
},
|
|
12
|
-
className:
|
|
13
|
-
'lw-h-[20px] lw-w-[20px]': spinnerSize === SpinnerSize.sm,
|
|
14
|
-
'lw-h-[36px] lw-w-[36px]': spinnerSize === SpinnerSize.lg
|
|
18
|
+
}, _react.default.createElement("div", {
|
|
19
|
+
className: (0, _classnames.default)('lw-animate-[spinner_1s_linear_160ms_infinite] lw-rounded-full lw-border-2 lw-border-solid lw-border-x-border-primary lw-border-b-border-primary lw-border-t-primary', {
|
|
20
|
+
'lw-h-[20px] lw-w-[20px]': spinnerSize === _types.SpinnerSize.sm,
|
|
21
|
+
'lw-h-[36px] lw-w-[36px]': spinnerSize === _types.SpinnerSize.lg
|
|
15
22
|
}),
|
|
16
23
|
"data-testid": "spinner"
|
|
17
24
|
}));
|
|
18
25
|
};
|
|
26
|
+
exports.Spinner = Spinner;
|
|
19
27
|
//# sourceMappingURL=Spinner.js.map
|