@tsingroc/tsingroc-components 5.0.0-alpha.21 → 5.0.0-alpha.22

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 (41) hide show
  1. package/dist/components/Calendar.js +8 -4
  2. package/dist/components/ECharts.d.ts +1 -1
  3. package/dist/components/Header.d.ts +1 -1
  4. package/dist/components/Header.js +3 -1
  5. package/dist/components/LineChartEditor.js +3 -3
  6. package/dist/components/LineChartTable.js +319 -123
  7. package/dist/components/LinkedLineChart.js +3 -3
  8. package/dist/components/QuickDateRangePicker.d.ts +1 -1
  9. package/dist/components/QuickDateRangePicker.js +2 -3
  10. package/dist/components/Sidebar.d.ts +1 -1
  11. package/dist/components/Sidebar.js +4 -5
  12. package/dist/components/TsingrocDatePicker.d.ts +2 -2
  13. package/dist/components/TsingrocDatePicker.js +6 -7
  14. package/dist/components/UserButton.d.ts +1 -1
  15. package/dist/components/UserButton.js +24 -18
  16. package/dist/components/WeatherMap.js +1 -1
  17. package/dist/components/auth/AuthProvider.d.ts +29 -0
  18. package/dist/components/auth/AuthProvider.js +138 -0
  19. package/dist/components/auth/AuthService.d.ts +30 -0
  20. package/dist/components/auth/AuthService.js +1 -0
  21. package/dist/components/auth/CasdoorAuth.d.ts +135 -0
  22. package/dist/components/auth/CasdoorAuth.js +156 -0
  23. package/dist/components/auth/EmbeddedAuth.d.ts +16 -0
  24. package/dist/components/auth/EmbeddedAuth.js +53 -0
  25. package/dist/components/auth/Fetcher.d.ts +30 -0
  26. package/dist/components/auth/Fetcher.js +132 -0
  27. package/dist/components/auth/LocalAuth.d.ts +70 -0
  28. package/dist/components/auth/LocalAuth.js +84 -0
  29. package/dist/components/auth/LoginCheck.d.ts +13 -0
  30. package/dist/components/auth/LoginCheck.js +54 -0
  31. package/dist/components/auth/SessionStore.d.ts +68 -0
  32. package/dist/components/auth/SessionStore.js +193 -0
  33. package/dist/deckgl/TiandituLayer.d.ts +1 -1
  34. package/dist/deckgl/TiandituLayer.js +1 -1
  35. package/dist/deckgl/WeatherData.d.ts +1 -1
  36. package/dist/echarts/series/maxBarSeries.d.ts +1 -1
  37. package/dist/index.d.ts +8 -1
  38. package/dist/index.js +7 -1
  39. package/package.json +34 -50
  40. package/dist/components/Auth.d.ts +0 -314
  41. package/dist/components/Auth.js +0 -296
@@ -78,9 +78,9 @@ function Calendar(props) {
78
78
  cx,
79
79
  styles
80
80
  } = useStyles();
81
- const [selected, setSelected] = propsSelected === undefined ?
81
+ const [selected, setSelected] = propsSelected === undefined
82
82
  // eslint-disable-next-line react-hooks/rules-of-hooks
83
- useState() : [propsSelected, () => {}];
83
+ ? useState() : [propsSelected, () => {}];
84
84
  const monthStart = month.startOf("month");
85
85
  const calendarStart = monthStart.startOf("week");
86
86
  const monthEnd = month.endOf("month");
@@ -93,7 +93,10 @@ function Calendar(props) {
93
93
  className: cx(styles.calendar, className),
94
94
  children: [/*#__PURE__*/_jsx("thead", {
95
95
  children: /*#__PURE__*/_jsx("tr", {
96
- children: weekdays.map((name, weekday) => /*#__PURE__*/_jsx("th", {
96
+ children: weekdays.map((name, weekday) =>
97
+ /*#__PURE__*/
98
+ // oxlint-disable-next-line react/no-children-prop
99
+ _jsx("th", {
97
100
  children: name,
98
101
  ...thProps?.(weekday)
99
102
  }, weekday))
@@ -104,13 +107,14 @@ function Calendar(props) {
104
107
  }, (_, week) => /*#__PURE__*/_jsx("tr", {
105
108
  children: Array(7).fill(null).map((_, weekday) => {
106
109
  const date = calendarStart.add(week * 7 + weekday, "day");
107
- const fade = fadeAdjacentDays && date.month() != monthStart.month();
110
+ const fade = fadeAdjacentDays && date.month() !== monthStart.month();
108
111
  const isSelected = Math.floor(selected?.diff(date, "day", true) ?? NaN) === 0;
109
112
  const {
110
113
  className,
111
114
  ...props
112
115
  } = tdProps?.(date, false) ?? {};
113
116
  return /*#__PURE__*/_jsx("td", {
117
+ // oxlint-disable-next-line react/no-children-prop
114
118
  children: date.date(),
115
119
  onClick: () => {
116
120
  setSelected(date);
@@ -1,5 +1,5 @@
1
1
  import type { EChartsOption } from "echarts";
2
- import type { EChartsCoreOption, EChartsInitOpts, ECharts as EChartsInstance, SetOptionOpts } from "echarts/core";
2
+ import type { ECharts as EChartsInstance, EChartsCoreOption, EChartsInitOpts, SetOptionOpts } from "echarts/core";
3
3
  import { type ComponentType, type HTMLAttributes, type ReactNode, type Ref } from "react";
4
4
  export interface EChartsProps<Option extends EChartsCoreOption = EChartsOption> extends HTMLAttributes<HTMLDivElement> {
5
5
  /**
@@ -53,7 +53,7 @@ export interface HeaderProps extends MenuProps {
53
53
  /**
54
54
  * 顶栏组件。该组件需要放置在 [Ant Design 的 `Layout` 组件][1]内部才能正常工作。
55
55
  * 如果没有指定 {@linkcode HeaderProps.rightEnd | rightEnd} 属性,
56
- * 那么还需要包裹在 {@linkcode AuthProvider} 内,并且经过 {@linkcode AuthCheck} 验证后
56
+ * 那么还需要包裹在 {@linkcode AuthProvider} 内,并且经过 {@linkcode LoginCheck} 验证后
57
57
  * 才能正常显示顶栏右端的用户信息按钮。
58
58
  *
59
59
  * 一般来说,使用该组件时至少需要提供 `logo`、`items` 和 `onSelect` 三个属性,具体用法请参照范例。
@@ -1,11 +1,13 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
2
  import { Flex, Layout, Menu, theme } from "antd";
3
3
  import UserButton from "./UserButton";
4
+ // eslint-disable-line @typescript-eslint/no-unused-vars
5
+ // eslint-disable-line @typescript-eslint/no-unused-vars
4
6
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
7
  /**
6
8
  * 顶栏组件。该组件需要放置在 [Ant Design 的 `Layout` 组件][1]内部才能正常工作。
7
9
  * 如果没有指定 {@linkcode HeaderProps.rightEnd | rightEnd} 属性,
8
- * 那么还需要包裹在 {@linkcode AuthProvider} 内,并且经过 {@linkcode AuthCheck} 验证后
10
+ * 那么还需要包裹在 {@linkcode AuthProvider} 内,并且经过 {@linkcode LoginCheck} 验证后
9
11
  * 才能正常显示顶栏右端的用户信息按钮。
10
12
  *
11
13
  * 一般来说,使用该组件时至少需要提供 `logo`、`items` 和 `onSelect` 三个属性,具体用法请参照范例。
@@ -1,6 +1,6 @@
1
1
  import { Button, ConfigProvider, Flex, Input, Modal, Table, message, theme } from "antd";
2
2
  import { createStyles } from "antd-style";
3
- import { useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
3
+ import { use, useCallback, useEffect, useMemo, useRef, useState } from "react";
4
4
  import * as echarts from "../echarts";
5
5
  import ECharts from "./ECharts";
6
6
  import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
@@ -38,7 +38,7 @@ function LineChartEditor(props) {
38
38
  styles,
39
39
  theme: token
40
40
  } = useStyles();
41
- const isDark = useContext(ConfigProvider.ConfigContext).theme?.algorithm === theme.darkAlgorithm;
41
+ const isDark = use(ConfigProvider.ConfigContext).theme?.algorithm === theme.darkAlgorithm;
42
42
  const [modal, modalContextHolder] = Modal.useModal();
43
43
  const [messageApi, messageContextHolder] = message.useMessage();
44
44
  const [newData, setNewData] = useState(origData);
@@ -238,7 +238,7 @@ function LineChartEditor(props) {
238
238
  }], [xName, origName, newName, adjustStep, unitString, token]);
239
239
  const onRow = useCallback((data, index) => {
240
240
  if (index === undefined) return {};
241
- const modified = data.orig != data.new;
241
+ const modified = data.orig !== data.new;
242
242
  const selected = index === selectedIndex;
243
243
  return {
244
244
  className: cx(styles.editableRow, {
@@ -1,6 +1,7 @@
1
+ import { c as _c } from "react/compiler-runtime";
1
2
  import { ConfigProvider, Flex, Table, theme } from "antd";
2
3
  import { createStyles } from "antd-style";
3
- import { useContext, useEffect, useMemo, useRef, useState } from "react";
4
+ import { use, useEffect, useMemo, useRef, useState } from "react";
4
5
  import * as echarts from "../echarts";
5
6
  import ECharts from "./ECharts";
6
7
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -14,26 +15,56 @@ const EMPTY = [];
14
15
  * [1]: https://ant-design.antgroup.com/components/flex-cn#api
15
16
  */
16
17
  function LineChartTable(props) {
17
- const {
18
- xData,
19
- xName = "时间",
20
- yName = "数值",
21
- yUnit,
22
- series = [],
23
- chartHeight = 175,
24
- ...rest
25
- } = props;
26
- // TODO i18n
18
+ const $ = _c(63);
19
+ let rest;
20
+ let t0;
21
+ let t1;
22
+ let t2;
23
+ let t3;
24
+ let xData;
25
+ let yUnit;
26
+ if ($[0] !== props) {
27
+ ({
28
+ xData,
29
+ xName: t0,
30
+ yName: t1,
31
+ yUnit,
32
+ series: t2,
33
+ chartHeight: t3,
34
+ ...rest
35
+ } = props);
36
+ $[0] = props;
37
+ $[1] = rest;
38
+ $[2] = t0;
39
+ $[3] = t1;
40
+ $[4] = t2;
41
+ $[5] = t3;
42
+ $[6] = xData;
43
+ $[7] = yUnit;
44
+ } else {
45
+ rest = $[1];
46
+ t0 = $[2];
47
+ t1 = $[3];
48
+ t2 = $[4];
49
+ t3 = $[5];
50
+ xData = $[6];
51
+ yUnit = $[7];
52
+ }
53
+ const xName = t0 === undefined ? "\u65F6\u95F4" : t0;
54
+ const yName = t1 === undefined ? "\u6570\u503C" : t1;
55
+ const series = t2 === undefined ? [] : t2;
56
+ const chartHeight = t3 === undefined ? 175 : t3;
27
57
  const unitString = yUnit !== undefined ? `(${yUnit})` : "";
28
58
  const {
29
59
  cx,
30
60
  styles,
31
61
  theme: token
32
62
  } = useStyles();
33
- const isDark = useContext(ConfigProvider.ConfigContext).theme?.algorithm === theme.darkAlgorithm;
63
+ const isDark = use(ConfigProvider.ConfigContext).theme?.algorithm === theme.darkAlgorithm;
34
64
  const echartsRef = useRef(null);
35
65
  const tableRef = useRef(null);
36
- const [[hoverSource, hoverXIndex, hoverY], setHover] = useState(EMPTY);
66
+ const [t4, setHover] = useState(EMPTY);
67
+ const [hoverSource, hoverXIndex, hoverY] = t4;
37
68
  let closestYIndex;
38
69
  let closestY;
39
70
  if (hoverXIndex !== undefined && hoverY !== undefined) {
@@ -72,9 +103,9 @@ function LineChartTable(props) {
72
103
  status: closestY !== undefined ? "show" : "hide"
73
104
  }
74
105
  },
75
- series: series.map(series_1 => echarts.lineSeries(series_1))
106
+ series: series.map(_temp)
76
107
  }), echarts.legend({
77
- data: series.map(series_2 => series_2.name),
108
+ data: series.map(_temp2),
78
109
  option: {
79
110
  right: 42
80
111
  }
@@ -89,137 +120,302 @@ function LineChartTable(props) {
89
120
  filterMode: "empty"
90
121
  }]
91
122
  });
92
- useEffect(() => {
93
- const inst = echartsRef.current?.instance?.getZr();
94
- if (!inst) return () => {};
95
- const onMousemove = event => {
96
- const inst_0 = echartsRef.current?.instance;
97
- if (!inst_0) return;
98
- const coord = [event.offsetX, event.offsetY];
99
- if (inst_0.containPixel("grid", coord)) {
100
- const [x, y_0] = inst_0.convertFromPixel("grid", coord);
101
- setHover(["chart", x, y_0]);
102
- } else {
103
- setHover(EMPTY);
123
+ let t5;
124
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
125
+ t5 = index_0 => {
126
+ const table = tableRef.current?.nativeElement;
127
+ if (table) {
128
+ const header = table.getElementsByTagName("thead")[0];
129
+ const row = table.getElementsByTagName("tr")[index_0];
130
+ table.scrollTo({
131
+ top: row.offsetTop + row.offsetHeight / 2 - (table.offsetHeight - header.offsetHeight) / 2,
132
+ behavior: "smooth"
133
+ });
104
134
  }
105
135
  };
106
- const onGlobalout = () => setHover(EMPTY);
107
- inst.on("mousemove", onMousemove);
108
- inst.on("globalout", onGlobalout);
109
- return () => {
110
- inst.off("mousemove", onMousemove);
111
- inst.off("globalout", onGlobalout);
136
+ $[8] = t5;
137
+ } else {
138
+ t5 = $[8];
139
+ }
140
+ const tableScrollTo = t5;
141
+ let t6;
142
+ if ($[9] !== setHover) {
143
+ t6 = () => {
144
+ const inst = echartsRef.current?.instance?.getZr();
145
+ if (!inst) {
146
+ return _temp3;
147
+ }
148
+ const onMousemove = event => {
149
+ const inst_0 = echartsRef.current?.instance;
150
+ if (!inst_0) {
151
+ return;
152
+ }
153
+ const coord = [event.offsetX, event.offsetY];
154
+ if (inst_0.containPixel("grid", coord)) {
155
+ const [x, y_0] = inst_0.convertFromPixel("grid", coord);
156
+ setHover(["chart", x, y_0]);
157
+ } else {
158
+ setHover(EMPTY);
159
+ }
160
+ };
161
+ const onGlobalout = () => setHover(EMPTY);
162
+ inst.on("mousemove", onMousemove);
163
+ inst.on("globalout", onGlobalout);
164
+ return () => {
165
+ inst.off("mousemove", onMousemove);
166
+ inst.off("globalout", onGlobalout);
167
+ };
112
168
  };
113
- }, []);
114
- useEffect(() => {
115
- const inst_1 = echartsRef.current?.instance;
116
- if (!inst_1) return;
117
- if (hoverXIndex !== undefined) {
118
- inst_1.dispatchAction({
119
- type: "highlight",
120
- seriesIndex: closestYIndex,
121
- dataIndex: hoverXIndex
122
- });
123
- if (hoverSource === "chart") {
124
- // eslint-disable-next-line react-hooks/immutability
125
- tableScrollTo(hoverXIndex);
169
+ $[9] = setHover;
170
+ $[10] = t6;
171
+ } else {
172
+ t6 = $[10];
173
+ }
174
+ let t7;
175
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
176
+ t7 = [];
177
+ $[11] = t7;
178
+ } else {
179
+ t7 = $[11];
180
+ }
181
+ useEffect(t6, t7);
182
+ let t8;
183
+ if ($[12] !== closestYIndex || $[13] !== hoverSource || $[14] !== hoverXIndex) {
184
+ t8 = () => {
185
+ const inst_1 = echartsRef.current?.instance;
186
+ if (!inst_1) {
187
+ return;
126
188
  }
127
- } else {
128
- inst_1.dispatchAction({
129
- type: "downplay"
130
- });
131
- }
132
- }, [hoverSource, hoverXIndex, closestYIndex]);
133
- const tableDataWithoutHover = useMemo(() => {
134
- const data = xData.map((x_0, i) => ({
135
- key: i,
136
- x: x_0
137
- }));
189
+ if (hoverXIndex !== undefined) {
190
+ inst_1.dispatchAction({
191
+ type: "highlight",
192
+ seriesIndex: closestYIndex,
193
+ dataIndex: hoverXIndex
194
+ });
195
+ if (hoverSource === "chart") {
196
+ tableScrollTo(hoverXIndex);
197
+ }
198
+ } else {
199
+ inst_1.dispatchAction({
200
+ type: "downplay"
201
+ });
202
+ }
203
+ };
204
+ $[12] = closestYIndex;
205
+ $[13] = hoverSource;
206
+ $[14] = hoverXIndex;
207
+ $[15] = t8;
208
+ } else {
209
+ t8 = $[15];
210
+ }
211
+ let t9;
212
+ if ($[16] !== closestYIndex || $[17] !== hoverSource || $[18] !== hoverXIndex) {
213
+ t9 = [hoverSource, hoverXIndex, closestYIndex];
214
+ $[16] = closestYIndex;
215
+ $[17] = hoverSource;
216
+ $[18] = hoverXIndex;
217
+ $[19] = t9;
218
+ } else {
219
+ t9 = $[19];
220
+ }
221
+ useEffect(t8, t9);
222
+ let data;
223
+ if ($[20] !== series || $[21] !== xData) {
224
+ data = xData.map(_temp4);
138
225
  series.forEach(series_3 => series_3.data.forEach((y_1, i_0) => data[i_0][`y${series_3.name}`] = y_1));
139
- return data;
140
- }, [xData, series]);
141
- const tableData = useMemo(() => {
142
- if (hoverSource === "chart" && hoverXIndex !== undefined) {
143
- const data_0 = [...tableDataWithoutHover];
226
+ $[20] = series;
227
+ $[21] = xData;
228
+ $[22] = data;
229
+ } else {
230
+ data = $[22];
231
+ }
232
+ const tableDataWithoutHover = data;
233
+ closestYIndex;
234
+ let t10;
235
+ if (hoverSource === "chart" && hoverXIndex !== undefined) {
236
+ let data_0;
237
+ if ($[23] !== closestYIndex || $[24] !== hoverXIndex || $[25] !== tableDataWithoutHover) {
238
+ data_0 = [...tableDataWithoutHover];
144
239
  data_0[hoverXIndex] = {
145
240
  ...data_0[hoverXIndex],
146
241
  hover: closestYIndex ?? true
147
242
  };
148
- return data_0;
243
+ $[23] = closestYIndex;
244
+ $[24] = hoverXIndex;
245
+ $[25] = tableDataWithoutHover;
246
+ $[26] = data_0;
149
247
  } else {
150
- return tableDataWithoutHover;
248
+ data_0 = $[26];
151
249
  }
152
- }, [tableDataWithoutHover, hoverSource, hoverXIndex, closestYIndex]);
153
- const tableColumns = useMemo(() => {
154
- const columnWidth = `${100 / series.length}%`;
155
- return [{
250
+ t10 = data_0;
251
+ } else {
252
+ t10 = tableDataWithoutHover;
253
+ }
254
+ const tableData = t10;
255
+ const columnWidth = `${100 / series.length}%`;
256
+ let t11;
257
+ if ($[27] !== cx || $[28] !== setHover || $[29] !== styles) {
258
+ t11 = (data_1, index_1) => ({
259
+ className: cx({
260
+ [styles.rowHovered]: data_1.hover !== undefined
261
+ }),
262
+ onMouseEnter: () => setHover(["table", index_1]),
263
+ onMouseLeave: () => setHover(EMPTY)
264
+ });
265
+ $[27] = cx;
266
+ $[28] = setHover;
267
+ $[29] = styles;
268
+ $[30] = t11;
269
+ } else {
270
+ t11 = $[30];
271
+ }
272
+ let t12;
273
+ if ($[31] !== t11 || $[32] !== xName) {
274
+ t12 = {
156
275
  key: "x",
157
276
  dataIndex: "x",
158
277
  title: xName,
159
- onCell: (data_1, index_0) => ({
160
- className: cx({
161
- [styles.rowHovered]: data_1.hover !== undefined
162
- }),
163
- onMouseEnter: () => setHover(["table", index_0]),
164
- onMouseLeave: () => setHover(EMPTY)
165
- })
166
- }, ...series.map((series_4, yIndex) => ({
167
- key: `y${series_4.name}`,
168
- dataIndex: `y${series_4.name}`,
169
- title: series_4.name + unitString,
170
- width: columnWidth,
171
- onCell: (data_2, xIndex) => ({
172
- className: cx(styles.cell, {
173
- [styles.rowHovered]: data_2.hover !== undefined,
174
- [styles.cellHovered]: data_2.hover === yIndex
175
- }),
176
- onMouseEnter: () => setHover(["table", xIndex, data_2[`y${series_4.name}`]]),
177
- onMouseLeave: () => setHover(EMPTY)
178
- })
179
- }))];
180
- }, [cx, styles, xName, series, unitString]);
181
- const tableScrollTo = index_1 => {
182
- const table = tableRef.current?.nativeElement;
183
- if (table) {
184
- const header = table.getElementsByTagName("thead")[0];
185
- const row = table.getElementsByTagName("tr")[index_1];
186
- table.scrollTo({
187
- top: row.offsetTop + row.offsetHeight / 2 - (table.offsetHeight - header.offsetHeight) / 2,
188
- behavior: "smooth"
278
+ onCell: t11
279
+ };
280
+ $[31] = t11;
281
+ $[32] = xName;
282
+ $[33] = t12;
283
+ } else {
284
+ t12 = $[33];
285
+ }
286
+ let t13;
287
+ if ($[34] !== columnWidth || $[35] !== cx || $[36] !== series || $[37] !== setHover || $[38] !== styles || $[39] !== t12 || $[40] !== unitString) {
288
+ let t14;
289
+ if ($[42] !== columnWidth || $[43] !== cx || $[44] !== setHover || $[45] !== styles || $[46] !== unitString) {
290
+ t14 = (series_4, yIndex) => ({
291
+ key: `y${series_4.name}`,
292
+ dataIndex: `y${series_4.name}`,
293
+ title: series_4.name + unitString,
294
+ width: columnWidth,
295
+ onCell: (data_2, xIndex) => ({
296
+ className: cx(styles.cell, {
297
+ [styles.rowHovered]: data_2.hover !== undefined,
298
+ [styles.cellHovered]: data_2.hover === yIndex
299
+ }),
300
+ onMouseEnter: () => setHover(["table", xIndex, data_2[`y${series_4.name}`]]),
301
+ onMouseLeave: () => setHover(EMPTY)
302
+ })
189
303
  });
304
+ $[42] = columnWidth;
305
+ $[43] = cx;
306
+ $[44] = setHover;
307
+ $[45] = styles;
308
+ $[46] = unitString;
309
+ $[47] = t14;
310
+ } else {
311
+ t14 = $[47];
190
312
  }
191
- };
192
- return /*#__PURE__*/_jsxs(Flex, {
193
- vertical: true,
194
- gap: token.marginXS,
195
- ...rest,
196
- children: [/*#__PURE__*/_jsx(ECharts, {
313
+ t13 = [t12, ...series.map(t14)];
314
+ $[34] = columnWidth;
315
+ $[35] = cx;
316
+ $[36] = series;
317
+ $[37] = setHover;
318
+ $[38] = styles;
319
+ $[39] = t12;
320
+ $[40] = unitString;
321
+ $[41] = t13;
322
+ } else {
323
+ t13 = $[41];
324
+ }
325
+ const tableColumns = t13;
326
+ const t14 = isDark ? "dark" : undefined;
327
+ let t15;
328
+ if ($[48] !== chartHeight) {
329
+ t15 = {
330
+ height: chartHeight,
331
+ flexShrink: 0
332
+ };
333
+ $[48] = chartHeight;
334
+ $[49] = t15;
335
+ } else {
336
+ t15 = $[49];
337
+ }
338
+ let t16;
339
+ if ($[50] !== option || $[51] !== t14 || $[52] !== t15) {
340
+ t16 = /*#__PURE__*/_jsx(ECharts, {
197
341
  ref: echartsRef,
198
342
  option: option,
199
- theme: isDark ? "dark" : undefined,
200
- style: {
201
- height: chartHeight,
202
- flexShrink: 0
203
- }
204
- }), useMemo(() => /*#__PURE__*/_jsx(Table, {
343
+ theme: t14,
344
+ style: t15
345
+ });
346
+ $[50] = option;
347
+ $[51] = t14;
348
+ $[52] = t15;
349
+ $[53] = t16;
350
+ } else {
351
+ t16 = $[53];
352
+ }
353
+ let t17;
354
+ if ($[54] === Symbol.for("react.memo_cache_sentinel")) {
355
+ t17 = {
356
+ flexBasis: "100%",
357
+ overflowY: "auto"
358
+ };
359
+ $[54] = t17;
360
+ } else {
361
+ t17 = $[54];
362
+ }
363
+ let t18;
364
+ if ($[55] !== tableColumns || $[56] !== tableData) {
365
+ t18 = /*#__PURE__*/_jsx(Table, {
205
366
  ref: tableRef,
206
367
  dataSource: tableData,
207
368
  columns: tableColumns,
208
369
  size: "small",
209
370
  pagination: false,
210
- style: {
211
- flexBasis: "100%",
212
- overflowY: "auto"
213
- },
214
- onHeaderRow: () => ({
215
- style: {
216
- position: "sticky",
217
- top: 0,
218
- zIndex: 1
219
- }
220
- })
221
- }), [tableData, tableColumns])]
222
- });
371
+ style: t17,
372
+ onHeaderRow: _temp5
373
+ });
374
+ $[55] = tableColumns;
375
+ $[56] = tableData;
376
+ $[57] = t18;
377
+ } else {
378
+ t18 = $[57];
379
+ }
380
+ let t19;
381
+ if ($[58] !== rest || $[59] !== t16 || $[60] !== t18 || $[61] !== token.marginXS) {
382
+ t19 = /*#__PURE__*/_jsxs(Flex, {
383
+ vertical: true,
384
+ gap: token.marginXS,
385
+ ...rest,
386
+ children: [t16, t18]
387
+ });
388
+ $[58] = rest;
389
+ $[59] = t16;
390
+ $[60] = t18;
391
+ $[61] = token.marginXS;
392
+ $[62] = t19;
393
+ } else {
394
+ t19 = $[62];
395
+ }
396
+ return t19;
397
+ }
398
+ function _temp5() {
399
+ return {
400
+ style: {
401
+ position: "sticky",
402
+ top: 0,
403
+ zIndex: 1
404
+ }
405
+ };
406
+ }
407
+ function _temp4(x_0, i) {
408
+ return {
409
+ key: i,
410
+ x: x_0
411
+ };
412
+ }
413
+ function _temp3() {}
414
+ function _temp2(series_2) {
415
+ return series_2.name;
416
+ }
417
+ function _temp(series_1) {
418
+ return echarts.lineSeries(series_1);
223
419
  }
224
420
  export default LineChartTable;
225
421
  const useStyles = createStyles(({
@@ -1,6 +1,6 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
2
  import { ConfigProvider, theme } from "antd";
3
- import { createContext, useContext } from "react";
3
+ import { createContext, use } from "react";
4
4
  import * as echarts from "../echarts";
5
5
  import ConnectedECharts, { EChartsConnector } from "./ConnectedECharts";
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -79,11 +79,11 @@ function LinkedLineChart(props) {
79
79
  const series = t1 === undefined ? [] : t1;
80
80
  const dataZoom = t2 === undefined ? true : t2;
81
81
  const unitString = yUnit !== undefined ? `(${yUnit})` : "";
82
- const isDark = useContext(ConfigProvider.ConfigContext).theme?.algorithm === theme.darkAlgorithm;
82
+ const isDark = use(ConfigProvider.ConfigContext).theme?.algorithm === theme.darkAlgorithm;
83
83
  const {
84
84
  xData,
85
85
  xName
86
- } = useContext(LineChartLinkContext);
86
+ } = use(LineChartLinkContext);
87
87
  const option = echarts.buildEChartsOption({
88
88
  backgroundColor: "transparent"
89
89
  }, echarts.useGrid({
@@ -1,7 +1,6 @@
1
1
  import { type ButtonProps, type SpaceProps } from "antd";
2
2
  import type { RangePickerProps } from "antd/es/date-picker";
3
3
  import { type Dayjs } from "dayjs";
4
- import type { NoUndefinedRangeValueType } from "rc-picker/lib/PickerInput/RangePicker";
5
4
  export interface QuickDateRangePickerProps extends Omit<SpaceProps, "onChange"> {
6
5
  /** 一个二元组 `[start, end]`,表示时间段的开始和结束。*/
7
6
  value?: NoUndefinedRangeValueType<Dayjs>;
@@ -19,6 +18,7 @@ export interface QuickDateRangePickerProps extends Omit<SpaceProps, "onChange">
19
18
  */
20
19
  pickerProps?: RangePickerProps;
21
20
  }
21
+ type NoUndefinedRangeValueType<T> = [T, T];
22
22
  /**
23
23
  * 带有快速选择最近 3/5/7 天功能的日期范围选择器。
24
24
  *
@@ -12,7 +12,6 @@ const QUICK_PICK_RANGES = [{
12
12
  value: 7,
13
13
  label: "最近 7 天"
14
14
  }];
15
-
16
15
  /**
17
16
  * 带有快速选择最近 3/5/7 天功能的日期范围选择器。
18
17
  *
@@ -28,9 +27,9 @@ function QuickDateRangePicker(props) {
28
27
  pickerProps,
29
28
  ...rest
30
29
  } = props;
31
- const [range, setRange] = value === undefined ?
30
+ const [range, setRange] = value === undefined
32
31
  // eslint-disable-next-line react-hooks/rules-of-hooks
33
- useState(undefined) : [value, () => {}];
32
+ ? useState(undefined) : [value, () => {}];
34
33
  function quickPick(value) {
35
34
  const end = dayjs();
36
35
  const start = end.subtract(value - 1, "day");
@@ -65,7 +65,7 @@ export interface SidebarProps extends MenuProps {
65
65
  /**
66
66
  * 出自 TMS 系统的侧边栏组件。该组件需要放置在 [Ant Design 的 `Layout` 组件][1]内部才能正常工作。
67
67
  * 如果没有指定 {@linkcode SidebarProps.footer | footer} 属性,
68
- * 那么还需要包裹在 {@linkcode AuthProvider} 内,并且经过 {@linkcode AuthCheck} 验证后
68
+ * 那么还需要包裹在 {@linkcode AuthProvider} 内,并且经过 {@linkcode LoginCheck} 验证后
69
69
  * 才能正常显示边栏底部的用户信息按钮。
70
70
  *
71
71
  * 一般来说,使用该组件时至少需要提供 `logo`、`items` 和 `onSelect` 三个属性,具体用法请参照范例。