@tsingroc/tsingroc-components 5.0.1 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/dist/components/BarLineChart/BarLineChart.module.css +10 -0
  2. package/dist/components/BarLineChart/index.d.ts +66 -0
  3. package/dist/components/BarLineChart/index.js +590 -0
  4. package/dist/components/BaseBarChart/BaseBarChart.module.css +12 -0
  5. package/dist/components/BaseBarChart/index.d.ts +33 -0
  6. package/dist/components/BaseBarChart/index.js +121 -0
  7. package/dist/components/DataCellNumber/DataCellNumber.module.css +20 -0
  8. package/dist/components/DataCellNumber/index.d.ts +14 -0
  9. package/dist/components/DataCellNumber/index.js +142 -0
  10. package/dist/components/FlexColLayout/index.d.ts +6 -0
  11. package/dist/components/FlexColLayout/index.js +40 -0
  12. package/dist/components/FlexRowLayout/index.d.ts +5 -0
  13. package/dist/components/FlexRowLayout/index.js +45 -0
  14. package/dist/components/HighlightSyncedECharts/index.d.ts +47 -0
  15. package/dist/components/HighlightSyncedECharts/index.js +260 -0
  16. package/dist/components/HighlightSyncedTable/index.d.ts +8 -0
  17. package/dist/components/HighlightSyncedTable/index.js +183 -0
  18. package/dist/components/LoadingSection/index.d.ts +41 -0
  19. package/dist/components/LoadingSection/index.js +183 -0
  20. package/dist/components/LoadingSkeleton/index.d.ts +42 -0
  21. package/dist/components/LoadingSkeleton/index.js +634 -0
  22. package/dist/components/ScrollableTable/ScrollableTable.module.css +21 -0
  23. package/dist/components/ScrollableTable/index.d.ts +13 -0
  24. package/dist/components/ScrollableTable/index.js +29 -0
  25. package/dist/components/TsingrocTable/TsingrocTable.module.css +32 -0
  26. package/dist/components/TsingrocTable/index.d.ts +12 -0
  27. package/dist/components/TsingrocTable/index.js +23 -0
  28. package/dist/components/TsingrocTheme/index.js +3 -3
  29. package/dist/index.d.ts +4 -0
  30. package/dist/index.js +4 -0
  31. package/dist/pages/DayAheadReviewPage/components/PricePlot/index.d.ts +7 -0
  32. package/dist/pages/DayAheadReviewPage/components/PricePlot/index.js +136 -0
  33. package/dist/pages/DayAheadReviewPage/components/ProfitBarChart/ProfitBarChart.module.css +13 -0
  34. package/dist/pages/DayAheadReviewPage/components/ProfitBarChart/index.d.ts +17 -0
  35. package/dist/pages/DayAheadReviewPage/components/ProfitBarChart/index.js +278 -0
  36. package/dist/pages/DayAheadReviewPage/components/RevenueCard/RevenueCard.module.css +40 -0
  37. package/dist/pages/DayAheadReviewPage/components/RevenueCard/index.d.ts +9 -0
  38. package/dist/pages/DayAheadReviewPage/components/RevenueCard/index.js +195 -0
  39. package/dist/pages/DayAheadReviewPage/components/RevenueSummaryCard/RevenueSummaryCard.module.css +38 -0
  40. package/dist/pages/DayAheadReviewPage/components/RevenueSummaryCard/index.d.ts +10 -0
  41. package/dist/pages/DayAheadReviewPage/components/RevenueSummaryCard/index.js +117 -0
  42. package/dist/pages/DayAheadReviewPage/components/ReviewLineChart/ReviewLineChart.module.css +11 -0
  43. package/dist/pages/DayAheadReviewPage/components/ReviewLineChart/index.d.ts +53 -0
  44. package/dist/pages/DayAheadReviewPage/components/ReviewLineChart/index.js +398 -0
  45. package/dist/pages/DayAheadReviewPage/components/ReviewSummaryTable/ReviewSummaryTable.module.css +33 -0
  46. package/dist/pages/DayAheadReviewPage/components/ReviewSummaryTable/index.d.ts +17 -0
  47. package/dist/pages/DayAheadReviewPage/components/ReviewSummaryTable/index.js +187 -0
  48. package/dist/pages/DayAheadReviewPage/components/StrategyPlot/index.d.ts +10 -0
  49. package/dist/pages/DayAheadReviewPage/components/StrategyPlot/index.js +223 -0
  50. package/dist/pages/DayAheadReviewPage/components/SummaryTable/index.d.ts +7 -0
  51. package/dist/pages/DayAheadReviewPage/components/SummaryTable/index.js +39 -0
  52. package/dist/pages/DayAheadReviewPage/components/SummaryTable/useTableColumns.d.ts +10 -0
  53. package/dist/pages/DayAheadReviewPage/components/SummaryTable/useTableColumns.js +307 -0
  54. package/dist/pages/DayAheadReviewPage/hook/useDayAheadReviewDate.d.ts +137 -0
  55. package/dist/pages/DayAheadReviewPage/hook/useDayAheadReviewDate.js +252 -0
  56. package/dist/pages/DayAheadReviewPage/index.d.ts +149 -0
  57. package/dist/pages/DayAheadReviewPage/index.js +259 -0
  58. package/dist/pages/DayAheadReviewPage/layout/LeftChartContainer.d.ts +12 -0
  59. package/dist/pages/DayAheadReviewPage/layout/LeftChartContainer.js +236 -0
  60. package/dist/pages/DayAheadReviewPage/layout/ReviewPageLayout.d.ts +4 -0
  61. package/dist/pages/DayAheadReviewPage/layout/ReviewPageLayout.js +32 -0
  62. package/dist/pages/DayAheadReviewPage/layout/RightSummaryContainer.d.ts +14 -0
  63. package/dist/pages/DayAheadReviewPage/layout/RightSummaryContainer.js +199 -0
  64. package/dist/pages/DayAheadReviewPage/layout/TopDayReviewHeader.d.ts +9 -0
  65. package/dist/pages/DayAheadReviewPage/layout/TopDayReviewHeader.js +115 -0
  66. package/dist/pages/DayAheadReviewPage/types/dayahead.d.ts +172 -0
  67. package/dist/pages/DayAheadReviewPage/types/dayahead.js +1 -0
  68. package/dist/utils/accessibility.d.ts +114 -0
  69. package/dist/utils/accessibility.js +214 -0
  70. package/dist/utils/constants.d.ts +18 -0
  71. package/dist/utils/constants.js +34 -0
  72. package/dist/utils/export.d.ts +10 -0
  73. package/dist/utils/export.js +72 -0
  74. package/dist/utils/formatters.d.ts +46 -0
  75. package/dist/utils/formatters.js +84 -0
  76. package/dist/utils/index.d.ts +1 -0
  77. package/dist/utils/index.js +1 -0
  78. package/dist/utils/presenters.d.ts +24 -0
  79. package/dist/utils/presenters.js +48 -0
  80. package/dist/utils/ui.d.ts +116 -0
  81. package/dist/utils/ui.js +171 -0
  82. package/package.json +32 -31
@@ -0,0 +1,398 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { Card } from "antd";
3
+ import dayjs from "dayjs";
4
+ import utc from "dayjs/plugin/utc";
5
+ import { HighlightSyncedECharts } from "#src";
6
+ import * as echarts from "#src/echarts";
7
+ import { COLOR_CHART_AXIS } from "#src/utils/constants";
8
+ import styles from "./ReviewLineChart.module.css";
9
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
+ dayjs.extend(utc);
11
+ const DEFAULT_GRID_OPTION = {
12
+ left: "3%",
13
+ top: 20,
14
+ bottom: 0,
15
+ right: 0
16
+ };
17
+ const AXIS_COLOR = "#ADADAD";
18
+ const AXIS_FONT_SIZE = 11;
19
+ /**
20
+ * Generate default hourly time data (0:00 to 23:00)
21
+ * @param useUtc - If true, generate UTC timestamps (Z suffix); otherwise generate local timestamps with +08:00 offset
22
+ */
23
+ const generateDefaultHourlyData = useUtc => {
24
+ if (useUtc) {
25
+ // UTC mode: generate timestamps with Z suffix
26
+ return Array.from({
27
+ length: 24
28
+ }, (_, i) => dayjs.utc().startOf("day").add(i, "hour").toISOString());
29
+ }
30
+ // Local mode: generate timestamps with +08:00 offset to match API format
31
+ return Array.from({
32
+ length: 24
33
+ }, (_, i) => dayjs().startOf("day").add(i, "hour").format("YYYY-MM-DDTHH:mm:ss+08:00"));
34
+ };
35
+
36
+ /**
37
+ * Format time strings to HH:mm format or keep date format (YYYY-MM-DD or MM-DD)
38
+ */
39
+ const formatTimeData = (timeData, useUtc, excludeTrailing24, isDefaultHourlyData) => {
40
+ if (timeData.length === 0) {
41
+ // Empty chart - show appropriate placeholders based on chart type
42
+ if (isDefaultHourlyData) {
43
+ // Hourly chart: show time labels from 00:00 to 23:00
44
+ return Array.from({
45
+ length: 24
46
+ }, (_, i) => `${String(i).padStart(2, "0")}:00`);
47
+ }
48
+ // Daily chart: show MM-DD format placeholders
49
+ return ["03-01", "03-02", "03-03"];
50
+ }
51
+
52
+ // Check if data is in daily date format (YYYY-MM-DD or MM-DD) vs time format
53
+ const firstItem = timeData[0];
54
+ const isDailyDateFormat = firstItem?.match(/^\d{4}-\d{2}-\d{2}$/) || firstItem?.match(/^\d{2}-\d{2}$/);
55
+ if (isDailyDateFormat) {
56
+ // Keep date format as-is (either YYYY-MM-DD or MM-DD)
57
+ return timeData;
58
+ }
59
+
60
+ // Original time formatting logic for HH:mm format
61
+ const formatted = timeData.map(timeStr => {
62
+ const parsed = useUtc ? dayjs.utc(timeStr) : dayjs(timeStr);
63
+ return parsed.format("HH:mm");
64
+ });
65
+
66
+ // Only append "24:00" if explicitly requested (excludeTrailing24 is false)
67
+ // This prevents mismatch between x-axis labels and series data length
68
+ if (excludeTrailing24) {
69
+ return formatted;
70
+ }
71
+
72
+ // Check if the last time point is already 23:XX (close to end of day)
73
+ // If so, don't append "24:00" to avoid series data mismatch
74
+ const lastFormatted = formatted[formatted.length - 1];
75
+ if (lastFormatted?.startsWith("23")) {
76
+ return formatted;
77
+ }
78
+ return formatted.concat("24:00");
79
+ };
80
+
81
+ /**
82
+ * Calculate x-axis interval for label display
83
+ */
84
+ const calculateInterval = (xAxisInterval, timeIntervalMinutes, hasData, isDefaultHourlyData, dataLength) => {
85
+ // If explicitly provided, use it
86
+ if (xAxisInterval !== undefined) {
87
+ return typeof xAxisInterval === "function" ? xAxisInterval(dataLength) : xAxisInterval;
88
+ }
89
+
90
+ // Calculate default based on time interval (show every 2 hours)
91
+ if (hasData && timeIntervalMinutes !== undefined) {
92
+ return 120 / timeIntervalMinutes - 1;
93
+ }
94
+
95
+ // Default hourly data: show every 2 hours (interval 1)
96
+ if (isDefaultHourlyData) {
97
+ return 1;
98
+ }
99
+ return undefined;
100
+ };
101
+ const ReviewLineChart = t0 => {
102
+ const $ = _c(49);
103
+ const {
104
+ title,
105
+ className,
106
+ chartClassName,
107
+ gridOption,
108
+ xAxisData,
109
+ xAxisInterval,
110
+ timeIntervalMinutes,
111
+ useUtc: t1,
112
+ excludeTrailing24: t2,
113
+ series,
114
+ legendData,
115
+ legendOption,
116
+ legendSelected,
117
+ showTitle: t3,
118
+ yAxisName,
119
+ yAxisNameLocation,
120
+ yAxisNamePadding
121
+ } = t0;
122
+ const useUtc = t1 === undefined ? false : t1;
123
+ const excludeTrailing24 = t2 === undefined ? false : t2;
124
+ const showTitle = t3 === undefined ? false : t3;
125
+ const hasData = Boolean(xAxisData && xAxisData.length > 0);
126
+ let T0;
127
+ let T1;
128
+ let t4;
129
+ let t5;
130
+ let t6;
131
+ let t7;
132
+ let t8;
133
+ let t9;
134
+ if ($[0] !== chartClassName || $[1] !== className || $[2] !== excludeTrailing24 || $[3] !== gridOption?.bottom || $[4] !== gridOption?.left || $[5] !== gridOption?.right || $[6] !== gridOption?.top || $[7] !== hasData || $[8] !== legendData || $[9] !== legendOption || $[10] !== legendSelected || $[11] !== series || $[12] !== timeIntervalMinutes || $[13] !== title || $[14] !== useUtc || $[15] !== xAxisData || $[16] !== xAxisInterval || $[17] !== yAxisName || $[18] !== yAxisNameLocation || $[19] !== yAxisNamePadding) {
135
+ const effectiveXAxisData = hasData && xAxisData ? xAxisData : generateDefaultHourlyData(useUtc);
136
+ const isDefaultHourlyData = !hasData;
137
+ const firstItem = effectiveXAxisData[0];
138
+ const isDailyDateFormat = firstItem?.match(/^\d{4}-\d{2}-\d{2}$/) || firstItem?.match(/^\d{2}-\d{2}$/);
139
+ const formattedXAxisData = formatTimeData(effectiveXAxisData, useUtc, excludeTrailing24, isDefaultHourlyData);
140
+ const interval = calculateInterval(xAxisInterval, timeIntervalMinutes, hasData, isDefaultHourlyData, effectiveXAxisData.length);
141
+ const finalGridOption = {
142
+ left: gridOption?.left ?? DEFAULT_GRID_OPTION.left,
143
+ top: gridOption?.top ?? DEFAULT_GRID_OPTION.top,
144
+ bottom: gridOption?.bottom ?? DEFAULT_GRID_OPTION.bottom,
145
+ right: gridOption?.right ?? DEFAULT_GRID_OPTION.right
146
+ };
147
+ T1 = Card;
148
+ t7 = className ?? styles.reviewLineChart;
149
+ let t10;
150
+ if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
151
+ t8 = {
152
+ body: {
153
+ height: "100%",
154
+ width: "100%",
155
+ padding: 0,
156
+ minHeight: 200,
157
+ display: "flex",
158
+ flexDirection: "column"
159
+ }
160
+ };
161
+ t10 = {
162
+ fontSize: "1.1rem"
163
+ };
164
+ $[28] = t10;
165
+ $[29] = t8;
166
+ } else {
167
+ t10 = $[28];
168
+ t8 = $[29];
169
+ }
170
+ if ($[30] !== title) {
171
+ t9 = /*#__PURE__*/_jsx("div", {
172
+ style: t10,
173
+ children: /*#__PURE__*/_jsx("span", {
174
+ children: title
175
+ })
176
+ });
177
+ $[30] = title;
178
+ $[31] = t9;
179
+ } else {
180
+ t9 = $[31];
181
+ }
182
+ T0 = HighlightSyncedECharts;
183
+ t5 = chartClassName ?? styles.reviewLineChartContainer;
184
+ if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
185
+ t6 = {
186
+ height: "100%",
187
+ width: "100%"
188
+ };
189
+ $[32] = t6;
190
+ } else {
191
+ t6 = $[32];
192
+ }
193
+ t4 = echarts.buildEChartsOption({}, echarts.grid({
194
+ option: finalGridOption,
195
+ xAxis: {
196
+ type: "category",
197
+ data: formattedXAxisData,
198
+ boundaryGap: false,
199
+ show: true,
200
+ axisLine: {
201
+ show: true,
202
+ lineStyle: {
203
+ color: AXIS_COLOR,
204
+ width: 1
205
+ }
206
+ },
207
+ axisTick: {
208
+ show: true,
209
+ ...(interval !== undefined && {
210
+ interval
211
+ })
212
+ },
213
+ axisLabel: {
214
+ show: true,
215
+ ...(interval !== undefined && {
216
+ interval
217
+ }),
218
+ color: AXIS_COLOR,
219
+ fontSize: AXIS_FONT_SIZE,
220
+ rotate: isDailyDateFormat && formattedXAxisData.length > 8 ? 45 : 0
221
+ },
222
+ axisPointer: {
223
+ animation: false
224
+ }
225
+ },
226
+ yAxis: {
227
+ name: yAxisName,
228
+ nameLocation: yAxisNameLocation,
229
+ show: true,
230
+ scale: false,
231
+ nameRotate: 0,
232
+ nameGap: 10,
233
+ nameTextStyle: yAxisName ? {
234
+ color: COLOR_CHART_AXIS,
235
+ ...(yAxisNamePadding && {
236
+ padding: yAxisNamePadding
237
+ })
238
+ } : undefined,
239
+ axisLabel: {
240
+ show: true,
241
+ color: AXIS_COLOR,
242
+ fontSize: AXIS_FONT_SIZE
243
+ },
244
+ axisLine: {
245
+ show: false
246
+ },
247
+ splitLine: {
248
+ show: true,
249
+ lineStyle: {
250
+ opacity: 0.5
251
+ }
252
+ }
253
+ },
254
+ series: series.map(_temp)
255
+ }), echarts.legend({
256
+ data: legendData,
257
+ option: {
258
+ itemHeight: 14,
259
+ itemWidth: 25,
260
+ itemGap: 12,
261
+ textStyle: {
262
+ fontSize: 12,
263
+ color: "#666"
264
+ },
265
+ ...(legendSelected && {
266
+ selected: legendSelected
267
+ }),
268
+ ...legendOption
269
+ }
270
+ }), echarts.tooltip({
271
+ backgroundColor: "rgba(255, 255, 255, 0.95)",
272
+ borderColor: COLOR_CHART_AXIS,
273
+ position: _temp2
274
+ }));
275
+ $[0] = chartClassName;
276
+ $[1] = className;
277
+ $[2] = excludeTrailing24;
278
+ $[3] = gridOption?.bottom;
279
+ $[4] = gridOption?.left;
280
+ $[5] = gridOption?.right;
281
+ $[6] = gridOption?.top;
282
+ $[7] = hasData;
283
+ $[8] = legendData;
284
+ $[9] = legendOption;
285
+ $[10] = legendSelected;
286
+ $[11] = series;
287
+ $[12] = timeIntervalMinutes;
288
+ $[13] = title;
289
+ $[14] = useUtc;
290
+ $[15] = xAxisData;
291
+ $[16] = xAxisInterval;
292
+ $[17] = yAxisName;
293
+ $[18] = yAxisNameLocation;
294
+ $[19] = yAxisNamePadding;
295
+ $[20] = T0;
296
+ $[21] = T1;
297
+ $[22] = t4;
298
+ $[23] = t5;
299
+ $[24] = t6;
300
+ $[25] = t7;
301
+ $[26] = t8;
302
+ $[27] = t9;
303
+ } else {
304
+ T0 = $[20];
305
+ T1 = $[21];
306
+ t4 = $[22];
307
+ t5 = $[23];
308
+ t6 = $[24];
309
+ t7 = $[25];
310
+ t8 = $[26];
311
+ t9 = $[27];
312
+ }
313
+ let t10;
314
+ if ($[33] !== showTitle) {
315
+ t10 = showTitle && {
316
+ title: {
317
+ left: "center",
318
+ top: 10,
319
+ textStyle: {
320
+ fontSize: 16,
321
+ fontWeight: 500
322
+ }
323
+ }
324
+ };
325
+ $[33] = showTitle;
326
+ $[34] = t10;
327
+ } else {
328
+ t10 = $[34];
329
+ }
330
+ let t11;
331
+ if ($[35] !== t10 || $[36] !== t4) {
332
+ t11 = {
333
+ ...t4,
334
+ ...t10
335
+ };
336
+ $[35] = t10;
337
+ $[36] = t4;
338
+ $[37] = t11;
339
+ } else {
340
+ t11 = $[37];
341
+ }
342
+ let t12;
343
+ if ($[38] !== T0 || $[39] !== t11 || $[40] !== t5 || $[41] !== t6) {
344
+ t12 = /*#__PURE__*/_jsx(T0, {
345
+ className: t5,
346
+ style: t6,
347
+ option: t11
348
+ });
349
+ $[38] = T0;
350
+ $[39] = t11;
351
+ $[40] = t5;
352
+ $[41] = t6;
353
+ $[42] = t12;
354
+ } else {
355
+ t12 = $[42];
356
+ }
357
+ let t13;
358
+ if ($[43] !== T1 || $[44] !== t12 || $[45] !== t7 || $[46] !== t8 || $[47] !== t9) {
359
+ t13 = /*#__PURE__*/_jsxs(T1, {
360
+ className: t7,
361
+ styles: t8,
362
+ children: [t9, t12]
363
+ });
364
+ $[43] = T1;
365
+ $[44] = t12;
366
+ $[45] = t7;
367
+ $[46] = t8;
368
+ $[47] = t9;
369
+ $[48] = t13;
370
+ } else {
371
+ t13 = $[48];
372
+ }
373
+ return t13;
374
+ };
375
+ export default ReviewLineChart;
376
+ function _temp(seriesConfig) {
377
+ return echarts.lineSeries({
378
+ name: seriesConfig.name,
379
+ data: seriesConfig.data,
380
+ option: {
381
+ ...seriesConfig.option,
382
+ triggerLineEvent: true
383
+ }
384
+ });
385
+ }
386
+ function _temp2(t0, _0, _1, _2, t1) {
387
+ const [x, y] = t0;
388
+ const {
389
+ viewSize: t2,
390
+ contentSize: t3
391
+ } = t1;
392
+ const [vw, vh] = t2;
393
+ const [, ch] = t3;
394
+ return {
395
+ left: x + vw / 100,
396
+ top: Math.min(y + vw / 100, vh - ch)
397
+ };
398
+ }
@@ -0,0 +1,33 @@
1
+ /* Block: review-summary-table */
2
+ .review-summary-table {
3
+ display: flex;
4
+ flex-direction: column;
5
+ border: 0px;
6
+ width: 100%;
7
+ }
8
+
9
+ .header {
10
+ display: flex;
11
+ justify-content: space-between;
12
+ align-items: center;
13
+ }
14
+
15
+ .header-title {
16
+ font-size: 1.25rem;
17
+ }
18
+
19
+ .header-actions {
20
+ display: flex;
21
+ align-items: center;
22
+ gap: 16px;
23
+ }
24
+
25
+ .header-actions_export-button {
26
+ border-radius: 8px;
27
+ }
28
+
29
+ .table-container {
30
+ min-height: 0;
31
+ flex: 1;
32
+ border-radius: 6px;
33
+ }
@@ -0,0 +1,17 @@
1
+ import type { ColumnType } from "antd/es/table";
2
+ import { type ReactNode } from "react";
3
+ export type FilterOption = "all" | "agent" | "manual";
4
+ export interface ReviewSummaryTableProps<T extends Record<string, any> & {
5
+ index: number;
6
+ }> {
7
+ data: Omit<T, "index">[];
8
+ columns: ColumnType<T>[];
9
+ tradingDay?: string;
10
+ onExport: (data: Omit<T, "index">[], date: string, filename: string) => void;
11
+ additionalActions?: ReactNode;
12
+ dataType?: 24 | 96;
13
+ }
14
+ declare const ReviewSummaryTable: <T extends Record<string, any> & {
15
+ index: number;
16
+ }>({ data, columns, tradingDay, onExport, additionalActions, dataType, }: ReviewSummaryTableProps<T>) => import("react/jsx-runtime").JSX.Element;
17
+ export default ReviewSummaryTable;
@@ -0,0 +1,187 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { Button, Card } from "antd";
3
+ import dayjs from "dayjs";
4
+ import { useMemo } from "react";
5
+ import { HighlightSyncedTable, TsingrocTable } from "#src";
6
+ import styles from "./ReviewSummaryTable.module.css";
7
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
+ const generateEmptyData = dataType => {
9
+ const intervalMinutes = dataType === 24 ? 60 : 15;
10
+ const rowCount = dataType;
11
+ return Array.from({
12
+ length: rowCount
13
+ }, (_, i) => {
14
+ const time = dayjs().startOf("day").add(i * intervalMinutes, "minute").format("YYYY-MM-DDTHH:mm");
15
+ const emptyRow = {
16
+ time
17
+ };
18
+ const numericFields = ["dayAheadPrice", "realTimePrice", "agentDeclaredPrice", "manualDeclaredPrice", "forecastVolume", "actualVolume", "agentDeclaredVolume", "manualDeclaredVolume", "agentClearanceVolume", "manualClearanceVolume", "clearanceVolume", "agentProfit", "manualProfit", "quotation", "tenDayPriceAgent", "tenDayAvgSpotPrice", "tenDayPriceManual", "monthHoldVolume", "tenDayClearanceVolume", "tenDayClearancePrice", "spotAvgPrice"];
19
+ numericFields.forEach(field => {
20
+ emptyRow[field] = null;
21
+ });
22
+ return emptyRow;
23
+ });
24
+ };
25
+ const ReviewSummaryTable = t0 => {
26
+ const $ = _c(25);
27
+ const {
28
+ data,
29
+ columns,
30
+ tradingDay,
31
+ onExport,
32
+ additionalActions,
33
+ dataType: t1
34
+ } = t0;
35
+ const dataType = t1 === undefined ? 24 : t1;
36
+ const hasData = data.length > 0;
37
+ let t2;
38
+ if ($[0] !== data || $[1] !== dataType || $[2] !== hasData) {
39
+ t2 = hasData ? data : generateEmptyData(dataType);
40
+ $[0] = data;
41
+ $[1] = dataType;
42
+ $[2] = hasData;
43
+ $[3] = t2;
44
+ } else {
45
+ t2 = $[3];
46
+ }
47
+ const effectiveData = t2;
48
+ let t3;
49
+ if ($[4] !== effectiveData) {
50
+ t3 = effectiveData.map(_temp);
51
+ $[4] = effectiveData;
52
+ $[5] = t3;
53
+ } else {
54
+ t3 = $[5];
55
+ }
56
+ const indexedData = t3;
57
+ let t4;
58
+ if ($[6] !== data || $[7] !== onExport || $[8] !== tradingDay) {
59
+ t4 = () => {
60
+ const date = tradingDay || dayjs().format("YYYY-MM-DD");
61
+ const filename = `day-ahead-review-${date}.csv`;
62
+ onExport(data, date, filename);
63
+ };
64
+ $[6] = data;
65
+ $[7] = onExport;
66
+ $[8] = tradingDay;
67
+ $[9] = t4;
68
+ } else {
69
+ t4 = $[9];
70
+ }
71
+ const handleExport = t4;
72
+ let t5;
73
+ if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
74
+ t5 = {
75
+ body: {
76
+ display: "flex",
77
+ flexDirection: "column",
78
+ padding: 0,
79
+ gap: 12,
80
+ flex: 1,
81
+ minHeight: 0
82
+ }
83
+ };
84
+ $[10] = t5;
85
+ } else {
86
+ t5 = $[10];
87
+ }
88
+ let t6;
89
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
90
+ t6 = /*#__PURE__*/_jsx("div", {
91
+ className: styles["header-title"],
92
+ children: "\u6570\u636E\u660E\u7EC6"
93
+ });
94
+ $[11] = t6;
95
+ } else {
96
+ t6 = $[11];
97
+ }
98
+ let t7;
99
+ if ($[12] !== handleExport) {
100
+ t7 = /*#__PURE__*/_jsx(Button, {
101
+ type: "primary",
102
+ className: styles["header-actions_export-button"],
103
+ onClick: handleExport,
104
+ children: "\u5BFC\u51FA\u6570\u636E"
105
+ });
106
+ $[12] = handleExport;
107
+ $[13] = t7;
108
+ } else {
109
+ t7 = $[13];
110
+ }
111
+ let t8;
112
+ if ($[14] !== additionalActions || $[15] !== t7) {
113
+ t8 = /*#__PURE__*/_jsxs("div", {
114
+ className: styles.header,
115
+ children: [t6, /*#__PURE__*/_jsxs("div", {
116
+ className: styles["header-actions"],
117
+ children: [additionalActions, t7]
118
+ })]
119
+ });
120
+ $[14] = additionalActions;
121
+ $[15] = t7;
122
+ $[16] = t8;
123
+ } else {
124
+ t8 = $[16];
125
+ }
126
+ let t9;
127
+ if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
128
+ t9 = {
129
+ flex: 1,
130
+ minHeight: 0,
131
+ display: "flex"
132
+ };
133
+ $[17] = t9;
134
+ } else {
135
+ t9 = $[17];
136
+ }
137
+ let t10;
138
+ if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
139
+ t10 = {
140
+ x: true
141
+ };
142
+ $[18] = t10;
143
+ } else {
144
+ t10 = $[18];
145
+ }
146
+ let t11;
147
+ if ($[19] !== columns || $[20] !== indexedData) {
148
+ t11 = /*#__PURE__*/_jsx("div", {
149
+ style: t9,
150
+ children: /*#__PURE__*/_jsx(HighlightSyncedTable, {
151
+ dataSource: indexedData,
152
+ columns: columns,
153
+ rowKey: "index",
154
+ scroll: t10,
155
+ pagination: false,
156
+ size: "small",
157
+ className: TsingrocTable.style + " " + styles["table-container"]
158
+ })
159
+ });
160
+ $[19] = columns;
161
+ $[20] = indexedData;
162
+ $[21] = t11;
163
+ } else {
164
+ t11 = $[21];
165
+ }
166
+ let t12;
167
+ if ($[22] !== t11 || $[23] !== t8) {
168
+ t12 = /*#__PURE__*/_jsxs(Card, {
169
+ className: styles["review-summary-table"],
170
+ styles: t5,
171
+ children: [t8, t11]
172
+ });
173
+ $[22] = t11;
174
+ $[23] = t8;
175
+ $[24] = t12;
176
+ } else {
177
+ t12 = $[24];
178
+ }
179
+ return t12;
180
+ };
181
+ export default ReviewSummaryTable;
182
+ function _temp(it, index) {
183
+ return {
184
+ ...it,
185
+ index
186
+ };
187
+ }
@@ -0,0 +1,10 @@
1
+ import type { StrategyPlotValue } from "../../types/dayahead";
2
+ import type { FilterOption } from "../ReviewSummaryTable";
3
+ type StrategyPlotProps = {
4
+ data: StrategyPlotValue[];
5
+ hasManualData: boolean;
6
+ filterValue?: FilterOption;
7
+ };
8
+ declare const StrategyPlot: ({ data, hasManualData, filterValue }: StrategyPlotProps) => import("react/jsx-runtime").JSX.Element;
9
+ export default StrategyPlot;
10
+ export type { StrategyPlotValue };