@ant-design/agentic-ui 2.14.1 → 2.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Bubble/BubbleBeforeNode.js +9 -9
- package/dist/Bubble/List/PureBubbleList.js +1 -1
- package/dist/Bubble/MessagesContent/EXCEPTION.js +1 -1
- package/dist/ChatLayout/style.js +16 -17
- package/dist/Constants/mobile.d.ts +3 -0
- package/dist/Constants/mobile.js +7 -0
- package/dist/Hooks/useLanguage.d.ts +2 -0
- package/dist/I18n/locales.d.ts +2 -0
- package/dist/I18n/locales.js +4 -0
- package/dist/MarkdownEditor/BaseMarkdownEditor.js +1 -1
- package/dist/MarkdownEditor/editor/Editor.js +16 -8
- package/dist/MarkdownEditor/editor/code.css +2 -2
- package/dist/MarkdownEditor/editor/elements/Code.js +11 -6
- package/dist/MarkdownEditor/editor/elements/FootnoteDefinition.js +2 -1
- package/dist/MarkdownEditor/editor/elements/FootnoteReference.js +2 -1
- package/dist/MarkdownEditor/editor/elements/Head.d.ts +1 -0
- package/dist/MarkdownEditor/editor/elements/Head.js +1 -1
- package/dist/MarkdownEditor/editor/elements/Image/index.js +19 -7
- package/dist/MarkdownEditor/editor/elements/LinkCard/index.js +2 -1
- package/dist/MarkdownEditor/editor/elements/LinkCard/style.js +1 -1
- package/dist/MarkdownEditor/editor/elements/List/ListItem.js +1 -0
- package/dist/MarkdownEditor/editor/elements/List/style.js +2 -2
- package/dist/MarkdownEditor/editor/elements/Media.js +22 -10
- package/dist/MarkdownEditor/editor/elements/Paragraph.js +2 -1
- package/dist/MarkdownEditor/editor/elements/Schema.js +1 -1
- package/dist/MarkdownEditor/editor/elements/Table/ReadonlyTableComponent.js +16 -4
- package/dist/MarkdownEditor/editor/elements/Table/SimpleTable.js +17 -2
- package/dist/MarkdownEditor/editor/elements/Table/Table.js +155 -20
- package/dist/MarkdownEditor/editor/elements/Table/Td/style.js +5 -2
- package/dist/MarkdownEditor/editor/elements/Table/index.js +0 -2
- package/dist/MarkdownEditor/editor/elements/Table/style.js +7 -8
- package/dist/MarkdownEditor/editor/elements/TagPopup/index.js +5 -3
- package/dist/MarkdownEditor/editor/elements/TagPopup/style.js +2 -2
- package/dist/MarkdownEditor/editor/parser/parserMarkdownToSlateNode.d.ts +100 -1
- package/dist/MarkdownEditor/editor/parser/parserMarkdownToSlateNode.js +781 -240
- package/dist/MarkdownEditor/editor/plugins/useKeyboard.js +8 -19
- package/dist/MarkdownEditor/editor/store.js +3 -3
- package/dist/MarkdownEditor/editor/style.js +41 -6
- package/dist/MarkdownEditor/editor/tools/DragHandle.js +3 -3
- package/dist/MarkdownEditor/editor/types/Table.d.ts +1 -0
- package/dist/MarkdownEditor/editor/utils/findMatchingClose.d.ts +36 -0
- package/dist/MarkdownEditor/editor/utils/findMatchingClose.js +158 -0
- package/dist/MarkdownEditor/editor/utils/markdownToHtml.d.ts +41 -2
- package/dist/MarkdownEditor/editor/utils/markdownToHtml.js +159 -7
- package/dist/MarkdownEditor/style.js +8 -2
- package/dist/MarkdownEditor/types.d.ts +1 -1
- package/dist/MarkdownEditor/utils/exportHtml.js +1 -1
- package/dist/MarkdownInputField/MarkdownInputField.d.ts +7 -7
- package/dist/MarkdownInputField/MarkdownInputField.js +11 -35
- package/dist/MarkdownInputField/SendButton/index.js +17 -3
- package/dist/MarkdownInputField/style.js +23 -2
- package/dist/Plugins/chart/AreaChart/index.d.ts +12 -0
- package/dist/Plugins/chart/AreaChart/index.js +14 -188
- package/dist/Plugins/chart/BarChart/index.d.ts +2 -0
- package/dist/Plugins/chart/BarChart/index.js +3 -12
- package/dist/Plugins/chart/ChartMark/Container.js +5 -2
- package/dist/Plugins/chart/ChartRender.d.ts +1 -0
- package/dist/Plugins/chart/ChartRender.js +104 -43
- package/dist/Plugins/chart/DonutChart/index.js +4 -2
- package/dist/Plugins/chart/DonutChart/types.d.ts +2 -0
- package/dist/Plugins/chart/FunnelChart/index.d.ts +2 -0
- package/dist/Plugins/chart/FunnelChart/index.js +4 -2
- package/dist/Plugins/chart/LineChart/index.d.ts +2 -0
- package/dist/Plugins/chart/LineChart/index.js +17 -162
- package/dist/Plugins/chart/RadarChart/index.d.ts +2 -0
- package/dist/Plugins/chart/RadarChart/index.js +8 -4
- package/dist/Plugins/chart/ScatterChart/index.d.ts +2 -0
- package/dist/Plugins/chart/ScatterChart/index.js +8 -4
- package/dist/Plugins/chart/components/ChartContainer/ChartContainer.d.ts +1 -0
- package/dist/Plugins/chart/components/ChartContainer/ChartErrorBoundaryExample.js +1 -1
- package/dist/Plugins/chart/components/ChartFilter/ChartFilter.d.ts +1 -1
- package/dist/Plugins/chart/components/ChartFilter/ChartFilter.js +210 -16
- package/dist/Plugins/chart/components/ChartToolBar/ChartToolBar.d.ts +2 -0
- package/dist/Plugins/chart/components/ChartToolBar/ChartToolBar.js +9 -2
- package/dist/Plugins/chart/components/ChartToolBar/style.js +3 -1
- package/dist/Plugins/chart/hooks/index.d.ts +10 -0
- package/dist/Plugins/chart/hooks/index.js +8 -0
- package/dist/Plugins/chart/hooks/useChartDataFilter.d.ts +46 -0
- package/dist/Plugins/chart/hooks/useChartDataFilter.js +182 -0
- package/dist/Plugins/chart/hooks/useChartStatistics.d.ts +17 -0
- package/dist/Plugins/chart/hooks/useChartStatistics.js +25 -0
- package/dist/Plugins/chart/hooks/useChartTheme.d.ts +20 -0
- package/dist/Plugins/chart/hooks/useChartTheme.js +30 -0
- package/dist/Plugins/chart/hooks/useResponsiveSize.d.ts +23 -0
- package/dist/Plugins/chart/hooks/useResponsiveSize.js +94 -0
- package/dist/Plugins/chart/index.js +94 -10
- package/dist/Plugins/chart/utils/registerChart.d.ts +35 -0
- package/dist/Plugins/chart/utils/registerChart.js +54 -0
- package/dist/Plugins/chart/utils.d.ts +19 -0
- package/dist/Plugins/chart/utils.js +27 -0
- package/dist/Plugins/code/components/CodeContainer.js +2 -3
- package/dist/Plugins/code/components/CodeRenderer.js +53 -2
- package/dist/Plugins/code/components/CodeToolbar.js +22 -3
- package/dist/Plugins/katex/InlineKatex.js +1 -1
- package/dist/Plugins/katex/Katex.js +1 -1
- package/dist/Plugins/mermaid/Mermaid.js +66 -66
- package/dist/Plugins/mermaid/index.js +1 -1
- package/dist/ThoughtChainList/index.js +21 -2
- package/dist/ThoughtChainList/style.js +1 -0
- package/dist/Utils/loadCSS.js +6 -6
- package/dist/WelcomeMessage/index.js +21 -2
- package/dist/Workspace/Task/index.js +1 -1
- package/package.json +2 -2
|
@@ -1,36 +1,228 @@
|
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
|
2
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
3
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
|
+
return arr2;
|
|
5
|
+
}
|
|
6
|
+
function _array_with_holes(arr) {
|
|
7
|
+
if (Array.isArray(arr)) return arr;
|
|
8
|
+
}
|
|
9
|
+
function _iterable_to_array_limit(arr, i) {
|
|
10
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
11
|
+
if (_i == null) return;
|
|
12
|
+
var _arr = [];
|
|
13
|
+
var _n = true;
|
|
14
|
+
var _d = false;
|
|
15
|
+
var _s, _e;
|
|
16
|
+
try {
|
|
17
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
18
|
+
_arr.push(_s.value);
|
|
19
|
+
if (i && _arr.length === i) break;
|
|
20
|
+
}
|
|
21
|
+
} catch (err) {
|
|
22
|
+
_d = true;
|
|
23
|
+
_e = err;
|
|
24
|
+
} finally{
|
|
25
|
+
try {
|
|
26
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
27
|
+
} finally{
|
|
28
|
+
if (_d) throw _e;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return _arr;
|
|
32
|
+
}
|
|
33
|
+
function _non_iterable_rest() {
|
|
34
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
35
|
+
}
|
|
36
|
+
function _sliced_to_array(arr, i) {
|
|
37
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
38
|
+
}
|
|
39
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
40
|
+
if (!o) return;
|
|
41
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
42
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
43
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
44
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
45
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
46
|
+
}
|
|
1
47
|
import { ChevronDown } from "@sofa-design/icons";
|
|
2
48
|
import { Button, ConfigProvider, Dropdown, Segmented } from "antd";
|
|
3
49
|
import classNames from "classnames";
|
|
4
|
-
import React, { useContext } from "react";
|
|
50
|
+
import React, { useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
5
51
|
import { I18nContext } from "../../../../I18n";
|
|
52
|
+
import { debounce } from "../../utils";
|
|
6
53
|
import { useStyle } from "./style";
|
|
7
|
-
|
|
54
|
+
/**
|
|
55
|
+
* 比较两个数组是否相等(浅比较)
|
|
56
|
+
*/ var areArraysEqual = function(a, b) {
|
|
57
|
+
if (a === b) return true;
|
|
58
|
+
if (!a || !b) return false;
|
|
59
|
+
if (a.length !== b.length) return false;
|
|
60
|
+
return a.every(function(item, index) {
|
|
61
|
+
var other = b[index];
|
|
62
|
+
if (!other) return false;
|
|
63
|
+
// 比较所有属性
|
|
64
|
+
return Object.keys(item).every(function(key) {
|
|
65
|
+
return item[key] === other[key];
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* ChartFilter 组件的 props 比较函数
|
|
71
|
+
* 用于 React.memo 优化,只在真正需要时重新渲染
|
|
72
|
+
*
|
|
73
|
+
* 注意:由于组件内部使用 ref 保存上一次有效的 filterOptions,
|
|
74
|
+
* 即使 filterOptions 暂时为空也不会导致组件消失。
|
|
75
|
+
* 因此比较时,如果当前值为空但之前有值,我们仍然认为它们"相等"(使用稳定值)。
|
|
76
|
+
*/ var arePropsEqual = function(prevProps, nextProps) {
|
|
77
|
+
// 比较基本属性
|
|
78
|
+
if (prevProps.selectedFilter !== nextProps.selectedFilter || prevProps.selectedCustomSelection !== nextProps.selectedCustomSelection || prevProps.className !== nextProps.className || prevProps.theme !== nextProps.theme || prevProps.variant !== nextProps.variant) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
// 比较数组属性(filterOptions 和 customOptions)
|
|
82
|
+
// 如果两个都是空或都有效,比较内容
|
|
83
|
+
// 如果一个为空一个有效,认为不相等(需要更新稳定值)
|
|
84
|
+
var prevFilterValid = prevProps.filterOptions && prevProps.filterOptions.length > 1;
|
|
85
|
+
var nextFilterValid = nextProps.filterOptions && nextProps.filterOptions.length > 1;
|
|
86
|
+
// 如果两个都有效,比较内容
|
|
87
|
+
if (prevFilterValid && nextFilterValid) {
|
|
88
|
+
if (!areArraysEqual(prevProps.filterOptions, nextProps.filterOptions)) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
} else if (prevFilterValid !== nextFilterValid) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
// 如果两个都无效,认为相等(使用上一次的稳定值)
|
|
95
|
+
var prevCustomValid = prevProps.customOptions && prevProps.customOptions.length > 1;
|
|
96
|
+
var nextCustomValid = nextProps.customOptions && nextProps.customOptions.length > 1;
|
|
97
|
+
if (prevCustomValid && nextCustomValid) {
|
|
98
|
+
if (!areArraysEqual(prevProps.customOptions, nextProps.customOptions)) {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
} else if (prevCustomValid !== nextCustomValid) {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
// 回调函数比较
|
|
105
|
+
// 由于我们已经用 ref 处理回调,即使引用变化也不会影响防抖逻辑
|
|
106
|
+
// 为了 memo 优化,我们只检查回调是否存在,不比较引用
|
|
107
|
+
var prevHasFilterChange = prevProps.onFilterChange !== undefined;
|
|
108
|
+
var nextHasFilterChange = nextProps.onFilterChange !== undefined;
|
|
109
|
+
if (prevHasFilterChange !== nextHasFilterChange) {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
var prevHasSelectionChange = prevProps.onSelectionChange !== undefined;
|
|
113
|
+
var nextHasSelectionChange = nextProps.onSelectionChange !== undefined;
|
|
114
|
+
if (prevHasSelectionChange !== nextHasSelectionChange) {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
// 所有关键属性都相同,可以跳过重新渲染
|
|
118
|
+
return true;
|
|
119
|
+
};
|
|
120
|
+
var ChartFilterComponent = function(param) {
|
|
8
121
|
var filterOptions = param.filterOptions, selectedFilter = param.selectedFilter, onFilterChange = param.onFilterChange, customOptions = param.customOptions, selectedCustomSelection = param.selectedCustomSelection, onSelectionChange = param.onSelectionChange, _param_className = param.className, className = _param_className === void 0 ? '' : _param_className, _param_theme = param.theme, theme = _param_theme === void 0 ? 'light' : _param_theme, _param_variant = param.variant, variant = _param_variant === void 0 ? 'default' : _param_variant;
|
|
9
|
-
var
|
|
122
|
+
var _stableCustomOptions_find, _i18n_locale;
|
|
10
123
|
var getPrefixCls = useContext(ConfigProvider.ConfigContext).getPrefixCls;
|
|
11
124
|
var i18n = useContext(I18nContext);
|
|
12
125
|
var prefixCls = getPrefixCls('chart-filter');
|
|
13
126
|
var _useStyle = useStyle(prefixCls), wrapSSR = _useStyle.wrapSSR, hashId = _useStyle.hashId;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
127
|
+
// 使用 useRef 保存最新的回调函数,避免防抖函数闭包问题
|
|
128
|
+
var onFilterChangeRef = useRef(onFilterChange);
|
|
129
|
+
var onSelectionChangeRef = useRef(onSelectionChange);
|
|
130
|
+
// 更新 ref,确保总是使用最新的回调
|
|
131
|
+
React.useEffect(function() {
|
|
132
|
+
onFilterChangeRef.current = onFilterChange;
|
|
133
|
+
onSelectionChangeRef.current = onSelectionChange;
|
|
134
|
+
}, [
|
|
135
|
+
onFilterChange,
|
|
136
|
+
onSelectionChange
|
|
137
|
+
]);
|
|
138
|
+
// 创建防抖的回调函数,1秒更新一次
|
|
139
|
+
var debouncedFilterChange = useMemo(function() {
|
|
140
|
+
return debounce(function(value) {
|
|
141
|
+
if (onFilterChangeRef.current) {
|
|
142
|
+
onFilterChangeRef.current(value);
|
|
143
|
+
}
|
|
144
|
+
}, 1000);
|
|
145
|
+
}, []);
|
|
146
|
+
var debouncedSelectionChange = useMemo(function() {
|
|
147
|
+
return debounce(function(region) {
|
|
148
|
+
if (onSelectionChangeRef.current) {
|
|
149
|
+
onSelectionChangeRef.current(region);
|
|
150
|
+
}
|
|
151
|
+
}, 1000);
|
|
152
|
+
}, []);
|
|
153
|
+
// 组件卸载时清理防抖函数
|
|
154
|
+
React.useEffect(function() {
|
|
155
|
+
return function() {
|
|
156
|
+
var _debouncedFilterChange_cancel, _debouncedSelectionChange_cancel;
|
|
157
|
+
debouncedFilterChange === null || debouncedFilterChange === void 0 ? void 0 : (_debouncedFilterChange_cancel = debouncedFilterChange.cancel) === null || _debouncedFilterChange_cancel === void 0 ? void 0 : _debouncedFilterChange_cancel.call(debouncedFilterChange);
|
|
158
|
+
debouncedSelectionChange === null || debouncedSelectionChange === void 0 ? void 0 : (_debouncedSelectionChange_cancel = debouncedSelectionChange.cancel) === null || _debouncedSelectionChange_cancel === void 0 ? void 0 : _debouncedSelectionChange_cancel.call(debouncedSelectionChange);
|
|
159
|
+
};
|
|
160
|
+
}, [
|
|
161
|
+
debouncedFilterChange,
|
|
162
|
+
debouncedSelectionChange
|
|
163
|
+
]);
|
|
164
|
+
// 稳定化 filterOptions 和 customOptions,避免在流式更新时频繁变化导致组件跳动
|
|
165
|
+
// 使用 useState 保存稳定的值,只在内容真正变化时才更新
|
|
166
|
+
var _useState = _sliced_to_array(useState(function() {
|
|
167
|
+
return filterOptions && filterOptions.length > 1 ? filterOptions : undefined;
|
|
168
|
+
}), 2), stableFilterOptions = _useState[0], setStableFilterOptions = _useState[1];
|
|
169
|
+
var _useState1 = _sliced_to_array(useState(function() {
|
|
170
|
+
return customOptions && customOptions.length > 1 ? customOptions : undefined;
|
|
171
|
+
}), 2), stableCustomOptions = _useState1[0], setStableCustomOptions = _useState1[1];
|
|
172
|
+
// 使用 useRef 保存上一次的值用于内容比较
|
|
173
|
+
var prevFilterOptionsRef = useRef(filterOptions);
|
|
174
|
+
var prevCustomOptionsRef = useRef(customOptions);
|
|
175
|
+
// 当 filterOptions 变化时,只在内容真正变化时才更新
|
|
176
|
+
useEffect(function() {
|
|
177
|
+
if (filterOptions && filterOptions.length > 1) {
|
|
178
|
+
// 比较内容是否真的变化
|
|
179
|
+
var contentChanged = !areArraysEqual(prevFilterOptionsRef.current, filterOptions);
|
|
180
|
+
if (contentChanged) {
|
|
181
|
+
// 内容变化,更新稳定值
|
|
182
|
+
setStableFilterOptions(filterOptions);
|
|
183
|
+
prevFilterOptionsRef.current = filterOptions;
|
|
184
|
+
}
|
|
185
|
+
// 如果内容相同,不更新,避免不必要的重新渲染
|
|
186
|
+
} else if (filterOptions && filterOptions.length <= 1) {
|
|
187
|
+
// 如果新值无效(长度 <= 1),但之前有有效值,保持上一次的值(不更新)
|
|
188
|
+
// 这样 filter 不会消失
|
|
189
|
+
}
|
|
190
|
+
// 注意:如果 filterOptions 变为 undefined 或 null,我们不更新稳定值,保持上一次的值
|
|
191
|
+
}, [
|
|
192
|
+
filterOptions
|
|
193
|
+
]);
|
|
194
|
+
useEffect(function() {
|
|
195
|
+
if (customOptions && customOptions.length > 1) {
|
|
196
|
+
var contentChanged = !areArraysEqual(prevCustomOptionsRef.current, customOptions);
|
|
197
|
+
if (contentChanged) {
|
|
198
|
+
setStableCustomOptions(customOptions);
|
|
199
|
+
prevCustomOptionsRef.current = customOptions;
|
|
200
|
+
}
|
|
17
201
|
}
|
|
202
|
+
}, [
|
|
203
|
+
customOptions
|
|
204
|
+
]);
|
|
205
|
+
var handleRegionChange = function(region) {
|
|
206
|
+
debouncedSelectionChange(region);
|
|
207
|
+
};
|
|
208
|
+
var handleFilterChange = function(value) {
|
|
209
|
+
debouncedFilterChange(value);
|
|
18
210
|
};
|
|
19
|
-
var hasMain = Array.isArray(
|
|
20
|
-
var hasSecondary = Array.isArray(
|
|
211
|
+
var hasMain = Array.isArray(stableFilterOptions) && stableFilterOptions.length > 1;
|
|
212
|
+
var hasSecondary = Array.isArray(stableCustomOptions) && stableCustomOptions.length > 1;
|
|
21
213
|
if (!hasMain && !hasSecondary) {
|
|
22
214
|
return null;
|
|
23
215
|
}
|
|
24
|
-
if (!
|
|
216
|
+
if (!stableFilterOptions || stableFilterOptions.length < 2) {
|
|
25
217
|
return null;
|
|
26
218
|
}
|
|
27
219
|
return wrapSSR(/*#__PURE__*/ React.createElement("div", {
|
|
28
220
|
className: classNames(prefixCls, "".concat(prefixCls, "-").concat(theme), "".concat(prefixCls, "-").concat(variant), hashId, className)
|
|
29
|
-
},
|
|
221
|
+
}, stableCustomOptions && stableCustomOptions.length > 1 && /*#__PURE__*/ React.createElement("div", {
|
|
30
222
|
className: classNames("".concat(prefixCls, "-region-filter"), hashId)
|
|
31
223
|
}, /*#__PURE__*/ React.createElement(Dropdown, {
|
|
32
224
|
menu: {
|
|
33
|
-
items:
|
|
225
|
+
items: stableCustomOptions.map(function(item) {
|
|
34
226
|
return {
|
|
35
227
|
key: item.key,
|
|
36
228
|
label: item.label,
|
|
@@ -52,18 +244,20 @@ var ChartFilter = function(param) {
|
|
|
52
244
|
type: "default",
|
|
53
245
|
size: "small",
|
|
54
246
|
className: classNames("".concat(prefixCls, "-region-dropdown-btn"), hashId)
|
|
55
|
-
}, /*#__PURE__*/ React.createElement("span", null, ((
|
|
247
|
+
}, /*#__PURE__*/ React.createElement("span", null, ((_stableCustomOptions_find = stableCustomOptions.find(function(r) {
|
|
56
248
|
return r.key === selectedCustomSelection;
|
|
57
|
-
})) === null ||
|
|
249
|
+
})) === null || _stableCustomOptions_find === void 0 ? void 0 : _stableCustomOptions_find.label) || (i18n === null || i18n === void 0 ? void 0 : (_i18n_locale = i18n.locale) === null || _i18n_locale === void 0 ? void 0 : _i18n_locale.all) || '全部'), /*#__PURE__*/ React.createElement(ChevronDown, {
|
|
58
250
|
className: classNames("".concat(prefixCls, "-dropdown-icon"), hashId)
|
|
59
|
-
})))),
|
|
60
|
-
options:
|
|
251
|
+
})))), stableFilterOptions && stableFilterOptions.length > 1 && /*#__PURE__*/ React.createElement(Segmented, {
|
|
252
|
+
options: stableFilterOptions || [],
|
|
61
253
|
value: selectedFilter,
|
|
62
254
|
size: "small",
|
|
63
255
|
className: classNames("".concat(prefixCls, "-segmented-filter"), 'custom-segmented', hashId),
|
|
64
256
|
onChange: function(value) {
|
|
65
|
-
return
|
|
257
|
+
return handleFilterChange(value);
|
|
66
258
|
}
|
|
67
259
|
})));
|
|
68
260
|
};
|
|
261
|
+
// 使用 React.memo 包装组件,确保内容稳定,只在 props 真正变化时重新渲染
|
|
262
|
+
var ChartFilter = /*#__PURE__*/ React.memo(ChartFilterComponent, arePropsEqual);
|
|
69
263
|
export default ChartFilter;
|
|
@@ -2,6 +2,7 @@ import { DownloadOutlined } from "@ant-design/icons";
|
|
|
2
2
|
import { ConfigProvider, Tooltip } from "antd";
|
|
3
3
|
import classNames from "classnames";
|
|
4
4
|
import React, { useContext } from "react";
|
|
5
|
+
import { Loading } from "../../../../Components/Loading";
|
|
5
6
|
import { I18nContext } from "../../../../I18n";
|
|
6
7
|
import TimeIcon from "../icons/TimeIcon";
|
|
7
8
|
import { useStyle } from "./style";
|
|
@@ -28,7 +29,7 @@ import { useStyle } from "./style";
|
|
|
28
29
|
*
|
|
29
30
|
* @since 1.0.0
|
|
30
31
|
*/ var ChartToolBar = function(param) {
|
|
31
|
-
var title = param.title, dataTime = param.dataTime, _param_className = param.className, className = _param_className === void 0 ? '' : _param_className, _param_theme = param.theme, theme = _param_theme === void 0 ? 'light' : _param_theme, onDownload = param.onDownload, extra = param.extra, filter = param.filter;
|
|
32
|
+
var title = param.title, dataTime = param.dataTime, _param_className = param.className, className = _param_className === void 0 ? '' : _param_className, _param_theme = param.theme, theme = _param_theme === void 0 ? 'light' : _param_theme, onDownload = param.onDownload, extra = param.extra, filter = param.filter, _param_loading = param.loading, loading = _param_loading === void 0 ? false : _param_loading;
|
|
32
33
|
var _i18n_locale, _i18n_locale1;
|
|
33
34
|
var getPrefixCls = useContext(ConfigProvider.ConfigContext).getPrefixCls;
|
|
34
35
|
var i18n = useContext(I18nContext);
|
|
@@ -46,7 +47,13 @@ import { useStyle } from "./style";
|
|
|
46
47
|
className: classNames(prefixCls, "".concat(prefixCls, "-").concat(theme), hashId, className)
|
|
47
48
|
}, /*#__PURE__*/ React.createElement("div", {
|
|
48
49
|
className: classNames("".concat(prefixCls, "-header-title"), hashId)
|
|
49
|
-
}, title
|
|
50
|
+
}, title, loading && /*#__PURE__*/ React.createElement(Loading, {
|
|
51
|
+
style: {
|
|
52
|
+
fontSize: '14px',
|
|
53
|
+
marginLeft: '8px',
|
|
54
|
+
flexShrink: 0
|
|
55
|
+
}
|
|
56
|
+
})), /*#__PURE__*/ React.createElement("div", {
|
|
50
57
|
className: classNames("".concat(prefixCls, "-header-actions"), hashId)
|
|
51
58
|
}, dataTime ? /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(TimeIcon, {
|
|
52
59
|
className: classNames("".concat(prefixCls, "-time-icon"), hashId)
|
|
@@ -71,7 +71,9 @@ var genStyle = function(token) {
|
|
|
71
71
|
textOverflow: 'ellipsis',
|
|
72
72
|
whiteSpace: 'nowrap',
|
|
73
73
|
marginRight: '16px',
|
|
74
|
-
minWidth: 0
|
|
74
|
+
minWidth: 0,
|
|
75
|
+
display: 'flex',
|
|
76
|
+
alignItems: 'center'
|
|
75
77
|
}), _define_property(_obj3, "".concat(token.componentCls, "-header-actions"), (_obj = {
|
|
76
78
|
display: 'flex',
|
|
77
79
|
alignItems: 'center',
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview 图表插件 Hooks 统一导出文件
|
|
3
|
+
* 提供图表组件相关的 React Hooks
|
|
4
|
+
* @author Chart Plugin Team
|
|
5
|
+
*/
|
|
6
|
+
export type { ChartStatisticConfig, StatisticConfigType } from './useChartStatistic';
|
|
7
|
+
export { useChartDataFilter } from './useChartDataFilter';
|
|
8
|
+
export { useChartStatistics } from './useChartStatistics';
|
|
9
|
+
export { useChartTheme } from './useChartTheme';
|
|
10
|
+
export { useResponsiveSize } from './useResponsiveSize';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview 图表插件 Hooks 统一导出文件
|
|
3
|
+
* 提供图表组件相关的 React Hooks
|
|
4
|
+
* @author Chart Plugin Team
|
|
5
|
+
*/ export { useChartDataFilter } from "./useChartDataFilter";
|
|
6
|
+
export { useChartStatistics } from "./useChartStatistics";
|
|
7
|
+
export { useChartTheme } from "./useChartTheme";
|
|
8
|
+
export { useResponsiveSize } from "./useResponsiveSize";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ChartDataItem } from '../utils';
|
|
3
|
+
/**
|
|
4
|
+
* 图表数据筛选 Hook
|
|
5
|
+
*
|
|
6
|
+
* 用于管理图表数据的筛选逻辑,包括分类筛选和 filterLabel 筛选。
|
|
7
|
+
* 自动处理数据变化时的筛选状态重置。
|
|
8
|
+
*
|
|
9
|
+
* @param {ChartDataItem[]} data - 原始数据数组
|
|
10
|
+
* @returns {object} 包含筛选后的数据、筛选选项和筛选状态的对象
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const {
|
|
15
|
+
* filteredData,
|
|
16
|
+
* categories,
|
|
17
|
+
* filterOptions,
|
|
18
|
+
* filterLabels,
|
|
19
|
+
* selectedFilter,
|
|
20
|
+
* setSelectedFilter,
|
|
21
|
+
* selectedFilterLabel,
|
|
22
|
+
* setSelectedFilterLabel,
|
|
23
|
+
* filteredDataByFilterLabel,
|
|
24
|
+
* } = useChartDataFilter(data);
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @since 1.0.0
|
|
28
|
+
*/
|
|
29
|
+
export declare const useChartDataFilter: (data: ChartDataItem[]) => {
|
|
30
|
+
filteredData: ChartDataItem[];
|
|
31
|
+
categories: (string | undefined)[];
|
|
32
|
+
filterOptions: {
|
|
33
|
+
label: string;
|
|
34
|
+
value: string;
|
|
35
|
+
}[];
|
|
36
|
+
filterLabels: string[] | undefined;
|
|
37
|
+
selectedFilter: string;
|
|
38
|
+
setSelectedFilter: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
39
|
+
selectedFilterLabel: string | undefined;
|
|
40
|
+
setSelectedFilterLabel: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
|
|
41
|
+
filteredDataByFilterLabel: {
|
|
42
|
+
key: string;
|
|
43
|
+
label: string;
|
|
44
|
+
}[] | undefined;
|
|
45
|
+
safeData: ChartDataItem[];
|
|
46
|
+
};
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
|
2
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
3
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
|
+
return arr2;
|
|
5
|
+
}
|
|
6
|
+
function _array_with_holes(arr) {
|
|
7
|
+
if (Array.isArray(arr)) return arr;
|
|
8
|
+
}
|
|
9
|
+
function _array_without_holes(arr) {
|
|
10
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
11
|
+
}
|
|
12
|
+
function _iterable_to_array(iter) {
|
|
13
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
14
|
+
}
|
|
15
|
+
function _iterable_to_array_limit(arr, i) {
|
|
16
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
17
|
+
if (_i == null) return;
|
|
18
|
+
var _arr = [];
|
|
19
|
+
var _n = true;
|
|
20
|
+
var _d = false;
|
|
21
|
+
var _s, _e;
|
|
22
|
+
try {
|
|
23
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
24
|
+
_arr.push(_s.value);
|
|
25
|
+
if (i && _arr.length === i) break;
|
|
26
|
+
}
|
|
27
|
+
} catch (err) {
|
|
28
|
+
_d = true;
|
|
29
|
+
_e = err;
|
|
30
|
+
} finally{
|
|
31
|
+
try {
|
|
32
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
33
|
+
} finally{
|
|
34
|
+
if (_d) throw _e;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return _arr;
|
|
38
|
+
}
|
|
39
|
+
function _non_iterable_rest() {
|
|
40
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
41
|
+
}
|
|
42
|
+
function _non_iterable_spread() {
|
|
43
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
44
|
+
}
|
|
45
|
+
function _sliced_to_array(arr, i) {
|
|
46
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
47
|
+
}
|
|
48
|
+
function _to_consumable_array(arr) {
|
|
49
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
50
|
+
}
|
|
51
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
52
|
+
if (!o) return;
|
|
53
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
54
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
55
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
56
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
57
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
58
|
+
}
|
|
59
|
+
import { useEffect, useMemo, useState } from "react";
|
|
60
|
+
import { getDataHash } from "../utils";
|
|
61
|
+
/**
|
|
62
|
+
* 图表数据筛选 Hook
|
|
63
|
+
*
|
|
64
|
+
* 用于管理图表数据的筛选逻辑,包括分类筛选和 filterLabel 筛选。
|
|
65
|
+
* 自动处理数据变化时的筛选状态重置。
|
|
66
|
+
*
|
|
67
|
+
* @param {ChartDataItem[]} data - 原始数据数组
|
|
68
|
+
* @returns {object} 包含筛选后的数据、筛选选项和筛选状态的对象
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```typescript
|
|
72
|
+
* const {
|
|
73
|
+
* filteredData,
|
|
74
|
+
* categories,
|
|
75
|
+
* filterOptions,
|
|
76
|
+
* filterLabels,
|
|
77
|
+
* selectedFilter,
|
|
78
|
+
* setSelectedFilter,
|
|
79
|
+
* selectedFilterLabel,
|
|
80
|
+
* setSelectedFilterLabel,
|
|
81
|
+
* filteredDataByFilterLabel,
|
|
82
|
+
* } = useChartDataFilter(data);
|
|
83
|
+
* ```
|
|
84
|
+
*
|
|
85
|
+
* @since 1.0.0
|
|
86
|
+
*/ export var useChartDataFilter = function(data) {
|
|
87
|
+
var safeData = Array.isArray(data) ? data : [];
|
|
88
|
+
// 使用数据哈希来优化依赖项比较
|
|
89
|
+
var dataHash = useMemo(function() {
|
|
90
|
+
return getDataHash(safeData);
|
|
91
|
+
}, [
|
|
92
|
+
safeData
|
|
93
|
+
]);
|
|
94
|
+
// 从数据中提取唯一的类别作为筛选选项
|
|
95
|
+
var categories = useMemo(function() {
|
|
96
|
+
var uniqueCategories = _to_consumable_array(new Set(safeData.map(function(item) {
|
|
97
|
+
return item.category;
|
|
98
|
+
}))).filter(Boolean);
|
|
99
|
+
return uniqueCategories;
|
|
100
|
+
}, [
|
|
101
|
+
dataHash
|
|
102
|
+
]);
|
|
103
|
+
// 从数据中提取 filterLabel,过滤掉 undefined 值
|
|
104
|
+
var validFilterLabels = useMemo(function() {
|
|
105
|
+
return safeData.map(function(item) {
|
|
106
|
+
return item.filterLabel;
|
|
107
|
+
}).filter(function(filterLabel) {
|
|
108
|
+
return filterLabel !== undefined;
|
|
109
|
+
});
|
|
110
|
+
}, [
|
|
111
|
+
dataHash
|
|
112
|
+
]);
|
|
113
|
+
var filterLabels = useMemo(function() {
|
|
114
|
+
return validFilterLabels.length > 0 ? _to_consumable_array(new Set(validFilterLabels)) : undefined;
|
|
115
|
+
}, [
|
|
116
|
+
validFilterLabels
|
|
117
|
+
]);
|
|
118
|
+
// 状态管理
|
|
119
|
+
var _useState = _sliced_to_array(useState(categories.find(Boolean) || ''), 2), selectedFilter = _useState[0], setSelectedFilter = _useState[1];
|
|
120
|
+
var _useState1 = _sliced_to_array(useState(filterLabels && filterLabels.length > 0 ? filterLabels[0] : undefined), 2), selectedFilterLabel = _useState1[0], setSelectedFilterLabel = _useState1[1];
|
|
121
|
+
// 当数据变化导致当前选中分类失效时,自动回退到首个有效分类或空(显示全部)
|
|
122
|
+
useEffect(function() {
|
|
123
|
+
if (selectedFilter && !categories.includes(selectedFilter)) {
|
|
124
|
+
setSelectedFilter(categories.find(Boolean) || '');
|
|
125
|
+
}
|
|
126
|
+
}, [
|
|
127
|
+
categories,
|
|
128
|
+
selectedFilter
|
|
129
|
+
]);
|
|
130
|
+
// 筛选数据
|
|
131
|
+
var filteredData = useMemo(function() {
|
|
132
|
+
var base = selectedFilter ? safeData.filter(function(item) {
|
|
133
|
+
return item.category === selectedFilter;
|
|
134
|
+
}) : safeData;
|
|
135
|
+
var withFilterLabel = !filterLabels || !selectedFilterLabel ? base : base.filter(function(item) {
|
|
136
|
+
return item.filterLabel === selectedFilterLabel;
|
|
137
|
+
});
|
|
138
|
+
// 统一过滤掉 x 为空(null/undefined)的数据,避免后续 toString 报错
|
|
139
|
+
return withFilterLabel.filter(function(item) {
|
|
140
|
+
return item.x !== null && item.x !== undefined;
|
|
141
|
+
});
|
|
142
|
+
}, [
|
|
143
|
+
dataHash,
|
|
144
|
+
selectedFilter,
|
|
145
|
+
filterLabels,
|
|
146
|
+
selectedFilterLabel
|
|
147
|
+
]);
|
|
148
|
+
// 筛选器选项
|
|
149
|
+
var filterOptions = useMemo(function() {
|
|
150
|
+
return categories.map(function(category) {
|
|
151
|
+
return {
|
|
152
|
+
label: category || '默认',
|
|
153
|
+
value: category || '默认'
|
|
154
|
+
};
|
|
155
|
+
});
|
|
156
|
+
}, [
|
|
157
|
+
categories
|
|
158
|
+
]);
|
|
159
|
+
// 根据 filterLabel 筛选数据 - 只有当 filterLabels 存在时才生成
|
|
160
|
+
var filteredDataByFilterLabel = useMemo(function() {
|
|
161
|
+
return filterLabels === null || filterLabels === void 0 ? void 0 : filterLabels.map(function(item) {
|
|
162
|
+
return {
|
|
163
|
+
key: item,
|
|
164
|
+
label: item
|
|
165
|
+
};
|
|
166
|
+
});
|
|
167
|
+
}, [
|
|
168
|
+
filterLabels
|
|
169
|
+
]);
|
|
170
|
+
return {
|
|
171
|
+
filteredData: filteredData,
|
|
172
|
+
categories: categories,
|
|
173
|
+
filterOptions: filterOptions,
|
|
174
|
+
filterLabels: filterLabels,
|
|
175
|
+
selectedFilter: selectedFilter,
|
|
176
|
+
setSelectedFilter: setSelectedFilter,
|
|
177
|
+
selectedFilterLabel: selectedFilterLabel,
|
|
178
|
+
setSelectedFilterLabel: setSelectedFilterLabel,
|
|
179
|
+
filteredDataByFilterLabel: filteredDataByFilterLabel,
|
|
180
|
+
safeData: safeData
|
|
181
|
+
};
|
|
182
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { StatisticConfigType } from './useChartStatistic';
|
|
2
|
+
/**
|
|
3
|
+
* 图表统计信息 Hook
|
|
4
|
+
*
|
|
5
|
+
* 用于处理 ChartStatistic 组件的配置,支持单个配置对象或配置数组。
|
|
6
|
+
*
|
|
7
|
+
* @param {StatisticConfigType} statisticConfig - 统计配置,可以是单个配置对象或配置数组
|
|
8
|
+
* @returns {ChartStatisticConfig[] | null} 处理后的统计配置数组,如果未提供配置则返回 null
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const statistics = useChartStatistics(statisticConfig);
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @since 1.0.0
|
|
16
|
+
*/
|
|
17
|
+
export declare const useChartStatistics: (statisticConfig?: StatisticConfigType) => import("./useChartStatistic").ChartStatisticConfig[] | null;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* 图表统计信息 Hook
|
|
4
|
+
*
|
|
5
|
+
* 用于处理 ChartStatistic 组件的配置,支持单个配置对象或配置数组。
|
|
6
|
+
*
|
|
7
|
+
* @param {StatisticConfigType} statisticConfig - 统计配置,可以是单个配置对象或配置数组
|
|
8
|
+
* @returns {ChartStatisticConfig[] | null} 处理后的统计配置数组,如果未提供配置则返回 null
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const statistics = useChartStatistics(statisticConfig);
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @since 1.0.0
|
|
16
|
+
*/ export var useChartStatistics = function(statisticConfig) {
|
|
17
|
+
return useMemo(function() {
|
|
18
|
+
if (!statisticConfig) return null;
|
|
19
|
+
return Array.isArray(statisticConfig) ? statisticConfig : [
|
|
20
|
+
statisticConfig
|
|
21
|
+
];
|
|
22
|
+
}, [
|
|
23
|
+
statisticConfig
|
|
24
|
+
]);
|
|
25
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 图表主题 Hook
|
|
3
|
+
*
|
|
4
|
+
* 用于计算图表在不同主题下的颜色配置,包括坐标轴文字颜色和网格颜色。
|
|
5
|
+
*
|
|
6
|
+
* @param {'light' | 'dark'} theme - 图表主题
|
|
7
|
+
* @returns {object} 包含主题相关颜色的对象
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const { axisTextColor, gridColor, isLight } = useChartTheme('light');
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @since 1.0.0
|
|
15
|
+
*/
|
|
16
|
+
export declare const useChartTheme: (theme?: 'light' | 'dark') => {
|
|
17
|
+
isLight: boolean;
|
|
18
|
+
axisTextColor: string;
|
|
19
|
+
gridColor: string;
|
|
20
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* 图表主题 Hook
|
|
4
|
+
*
|
|
5
|
+
* 用于计算图表在不同主题下的颜色配置,包括坐标轴文字颜色和网格颜色。
|
|
6
|
+
*
|
|
7
|
+
* @param {'light' | 'dark'} theme - 图表主题
|
|
8
|
+
* @returns {object} 包含主题相关颜色的对象
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const { axisTextColor, gridColor, isLight } = useChartTheme('light');
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @since 1.0.0
|
|
16
|
+
*/ export var useChartTheme = function() {
|
|
17
|
+
var theme = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 'light';
|
|
18
|
+
return useMemo(function() {
|
|
19
|
+
var isLight = theme === 'light';
|
|
20
|
+
var axisTextColor = isLight ? 'rgba(0, 25, 61, 0.3255)' : 'rgba(255, 255, 255, 0.8)';
|
|
21
|
+
var gridColor = isLight ? 'rgba(0,0,0,0.08)' : 'rgba(255,255,255,0.2)';
|
|
22
|
+
return {
|
|
23
|
+
isLight: isLight,
|
|
24
|
+
axisTextColor: axisTextColor,
|
|
25
|
+
gridColor: gridColor
|
|
26
|
+
};
|
|
27
|
+
}, [
|
|
28
|
+
theme
|
|
29
|
+
]);
|
|
30
|
+
};
|