@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,199 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import Card from "antd/es/card";
3
+ import { useMemo } from "react";
4
+ import { LoadingSkeleton } from "#src/components/LoadingSkeleton";
5
+ import RevenueSummaryCard from "../components/RevenueSummaryCard";
6
+ import SummaryTable from "../components/SummaryTable";
7
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
8
+ const RightSummaryContainer = t0 => {
9
+ const $ = _c(30);
10
+ const {
11
+ data,
12
+ date,
13
+ hasManualData,
14
+ filterValue,
15
+ loading: t1,
16
+ profitAgentData,
17
+ profitManualData,
18
+ onExport
19
+ } = t0;
20
+ const loading = t1 === undefined ? false : t1;
21
+ let t2;
22
+ if ($[0] !== profitAgentData) {
23
+ t2 = profitAgentData ?? [];
24
+ $[0] = profitAgentData;
25
+ $[1] = t2;
26
+ } else {
27
+ t2 = $[1];
28
+ }
29
+ const agentProfits = t2;
30
+ let t3;
31
+ if ($[2] !== profitManualData) {
32
+ t3 = profitManualData ?? [];
33
+ $[2] = profitManualData;
34
+ $[3] = t3;
35
+ } else {
36
+ t3 = $[3];
37
+ }
38
+ const manualProfits = t3;
39
+ let t4;
40
+ if ($[4] !== agentProfits) {
41
+ t4 = agentProfits.reduce(_temp, 0);
42
+ $[4] = agentProfits;
43
+ $[5] = t4;
44
+ } else {
45
+ t4 = $[5];
46
+ }
47
+ let t5;
48
+ if ($[6] !== agentProfits) {
49
+ t5 = agentProfits.reduce(_temp2, 0);
50
+ $[6] = agentProfits;
51
+ $[7] = t5;
52
+ } else {
53
+ t5 = $[7];
54
+ }
55
+ let t6;
56
+ if ($[8] !== agentProfits) {
57
+ t6 = agentProfits.reduce(_temp3, 0);
58
+ $[8] = agentProfits;
59
+ $[9] = t6;
60
+ } else {
61
+ t6 = $[9];
62
+ }
63
+ let t7;
64
+ if ($[10] !== manualProfits) {
65
+ t7 = manualProfits.reduce(_temp4, 0);
66
+ $[10] = manualProfits;
67
+ $[11] = t7;
68
+ } else {
69
+ t7 = $[11];
70
+ }
71
+ let t8;
72
+ if ($[12] !== t4 || $[13] !== t5 || $[14] !== t6 || $[15] !== t7) {
73
+ t8 = {
74
+ agentProfitTotal: t4,
75
+ agentStrategyAddTotal: t5,
76
+ agentPredictBaselineTotal: t6,
77
+ manualProfitTotal: t7
78
+ };
79
+ $[12] = t4;
80
+ $[13] = t5;
81
+ $[14] = t6;
82
+ $[15] = t7;
83
+ $[16] = t8;
84
+ } else {
85
+ t8 = $[16];
86
+ }
87
+ const {
88
+ agentProfitTotal,
89
+ agentStrategyAddTotal,
90
+ agentPredictBaselineTotal,
91
+ manualProfitTotal
92
+ } = t8;
93
+ let t10;
94
+ let t9;
95
+ if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
96
+ t9 = {
97
+ flex: 1,
98
+ minHeight: 0,
99
+ display: "flex",
100
+ flexDirection: "column",
101
+ border: 0
102
+ };
103
+ t10 = {
104
+ body: {
105
+ padding: 16,
106
+ display: "flex",
107
+ flexDirection: "column",
108
+ gap: 12,
109
+ flex: 1,
110
+ minHeight: 0
111
+ }
112
+ };
113
+ $[17] = t10;
114
+ $[18] = t9;
115
+ } else {
116
+ t10 = $[17];
117
+ t9 = $[18];
118
+ }
119
+ let t11;
120
+ if ($[19] !== agentPredictBaselineTotal || $[20] !== agentProfitTotal || $[21] !== agentStrategyAddTotal || $[22] !== data || $[23] !== date || $[24] !== filterValue || $[25] !== hasManualData || $[26] !== loading || $[27] !== manualProfitTotal || $[28] !== onExport) {
121
+ t11 = /*#__PURE__*/_jsx(Card, {
122
+ style: t9,
123
+ styles: t10,
124
+ children: loading ? /*#__PURE__*/_jsxs(_Fragment, {
125
+ children: [/*#__PURE__*/_jsx("div", {
126
+ style: {
127
+ flexShrink: 0
128
+ },
129
+ children: /*#__PURE__*/_jsx(LoadingSkeleton, {
130
+ type: "summary",
131
+ rows: 2
132
+ })
133
+ }), /*#__PURE__*/_jsx("div", {
134
+ style: {
135
+ flex: 1,
136
+ minHeight: 0
137
+ },
138
+ children: /*#__PURE__*/_jsx(LoadingSkeleton, {
139
+ type: "table",
140
+ rows: 8
141
+ })
142
+ })]
143
+ }) : /*#__PURE__*/_jsxs(_Fragment, {
144
+ children: [/*#__PURE__*/_jsx("div", {
145
+ style: {
146
+ flexShrink: 0
147
+ },
148
+ children: /*#__PURE__*/_jsx(RevenueSummaryCard, {
149
+ hasManualData: hasManualData,
150
+ filterValue: filterValue,
151
+ agent_profit: agentProfitTotal,
152
+ agent_strategy_add: agentStrategyAddTotal,
153
+ agent_predict_baseline: agentPredictBaselineTotal,
154
+ manual_profit: manualProfitTotal
155
+ })
156
+ }), /*#__PURE__*/_jsx("div", {
157
+ style: {
158
+ flex: 1,
159
+ minHeight: 0,
160
+ display: "flex"
161
+ },
162
+ children: /*#__PURE__*/_jsx(SummaryTable, {
163
+ data: data,
164
+ tradingDay: date.format("YYYY-MM-DD"),
165
+ filterValue: filterValue,
166
+ onExport: onExport
167
+ })
168
+ })]
169
+ })
170
+ });
171
+ $[19] = agentPredictBaselineTotal;
172
+ $[20] = agentProfitTotal;
173
+ $[21] = agentStrategyAddTotal;
174
+ $[22] = data;
175
+ $[23] = date;
176
+ $[24] = filterValue;
177
+ $[25] = hasManualData;
178
+ $[26] = loading;
179
+ $[27] = manualProfitTotal;
180
+ $[28] = onExport;
181
+ $[29] = t11;
182
+ } else {
183
+ t11 = $[29];
184
+ }
185
+ return t11;
186
+ };
187
+ export default RightSummaryContainer;
188
+ function _temp(sum, item) {
189
+ return sum + (item.agentProfit ?? 0);
190
+ }
191
+ function _temp2(sum_0, item_0) {
192
+ return sum_0 + (item_0.agentStrategyAdd ?? 0);
193
+ }
194
+ function _temp3(sum_1, item_1) {
195
+ return sum_1 + (item_1.agentPredictBaseline ?? 0);
196
+ }
197
+ function _temp4(sum_2, item_2) {
198
+ return sum_2 + (item_2.manualProfit ?? 0);
199
+ }
@@ -0,0 +1,9 @@
1
+ import { type Dayjs } from "dayjs";
2
+ interface TopHeaderProps {
3
+ date: Dayjs;
4
+ setDate: (date: Dayjs) => void;
5
+ /** Optional disabled date function - if not provided, uses useDayAheadTradingDays hook */
6
+ disabledDate?: (current: Dayjs | null) => boolean;
7
+ }
8
+ declare const TopHeader: ({ date, setDate, disabledDate: disabledDateProp }: TopHeaderProps) => import("react/jsx-runtime").JSX.Element;
9
+ export default TopHeader;
@@ -0,0 +1,115 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { DatePicker } from "antd";
3
+ import dayjs from "dayjs";
4
+ import { useDayAheadTradingDays } from "#src/utils/presenters";
5
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
+ const TopHeader = t0 => {
7
+ const $ = _c(12);
8
+ const {
9
+ date,
10
+ setDate,
11
+ disabledDate: disabledDateProp
12
+ } = t0;
13
+ const {
14
+ disabledDate: disabledDateFromHook
15
+ } = useDayAheadTradingDays();
16
+ const disabledDate = disabledDateProp ?? disabledDateFromHook;
17
+ let t1;
18
+ let t2;
19
+ let t3;
20
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
21
+ t1 = {
22
+ display: "flex",
23
+ justifyContent: "space-between",
24
+ alignItems: "center"
25
+ };
26
+ t2 = {
27
+ display: "flex",
28
+ alignItems: "center",
29
+ gap: 24
30
+ };
31
+ t3 = /*#__PURE__*/_jsx("h2", {
32
+ style: {
33
+ margin: 0,
34
+ color: "#333",
35
+ fontStyle: "italic"
36
+ },
37
+ children: "\u65E5\u524D\u4EA4\u6613\u590D\u76D8"
38
+ });
39
+ $[0] = t1;
40
+ $[1] = t2;
41
+ $[2] = t3;
42
+ } else {
43
+ t1 = $[0];
44
+ t2 = $[1];
45
+ t3 = $[2];
46
+ }
47
+ let t4;
48
+ if ($[3] !== setDate) {
49
+ t4 = value => setDate(value ?? dayjs());
50
+ $[3] = setDate;
51
+ $[4] = t4;
52
+ } else {
53
+ t4 = $[4];
54
+ }
55
+ let t5;
56
+ if ($[5] !== date || $[6] !== disabledDate || $[7] !== t4) {
57
+ t5 = /*#__PURE__*/_jsxs("div", {
58
+ style: t2,
59
+ children: [t3, /*#__PURE__*/_jsx(DatePicker, {
60
+ value: date,
61
+ onChange: t4,
62
+ allowClear: false,
63
+ disabledDate: disabledDate
64
+ })]
65
+ });
66
+ $[5] = date;
67
+ $[6] = disabledDate;
68
+ $[7] = t4;
69
+ $[8] = t5;
70
+ } else {
71
+ t5 = $[8];
72
+ }
73
+ let t6;
74
+ if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
75
+ t6 = /*#__PURE__*/_jsxs("div", {
76
+ style: {
77
+ display: "flex",
78
+ alignItems: "baseline",
79
+ gap: 12
80
+ },
81
+ children: [/*#__PURE__*/_jsx("span", {
82
+ style: {
83
+ color: "var(--ant-color-text-label)"
84
+ },
85
+ children: "\u7535\u91CF\u5355\u4F4D:MWh"
86
+ }), /*#__PURE__*/_jsx("span", {
87
+ style: {
88
+ color: "var(--ant-color-text-label)"
89
+ },
90
+ children: "\u7535\u4EF7\u5355\u4F4D:\u5143/MWh"
91
+ }), /*#__PURE__*/_jsx("span", {
92
+ style: {
93
+ color: "var(--ant-color-text-label)"
94
+ },
95
+ children: "\u4EF7\u683C\u5355\u4F4D:\u5143"
96
+ })]
97
+ });
98
+ $[9] = t6;
99
+ } else {
100
+ t6 = $[9];
101
+ }
102
+ let t7;
103
+ if ($[10] !== t5) {
104
+ t7 = /*#__PURE__*/_jsxs("div", {
105
+ style: t1,
106
+ children: [t5, t6]
107
+ });
108
+ $[10] = t5;
109
+ $[11] = t7;
110
+ } else {
111
+ t7 = $[11];
112
+ }
113
+ return t7;
114
+ };
115
+ export default TopHeader;
@@ -0,0 +1,172 @@
1
+ /**
2
+ * Application/presentation types for Day-Ahead Review.
3
+ * Consumed by the presentation layer; mapped from API DTOs in useDayAheadReviewData.
4
+ *
5
+ * @packageDocumentation
6
+ */
7
+ /**
8
+ * Power/Volume data for the strategy comparison chart.
9
+ *
10
+ * Displays forecasted vs actual volumes alongside agent and manual
11
+ * declared and cleared volumes for performance comparison.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const powerData: StrategyPlotValue = {
16
+ * time: "2024-01-01T00:00",
17
+ * forecastVolume: 120.5, // MW
18
+ * actualVolume: 118.2, // MW
19
+ * agentDeclaredVolume: 115.0, // MW
20
+ * manualDeclaredVolume: 110.0, // MW (optional)
21
+ * agentClearanceVolume: 100.0, // MW
22
+ * manualClearanceVolume: 95.0, // MW (optional)
23
+ * };
24
+ * ```
25
+ */
26
+ export interface StrategyPlotValue {
27
+ /** ISO 8601 timestamp in format `YYYY-MM-DDTHH:mm` (e.g., "2024-01-01T00:00") */
28
+ time: string;
29
+ /** Forecasted load volume in MW (兆瓦) - predicted load for the period */
30
+ forecastVolume?: number | null;
31
+ /** Actual metered volume in MW (兆瓦) - real-time measured consumption */
32
+ actualVolume?: number | null;
33
+ /** Agent-declared bid volume in MW (兆瓦) - AI/algorithmic bid volume submitted to market */
34
+ agentDeclaredVolume?: number | null;
35
+ /** Manually-declared bid volume in MW (兆瓦) - human-adjusted bid volume (optional if manual mode not enabled) */
36
+ manualDeclaredVolume?: number | null;
37
+ /** Agent-cleared volume in MW (兆瓦) - volume matched in market clearing for agent bids */
38
+ agentClearanceVolume?: number | null;
39
+ /** Manually-cleared volume in MW (兆瓦) - volume matched in market clearing for manual bids (optional) */
40
+ manualClearanceVolume?: number | null;
41
+ }
42
+ /**
43
+ * Price data for the price trend chart.
44
+ *
45
+ * Compares day-ahead market prices with real-time prices and
46
+ * declared bid prices from both agent and manual strategies.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const priceData: PricePlotValue = {
51
+ * time: "2024-01-01T00:00",
52
+ * dayAheadPrice: 350.5, // RMB/MWh
53
+ * realTimePrice: 380.2, // RMB/MWh
54
+ * agentDeclaredPrice: 360.0, // RMB/MWh
55
+ * manualDeclaredPrice: 355.0, // RMB/MWh (optional)
56
+ * };
57
+ * ```
58
+ */
59
+ export interface PricePlotValue {
60
+ /** ISO 8601 timestamp in format `YYYY-MM-DDTHH:mm` (e.g., "2024-01-01T00:00") */
61
+ time: string;
62
+ /** Day-ahead market clearing price in RMB/MWh (元/兆瓦时) - official DAM clearing price */
63
+ dayAheadPrice?: number | null;
64
+ /** Real-time market price in RMB/MWh (元/兆瓦时) - actual real-time settlement price */
65
+ realTimePrice?: number | null;
66
+ /** Agent-declared bid price in RMB/MWh (元/兆瓦时) - price submitted in agent bids */
67
+ agentDeclaredPrice?: number | null;
68
+ /** Manually-declared bid price in RMB/MWh (元/兆瓦时) - price submitted in manual bids (optional) */
69
+ manualDeclaredPrice?: number | null;
70
+ }
71
+ /**
72
+ * Profit breakdown data for the profit distribution chart.
73
+ *
74
+ * Shows total profit with baseline prediction and strategy additive
75
+ * value for agent, plus optional manual profit for comparison.
76
+ *
77
+ * Profit Calculation Formula:
78
+ * - `agentProfit = (realTimePrice - agentDeclaredPrice) × agentClearanceVolume`
79
+ * - `agentPredictBaseline = (realTimePrice - dayAheadPrice) × clearanceVolume`
80
+ * - `agentStrategyAdd = agentProfit - agentPredictBaseline`
81
+ *
82
+ * @example
83
+ * ```ts
84
+ * const profitData: ProfitPlotValue = {
85
+ * time: "2024-01-01T00:00",
86
+ * agentProfit: 2015.0, // RMB
87
+ * agentPredictBaseline: 2970.0, // RMB
88
+ * agentStrategyAdd: -955.0, // RMB (negative = strategy underperformed baseline)
89
+ * manualProfit: 2375.5, // RMB (optional)
90
+ * };
91
+ * ```
92
+ */
93
+ export interface ProfitPlotValue {
94
+ /** ISO 8601 timestamp in format `YYYY-MM-DDTHH:mm` (e.g., "2024-01-01T00:00") */
95
+ time: string;
96
+ /** Total agent profit in RMB (元) - final realized profit from agent trading */
97
+ agentProfit?: number | null;
98
+ /** Agent baseline profit in RMB (元) - theoretical profit using passive day-ahead price strategy */
99
+ agentPredictBaseline?: number | null;
100
+ /** Agent strategy additive value in RMB (元) - marginal contribution of active strategy over baseline (can be negative) */
101
+ agentStrategyAdd?: number | null;
102
+ /** Total manual profit in RMB (元) - realized profit from manual trading (optional if manual mode not enabled) */
103
+ manualProfit?: number | null;
104
+ }
105
+ export interface RevenueSummaryCardProps {
106
+ agent_profit: number;
107
+ manual_profit: number;
108
+ }
109
+ export type ReviewSection = "standard" | "thermalQuote";
110
+ /**
111
+ * Combined data structure for the detail table and profit calculation.
112
+ *
113
+ * Extends both {@link StrategyPlotValue} and {@link PricePlotValue} to provide
114
+ * a comprehensive view of all trading data per time period, including
115
+ * profit metrics and optional thermal quotation data.
116
+ *
117
+ * This is the primary data type used in the detail table and serves as
118
+ * the source for profit chart data extraction.
119
+ *
120
+ * @example
121
+ * ```ts
122
+ * const tableRow: ExtendedReviewValue = {
123
+ * // From StrategyPlotValue
124
+ * time: "2024-01-01T00:00",
125
+ * forecastVolume: 120.5,
126
+ * actualVolume: 118.2,
127
+ * agentDeclaredVolume: 115.0,
128
+ * agentClearanceVolume: 100.0,
129
+ *
130
+ * // From PricePlotValue
131
+ * dayAheadPrice: 350.5,
132
+ * realTimePrice: 380.2,
133
+ * agentDeclaredPrice: 360.0,
134
+ *
135
+ * // Extended fields
136
+ * clearanceVolume: 100.0, // MW
137
+ * agentProfit: 2015.0, // RMB
138
+ * agentPredictBaseline: 2970.0, // RMB
139
+ * agentStrategyAdd: -955.0, // RMB
140
+ * manualProfit: 2375.5, // RMB (optional)
141
+ * quotation: 385.0, // RMB/MWh (optional)
142
+ * };
143
+ * ```
144
+ */
145
+ export interface ExtendedReviewValue extends PricePlotValue, StrategyPlotValue {
146
+ /**
147
+ * Clearance volume used in profit calculation in MW (兆瓦).
148
+ * This represents the volume actually settled in the market.
149
+ */
150
+ clearanceVolume?: number;
151
+ /** Total agent profit in RMB (元) - final realized profit from agent trading */
152
+ agentProfit?: number | null;
153
+ /** Agent baseline profit in RMB (元) - theoretical profit using passive day-ahead price strategy */
154
+ agentPredictBaseline?: number | null;
155
+ /** Agent strategy additive value in RMB (元) - marginal contribution of active strategy (can be negative) */
156
+ agentStrategyAdd?: number | null;
157
+ /** Total manual profit in RMB (元) - realized profit from manual trading (optional if manual mode not enabled) */
158
+ manualProfit?: number | null;
159
+ /** Thermal power quotation price in RMB/MWh (元/兆瓦时) - reference price for thermal bidding (optional) */
160
+ quotation?: number;
161
+ }
162
+ export interface TableProps {
163
+ data: ExtendedReviewValue[];
164
+ section?: ReviewSection;
165
+ tradingDay?: string;
166
+ onExport?: (data: ExtendedReviewValue[], date: string, filename: string) => void;
167
+ }
168
+ export type ProfitDataEndpointResponse = ProfitPlotValue[];
169
+ export type PriceDataEndpointResponse = PricePlotValue[];
170
+ export type PowerDataEndpointResponse = StrategyPlotValue[];
171
+ export type ReviewTableDataEndpointResponse = ExtendedReviewValue[];
172
+ export type FilterOption = "all" | "agent" | "manual";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,114 @@
1
+ import type { ButtonProps, InputProps } from "antd";
2
+ import type { ReactNode } from "react";
3
+ /**
4
+ * Accessibility utility functions and helpers
5
+ */
6
+ /**
7
+ * Generate a unique ID for accessibility attributes
8
+ */
9
+ export declare function generateAriaId(prefix: string): string;
10
+ /**
11
+ * Common ARIA labels for UI elements
12
+ */
13
+ export declare const ARIA_LABELS: {
14
+ readonly CLOSE: "关闭";
15
+ readonly OPEN: "打开";
16
+ readonly MENU: "菜单";
17
+ readonly SEARCH: "搜索";
18
+ readonly FILTER: "筛选";
19
+ readonly EXPORT: "导出";
20
+ readonly IMPORT: "导入";
21
+ readonly SAVE: "保存";
22
+ readonly CANCEL: "取消";
23
+ readonly CONFIRM: "确认";
24
+ readonly DELETE: "删除";
25
+ readonly EDIT: "编辑";
26
+ readonly ADD: "添加";
27
+ readonly REMOVE: "移除";
28
+ readonly REFRESH: "刷新";
29
+ readonly LOAD_MORE: "加载更多";
30
+ readonly PREVIOUS_PAGE: "上一页";
31
+ readonly NEXT_PAGE: "下一页";
32
+ readonly FIRST_PAGE: "首页";
33
+ readonly LAST_PAGE: "末页";
34
+ readonly LOADING: "加载中";
35
+ readonly SUCCESS: "成功";
36
+ readonly ERROR: "错误";
37
+ readonly WARNING: "警告";
38
+ readonly INFO: "信息";
39
+ };
40
+ /**
41
+ * ARIA roles for common UI patterns
42
+ */
43
+ export declare const ARIA_ROLES: {
44
+ readonly BUTTON: "button";
45
+ readonly LINK: "link";
46
+ readonly MENU: "menu";
47
+ readonly MENUITEM: "menuitem";
48
+ readonly TAB: "tab";
49
+ readonly TABPANEL: "tabpanel";
50
+ readonly TABLIST: "tablist";
51
+ readonly DIALOG: "dialog";
52
+ readonly ALERT: "alert";
53
+ readonly ALERTDIALOG: "alertdialog";
54
+ readonly STATUS: "status";
55
+ readonly PROGRESSBAR: "progressbar";
56
+ readonly SPINBUTTON: "spinbutton";
57
+ readonly COMBOBOX: "combobox";
58
+ readonly LISTBOX: "listbox";
59
+ readonly OPTION: "option";
60
+ readonly SEARCH: "search";
61
+ readonly NAVIGATION: "navigation";
62
+ readonly BANNER: "banner";
63
+ readonly MAIN: "main";
64
+ readonly COMPLEMENTARY: "complementary";
65
+ readonly CONTENTINFO: "contentinfo";
66
+ };
67
+ /**
68
+ * Accessible button props generator
69
+ */
70
+ export declare function getAccessibleButtonProps(label: string, props?: Partial<ButtonProps>): ButtonProps & {
71
+ "aria-label": string;
72
+ };
73
+ /**
74
+ * Accessible input props generator
75
+ */
76
+ export declare function getAccessibleInputProps(label: string, props?: Partial<InputProps>): InputProps & {
77
+ "aria-label": string;
78
+ };
79
+ /**
80
+ * Generate screen reader only text
81
+ */
82
+ export declare function ScreenReaderOnly({ children }: {
83
+ children: ReactNode;
84
+ }): import("react/jsx-runtime").JSX.Element;
85
+ /**
86
+ * Keyboard event handler helpers
87
+ */
88
+ export declare const keyboard: {
89
+ /** Check if Enter or Space key was pressed */
90
+ isActivationKey: (event: KeyboardEvent) => boolean;
91
+ /** Check if Escape key was pressed */
92
+ isEscapeKey: (event: KeyboardEvent) => boolean;
93
+ /** Check if Arrow keys were pressed */
94
+ isArrowKey: (event: KeyboardEvent) => boolean;
95
+ /** Check if Tab key was pressed */
96
+ isTabKey: (event: KeyboardEvent) => boolean;
97
+ };
98
+ /**
99
+ * Focus management utilities
100
+ */
101
+ export declare const focus: {
102
+ /** Trap focus within an element */
103
+ trapFocus: (element: HTMLElement) => () => void;
104
+ /** Restore focus to previous element */
105
+ restoreFocus: (previousElement?: HTMLElement | null) => void;
106
+ };
107
+ /**
108
+ * Live region announcer for screen readers
109
+ */
110
+ export declare function announceToScreenReader(message: string, priority?: "polite" | "assertive"): void;
111
+ /**
112
+ * Get accessible color contrast (WCAG compliance)
113
+ */
114
+ export declare function getAccessibleColor(_bg: string, _fg: string, _level?: "AA" | "AAA"): boolean;