@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.
Files changed (334) hide show
  1. package/CHANGELOG.md +774 -62520
  2. package/dist/main/components/style.css +1 -1
  3. package/dist/module/chart/BaseChart.js +15 -7
  4. package/dist/module/chart/BaseChart.js.map +1 -1
  5. package/dist/module/chart/formatters.js +12 -3
  6. package/dist/module/chart/formatters.js.map +1 -1
  7. package/dist/module/chart/getGridLines.js +16 -9
  8. package/dist/module/chart/getGridLines.js.map +1 -1
  9. package/dist/module/chart/getTheme.js +38 -31
  10. package/dist/module/chart/getTheme.js.map +1 -1
  11. package/dist/module/chart/getZoomControls.js +12 -5
  12. package/dist/module/chart/getZoomControls.js.map +1 -1
  13. package/dist/module/chart/index.js +82 -7
  14. package/dist/module/chart/index.js.map +1 -1
  15. package/dist/module/chart/sharedOptions.js +11 -4
  16. package/dist/module/chart/sharedOptions.js.map +1 -1
  17. package/dist/module/chart/types.js +5 -1
  18. package/dist/module/components/Button/Button.js +18 -11
  19. package/dist/module/components/Button/Button.js.map +1 -1
  20. package/dist/module/components/Button/index.js +27 -2
  21. package/dist/module/components/Button/index.js.map +1 -1
  22. package/dist/module/components/Button/types.js +8 -2
  23. package/dist/module/components/Button/types.js.map +1 -1
  24. package/dist/module/components/Card/Card.js +24 -16
  25. package/dist/module/components/Card/Card.js.map +1 -1
  26. package/dist/module/components/Card/CardHeader.js +21 -14
  27. package/dist/module/components/Card/CardHeader.js.map +1 -1
  28. package/dist/module/components/Card/index.js +38 -3
  29. package/dist/module/components/Card/index.js.map +1 -1
  30. package/dist/module/components/Card/rows/DailyChangeCardRow.js +15 -7
  31. package/dist/module/components/Card/rows/DailyChangeCardRow.js.map +1 -1
  32. package/dist/module/components/Card/rows/LineChartCardRow.js +17 -10
  33. package/dist/module/components/Card/rows/LineChartCardRow.js.map +1 -1
  34. package/dist/module/components/Card/rows/PriceCardRow.js +16 -8
  35. package/dist/module/components/Card/rows/PriceCardRow.js.map +1 -1
  36. package/dist/module/components/Card/rows/SentimentCardRow.js +18 -10
  37. package/dist/module/components/Card/rows/SentimentCardRow.js.map +1 -1
  38. package/dist/module/components/Card/rows/SpreadCardRow.js +15 -7
  39. package/dist/module/components/Card/rows/SpreadCardRow.js.map +1 -1
  40. package/dist/module/components/Card/rows/index.js +60 -5
  41. package/dist/module/components/Card/rows/index.js.map +1 -1
  42. package/dist/module/components/Card/types.js +5 -1
  43. package/dist/module/components/Disclaimer/Disclaimer.js +32 -24
  44. package/dist/module/components/Disclaimer/Disclaimer.js.map +1 -1
  45. package/dist/module/components/Disclaimer/index.js +16 -1
  46. package/dist/module/components/Disclaimer/index.js.map +1 -1
  47. package/dist/module/components/Error/Error.js +27 -18
  48. package/dist/module/components/Error/Error.js.map +1 -1
  49. package/dist/module/components/Error/index.js +16 -1
  50. package/dist/module/components/Error/index.js.map +1 -1
  51. package/dist/module/components/InfoBox/InfoBox.js +10 -3
  52. package/dist/module/components/InfoBox/InfoBox.js.map +1 -1
  53. package/dist/module/components/InfoBox/index.js +27 -2
  54. package/dist/module/components/InfoBox/index.js.map +1 -1
  55. package/dist/module/components/InfoBox/types.js +5 -1
  56. package/dist/module/components/Input/NumberInput.js +21 -13
  57. package/dist/module/components/Input/NumberInput.js.map +1 -1
  58. package/dist/module/components/Input/index.js +38 -3
  59. package/dist/module/components/Input/index.js.map +1 -1
  60. package/dist/module/components/Input/types.js +5 -1
  61. package/dist/module/components/Input/useNumberFormat.js +11 -4
  62. package/dist/module/components/Input/useNumberFormat.js.map +1 -1
  63. package/dist/module/components/InstrumentRate/InstrumentRate.js +37 -30
  64. package/dist/module/components/InstrumentRate/InstrumentRate.js.map +1 -1
  65. package/dist/module/components/InstrumentRate/InstrumentRateWithChart.js +19 -13
  66. package/dist/module/components/InstrumentRate/InstrumentRateWithChart.js.map +1 -1
  67. package/dist/module/components/InstrumentRate/index.js +38 -3
  68. package/dist/module/components/InstrumentRate/index.js.map +1 -1
  69. package/dist/module/components/InstrumentRate/types.js +5 -1
  70. package/dist/module/components/InstrumentRate/utils.js +13 -6
  71. package/dist/module/components/InstrumentRate/utils.js.map +1 -1
  72. package/dist/module/components/Label/Label.js +12 -6
  73. package/dist/module/components/Label/Label.js.map +1 -1
  74. package/dist/module/components/Label/index.js +16 -1
  75. package/dist/module/components/Label/index.js.map +1 -1
  76. package/dist/module/components/LabelWrapper/LabelWrapper.js +24 -17
  77. package/dist/module/components/LabelWrapper/LabelWrapper.js.map +1 -1
  78. package/dist/module/components/LabelWrapper/index.js +27 -2
  79. package/dist/module/components/LabelWrapper/index.js.map +1 -1
  80. package/dist/module/components/LabelWrapper/types.js +7 -1
  81. package/dist/module/components/LabelWrapper/types.js.map +1 -1
  82. package/dist/module/components/LastUpdated/LastUpdated.js +13 -6
  83. package/dist/module/components/LastUpdated/LastUpdated.js.map +1 -1
  84. package/dist/module/components/LastUpdated/index.js +27 -2
  85. package/dist/module/components/LastUpdated/index.js.map +1 -1
  86. package/dist/module/components/LastUpdated/types.js +5 -1
  87. package/dist/module/components/LineChart/LineChart.js +18 -11
  88. package/dist/module/components/LineChart/LineChart.js.map +1 -1
  89. package/dist/module/components/LineChart/LineChartWithData.js +14 -8
  90. package/dist/module/components/LineChart/LineChartWithData.js.map +1 -1
  91. package/dist/module/components/LineChart/index.js +49 -4
  92. package/dist/module/components/LineChart/index.js.map +1 -1
  93. package/dist/module/components/LineChart/types.js +7 -1
  94. package/dist/module/components/LineChart/types.js.map +1 -1
  95. package/dist/module/components/LineChart/utils.js +16 -8
  96. package/dist/module/components/LineChart/utils.js.map +1 -1
  97. package/dist/module/components/Loader/Loader.js +18 -11
  98. package/dist/module/components/Loader/Loader.js.map +1 -1
  99. package/dist/module/components/Loader/index.js +27 -2
  100. package/dist/module/components/Loader/index.js.map +1 -1
  101. package/dist/module/components/Loader/types.js +7 -1
  102. package/dist/module/components/Loader/types.js.map +1 -1
  103. package/dist/module/components/Pagination/Pagination.js +40 -33
  104. package/dist/module/components/Pagination/Pagination.js.map +1 -1
  105. package/dist/module/components/Pagination/index.js +27 -2
  106. package/dist/module/components/Pagination/index.js.map +1 -1
  107. package/dist/module/components/Pagination/types.js +5 -1
  108. package/dist/module/components/Pagination/utils.js +8 -1
  109. package/dist/module/components/Pagination/utils.js.map +1 -1
  110. package/dist/module/components/Price/Price.js +23 -15
  111. package/dist/module/components/Price/Price.js.map +1 -1
  112. package/dist/module/components/Price/index.js +27 -2
  113. package/dist/module/components/Price/index.js.map +1 -1
  114. package/dist/module/components/Price/types.js +7 -1
  115. package/dist/module/components/Price/types.js.map +1 -1
  116. package/dist/module/components/SearchInput/SearchInput.js +12 -5
  117. package/dist/module/components/SearchInput/SearchInput.js.map +1 -1
  118. package/dist/module/components/SearchInput/index.js +27 -2
  119. package/dist/module/components/SearchInput/index.js.map +1 -1
  120. package/dist/module/components/SearchInput/types.js +5 -1
  121. package/dist/module/components/Select/Select.js +44 -36
  122. package/dist/module/components/Select/Select.js.map +1 -1
  123. package/dist/module/components/Select/index.js +27 -2
  124. package/dist/module/components/Select/index.js.map +1 -1
  125. package/dist/module/components/Select/types.js +5 -1
  126. package/dist/module/components/Sentiment/Sentiment.js +28 -20
  127. package/dist/module/components/Sentiment/Sentiment.js.map +1 -1
  128. package/dist/module/components/Sentiment/SentimentError.js +17 -10
  129. package/dist/module/components/Sentiment/SentimentError.js.map +1 -1
  130. package/dist/module/components/Sentiment/SentimentLoader.js +17 -10
  131. package/dist/module/components/Sentiment/SentimentLoader.js.map +1 -1
  132. package/dist/module/components/Sentiment/index.js +38 -3
  133. package/dist/module/components/Sentiment/index.js.map +1 -1
  134. package/dist/module/components/Sentiment/types.js +7 -1
  135. package/dist/module/components/Sentiment/types.js.map +1 -1
  136. package/dist/module/components/Sentiment/utils.js +7 -1
  137. package/dist/module/components/Sentiment/utils.js.map +1 -1
  138. package/dist/module/components/Spinner/Spinner.js +18 -10
  139. package/dist/module/components/Spinner/Spinner.js.map +1 -1
  140. package/dist/module/components/Spinner/index.js +27 -2
  141. package/dist/module/components/Spinner/index.js.map +1 -1
  142. package/dist/module/components/Spinner/types.js +7 -1
  143. package/dist/module/components/Spinner/types.js.map +1 -1
  144. package/dist/module/components/Switch/Switch.js +26 -18
  145. package/dist/module/components/Switch/Switch.js.map +1 -1
  146. package/dist/module/components/Switch/SwitchItem.js +18 -10
  147. package/dist/module/components/Switch/SwitchItem.js.map +1 -1
  148. package/dist/module/components/Switch/constants.js +7 -1
  149. package/dist/module/components/Switch/constants.js.map +1 -1
  150. package/dist/module/components/Switch/index.js +16 -1
  151. package/dist/module/components/Switch/index.js.map +1 -1
  152. package/dist/module/components/Switch/types.js +5 -1
  153. package/dist/module/components/Table/Table.js +21 -14
  154. package/dist/module/components/Table/Table.js.map +1 -1
  155. package/dist/module/components/Table/TableCell.js +19 -12
  156. package/dist/module/components/Table/TableCell.js.map +1 -1
  157. package/dist/module/components/Table/TableHeader.js +20 -13
  158. package/dist/module/components/Table/TableHeader.js.map +1 -1
  159. package/dist/module/components/Table/TableRow.js +15 -8
  160. package/dist/module/components/Table/TableRow.js.map +1 -1
  161. package/dist/module/components/Table/columns/ChartColumn.js +20 -12
  162. package/dist/module/components/Table/columns/ChartColumn.js.map +1 -1
  163. package/dist/module/components/Table/columns/DailyChangeColumn.js +15 -7
  164. package/dist/module/components/Table/columns/DailyChangeColumn.js.map +1 -1
  165. package/dist/module/components/Table/columns/InstrumentColumn.js +19 -11
  166. package/dist/module/components/Table/columns/InstrumentColumn.js.map +1 -1
  167. package/dist/module/components/Table/columns/PriceColumn.js +16 -8
  168. package/dist/module/components/Table/columns/PriceColumn.js.map +1 -1
  169. package/dist/module/components/Table/columns/SentimentColumn.js +16 -8
  170. package/dist/module/components/Table/columns/SentimentColumn.js.map +1 -1
  171. package/dist/module/components/Table/columns/SpreadColumn.js +17 -9
  172. package/dist/module/components/Table/columns/SpreadColumn.js.map +1 -1
  173. package/dist/module/components/Table/columns/index.js +71 -6
  174. package/dist/module/components/Table/columns/index.js.map +1 -1
  175. package/dist/module/components/Table/index.js +60 -5
  176. package/dist/module/components/Table/index.js.map +1 -1
  177. package/dist/module/components/Table/types.js +5 -1
  178. package/dist/module/components/TableWidget/CardRecordRow.js +22 -14
  179. package/dist/module/components/TableWidget/CardRecordRow.js.map +1 -1
  180. package/dist/module/components/TableWidget/CardRenderer.js +20 -12
  181. package/dist/module/components/TableWidget/CardRenderer.js.map +1 -1
  182. package/dist/module/components/TableWidget/Cards.js +14 -6
  183. package/dist/module/components/TableWidget/Cards.js.map +1 -1
  184. package/dist/module/components/TableWidget/ColumnRenderer.js +42 -34
  185. package/dist/module/components/TableWidget/ColumnRenderer.js.map +1 -1
  186. package/dist/module/components/TableWidget/DataRecordRow.js +20 -12
  187. package/dist/module/components/TableWidget/DataRecordRow.js.map +1 -1
  188. package/dist/module/components/TableWidget/TableWidget.js +34 -26
  189. package/dist/module/components/TableWidget/TableWidget.js.map +1 -1
  190. package/dist/module/components/TableWidget/index.js +27 -2
  191. package/dist/module/components/TableWidget/index.js.map +1 -1
  192. package/dist/module/components/TableWidget/types.js +5 -1
  193. package/dist/module/components/TableWidget/utils.js +12 -4
  194. package/dist/module/components/TableWidget/utils.js.map +1 -1
  195. package/dist/module/components/Tabs/Tab.js +16 -10
  196. package/dist/module/components/Tabs/Tab.js.map +1 -1
  197. package/dist/module/components/Tabs/Tabs.js +11 -5
  198. package/dist/module/components/Tabs/Tabs.js.map +1 -1
  199. package/dist/module/components/Tabs/index.js +16 -1
  200. package/dist/module/components/Tabs/index.js.map +1 -1
  201. package/dist/module/components/Tabs/types.js +5 -1
  202. package/dist/module/components/TextInput/TextInput.js +17 -10
  203. package/dist/module/components/TextInput/TextInput.js.map +1 -1
  204. package/dist/module/components/TextInput/index.js +16 -1
  205. package/dist/module/components/TextInput/index.js.map +1 -1
  206. package/dist/module/components/TimeUnitSwitch/TimeUnitSelect.js +14 -7
  207. package/dist/module/components/TimeUnitSwitch/TimeUnitSelect.js.map +1 -1
  208. package/dist/module/components/TimeUnitSwitch/TimeUnitSwitch.js +22 -15
  209. package/dist/module/components/TimeUnitSwitch/TimeUnitSwitch.js.map +1 -1
  210. package/dist/module/components/TimeUnitSwitch/index.js +16 -1
  211. package/dist/module/components/TimeUnitSwitch/index.js.map +1 -1
  212. package/dist/module/components/TimeUnitSwitch/types.js +5 -1
  213. package/dist/module/components/Tooltip/Tooltip.js +11 -4
  214. package/dist/module/components/Tooltip/Tooltip.js.map +1 -1
  215. package/dist/module/components/Tooltip/index.js +27 -2
  216. package/dist/module/components/Tooltip/index.js.map +1 -1
  217. package/dist/module/components/Tooltip/types.js +5 -1
  218. package/dist/module/components/Truncate/Truncate.js +18 -11
  219. package/dist/module/components/Truncate/Truncate.js.map +1 -1
  220. package/dist/module/components/Truncate/index.js +27 -2
  221. package/dist/module/components/Truncate/index.js.map +1 -1
  222. package/dist/module/components/Truncate/types.js +5 -1
  223. package/dist/module/components/WidgetWrapper/WidgetWrapper.js +14 -6
  224. package/dist/module/components/WidgetWrapper/WidgetWrapper.js.map +1 -1
  225. package/dist/module/components/WidgetWrapper/index.js +16 -1
  226. package/dist/module/components/WidgetWrapper/index.js.map +1 -1
  227. package/dist/module/components/constant.js +8 -2
  228. package/dist/module/components/constant.js.map +1 -1
  229. package/dist/module/components/index.js +292 -27
  230. package/dist/module/components/index.js.map +1 -1
  231. package/dist/module/components/style.css +1 -1
  232. package/dist/module/constants/index.js +13 -7
  233. package/dist/module/constants/index.js.map +1 -1
  234. package/dist/module/fonts/index.js +27 -4
  235. package/dist/module/fonts/index.js.map +1 -1
  236. package/dist/module/hooks/index.js +71 -6
  237. package/dist/module/hooks/index.js.map +1 -1
  238. package/dist/module/hooks/useFetchCombinedDataRecords.js +14 -7
  239. package/dist/module/hooks/useFetchCombinedDataRecords.js.map +1 -1
  240. package/dist/module/hooks/useLiveRates.js +12 -5
  241. package/dist/module/hooks/useLiveRates.js.map +1 -1
  242. package/dist/module/hooks/useLiveRatesMessage.js +26 -19
  243. package/dist/module/hooks/useLiveRatesMessage.js.map +1 -1
  244. package/dist/module/hooks/useLiveRatesQuery.js +12 -5
  245. package/dist/module/hooks/useLiveRatesQuery.js.map +1 -1
  246. package/dist/module/hooks/useRecords.js +13 -7
  247. package/dist/module/hooks/useRecords.js.map +1 -1
  248. package/dist/module/hooks/useVisibleLiveDataRecord.js +16 -9
  249. package/dist/module/hooks/useVisibleLiveDataRecord.js.map +1 -1
  250. package/dist/module/images/index.js +111 -16
  251. package/dist/module/images/index.js.map +1 -1
  252. package/dist/module/index.js +126 -11
  253. package/dist/module/index.js.map +1 -1
  254. package/dist/module/providers/ConditionalProvider.js +11 -3
  255. package/dist/module/providers/ConditionalProvider.js.map +1 -1
  256. package/dist/module/providers/Layout/LayoutContext.js +12 -4
  257. package/dist/module/providers/Layout/LayoutContext.js.map +1 -1
  258. package/dist/module/providers/Layout/LayoutProvider.js +30 -22
  259. package/dist/module/providers/Layout/LayoutProvider.js.map +1 -1
  260. package/dist/module/providers/Layout/LayoutProvider.test.js +61 -58
  261. package/dist/module/providers/Layout/LayoutProvider.test.js.map +1 -1
  262. package/dist/module/providers/Layout/index.js +27 -2
  263. package/dist/module/providers/Layout/index.js.map +1 -1
  264. package/dist/module/providers/LiveRates/LiveRatesContext.js +11 -4
  265. package/dist/module/providers/LiveRates/LiveRatesContext.js.map +1 -1
  266. package/dist/module/providers/LiveRates/LiveRatesProvider.js +37 -29
  267. package/dist/module/providers/LiveRates/LiveRatesProvider.js.map +1 -1
  268. package/dist/module/providers/LiveRates/index.js +27 -2
  269. package/dist/module/providers/LiveRates/index.js.map +1 -1
  270. package/dist/module/providers/Widget/WidgetProvider.js +26 -18
  271. package/dist/module/providers/Widget/WidgetProvider.js.map +1 -1
  272. package/dist/module/providers/Widget/index.js +16 -1
  273. package/dist/module/providers/Widget/index.js.map +1 -1
  274. package/dist/module/providers/index.js +38 -3
  275. package/dist/module/providers/index.js.map +1 -1
  276. package/dist/module/tailwind/cn.js +11 -4
  277. package/dist/module/tailwind/cn.js.map +1 -1
  278. package/dist/module/tailwind/colors.js +9 -3
  279. package/dist/module/tailwind/colors.js.map +1 -1
  280. package/dist/module/tailwind/index.js +39 -3
  281. package/dist/module/tailwind/index.js.map +1 -1
  282. package/dist/module/tailwind/preset.js +11 -5
  283. package/dist/module/tailwind/preset.js.map +1 -1
  284. package/dist/module/tailwind/themes/background.js +14 -8
  285. package/dist/module/tailwind/themes/background.js.map +1 -1
  286. package/dist/module/tailwind/themes/border.js +10 -4
  287. package/dist/module/tailwind/themes/border.js.map +1 -1
  288. package/dist/module/tailwind/themes/index.js +12 -6
  289. package/dist/module/tailwind/themes/index.js.map +1 -1
  290. package/dist/module/tailwind/themes/text.js +18 -12
  291. package/dist/module/tailwind/themes/text.js.map +1 -1
  292. package/dist/module/tailwind/themes/themeColors.js +26 -20
  293. package/dist/module/tailwind/themes/themeColors.js.map +1 -1
  294. package/dist/module/tailwind/types.js +5 -1
  295. package/dist/module/tailwind/utils.js +8 -1
  296. package/dist/module/tailwind/utils.js.map +1 -1
  297. package/dist/module/testUtils/index.js +15 -7
  298. package/dist/module/testUtils/index.js.map +1 -1
  299. package/dist/module/translations/index.js +15 -8
  300. package/dist/module/translations/index.js.map +1 -1
  301. package/dist/module/translations/translations.js +7 -1
  302. package/dist/module/translations/translations.js.map +1 -1
  303. package/dist/module/types/dataTypes.js +7 -1
  304. package/dist/module/types/dataTypes.js.map +1 -1
  305. package/dist/module/types/index.js +36 -4
  306. package/dist/module/types/index.js.map +1 -1
  307. package/dist/module/types/liveRatesTypes.js +5 -1
  308. package/dist/module/utils/dateUtils.js +9 -1
  309. package/dist/module/utils/dateUtils.js.map +1 -1
  310. package/dist/module/utils/getLocale.js +20 -13
  311. package/dist/module/utils/getLocale.js.map +1 -1
  312. package/dist/module/utils/index.js +38 -3
  313. package/dist/module/utils/index.js.map +1 -1
  314. package/dist/module/utils/liveRates/buildUrl.js +8 -1
  315. package/dist/module/utils/liveRates/buildUrl.js.map +1 -1
  316. package/dist/module/utils/liveRates/calculatePipsChangeFromOpen.js +7 -1
  317. package/dist/module/utils/liveRates/calculatePipsChangeFromOpen.js.map +1 -1
  318. package/dist/module/utils/liveRates/calculatePriceChange.js +8 -1
  319. package/dist/module/utils/liveRates/calculatePriceChange.js.map +1 -1
  320. package/dist/module/utils/liveRates/calculatePriceChangeFromOpen.js +8 -1
  321. package/dist/module/utils/liveRates/calculatePriceChangeFromOpen.js.map +1 -1
  322. package/dist/module/utils/liveRates/calculateSpread.js +8 -1
  323. package/dist/module/utils/liveRates/calculateSpread.js.map +1 -1
  324. package/dist/module/utils/liveRates/decodeLiveRateMessage.js +9 -2
  325. package/dist/module/utils/liveRates/decodeLiveRateMessage.js.map +1 -1
  326. package/dist/module/utils/liveRates/decodeUtilities.js +18 -6
  327. package/dist/module/utils/liveRates/decodeUtilities.js.map +1 -1
  328. package/dist/module/utils/liveRates/index.js +82 -7
  329. package/dist/module/utils/liveRates/index.js.map +1 -1
  330. package/dist/module/utils/validateToolParams.js +7 -1
  331. package/dist/module/utils/validateToolParams.js.map +1 -1
  332. package/package.json +9 -4
  333. package/src/components/style.css +1 -1
  334. package/tsconfig.types.json +2 -4
@@ -1,15 +1,22 @@
1
- import { useLocale } from '@oanda/mono-i18n';
2
- import React from 'react';
3
- import { useLayoutProvider } from '../../providers';
4
- import { cn } from '../../tailwind';
5
- import { Size } from '../../types';
6
- import { LastUpdated } from '../LastUpdated';
7
- import { Table } from '../Table';
8
- import { Tooltip } from '../Tooltip';
9
- import { CardRecordRow } from './CardRecordRow';
10
- import { Cards } from './Cards';
11
- import { DataRecordRow } from './DataRecordRow';
12
- export const TableWidget = _ref => {
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TableWidget = void 0;
7
+ var _monoI18n = require("@oanda/mono-i18n");
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _providers = require("../../providers");
10
+ var _tailwind = require("../../tailwind");
11
+ var _types = require("../../types");
12
+ var _LastUpdated = require("../LastUpdated");
13
+ var _Table = require("../Table");
14
+ var _Tooltip = require("../Tooltip");
15
+ var _CardRecordRow = require("./CardRecordRow");
16
+ var _Cards = require("./Cards");
17
+ var _DataRecordRow = require("./DataRecordRow");
18
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
19
+ const TableWidget = _ref => {
13
20
  let {
14
21
  testId,
15
22
  toolTipId,
@@ -30,25 +37,25 @@ export const TableWidget = _ref => {
30
37
  } = _ref;
31
38
  const {
32
39
  lang
33
- } = useLocale();
40
+ } = (0, _monoI18n.useLocale)();
34
41
  const {
35
42
  size
36
- } = useLayoutProvider();
37
- const isDesktop = size === Size.DESKTOP;
43
+ } = (0, _providers.useLayoutProvider)();
44
+ const isDesktop = size === _types.Size.DESKTOP;
38
45
  const isTable = viewType ? viewType === 'table' : isDesktop;
39
46
  if (!size) {
40
47
  return null;
41
48
  }
42
- return React.createElement("div", {
49
+ return _react.default.createElement("div", {
43
50
  className: "lw-relative lw-text-sm lw-tracking-normal lw-text-text-primary",
44
51
  "data-testid": testId
45
- }, TabsComponent, isTable ? React.createElement("div", {
52
+ }, TabsComponent, isTable ? _react.default.createElement("div", {
46
53
  className: "lw-border lw-border-solid lw-border-border-primary"
47
- }, React.createElement(Table, {
54
+ }, _react.default.createElement(_Table.Table, {
48
55
  headerConfig: headerColumns,
49
56
  isError: hasError,
50
57
  records: records,
51
- renderRow: (record, index, isScrolled) => React.createElement(DataRecordRow, {
58
+ renderRow: (record, index, isScrolled) => _react.default.createElement(_DataRecordRow.DataRecordRow, {
52
59
  key: `row_${index}`,
53
60
  activeColumns: activeColumns,
54
61
  hasBackgroundColor: index % 2 === 0,
@@ -60,7 +67,7 @@ export const TableWidget = _ref => {
60
67
  target: target,
61
68
  toolTipId: toolTipId
62
69
  })
63
- })) : React.createElement(Cards, {
70
+ })) : _react.default.createElement(_Cards.Cards, {
64
71
  isError: hasError,
65
72
  records: records,
66
73
  renderCard: _ref2 => {
@@ -69,7 +76,7 @@ export const TableWidget = _ref => {
69
76
  idx,
70
77
  isLast
71
78
  } = _ref2;
72
- return React.createElement(CardRecordRow, {
79
+ return _react.default.createElement(_CardRecordRow.CardRecordRow, {
73
80
  activeColumns: activeColumns,
74
81
  index: idx,
75
82
  isChartLoading: isChartLoading,
@@ -81,17 +88,18 @@ export const TableWidget = _ref => {
81
88
  });
82
89
  },
83
90
  startIndex: pageNumber * count
84
- }), PaginationComponent && !hasError && React.createElement("div", {
85
- className: cn('lw-border-solid lw-border-border-primary', {
91
+ }), PaginationComponent && !hasError && _react.default.createElement("div", {
92
+ className: (0, _tailwind.cn)('lw-border-solid lw-border-border-primary', {
86
93
  'lw-border-x lw-border-b': isDesktop
87
94
  })
88
- }, PaginationComponent), React.createElement(Tooltip, {
95
+ }, PaginationComponent), _react.default.createElement(_Tooltip.Tooltip, {
89
96
  id: toolTipId
90
- }), !hasError && timestamp && React.createElement("div", {
97
+ }), !hasError && timestamp && _react.default.createElement("div", {
91
98
  className: "lw-mt-2 lw-h-8"
92
- }, React.createElement(LastUpdated, {
99
+ }, _react.default.createElement(_LastUpdated.LastUpdated, {
93
100
  labelCallback: lang,
94
101
  timestamp: timestamp
95
102
  })));
96
103
  };
104
+ exports.TableWidget = TableWidget;
97
105
  //# sourceMappingURL=TableWidget.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableWidget.js","names":["useLocale","React","useLayoutProvider","cn","Size","LastUpdated","Table","Tooltip","CardRecordRow","Cards","DataRecordRow","TableWidget","_ref","testId","toolTipId","PaginationComponent","hasError","TabsComponent","headerColumns","records","target","isLoading","isChartLoading","activeColumns","timestamp","pageNumber","count","viewType","instrumentColumnWidth","lang","size","isDesktop","DESKTOP","isTable","createElement","className","headerConfig","isError","renderRow","record","index","isScrolled","key","hasBackgroundColor","renderCard","_ref2","idx","isLast","tooltipId","startIndex","id","labelCallback"],"sources":["../../../../src/components/TableWidget/TableWidget.tsx"],"sourcesContent":["import { useLocale } from '@oanda/mono-i18n';\nimport type { ReactElement } from 'react';\nimport React from 'react';\n\nimport { useLayoutProvider } from '../../providers';\nimport { cn } from '../../tailwind';\nimport type { DataRecord, DataRecordType } from '../../types';\nimport { Size } from '../../types';\nimport { LastUpdated } from '../LastUpdated';\nimport type { Pagination, PaginationProps } from '../Pagination';\nimport type { HeaderColumns } from '../Table';\nimport { Table } from '../Table';\nimport type { Tabs } from '../Tabs';\nimport type { TabsProps } from '../Tabs/types';\nimport { Tooltip } from '../Tooltip';\nimport { CardRecordRow } from './CardRecordRow';\nimport { Cards } from './Cards';\nimport { DataRecordRow } from './DataRecordRow';\n\ninterface TableWidgetProps<TTabs> {\n testId: string;\n toolTipId: string;\n hasError?: boolean;\n TabsComponent?: ReactElement<TabsProps<TTabs>, typeof Tabs<TTabs>>;\n PaginationComponent?: ReactElement<PaginationProps, typeof Pagination>;\n headerColumns: HeaderColumns[];\n records: DataRecord[];\n target: EventTarget | null;\n isLoading: boolean;\n isChartLoading?: boolean;\n activeColumns: DataRecordType[];\n timestamp?: string;\n pageNumber: number;\n count: number;\n viewType?: 'table' | 'cards';\n instrumentColumnWidth?: string;\n}\n\nexport const TableWidget = <TTabs,>({\n testId,\n toolTipId,\n PaginationComponent,\n hasError,\n TabsComponent,\n headerColumns,\n records,\n target,\n isLoading,\n isChartLoading,\n activeColumns,\n timestamp,\n pageNumber,\n count,\n viewType,\n instrumentColumnWidth,\n}: TableWidgetProps<TTabs>) => {\n const { lang } = useLocale();\n const { size } = useLayoutProvider();\n const isDesktop = size === Size.DESKTOP;\n const isTable = viewType ? viewType === 'table' : isDesktop;\n\n if (!size) {\n return null;\n }\n\n return (\n <div\n className=\"lw-relative lw-text-sm lw-tracking-normal lw-text-text-primary\"\n data-testid={testId}\n >\n {TabsComponent}\n\n {isTable ? (\n <div className=\"lw-border lw-border-solid lw-border-border-primary\">\n <Table<DataRecord>\n headerConfig={headerColumns}\n isError={hasError}\n records={records}\n renderRow={(record, index, isScrolled) => (\n <DataRecordRow\n key={`row_${index}`}\n activeColumns={activeColumns}\n hasBackgroundColor={index % 2 === 0}\n instrumentColumnWidth={instrumentColumnWidth}\n isChartLoading={isChartLoading}\n isLoading={isLoading}\n isScrolled={isScrolled}\n record={record}\n target={target}\n toolTipId={toolTipId}\n />\n )}\n />\n </div>\n ) : (\n <Cards\n isError={hasError}\n records={records}\n renderCard={({ record, idx, isLast }) => (\n <CardRecordRow\n activeColumns={activeColumns}\n index={idx}\n isChartLoading={isChartLoading}\n isLast={isLast}\n isLoading={isLoading}\n record={record}\n target={target}\n tooltipId={toolTipId}\n />\n )}\n startIndex={pageNumber * count}\n />\n )}\n\n {PaginationComponent && !hasError && (\n <div\n className={cn('lw-border-solid lw-border-border-primary', {\n 'lw-border-x lw-border-b': isDesktop,\n })}\n >\n {PaginationComponent}\n </div>\n )}\n\n <Tooltip id={toolTipId} />\n\n {!hasError && timestamp && (\n <div className=\"lw-mt-2 lw-h-8\">\n <LastUpdated labelCallback={lang} timestamp={timestamp} />\n </div>\n )}\n </div>\n );\n};\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,kBAAkB;AAE5C,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,iBAAiB,QAAQ,iBAAiB;AACnD,SAASC,EAAE,QAAQ,gBAAgB;AAEnC,SAASC,IAAI,QAAQ,aAAa;AAClC,SAASC,WAAW,QAAQ,gBAAgB;AAG5C,SAASC,KAAK,QAAQ,UAAU;AAGhC,SAASC,OAAO,QAAQ,YAAY;AACpC,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,KAAK,QAAQ,SAAS;AAC/B,SAASC,aAAa,QAAQ,iBAAiB;AAqB/C,OAAO,MAAMC,WAAW,GAAGC,IAAA,IAiBI;EAAA,IAjBK;IAClCC,MAAM;IACNC,SAAS;IACTC,mBAAmB;IACnBC,QAAQ;IACRC,aAAa;IACbC,aAAa;IACbC,OAAO;IACPC,MAAM;IACNC,SAAS;IACTC,cAAc;IACdC,aAAa;IACbC,SAA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KAAA;MAAA,IAAC;QAAEN,MAAM;QAAEO,GAAG;QAAEC;MAAO,CAAC,GAAAF,KAAA;MAAA,OAClC5C,KAAA,CAAAiC,aAAA,CAAC1B,aAAa;QACZe,aAAa,EAAEA,aAAc;QAC7BiB,KAAK,EAAEM,GAAI;QACXxB,cAAc,EAAEA,cAAe;QAC/ByB,MAAM,EAAEA,MAAO;QACf1B,SAAS,EAAEA,SAAU;QACrBkB,MAAM,EAAEA,MAAO;QACfnB,MAAM,EAAEA,MAAO;QACf4B,SAAS,EAAElC;MAAU,CACtB,CAAC;IAAA,CACF;IACFmC,UAAU,EAAExB,UAAU,GAAGC;EAAM,CAChC,CACF,EAEAX,mBAAmB,IAAI,CAACC,QAAQ,IAC/Bf,KAAA,CAAAiC,aAAA;IACEC,SAAS,EAAEhC,EAAE,CAAC,0CAA0C,EAAE;MACxD,yBAAyB,EAAE4B;IAC7B,CAAC;EAAE,GAEFhB,mBACE,CACN,EAEDd,KAAA,CAAAiC,aAAA,CAAC3B,OAAO;IAAC2C,EAAE,EAAEpC;EAAU,CAAE,CAAC,EAEzB,CAACE,QAAQ,IAAIQ,SAAS,IACrBvB,KAAA,CAAAiC,aAAA;IAAKC,SAAS,EAAC;EAAgB,GAC7BlC,KAAA,CAAAiC,aAAA,CAAC7B,WAAW;IAAC8C,aAAa,EAAEtB,IAAK;IAACL,SAAS,EAAEA;EAAU,CAAE,CACtD,CAEJ,CAAC;AAEV,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"TableWidget.js","names":["_monoI18n","require","_react","_interopRequireDefault","_providers","_tailwind","_types","_LastUpdated","_Table","_Tooltip","_CardRecordRow","_Cards","_DataRecordRow","e","__esModule","default","TableWidget","_ref","testId","toolTipId","PaginationComponent","hasError","TabsComponent","headerColumns","records","target","isLoading","isChartLoading","activeColumns","timestamp","pageNumber","count","viewType","instrumentColumnWidth","lang","useLocale","size","useLayoutProvider","isDesktop","Size","DESKTOP","isTable","createElement","className","Table","headerConfig","isError","renderRow","record","index","isScrolled","DataRecordRow","key","hasBackgroundColor","Cards","renderCard","_ref2","idx","isLast","CardRecordRow","tooltipId","startIndex","cn","Tooltip","id","LastUpdated","labelCallback","exports"],"sources":["../../../../src/components/TableWidget/TableWidget.tsx"],"sourcesContent":["import { useLocale } from '@oanda/mono-i18n';\nimport type { ReactElement } from 'react';\nimport React from 'react';\n\nimport { useLayoutProvider } from '../../providers';\nimport { cn } from '../../tailwind';\nimport type { DataRecord, DataRecordType } from '../../types';\nimport { Size } from '../../types';\nimport { LastUpdated } from '../LastUpdated';\nimport type { Pagination, PaginationProps } from '../Pagination';\nimport type { HeaderColumns } from '../Table';\nimport { Table } from '../Table';\nimport type { Tabs } from '../Tabs';\nimport type { TabsProps } from '../Tabs/types';\nimport { Tooltip } from '../Tooltip';\nimport { CardRecordRow } from './CardRecordRow';\nimport { Cards } from './Cards';\nimport { DataRecordRow } from './DataRecordRow';\n\ninterface TableWidgetProps<TTabs> {\n testId: string;\n toolTipId: string;\n hasError?: boolean;\n TabsComponent?: ReactElement<TabsProps<TTabs>, typeof Tabs<TTabs>>;\n PaginationComponent?: ReactElement<PaginationProps, typeof Pagination>;\n headerColumns: HeaderColumns[];\n records: DataRecord[];\n target: EventTarget | null;\n isLoading: boolean;\n isChartLoading?: boolean;\n activeColumns: DataRecordType[];\n timestamp?: string;\n pageNumber: number;\n count: number;\n viewType?: 'table' | 'cards';\n instrumentColumnWidth?: string;\n}\n\nexport const TableWidget = <TTabs,>({\n testId,\n toolTipId,\n PaginationComponent,\n hasError,\n TabsComponent,\n headerColumns,\n records,\n target,\n isLoading,\n isChartLoading,\n activeColumns,\n timestamp,\n pageNumber,\n count,\n viewType,\n instrumentColumnWidth,\n}: TableWidgetProps<TTabs>) => {\n const { lang } = useLocale();\n const { size } = useLayoutProvider();\n const isDesktop = size === Size.DESKTOP;\n const isTable = viewType ? viewType === 'table' : isDesktop;\n\n if (!size) {\n return null;\n }\n\n return (\n <div\n className=\"lw-relative lw-text-sm lw-tracking-normal lw-text-text-primary\"\n data-testid={testId}\n >\n {TabsComponent}\n\n {isTable ? (\n <div className=\"lw-border lw-border-solid lw-border-border-primary\">\n <Table<DataRecord>\n headerConfig={headerColumns}\n isError={hasError}\n records={records}\n renderRow={(record, index, isScrolled) => (\n <DataRecordRow\n key={`row_${index}`}\n activeColumns={activeColumns}\n hasBackgroundColor={index % 2 === 0}\n instrumentColumnWidth={instrumentColumnWidth}\n isChartLoading={isChartLoading}\n isLoading={isLoading}\n isScrolled={isScrolled}\n record={record}\n target={target}\n toolTipId={toolTipId}\n />\n )}\n />\n </div>\n ) : (\n <Cards\n isError={hasError}\n records={records}\n renderCard={({ record, idx, isLast }) => (\n <CardRecordRow\n activeColumns={activeColumns}\n index={idx}\n isChartLoading={isChartLoading}\n isLast={isLast}\n isLoading={isLoading}\n record={record}\n target={target}\n tooltipId={toolTipId}\n />\n )}\n startIndex={pageNumber * count}\n />\n )}\n\n {PaginationComponent && !hasError && (\n <div\n className={cn('lw-border-solid lw-border-border-primary', {\n 'lw-border-x lw-border-b': isDesktop,\n })}\n >\n {PaginationComponent}\n </div>\n )}\n\n <Tooltip id={toolTipId} />\n\n {!hasError && timestamp && (\n <div className=\"lw-mt-2 lw-h-8\">\n <LastUpdated labelCallback={lang} timestamp={timestamp} />\n </div>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAEA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAGA,IAAAO,MAAA,GAAAP,OAAA;AAGA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,cAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,cAAA,GAAAX,OAAA;AAAgD,SAAAE,uBAAAU,CAA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AS,EAAC;EAAgB,GAC7BzC,MAAA,CAAAa,OAAA,CAAA2B,aAAA,CAACnC,YAAA,CAAA0D,WAAW;IAACC,aAAa,EAAEhC,IAAK;IAACL,SAAS,EAAEA;EAAU,CAAE,CACtD,CAEJ,CAAC;AAEV,CAAC;AAACsC,OAAA,CAAAnD,WAAA,GAAAA,WAAA","ignoreList":[]}
@@ -1,3 +1,28 @@
1
- export * from './TableWidget';
2
- export * from './utils';
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _TableWidget = require("./TableWidget");
7
+ Object.keys(_TableWidget).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _TableWidget[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _TableWidget[key];
14
+ }
15
+ });
16
+ });
17
+ var _utils = require("./utils");
18
+ Object.keys(_utils).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _utils[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _utils[key];
25
+ }
26
+ });
27
+ });
3
28
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/TableWidget/index.ts"],"sourcesContent":["export * from './TableWidget';\nexport * from './utils';\n"],"mappings":"AAAA,cAAc,eAAe;AAC7B,cAAc,SAAS","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_TableWidget","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_utils"],"sources":["../../../../src/components/TableWidget/index.ts"],"sourcesContent":["export * from './TableWidget';\nexport * from './utils';\n"],"mappings":";;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,YAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,YAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,YAAA,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,2 +1,6 @@
1
- export {};
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
2
6
  //# sourceMappingURL=types.js.map
@@ -1,7 +1,15 @@
1
- import { DataRecordType } from '../../types';
2
- export const getTableRowIndex = () => ({});
3
- export const getHeaderConfig = (activeColumns, headerConfig) => {
4
- const columns = [DataRecordType.INSTRUMENT, ...activeColumns];
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getTableRowIndex = exports.getHeaderConfig = void 0;
7
+ var _types = require("../../types");
8
+ const getTableRowIndex = () => ({});
9
+ exports.getTableRowIndex = getTableRowIndex;
10
+ const getHeaderConfig = (activeColumns, headerConfig) => {
11
+ const columns = [_types.DataRecordType.INSTRUMENT, ...activeColumns];
5
12
  return columns.map(item => headerConfig[item]).filter(headerCell => headerCell !== undefined);
6
13
  };
14
+ exports.getHeaderConfig = getHeaderConfig;
7
15
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","names":["DataRecordType","getTableRowIndex","getHeaderConfig","activeColumns","headerConfig","columns","INSTRUMENT","map","item","filter","headerCell","undefined"],"sources":["../../../../src/components/TableWidget/utils.ts"],"sourcesContent":["import { DataRecordType } from '../../types';\nimport type { HeaderColumns, HeaderConfigType } from '../Table';\n\nexport const getTableRowIndex = () => ({});\n\nexport const getHeaderConfig = (\n activeColumns: DataRecordType[],\n headerConfig: HeaderConfigType\n): HeaderColumns[] => {\n const columns: DataRecordType[] = [\n DataRecordType.INSTRUMENT,\n ...activeColumns,\n ];\n\n return columns\n .map((item) => headerConfig[item])\n .filter((headerCell) => headerCell !== undefined);\n};\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,aAAa;AAG5C,OAAO,MAAMC,gBAAgB,GAAGA,CAAA,MAAO,CAAC,CAAC,CAAC;AAE1C,OAAO,MAAMC,eAAe,GAAGA,CAC7BC,aAA+B,EAC/BC,YAA8B,KACV;EACpB,MAAMC,OAAyB,GAAG,CAChCL,cAAc,CAACM,UAAU,EACzB,GAAGH,aAAa,CACjB;EAED,OAAOE,OAAO,CACXE,GAAG,CAAEC,IAAI,IAAKJ,YAAY,CAACI,IAAI,CAAC,CAAC,CACjCC,MAAM,CAAEC,UAAU,IAAKA,UAAU,KAAKC,SAAS,CAAC;AACrD,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"utils.js","names":["_types","require","getTableRowIndex","exports","getHeaderConfig","activeColumns","headerConfig","columns","DataRecordType","INSTRUMENT","map","item","filter","headerCell","undefined"],"sources":["../../../../src/components/TableWidget/utils.ts"],"sourcesContent":["import { DataRecordType } from '../../types';\nimport type { HeaderColumns, HeaderConfigType } from '../Table';\n\nexport const getTableRowIndex = () => ({});\n\nexport const getHeaderConfig = (\n activeColumns: DataRecordType[],\n headerConfig: HeaderConfigType\n): HeaderColumns[] => {\n const columns: DataRecordType[] = [\n DataRecordType.INSTRUMENT,\n ...activeColumns,\n ];\n\n return columns\n .map((item) => headerConfig[item])\n .filter((headerCell) => headerCell !== undefined);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGO,MAAMC,gBAAgB,GAAGA,CAAA,MAAO,CAAC,CAAC,CAAC;AAACC,OAAA,CAAAD,gBAAA,GAAAA,gBAAA;AAEpC,MAAME,eAAe,GAAGA,CAC7BC,aAA+B,EAC/BC,YAA8B,KACV;EACpB,MAAMC,OAAyB,GAAG,CAChCC,qBAAc,CAACC,UAAU,EACzB,GAAGJ,aAAa,CACjB;EAED,OAAOE,OAAO,CACXG,GAAG,CAAEC,IAAI,IAAKL,YAAY,CAACK,IAAI,CAAC,CAAC,CACjCC,MAAM,CAAEC,UAAU,IAAKA,UAAU,KAAKC,SAAS,CAAC;AACrD,CAAC;AAACX,OAAA,CAAAC,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -1,7 +1,14 @@
1
- import classnames from 'classnames';
2
- import React from 'react';
3
- import { useLayoutProvider } from '../../providers';
4
- import { Size } from '../../types';
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Tab = Tab;
7
+ var _classnames = _interopRequireDefault(require("classnames"));
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _providers = require("../../providers");
10
+ var _types = require("../../types");
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
5
12
  function Tab(_ref) {
6
13
  let {
7
14
  id,
@@ -13,10 +20,10 @@ function Tab(_ref) {
13
20
  const {
14
21
  isDark,
15
22
  size
16
- } = useLayoutProvider();
17
- const isDesktop = size === Size.DESKTOP;
18
- return React.createElement("li", {
19
- className: classnames('lw-mb-0 lw-flex lw-min-w-[100px] lw-rounded lw-border lw-text-center lw-text-lg lw-tracking-normal', {
23
+ } = (0, _providers.useLayoutProvider)();
24
+ const isDesktop = size === _types.Size.DESKTOP;
25
+ return _react.default.createElement("li", {
26
+ className: (0, _classnames.default)('lw-mb-0 lw-flex lw-min-w-[100px] lw-rounded lw-border lw-text-center lw-text-lg lw-tracking-normal', {
20
27
  'lw-w-[calc(50%-0.5rem)]': mobileFullWidth,
21
28
  'lw-border-primary lw-bg-primary lw-text-text-negative': isActive,
22
29
  'lw-bg-bg-primary lw-text-text-primary': !isActive && isDark,
@@ -24,7 +31,7 @@ function Tab(_ref) {
24
31
  'lw-flex-1': isDesktop
25
32
  }),
26
33
  "data-testid": "tab"
27
- }, React.createElement("button", {
34
+ }, _react.default.createElement("button", {
28
35
  "aria-current": isActive || undefined,
29
36
  className: "lw-flex-1 lw-px-2.5 lw-py-2 lw-font-sans lw-capitalize focus:lw-outline-primary",
30
37
  type: "button",
@@ -32,5 +39,4 @@ function Tab(_ref) {
32
39
  onClick: handleClick
33
40
  }, label));
34
41
  }
35
- export { Tab };
36
42
  //# sourceMappingURL=Tab.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tab.js","names":["classnames","React","useLayoutProvider","Size","Tab","_ref","id","label","isActive","handleClick","mobileFullWidth","isDark","size","isDesktop","DESKTOP","createElement","className","undefined","type","value","onClick"],"sources":["../../../../src/components/Tabs/Tab.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport React from 'react';\n\nimport { useLayoutProvider } from '../../providers';\nimport { Size } from '../../types';\nimport type { TabProps } from './types';\n\nfunction Tab<T>({\n id,\n label,\n isActive,\n handleClick,\n mobileFullWidth,\n}: TabProps<T>) {\n const { isDark, size } = useLayoutProvider();\n const isDesktop = size === Size.DESKTOP;\n\n return (\n <li\n className={classnames(\n 'lw-mb-0 lw-flex lw-min-w-[100px] lw-rounded lw-border lw-text-center lw-text-lg lw-tracking-normal',\n {\n 'lw-w-[calc(50%-0.5rem)]': mobileFullWidth,\n 'lw-border-primary lw-bg-primary lw-text-text-negative': isActive,\n 'lw-bg-bg-primary lw-text-text-primary': !isActive && isDark,\n 'lw-bg-bg-primary lw-text-text-secondary-75 hover:lw-text-text-secondary':\n !isActive && !isDark,\n 'lw-flex-1': isDesktop,\n }\n )}\n data-testid=\"tab\"\n >\n <button\n aria-current={isActive || undefined}\n className=\"lw-flex-1 lw-px-2.5 lw-py-2 lw-font-sans lw-capitalize focus:lw-outline-primary\"\n type=\"button\"\n value={id as string}\n onClick={handleClick}\n >\n {label as React.ReactNode}\n </button>\n </li>\n );\n}\n\nexport { Tab };\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,iBAAiB,QAAQ,iBAAiB;AACnD,SAASC,IAAI,QAAQ,aAAa;AAGlC,SAASC,GAAGA,CAAAC,IAAA,EAMI;EAAA,IANA;IACdC,EAAE;IACFC,KAAK;IACLC,QAAQ;IACRC,WAAW;IACXC;EACW,CAAC,GAAAL,IAAA;EACZ,MAAM;IAAEM,MAAM;IAAEC;EAAK,CAAC,GAAGV,iBAAiB,CAAC,CAAC;EAC5C,MAAMW,SAAS,GAAGD,IAAI,KAAKT,IAAI,CAACW,OAAO;EAEvC,OACEb,KAAA,CAAAc,aAAA;IACEC,SAAS,EAAEhB,UAAU,CACnB,oGAAoG,EACpG;MACE,yBAAyB,EAAEU,eAAe;MAC1C,uDAAuD,EAAEF,QAAQ;MACjE,uCAAuC,EAAE,CAACA,QAAQ,IAAIG,MAAM;MAC5D,yEAAyE,EACvE,CAACH,QAAQ,IAAI,CAACG,MAAM;MACtB,WAAW,EAAEE;IACf,CACF,CAAE;IACF,eAAY;EAAK,GAEjBZ,KAAA,CAAAc,aAAA;IACE,gBAAcP,QAAQ,IAAIS,SAAU;IACpCD,SAAS,EAAC,iFAAiF;IAC3FE,IAAI,EAAC,QAAQ;IACbC,KAAK,EAAEb,EAAa;IACpBc,OAAO,EAAEX;EAAY,GAEpBF,KACK,CACN,CAAC;AAET;AAEA,SAASH,GAAG","ignoreList":[]}
1
+ {"version":3,"file":"Tab.js","names":["_classnames","_interopRequireDefault","require","_react","_providers","_types","e","__esModule","default","Tab","_ref","id","label","isActive","handleClick","mobileFullWidth","isDark","size","useLayoutProvider","isDesktop","Size","DESKTOP","createElement","className","classnames","undefined","type","value","onClick"],"sources":["../../../../src/components/Tabs/Tab.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport React from 'react';\n\nimport { useLayoutProvider } from '../../providers';\nimport { Size } from '../../types';\nimport type { TabProps } from './types';\n\nfunction Tab<T>({\n id,\n label,\n isActive,\n handleClick,\n mobileFullWidth,\n}: TabProps<T>) {\n const { isDark, size } = useLayoutProvider();\n const isDesktop = size === Size.DESKTOP;\n\n return (\n <li\n className={classnames(\n 'lw-mb-0 lw-flex lw-min-w-[100px] lw-rounded lw-border lw-text-center lw-text-lg lw-tracking-normal',\n {\n 'lw-w-[calc(50%-0.5rem)]': mobileFullWidth,\n 'lw-border-primary lw-bg-primary lw-text-text-negative': isActive,\n 'lw-bg-bg-primary lw-text-text-primary': !isActive && isDark,\n 'lw-bg-bg-primary lw-text-text-secondary-75 hover:lw-text-text-secondary':\n !isActive && !isDark,\n 'lw-flex-1': isDesktop,\n }\n )}\n data-testid=\"tab\"\n >\n <button\n aria-current={isActive || undefined}\n className=\"lw-flex-1 lw-px-2.5 lw-py-2 lw-font-sans lw-capitalize focus:lw-outline-primary\"\n type=\"button\"\n value={id as string}\n onClick={handleClick}\n >\n {label as React.ReactNode}\n </button>\n </li>\n );\n}\n\nexport { Tab };\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAAmC,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGnC,SAASG,GAAGA,CAAAC,IAAA,EAMI;EAAA,IANA;IACdC,EAAE;IACFC,KAAK;IACLC,QAAQ;IACRC,WAAW;IACXC;EACW,CAAC,GAAAL,IAAA;EACZ,MAAM;IAAEM,MAAM;IAAEC;EAAK,CAAC,GAAG,IAAAC,4BAAiB,EAAC,CAAC;EAC5C,MAAMC,SAAS,GAAGF,IAAI,KAAKG,WAAI,CAACC,OAAO;EAEvC,OACElB,MAAA,CAAAK,OAAA,CAAAc,aAAA;IACEC,SAAS,EAAE,IAAAC,mBAAU,EACnB,oGAAoG,EACpG;MACE,yBAAyB,EAAET,eAAe;MAC1C,uDAAuD,EAAEF,QAAQ;MACjE,uCAAuC,EAAE,CAACA,QAAQ,IAAIG,MAAM;MAC5D,yEAAyE,EACvE,CAACH,QAAQ,IAAI,CAACG,MAAM;MACtB,WAAW,EAAEG;IACf,CACF,CAAE;IACF,eAAY;EAAK,GAEjBhB,MAAA,CAAAK,OAAA,CAAAc,aAAA;IACE,gBAAcT,QAAQ,IAAIY,SAAU;IACpCF,SAAS,EAAC,iFAAiF;IAC3FG,IAAI,EAAC,QAAQ;IACbC,KAAK,EAAEhB,EAAa;IACpBiB,OAAO,EAAEd;EAAY,GAEpBF,KACK,CACN,CAAC;AAET","ignoreList":[]}
@@ -1,5 +1,12 @@
1
- import React from 'react';
2
- import { Tab } from './Tab';
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Tabs = Tabs;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _Tab = require("./Tab");
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
3
10
  function Tabs(_ref) {
4
11
  let {
5
12
  items,
@@ -8,7 +15,7 @@ function Tabs(_ref) {
8
15
  handleClick,
9
16
  mobileFullWidth
10
17
  } = _ref;
11
- return React.createElement("ul", {
18
+ return _react.default.createElement("ul", {
12
19
  className: "lw-mx-0 lw-mb-8 lw-flex lw-flex-wrap lw-justify-center lw-gap-4 lw-px-px",
13
20
  "data-testid": "tabs"
14
21
  }, items.map(_ref2 => {
@@ -16,7 +23,7 @@ function Tabs(_ref) {
16
23
  id,
17
24
  label
18
25
  } = _ref2;
19
- return React.createElement(Tab, {
26
+ return _react.default.createElement(_Tab.Tab, {
20
27
  key: `${id}-item`,
21
28
  handleClick: handleClick,
22
29
  id: id,
@@ -26,5 +33,4 @@ function Tabs(_ref) {
26
33
  });
27
34
  }));
28
35
  }
29
- export { Tabs };
30
36
  //# sourceMappingURL=Tabs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.js","names":["React","Tab","Tabs","_ref","items","activeTab","labelCallback","handleClick","mobileFullWidth","createElement","className","map","_ref2","id","label","key","isActive"],"sources":["../../../../src/components/Tabs/Tabs.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Tab } from './Tab';\nimport type { TabsProps } from './types';\n\nfunction Tabs<T>({\n items,\n activeTab,\n labelCallback,\n handleClick,\n mobileFullWidth,\n}: TabsProps<T>) {\n return (\n <ul\n className=\"lw-mx-0 lw-mb-8 lw-flex lw-flex-wrap lw-justify-center lw-gap-4 lw-px-px\"\n data-testid=\"tabs\"\n >\n {items.map(({ id, label }) => (\n <Tab\n key={`${id}-item`}\n handleClick={handleClick}\n id={id}\n isActive={id === activeTab}\n label={labelCallback ? labelCallback(label) : label}\n mobileFullWidth={mobileFullWidth}\n />\n ))}\n </ul>\n );\n}\n\nexport { Tabs };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,GAAG,QAAQ,OAAO;AAG3B,SAASC,IAAIA,CAAAC,IAAA,EAMI;EAAA,IANA;IACfC,KAAK;IACLC,SAAS;IACTC,aAAa;IACbC,WAAW;IACXC;EACY,CAAC,GAAAL,IAAA;EACb,OACEH,KAAA,CAAAS,aAAA;IACEC,SAAS,EAAC,0EAA0E;IACpF,eAAY;EAAM,GAEjBN,KAAK,CAACO,GAAG,CAACC,KAAA;IAAA,IAAC;MAAEC,EAAE;MAAEC;IAAM,CAAC,GAAAF,KAAA;IAAA,OACvBZ,KAAA,CAAAS,aAAA,CAACR,GAAG;MACFc,GAAG,EAAE,GAAGF,EAAE,OAAQ;MAClBN,WAAW,EAAEA,WAAY;MACzBM,EAAE,EAAEA,EAAG;MACPG,QAAQ,EAAEH,EAAE,KAAKR,SAAU;MAC3BS,KAAK,EAAER,aAAa,GAAGA,aAAa,CAACQ,KAAK,CAAC,GAAGA,KAAM;MACpDN,eAAe,EAAEA;IAAgB,CAClC,CAAC;EAAA,CACH,CACC,CAAC;AAET;AAEA,SAASN,IAAI","ignoreList":[]}
1
+ {"version":3,"file":"Tabs.js","names":["_react","_interopRequireDefault","require","_Tab","e","__esModule","default","Tabs","_ref","items","activeTab","labelCallback","handleClick","mobileFullWidth","createElement","className","map","_ref2","id","label","Tab","key","isActive"],"sources":["../../../../src/components/Tabs/Tabs.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Tab } from './Tab';\nimport type { TabsProps } from './types';\n\nfunction Tabs<T>({\n items,\n activeTab,\n labelCallback,\n handleClick,\n mobileFullWidth,\n}: TabsProps<T>) {\n return (\n <ul\n className=\"lw-mx-0 lw-mb-8 lw-flex lw-flex-wrap lw-justify-center lw-gap-4 lw-px-px\"\n data-testid=\"tabs\"\n >\n {items.map(({ id, label }) => (\n <Tab\n key={`${id}-item`}\n handleClick={handleClick}\n id={id}\n isActive={id === activeTab}\n label={labelCallback ? labelCallback(label) : label}\n mobileFullWidth={mobileFullWidth}\n />\n ))}\n </ul>\n );\n}\n\nexport { Tabs };\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,IAAA,GAAAD,OAAA;AAA4B,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAG5B,SAASG,IAAIA,CAAAC,IAAA,EAMI;EAAA,IANA;IACfC,KAAK;IACLC,SAAS;IACTC,aAAa;IACbC,WAAW;IACXC;EACY,CAAC,GAAAL,IAAA;EACb,OACER,MAAA,CAAAM,OAAA,CAAAQ,aAAA;IACEC,SAAS,EAAC,0EAA0E;IACpF,eAAY;EAAM,GAEjBN,KAAK,CAACO,GAAG,CAACC,KAAA;IAAA,IAAC;MAAEC,EAAE;MAAEC;IAAM,CAAC,GAAAF,KAAA;IAAA,OACvBjB,MAAA,CAAAM,OAAA,CAAAQ,aAAA,CAACX,IAAA,CAAAiB,GAAG;MACFC,GAAG,EAAE,GAAGH,EAAE,OAAQ;MAClBN,WAAW,EAAEA,WAAY;MACzBM,EAAE,EAAEA,EAAG;MACPI,QAAQ,EAAEJ,EAAE,KAAKR,SAAU;MAC3BS,KAAK,EAAER,aAAa,GAAGA,aAAa,CAACQ,KAAK,CAAC,GAAGA,KAAM;MACpDN,eAAe,EAAEA;IAAgB,CAClC,CAAC;EAAA,CACH,CACC,CAAC;AAET","ignoreList":[]}
@@ -1,2 +1,17 @@
1
- export * from './Tabs';
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _Tabs = require("./Tabs");
7
+ Object.keys(_Tabs).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _Tabs[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _Tabs[key];
14
+ }
15
+ });
16
+ });
2
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/Tabs/index.ts"],"sourcesContent":["export * from './Tabs';\n"],"mappings":"AAAA,cAAc,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_Tabs","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["../../../../src/components/Tabs/index.ts"],"sourcesContent":["export * from './Tabs';\n"],"mappings":";;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,KAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,KAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,KAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -1,2 +1,6 @@
1
- export {};
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
2
6
  //# sourceMappingURL=types.js.map
@@ -1,5 +1,12 @@
1
- import React, { useRef } from 'react';
2
- import { CloseIcon } from '../../images';
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TextInput = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _images = require("../../images");
9
+ 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); }
3
10
  const TextInput = _ref => {
4
11
  let {
5
12
  value,
@@ -7,18 +14,18 @@ const TextInput = _ref => {
7
14
  placeholder = '',
8
15
  label
9
16
  } = _ref;
10
- const inputRef = useRef(null);
17
+ const inputRef = (0, _react.useRef)(null);
11
18
  const handleReset = () => {
12
19
  inputRef.current?.focus();
13
20
  onChange('');
14
21
  };
15
- return React.createElement("div", {
22
+ return _react.default.createElement("div", {
16
23
  className: "lw-text-text-primary"
17
- }, label && React.createElement("div", null, React.createElement("span", {
24
+ }, label && _react.default.createElement("div", null, _react.default.createElement("span", {
18
25
  className: "lw-text-base lw-font-bold"
19
- }, `${label}:`)), React.createElement("div", null), React.createElement("div", {
26
+ }, `${label}:`)), _react.default.createElement("div", null), _react.default.createElement("div", {
20
27
  className: "lw-relative"
21
- }, React.createElement("input", {
28
+ }, _react.default.createElement("input", {
22
29
  ref: inputRef,
23
30
  className: "lw-flex lw-h-[50px] lw-w-full lw-items-center lw-justify-between lw-rounded lw-border lw-bg-transparent lw-stroke-text-primary lw-py-2 lw-pl-3 lw-pr-8 focus:lw-outline-primary",
24
31
  "data-testid": "text-input",
@@ -26,11 +33,11 @@ const TextInput = _ref => {
26
33
  type: "text",
27
34
  value: value,
28
35
  onChange: e => onChange(e.target.value)
29
- }), value.length > 0 && React.createElement("button", {
36
+ }), value.length > 0 && _react.default.createElement("button", {
30
37
  className: "lw-absolute lw-right-1 lw-top-1 lw-h-[42px] lw-cursor-pointer lw-rounded focus:lw-outline-primary [&>svg]:lw-stroke-text-primary",
31
38
  "data-testid": "text-input-clear-button",
32
39
  onClick: handleReset
33
- }, React.createElement(CloseIcon, null))));
40
+ }, _react.default.createElement(_images.CloseIcon, null))));
34
41
  };
35
- export { TextInput };
42
+ exports.TextInput = TextInput;
36
43
  //# sourceMappingURL=TextInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextInput.js","names":["React","useRef","CloseIcon","TextInput","_ref","value","onChange","placeholder","label","inputRef","handleReset","current","focus","createElement","className","ref","type","e","target","length","onClick"],"sources":["../../../../src/components/TextInput/TextInput.tsx"],"sourcesContent":["import React, { useRef } from 'react';\n\nimport { CloseIcon } from '../../images';\n\ninterface TextInputProps {\n value: string;\n onChange: (val: string) => void;\n placeholder?: string;\n label?: string;\n}\n\nconst TextInput: React.FC<TextInputProps> = ({\n value,\n onChange,\n placeholder = '',\n label,\n}) => {\n const inputRef = useRef<HTMLInputElement>(null);\n\n const handleReset = () => {\n inputRef.current?.focus();\n onChange('');\n };\n return (\n <div className=\"lw-text-text-primary\">\n {label && (\n <div>\n <span className=\"lw-text-base lw-font-bold\">{`${label}:`}</span>\n </div>\n )}\n <div />\n <div className=\"lw-relative\">\n <input\n ref={inputRef}\n className=\"lw-flex lw-h-[50px] lw-w-full lw-items-center lw-justify-between lw-rounded lw-border lw-bg-transparent lw-stroke-text-primary lw-py-2 lw-pl-3 lw-pr-8 focus:lw-outline-primary\"\n data-testid=\"text-input\"\n placeholder={placeholder}\n type=\"text\"\n value={value}\n onChange={(e) => onChange(e.target.value)}\n />\n {value.length > 0 && (\n <button\n className=\"lw-absolute lw-right-1 lw-top-1 lw-h-[42px] lw-cursor-pointer lw-rounded focus:lw-outline-primary [&>svg]:lw-stroke-text-primary\"\n data-testid=\"text-input-clear-button\"\n onClick={handleReset}\n >\n <CloseIcon />\n </button>\n )}\n </div>\n </div>\n );\n};\n\nexport { TextInput };\nexport type { TextInputProps };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,MAAM,QAAQ,OAAO;AAErC,SAASC,SAAS,QAAQ,cAAc;AASxC,MAAMC,SAAmC,GAAGC,IAAA,IAKtC;EAAA,IALuC;IAC3CC,KAAK;IACLC,QAAQ;IACRC,WAAW,GAAG,EAAE;IAChBC;EACF,CAAC,GAAAJ,IAAA;EACC,MAAMK,QAAQ,GAAGR,MAAM,CAAmB,IAAI,CAAC;EAE/C,MAAMS,WAAW,GAAGA,CAAA,KAAM;IACxBD,QAAQ,CAACE,OAAO,EAAEC,KAAK,CAAC,CAAC;IACzBN,QAAQ,CAAC,EAAE,CAAC;EACd,CAAC;EACD,OACEN,KAAA,CAAAa,aAAA;IAAKC,SAAS,EAAC;EAAsB,GAClCN,KAAK,IACJR,KAAA,CAAAa,aAAA,cACEb,KAAA,CAAAa,aAAA;IAAMC,SAAS,EAAC;EAA2B,GAAE,GAAGN,KAAK,GAAU,CAC5D,CACN,EACDR,KAAA,CAAAa,aAAA,YAAM,CAAC,EACPb,KAAA,CAAAa,aAAA;IAAKC,SAAS,EAAC;EAAa,GAC1Bd,KAAA,CAAAa,aAAA;IACEE,GAAG,EAAEN,QAAS;IACdK,SAAS,EAAC,iLAAiL;IAC3L,eAAY,YAAY;IACxBP,WAAW,EAAEA,WAAY;IACzBS,IAAI,EAAC,MAAM;IACXX,KAAK,EAAEA,KAAM;IACbC,QAAQ,EAAGW,CAAC,IAAKX,QAAQ,CAACW,CAAC,CAACC,MAAM,CAACb,KAAK;EAAE,CAC3C,CAAC,EACDA,KAAK,CAACc,MAAM,GAAG,CAAC,IACfnB,KAAA,CAAAa,aAAA;IACEC,SAAS,EAAC,kIAAkI;IAC5I,eAAY,yBAAyB;IACrCM,OAAO,EAAEV;EAAY,GAErBV,KAAA,CAAAa,aAAA,CAACX,SAAS,MAAE,CACN,CAEP,CACF,CAAC;AAEV,CAAC;AAED,SAASC,SAAS","ignoreList":[]}
1
+ {"version":3,"file":"TextInput.js","names":["_react","_interopRequireWildcard","require","_images","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","TextInput","_ref","value","onChange","placeholder","label","inputRef","useRef","handleReset","current","focus","createElement","className","ref","type","target","length","onClick","CloseIcon","exports"],"sources":["../../../../src/components/TextInput/TextInput.tsx"],"sourcesContent":["import React, { useRef } from 'react';\n\nimport { CloseIcon } from '../../images';\n\ninterface TextInputProps {\n value: string;\n onChange: (val: string) => void;\n placeholder?: string;\n label?: string;\n}\n\nconst TextInput: React.FC<TextInputProps> = ({\n value,\n onChange,\n placeholder = '',\n label,\n}) => {\n const inputRef = useRef<HTMLInputElement>(null);\n\n const handleReset = () => {\n inputRef.current?.focus();\n onChange('');\n };\n return (\n <div className=\"lw-text-text-primary\">\n {label && (\n <div>\n <span className=\"lw-text-base lw-font-bold\">{`${label}:`}</span>\n </div>\n )}\n <div />\n <div className=\"lw-relative\">\n <input\n ref={inputRef}\n className=\"lw-flex lw-h-[50px] lw-w-full lw-items-center lw-justify-between lw-rounded lw-border lw-bg-transparent lw-stroke-text-primary lw-py-2 lw-pl-3 lw-pr-8 focus:lw-outline-primary\"\n data-testid=\"text-input\"\n placeholder={placeholder}\n type=\"text\"\n value={value}\n onChange={(e) => onChange(e.target.value)}\n />\n {value.length > 0 && (\n <button\n className=\"lw-absolute lw-right-1 lw-top-1 lw-h-[42px] lw-cursor-pointer lw-rounded focus:lw-outline-primary [&>svg]:lw-stroke-text-primary\"\n data-testid=\"text-input-clear-button\"\n onClick={handleReset}\n >\n <CloseIcon />\n </button>\n )}\n </div>\n </div>\n );\n};\n\nexport { TextInput };\nexport type { TextInputProps };\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AAAyC,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,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,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK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ACEC,SAAS,EAAC,kIAAkI;IAC5I,eAAY,yBAAyB;IACrCK,OAAO,EAAET;EAAY,GAErB/B,MAAA,CAAAc,OAAA,CAAAoB,aAAA,CAAC/B,OAAA,CAAAsC,SAAS,MAAE,CACN,CAEP,CACF,CAAC;AAEV,CAAC;AAACC,OAAA,CAAAnB,SAAA,GAAAA,SAAA","ignoreList":[]}
@@ -1,2 +1,17 @@
1
- export * from './TextInput';
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _TextInput = require("./TextInput");
7
+ Object.keys(_TextInput).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _TextInput[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _TextInput[key];
14
+ }
15
+ });
16
+ });
2
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/TextInput/index.ts"],"sourcesContent":["export * from './TextInput';\n"],"mappings":"AAAA,cAAc,aAAa","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_TextInput","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["../../../../src/components/TextInput/index.ts"],"sourcesContent":["export * from './TextInput';\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","ignoreList":[]}
@@ -1,6 +1,13 @@
1
- import { useLocale } from '@oanda/mono-i18n';
2
- import React from 'react';
3
- import { Select } from '../Select';
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TimeUnitSelect = void 0;
7
+ var _monoI18n = require("@oanda/mono-i18n");
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _Select = require("../Select");
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
4
11
  const TimeUnitSelect = _ref => {
5
12
  let {
6
13
  selected,
@@ -9,7 +16,7 @@ const TimeUnitSelect = _ref => {
9
16
  } = _ref;
10
17
  const {
11
18
  lang
12
- } = useLocale();
19
+ } = (0, _monoI18n.useLocale)();
13
20
  const selectOptions = options.map(_ref2 => {
14
21
  let {
15
22
  value,
@@ -31,10 +38,10 @@ const TimeUnitSelect = _ref => {
31
38
  } = _ref3;
32
39
  return id === selected;
33
40
  });
34
- return React.createElement("div", {
41
+ return _react.default.createElement("div", {
35
42
  className: "lw-mb-6 lw-w-full",
36
43
  "data-testid": "time-unit-select"
37
- }, React.createElement(Select, {
44
+ }, _react.default.createElement(_Select.Select, {
38
45
  options: selectOptions,
39
46
  searchPlaceholder: lang('search'),
40
47
  selectedOption: {
@@ -49,5 +56,5 @@ const TimeUnitSelect = _ref => {
49
56
  }
50
57
  }));
51
58
  };
52
- export { TimeUnitSelect };
59
+ exports.TimeUnitSelect = TimeUnitSelect;
53
60
  //# sourceMappingURL=TimeUnitSelect.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TimeUnitSelect.js","names":["useLocale","React","Select","TimeUnitSelect","_ref","selected","options","callback","lang","selectOptions","map","_ref2","value","label","tooltipLabel","id","translationKey","count","selectedLabel","filter","_ref3","createElement","className","searchPlaceholder","selectedOption","setSelectedOption","_ref4"],"sources":["../../../../src/components/TimeUnitSwitch/TimeUnitSelect.tsx"],"sourcesContent":["import { useLocale } from '@oanda/mono-i18n';\nimport React from 'react';\n\nimport type { SelectOption } from '../Select';\nimport { Select } from '../Select';\nimport type { TimeUnitSwitchProps } from './types';\n\nconst TimeUnitSelect = <T extends string>({\n selected,\n options,\n callback,\n}: TimeUnitSwitchProps<T>) => {\n const { lang } = useLocale();\n\n const selectOptions: SelectOption[] = options.map(\n ({ value, label, tooltipLabel }) => ({\n id: value,\n label: tooltipLabel\n ? lang(tooltipLabel.translationKey, { count: tooltipLabel.count })\n : lang(label),\n })\n );\n\n const [{ label: selectedLabel }] = selectOptions.filter(\n ({ id }) => id === selected\n );\n\n return (\n <div className=\"lw-mb-6 lw-w-full\" data-testid=\"time-unit-select\">\n <Select\n options={selectOptions}\n searchPlaceholder={lang('search')}\n selectedOption={{ id: selected, label: selectedLabel }}\n setSelectedOption={({ id }) => callback(id as T)}\n />\n </div>\n );\n};\n\nexport { TimeUnitSelect };\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,kBAAkB;AAC5C,OAAOC,KAAK,MAAM,OAAO;AAGzB,SAASC,MAAM,QAAQ,WAAW;AAGlC,MAAMC,cAAc,GAAGC,IAAA,IAIO;EAAA,IAJY;IACxCC,QAAQ;IACRC,OAAO;IACPC;EACsB,CAAC,GAAAH,IAAA;EACvB,MAAM;IAAEI;EAAK,CAAC,GAAGR,SAAS,CAAC,CAAC;EAE5B,MAAMS,aAA6B,GAAGH,OAAO,CAACI,GAAG,CAC/CC,KAAA;IAAA,IAAC;MAAEC,KAAK;MAAEC,KAAK;MAAEC;IAAa,CAAC,GAAAH,KAAA;IAAA,OAAM;MACnCI,EAAE,EAAEH,KAAK;MACTC,KAAK,EAAEC,YAAY,GACfN,IAAI,CAACM,YAAY,CAACE,cAAc,EAAE;QAAEC,KAAK,EAAEH,YAAY,CAACG;MAAM,CAAC,CAAC,GAChET,IAAI,CAACK,KAAK;IAChB,CAAC;EAAA,CACH,CAAC;EAED,MAAM,CAAC;IAAEA,KAAK,EAAEK;EAAc,CAAC,CAAC,GAAGT,aAAa,CAACU,MAAM,CACrDC,KAAA;IAAA,IAAC;MAAEL;IAAG,CAAC,GAAAK,KAAA;IAAA,OAAKL,EAAE,KAAKV,QAAQ;EAAA,CAC7B,CAAC;EAED,OACEJ,KAAA,CAAAoB,aAAA;IAAKC,SAAS,EAAC,mBAAmB;IAAC,eAAY;EAAkB,GAC/DrB,KAAA,CAAAoB,aAAA,CAACnB,MAAM;IACLI,OAAO,EAAEG,aAAc;IACvBc,iBAAiB,EAAEf,IAAI,CAAC,QAAQ,CAAE;IAClCgB,cAAc,EAAE;MAAET,EAAE,EAAEV,QAAQ;MAAEQ,KAAK,EAAEK;IAAc,CAAE;IACvDO,iBAAiB,EAAEC,KAAA;MAAA,IAAC;QAAEX;MAAG,CAAC,GAAAW,KAAA;MAAA,OAAKnB,QAAQ,CAACQ,EAAO,CAAC;IAAA;EAAC,CAClD,CACE,CAAC;AAEV,CAAC;AAED,SAASZ,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"TimeUnitSelect.js","names":["_monoI18n","require","_react","_interopRequireDefault","_Select","e","__esModule","default","TimeUnitSelect","_ref","selected","options","callback","lang","useLocale","selectOptions","map","_ref2","value","label","tooltipLabel","id","translationKey","count","selectedLabel","filter","_ref3","createElement","className","Select","searchPlaceholder","selectedOption","setSelectedOption","_ref4","exports"],"sources":["../../../../src/components/TimeUnitSwitch/TimeUnitSelect.tsx"],"sourcesContent":["import { useLocale } from '@oanda/mono-i18n';\nimport React from 'react';\n\nimport type { SelectOption } from '../Select';\nimport { Select } from '../Select';\nimport type { TimeUnitSwitchProps } from './types';\n\nconst TimeUnitSelect = <T extends string>({\n selected,\n options,\n callback,\n}: TimeUnitSwitchProps<T>) => {\n const { lang } = useLocale();\n\n const selectOptions: SelectOption[] = options.map(\n ({ value, label, tooltipLabel }) => ({\n id: value,\n label: tooltipLabel\n ? lang(tooltipLabel.translationKey, { count: tooltipLabel.count })\n : lang(label),\n })\n );\n\n const [{ label: selectedLabel }] = selectOptions.filter(\n ({ id }) => id === selected\n );\n\n return (\n <div className=\"lw-mb-6 lw-w-full\" data-testid=\"time-unit-select\">\n <Select\n options={selectOptions}\n searchPlaceholder={lang('search')}\n selectedOption={{ id: selected, label: selectedLabel }}\n setSelectedOption={({ id }) => callback(id as T)}\n />\n </div>\n );\n};\n\nexport { TimeUnitSelect };\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,OAAA,GAAAH,OAAA;AAAmC,SAAAE,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGnC,MAAMG,cAAc,GAAGC,IAAA,IAIO;EAAA,IAJY;IACxCC,QAAQ;IACRC,OAAO;IACPC;EACsB,CAAC,GAAAH,IAAA;EACvB,MAAM;IAAEI;EAAK,CAAC,GAAG,IAAAC,mBAAS,EAAC,CAAC;EAE5B,MAAMC,aAA6B,GAAGJ,OAAO,CAACK,GAAG,CAC/CC,KAAA;IAAA,IAAC;MAAEC,KAAK;MAAEC,KAAK;MAAEC;IAAa,CAAC,GAAAH,KAAA;IAAA,OAAM;MACnCI,EAAE,EAAEH,KAAK;MACTC,KAAK,EAAEC,YAAY,GACfP,IAAI,CAACO,YAAY,CAACE,cAAc,EAAE;QAAEC,KAAK,EAAEH,YAAY,CAACG;MAAM,CAAC,CAAC,GAChEV,IAAI,CAACM,KAAK;IAChB,CAAC;EAAA,CACH,CAAC;EAED,MAAM,CAAC;IAAEA,KAAK,EAAEK;EAAc,CAAC,CAAC,GAAGT,aAAa,CAACU,MAAM,CACrDC,KAAA;IAAA,IAAC;MAAEL;IAAG,CAAC,GAAAK,KAAA;IAAA,OAAKL,EAAE,KAAKX,QAAQ;EAAA,CAC7B,CAAC;EAED,OACER,MAAA,CAAAK,OAAA,CAAAoB,aAAA;IAAKC,SAAS,EAAC,mBAAmB;IAAC,eAAY;EAAkB,GAC/D1B,MAAA,CAAAK,OAAA,CAAAoB,aAAA,CAACvB,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