@lark-apaas/fullstack-rspack-preset 1.0.2 → 1.0.3
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.
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export { default as echarts } from
|
|
3
|
-
export
|
|
4
|
-
export declare function resgisterEchartsTheme(): void;
|
|
1
|
+
export function resgisterEchartsTheme(): void;
|
|
2
|
+
export { default as echarts } from "echarts";
|
|
3
|
+
export * from "echarts";
|
|
@@ -10,40 +10,20 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
12
|
}));
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
35
16
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
18
|
};
|
|
38
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
20
|
exports.echarts = void 0;
|
|
40
21
|
exports.resgisterEchartsTheme = resgisterEchartsTheme;
|
|
41
|
-
const echartsModule = __importStar(require("echarts"));
|
|
42
22
|
var echarts_1 = require("echarts");
|
|
43
23
|
Object.defineProperty(exports, "echarts", { enumerable: true, get: function () { return __importDefault(echarts_1).default; } });
|
|
44
|
-
exports
|
|
24
|
+
__exportStar(require("echarts"), exports);
|
|
45
25
|
const echarts_2 = require("echarts");
|
|
46
|
-
const
|
|
26
|
+
const registry_echarts_theme_1 = require("./registry_echarts_theme");
|
|
47
27
|
let isRegistered = false;
|
|
48
28
|
function resgisterEchartsTheme() {
|
|
49
29
|
// 注册 ud 主题,全局仅注册一次
|
|
@@ -51,7 +31,16 @@ function resgisterEchartsTheme() {
|
|
|
51
31
|
return;
|
|
52
32
|
}
|
|
53
33
|
isRegistered = true;
|
|
54
|
-
|
|
34
|
+
// 打包后main.js defer 执行,css会加载完成
|
|
35
|
+
(0, echarts_2.registerTheme)('ud', (0, registry_echarts_theme_1.getShadcnEChartsTheme)());
|
|
36
|
+
// 监听hmr更新完成之后重新注册主题
|
|
37
|
+
if (import.meta.webpackHot || module.hot) {
|
|
38
|
+
const hot = import.meta.webpackHot || module.hot;
|
|
39
|
+
hot.addStatusHandler(status => {
|
|
40
|
+
if (status === 'idle') {
|
|
41
|
+
(0, echarts_2.registerTheme)('ud', (0, registry_echarts_theme_1.getShadcnEChartsTheme)());
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
55
45
|
}
|
|
56
46
|
resgisterEchartsTheme();
|
|
57
|
-
// registerChinaMap();
|
|
@@ -0,0 +1,695 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 获取 CSS 变量的值,并转换为 sRGB 颜色空间的十六进制字符串
|
|
3
|
+
* @param varName CSS 变量名
|
|
4
|
+
* @param element 可选的元素,默认为 document.documentElement
|
|
5
|
+
* @returns sRGB 颜色空间的十六进制字符串
|
|
6
|
+
*/
|
|
7
|
+
export declare function getCssVariable(varName: string, element?: HTMLElement): string;
|
|
8
|
+
export declare function generateEChartsTheme(element?: HTMLElement): {
|
|
9
|
+
color: string[];
|
|
10
|
+
backgroundColor: string;
|
|
11
|
+
textStyle: {
|
|
12
|
+
color: string;
|
|
13
|
+
};
|
|
14
|
+
title: {
|
|
15
|
+
textStyle: {
|
|
16
|
+
color: string;
|
|
17
|
+
};
|
|
18
|
+
subtextStyle: {
|
|
19
|
+
color: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
line: {
|
|
23
|
+
itemStyle: {
|
|
24
|
+
borderWidth: number;
|
|
25
|
+
};
|
|
26
|
+
lineStyle: {
|
|
27
|
+
width: number;
|
|
28
|
+
};
|
|
29
|
+
symbolSize: number;
|
|
30
|
+
symbol: string;
|
|
31
|
+
smooth: boolean;
|
|
32
|
+
};
|
|
33
|
+
radar: {
|
|
34
|
+
itemStyle: {
|
|
35
|
+
borderWidth: number;
|
|
36
|
+
};
|
|
37
|
+
lineStyle: {
|
|
38
|
+
width: number;
|
|
39
|
+
};
|
|
40
|
+
symbolSize: number;
|
|
41
|
+
symbol: string;
|
|
42
|
+
smooth: boolean;
|
|
43
|
+
};
|
|
44
|
+
bar: {
|
|
45
|
+
itemStyle: {
|
|
46
|
+
barBorderWidth: number;
|
|
47
|
+
barBorderColor: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
pie: {
|
|
51
|
+
itemStyle: {
|
|
52
|
+
borderWidth: number;
|
|
53
|
+
borderColor: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
scatter: {
|
|
57
|
+
itemStyle: {
|
|
58
|
+
borderWidth: number;
|
|
59
|
+
borderColor: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
boxplot: {
|
|
63
|
+
itemStyle: {
|
|
64
|
+
borderWidth: number;
|
|
65
|
+
borderColor: string;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
parallel: {
|
|
69
|
+
itemStyle: {
|
|
70
|
+
borderWidth: number;
|
|
71
|
+
borderColor: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
sankey: {
|
|
75
|
+
itemStyle: {
|
|
76
|
+
borderWidth: number;
|
|
77
|
+
borderColor: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
funnel: {
|
|
81
|
+
itemStyle: {
|
|
82
|
+
borderWidth: number;
|
|
83
|
+
borderColor: string;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
gauge: {
|
|
87
|
+
itemStyle: {
|
|
88
|
+
borderWidth: number;
|
|
89
|
+
borderColor: string;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
candlestick: {
|
|
93
|
+
itemStyle: {
|
|
94
|
+
color: string;
|
|
95
|
+
color0: string;
|
|
96
|
+
borderColor: string;
|
|
97
|
+
borderColor0: string;
|
|
98
|
+
borderWidth: number;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
graph: {
|
|
102
|
+
itemStyle: {
|
|
103
|
+
borderWidth: number;
|
|
104
|
+
borderColor: string;
|
|
105
|
+
};
|
|
106
|
+
lineStyle: {
|
|
107
|
+
width: number;
|
|
108
|
+
color: string;
|
|
109
|
+
};
|
|
110
|
+
symbolSize: number;
|
|
111
|
+
symbol: string;
|
|
112
|
+
smooth: boolean;
|
|
113
|
+
color: string[];
|
|
114
|
+
label: {
|
|
115
|
+
color: string;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
map: {
|
|
119
|
+
itemStyle: {
|
|
120
|
+
areaColor: string;
|
|
121
|
+
borderColor: string;
|
|
122
|
+
borderWidth: number;
|
|
123
|
+
};
|
|
124
|
+
label: {
|
|
125
|
+
color: string;
|
|
126
|
+
};
|
|
127
|
+
emphasis: {
|
|
128
|
+
itemStyle: {
|
|
129
|
+
areaColor: string;
|
|
130
|
+
borderColor: string;
|
|
131
|
+
borderWidth: number;
|
|
132
|
+
};
|
|
133
|
+
label: {
|
|
134
|
+
color: string;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
geo: {
|
|
139
|
+
itemStyle: {
|
|
140
|
+
areaColor: string;
|
|
141
|
+
borderColor: string;
|
|
142
|
+
borderWidth: number;
|
|
143
|
+
};
|
|
144
|
+
label: {
|
|
145
|
+
color: string;
|
|
146
|
+
};
|
|
147
|
+
emphasis: {
|
|
148
|
+
itemStyle: {
|
|
149
|
+
areaColor: string;
|
|
150
|
+
borderColor: string;
|
|
151
|
+
borderWidth: number;
|
|
152
|
+
};
|
|
153
|
+
label: {
|
|
154
|
+
color: string;
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
categoryAxis: {
|
|
159
|
+
axisLine: {
|
|
160
|
+
show: boolean;
|
|
161
|
+
lineStyle: {
|
|
162
|
+
color: string;
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
axisTick: {
|
|
166
|
+
show: boolean;
|
|
167
|
+
lineStyle: {
|
|
168
|
+
color: string;
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
axisLabel: {
|
|
172
|
+
show: boolean;
|
|
173
|
+
color: string;
|
|
174
|
+
};
|
|
175
|
+
splitLine: {
|
|
176
|
+
show: boolean;
|
|
177
|
+
lineStyle: {
|
|
178
|
+
color: string[];
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
splitArea: {
|
|
182
|
+
show: boolean;
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
valueAxis: {
|
|
186
|
+
axisLine: {
|
|
187
|
+
show: boolean;
|
|
188
|
+
lineStyle: {
|
|
189
|
+
color: string;
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
axisTick: {
|
|
193
|
+
show: boolean;
|
|
194
|
+
lineStyle: {
|
|
195
|
+
color: string;
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
axisLabel: {
|
|
199
|
+
show: boolean;
|
|
200
|
+
color: string;
|
|
201
|
+
};
|
|
202
|
+
splitLine: {
|
|
203
|
+
show: boolean;
|
|
204
|
+
lineStyle: {
|
|
205
|
+
color: string[];
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
splitArea: {
|
|
209
|
+
show: boolean;
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
logAxis: {
|
|
213
|
+
axisLine: {
|
|
214
|
+
show: boolean;
|
|
215
|
+
lineStyle: {
|
|
216
|
+
color: string;
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
axisTick: {
|
|
220
|
+
show: boolean;
|
|
221
|
+
lineStyle: {
|
|
222
|
+
color: string;
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
axisLabel: {
|
|
226
|
+
show: boolean;
|
|
227
|
+
color: string;
|
|
228
|
+
};
|
|
229
|
+
splitLine: {
|
|
230
|
+
show: boolean;
|
|
231
|
+
lineStyle: {
|
|
232
|
+
color: string[];
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
splitArea: {
|
|
236
|
+
show: boolean;
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
timeAxis: {
|
|
240
|
+
axisLine: {
|
|
241
|
+
show: boolean;
|
|
242
|
+
lineStyle: {
|
|
243
|
+
color: string;
|
|
244
|
+
};
|
|
245
|
+
};
|
|
246
|
+
axisTick: {
|
|
247
|
+
show: boolean;
|
|
248
|
+
lineStyle: {
|
|
249
|
+
color: string;
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
axisLabel: {
|
|
253
|
+
show: boolean;
|
|
254
|
+
color: string;
|
|
255
|
+
};
|
|
256
|
+
splitLine: {
|
|
257
|
+
show: boolean;
|
|
258
|
+
lineStyle: {
|
|
259
|
+
color: string[];
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
splitArea: {
|
|
263
|
+
show: boolean;
|
|
264
|
+
};
|
|
265
|
+
};
|
|
266
|
+
toolbox: {
|
|
267
|
+
iconStyle: {
|
|
268
|
+
borderColor: string;
|
|
269
|
+
};
|
|
270
|
+
emphasis: {
|
|
271
|
+
iconStyle: {
|
|
272
|
+
borderColor: string;
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
legend: {
|
|
277
|
+
textStyle: {
|
|
278
|
+
color: string;
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
tooltip: {
|
|
282
|
+
axisPointer: {
|
|
283
|
+
lineStyle: {
|
|
284
|
+
color: string;
|
|
285
|
+
width: number;
|
|
286
|
+
};
|
|
287
|
+
crossStyle: {
|
|
288
|
+
color: string;
|
|
289
|
+
width: number;
|
|
290
|
+
};
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
timeline: {
|
|
294
|
+
lineStyle: {
|
|
295
|
+
color: string;
|
|
296
|
+
width: number;
|
|
297
|
+
};
|
|
298
|
+
itemStyle: {
|
|
299
|
+
color: string;
|
|
300
|
+
borderWidth: number;
|
|
301
|
+
};
|
|
302
|
+
controlStyle: {
|
|
303
|
+
color: string;
|
|
304
|
+
borderColor: string;
|
|
305
|
+
borderWidth: number;
|
|
306
|
+
};
|
|
307
|
+
checkpointStyle: {
|
|
308
|
+
color: string;
|
|
309
|
+
borderColor: string;
|
|
310
|
+
};
|
|
311
|
+
label: {
|
|
312
|
+
color: string;
|
|
313
|
+
};
|
|
314
|
+
emphasis: {
|
|
315
|
+
itemStyle: {
|
|
316
|
+
color: string;
|
|
317
|
+
};
|
|
318
|
+
controlStyle: {
|
|
319
|
+
color: string;
|
|
320
|
+
borderColor: string;
|
|
321
|
+
borderWidth: number;
|
|
322
|
+
};
|
|
323
|
+
label: {
|
|
324
|
+
color: string;
|
|
325
|
+
};
|
|
326
|
+
};
|
|
327
|
+
};
|
|
328
|
+
visualMap: {
|
|
329
|
+
color: string[];
|
|
330
|
+
};
|
|
331
|
+
dataZoom: {
|
|
332
|
+
backgroundColor: string;
|
|
333
|
+
dataBackgroundColor: string;
|
|
334
|
+
fillerColor: string;
|
|
335
|
+
handleColor: string;
|
|
336
|
+
handleSize: string;
|
|
337
|
+
textStyle: {
|
|
338
|
+
color: string;
|
|
339
|
+
};
|
|
340
|
+
};
|
|
341
|
+
markPoint: {
|
|
342
|
+
label: {
|
|
343
|
+
color: string;
|
|
344
|
+
};
|
|
345
|
+
emphasis: {
|
|
346
|
+
label: {
|
|
347
|
+
color: string;
|
|
348
|
+
};
|
|
349
|
+
};
|
|
350
|
+
};
|
|
351
|
+
};
|
|
352
|
+
export declare function getShadcnEChartsTheme(): {
|
|
353
|
+
color: string[];
|
|
354
|
+
backgroundColor: string;
|
|
355
|
+
textStyle: {
|
|
356
|
+
color: string;
|
|
357
|
+
};
|
|
358
|
+
title: {
|
|
359
|
+
textStyle: {
|
|
360
|
+
color: string;
|
|
361
|
+
};
|
|
362
|
+
subtextStyle: {
|
|
363
|
+
color: string;
|
|
364
|
+
};
|
|
365
|
+
};
|
|
366
|
+
line: {
|
|
367
|
+
itemStyle: {
|
|
368
|
+
borderWidth: number;
|
|
369
|
+
};
|
|
370
|
+
lineStyle: {
|
|
371
|
+
width: number;
|
|
372
|
+
};
|
|
373
|
+
symbolSize: number;
|
|
374
|
+
symbol: string;
|
|
375
|
+
smooth: boolean;
|
|
376
|
+
};
|
|
377
|
+
radar: {
|
|
378
|
+
itemStyle: {
|
|
379
|
+
borderWidth: number;
|
|
380
|
+
};
|
|
381
|
+
lineStyle: {
|
|
382
|
+
width: number;
|
|
383
|
+
};
|
|
384
|
+
symbolSize: number;
|
|
385
|
+
symbol: string;
|
|
386
|
+
smooth: boolean;
|
|
387
|
+
};
|
|
388
|
+
bar: {
|
|
389
|
+
itemStyle: {
|
|
390
|
+
barBorderWidth: number;
|
|
391
|
+
barBorderColor: string;
|
|
392
|
+
};
|
|
393
|
+
};
|
|
394
|
+
pie: {
|
|
395
|
+
itemStyle: {
|
|
396
|
+
borderWidth: number;
|
|
397
|
+
borderColor: string;
|
|
398
|
+
};
|
|
399
|
+
};
|
|
400
|
+
scatter: {
|
|
401
|
+
itemStyle: {
|
|
402
|
+
borderWidth: number;
|
|
403
|
+
borderColor: string;
|
|
404
|
+
};
|
|
405
|
+
};
|
|
406
|
+
boxplot: {
|
|
407
|
+
itemStyle: {
|
|
408
|
+
borderWidth: number;
|
|
409
|
+
borderColor: string;
|
|
410
|
+
};
|
|
411
|
+
};
|
|
412
|
+
parallel: {
|
|
413
|
+
itemStyle: {
|
|
414
|
+
borderWidth: number;
|
|
415
|
+
borderColor: string;
|
|
416
|
+
};
|
|
417
|
+
};
|
|
418
|
+
sankey: {
|
|
419
|
+
itemStyle: {
|
|
420
|
+
borderWidth: number;
|
|
421
|
+
borderColor: string;
|
|
422
|
+
};
|
|
423
|
+
};
|
|
424
|
+
funnel: {
|
|
425
|
+
itemStyle: {
|
|
426
|
+
borderWidth: number;
|
|
427
|
+
borderColor: string;
|
|
428
|
+
};
|
|
429
|
+
};
|
|
430
|
+
gauge: {
|
|
431
|
+
itemStyle: {
|
|
432
|
+
borderWidth: number;
|
|
433
|
+
borderColor: string;
|
|
434
|
+
};
|
|
435
|
+
};
|
|
436
|
+
candlestick: {
|
|
437
|
+
itemStyle: {
|
|
438
|
+
color: string;
|
|
439
|
+
color0: string;
|
|
440
|
+
borderColor: string;
|
|
441
|
+
borderColor0: string;
|
|
442
|
+
borderWidth: number;
|
|
443
|
+
};
|
|
444
|
+
};
|
|
445
|
+
graph: {
|
|
446
|
+
itemStyle: {
|
|
447
|
+
borderWidth: number;
|
|
448
|
+
borderColor: string;
|
|
449
|
+
};
|
|
450
|
+
lineStyle: {
|
|
451
|
+
width: number;
|
|
452
|
+
color: string;
|
|
453
|
+
};
|
|
454
|
+
symbolSize: number;
|
|
455
|
+
symbol: string;
|
|
456
|
+
smooth: boolean;
|
|
457
|
+
color: string[];
|
|
458
|
+
label: {
|
|
459
|
+
color: string;
|
|
460
|
+
};
|
|
461
|
+
};
|
|
462
|
+
map: {
|
|
463
|
+
itemStyle: {
|
|
464
|
+
areaColor: string;
|
|
465
|
+
borderColor: string;
|
|
466
|
+
borderWidth: number;
|
|
467
|
+
};
|
|
468
|
+
label: {
|
|
469
|
+
color: string;
|
|
470
|
+
};
|
|
471
|
+
emphasis: {
|
|
472
|
+
itemStyle: {
|
|
473
|
+
areaColor: string;
|
|
474
|
+
borderColor: string;
|
|
475
|
+
borderWidth: number;
|
|
476
|
+
};
|
|
477
|
+
label: {
|
|
478
|
+
color: string;
|
|
479
|
+
};
|
|
480
|
+
};
|
|
481
|
+
};
|
|
482
|
+
geo: {
|
|
483
|
+
itemStyle: {
|
|
484
|
+
areaColor: string;
|
|
485
|
+
borderColor: string;
|
|
486
|
+
borderWidth: number;
|
|
487
|
+
};
|
|
488
|
+
label: {
|
|
489
|
+
color: string;
|
|
490
|
+
};
|
|
491
|
+
emphasis: {
|
|
492
|
+
itemStyle: {
|
|
493
|
+
areaColor: string;
|
|
494
|
+
borderColor: string;
|
|
495
|
+
borderWidth: number;
|
|
496
|
+
};
|
|
497
|
+
label: {
|
|
498
|
+
color: string;
|
|
499
|
+
};
|
|
500
|
+
};
|
|
501
|
+
};
|
|
502
|
+
categoryAxis: {
|
|
503
|
+
axisLine: {
|
|
504
|
+
show: boolean;
|
|
505
|
+
lineStyle: {
|
|
506
|
+
color: string;
|
|
507
|
+
};
|
|
508
|
+
};
|
|
509
|
+
axisTick: {
|
|
510
|
+
show: boolean;
|
|
511
|
+
lineStyle: {
|
|
512
|
+
color: string;
|
|
513
|
+
};
|
|
514
|
+
};
|
|
515
|
+
axisLabel: {
|
|
516
|
+
show: boolean;
|
|
517
|
+
color: string;
|
|
518
|
+
};
|
|
519
|
+
splitLine: {
|
|
520
|
+
show: boolean;
|
|
521
|
+
lineStyle: {
|
|
522
|
+
color: string[];
|
|
523
|
+
};
|
|
524
|
+
};
|
|
525
|
+
splitArea: {
|
|
526
|
+
show: boolean;
|
|
527
|
+
};
|
|
528
|
+
};
|
|
529
|
+
valueAxis: {
|
|
530
|
+
axisLine: {
|
|
531
|
+
show: boolean;
|
|
532
|
+
lineStyle: {
|
|
533
|
+
color: string;
|
|
534
|
+
};
|
|
535
|
+
};
|
|
536
|
+
axisTick: {
|
|
537
|
+
show: boolean;
|
|
538
|
+
lineStyle: {
|
|
539
|
+
color: string;
|
|
540
|
+
};
|
|
541
|
+
};
|
|
542
|
+
axisLabel: {
|
|
543
|
+
show: boolean;
|
|
544
|
+
color: string;
|
|
545
|
+
};
|
|
546
|
+
splitLine: {
|
|
547
|
+
show: boolean;
|
|
548
|
+
lineStyle: {
|
|
549
|
+
color: string[];
|
|
550
|
+
};
|
|
551
|
+
};
|
|
552
|
+
splitArea: {
|
|
553
|
+
show: boolean;
|
|
554
|
+
};
|
|
555
|
+
};
|
|
556
|
+
logAxis: {
|
|
557
|
+
axisLine: {
|
|
558
|
+
show: boolean;
|
|
559
|
+
lineStyle: {
|
|
560
|
+
color: string;
|
|
561
|
+
};
|
|
562
|
+
};
|
|
563
|
+
axisTick: {
|
|
564
|
+
show: boolean;
|
|
565
|
+
lineStyle: {
|
|
566
|
+
color: string;
|
|
567
|
+
};
|
|
568
|
+
};
|
|
569
|
+
axisLabel: {
|
|
570
|
+
show: boolean;
|
|
571
|
+
color: string;
|
|
572
|
+
};
|
|
573
|
+
splitLine: {
|
|
574
|
+
show: boolean;
|
|
575
|
+
lineStyle: {
|
|
576
|
+
color: string[];
|
|
577
|
+
};
|
|
578
|
+
};
|
|
579
|
+
splitArea: {
|
|
580
|
+
show: boolean;
|
|
581
|
+
};
|
|
582
|
+
};
|
|
583
|
+
timeAxis: {
|
|
584
|
+
axisLine: {
|
|
585
|
+
show: boolean;
|
|
586
|
+
lineStyle: {
|
|
587
|
+
color: string;
|
|
588
|
+
};
|
|
589
|
+
};
|
|
590
|
+
axisTick: {
|
|
591
|
+
show: boolean;
|
|
592
|
+
lineStyle: {
|
|
593
|
+
color: string;
|
|
594
|
+
};
|
|
595
|
+
};
|
|
596
|
+
axisLabel: {
|
|
597
|
+
show: boolean;
|
|
598
|
+
color: string;
|
|
599
|
+
};
|
|
600
|
+
splitLine: {
|
|
601
|
+
show: boolean;
|
|
602
|
+
lineStyle: {
|
|
603
|
+
color: string[];
|
|
604
|
+
};
|
|
605
|
+
};
|
|
606
|
+
splitArea: {
|
|
607
|
+
show: boolean;
|
|
608
|
+
};
|
|
609
|
+
};
|
|
610
|
+
toolbox: {
|
|
611
|
+
iconStyle: {
|
|
612
|
+
borderColor: string;
|
|
613
|
+
};
|
|
614
|
+
emphasis: {
|
|
615
|
+
iconStyle: {
|
|
616
|
+
borderColor: string;
|
|
617
|
+
};
|
|
618
|
+
};
|
|
619
|
+
};
|
|
620
|
+
legend: {
|
|
621
|
+
textStyle: {
|
|
622
|
+
color: string;
|
|
623
|
+
};
|
|
624
|
+
};
|
|
625
|
+
tooltip: {
|
|
626
|
+
axisPointer: {
|
|
627
|
+
lineStyle: {
|
|
628
|
+
color: string;
|
|
629
|
+
width: number;
|
|
630
|
+
};
|
|
631
|
+
crossStyle: {
|
|
632
|
+
color: string;
|
|
633
|
+
width: number;
|
|
634
|
+
};
|
|
635
|
+
};
|
|
636
|
+
};
|
|
637
|
+
timeline: {
|
|
638
|
+
lineStyle: {
|
|
639
|
+
color: string;
|
|
640
|
+
width: number;
|
|
641
|
+
};
|
|
642
|
+
itemStyle: {
|
|
643
|
+
color: string;
|
|
644
|
+
borderWidth: number;
|
|
645
|
+
};
|
|
646
|
+
controlStyle: {
|
|
647
|
+
color: string;
|
|
648
|
+
borderColor: string;
|
|
649
|
+
borderWidth: number;
|
|
650
|
+
};
|
|
651
|
+
checkpointStyle: {
|
|
652
|
+
color: string;
|
|
653
|
+
borderColor: string;
|
|
654
|
+
};
|
|
655
|
+
label: {
|
|
656
|
+
color: string;
|
|
657
|
+
};
|
|
658
|
+
emphasis: {
|
|
659
|
+
itemStyle: {
|
|
660
|
+
color: string;
|
|
661
|
+
};
|
|
662
|
+
controlStyle: {
|
|
663
|
+
color: string;
|
|
664
|
+
borderColor: string;
|
|
665
|
+
borderWidth: number;
|
|
666
|
+
};
|
|
667
|
+
label: {
|
|
668
|
+
color: string;
|
|
669
|
+
};
|
|
670
|
+
};
|
|
671
|
+
};
|
|
672
|
+
visualMap: {
|
|
673
|
+
color: string[];
|
|
674
|
+
};
|
|
675
|
+
dataZoom: {
|
|
676
|
+
backgroundColor: string;
|
|
677
|
+
dataBackgroundColor: string;
|
|
678
|
+
fillerColor: string;
|
|
679
|
+
handleColor: string;
|
|
680
|
+
handleSize: string;
|
|
681
|
+
textStyle: {
|
|
682
|
+
color: string;
|
|
683
|
+
};
|
|
684
|
+
};
|
|
685
|
+
markPoint: {
|
|
686
|
+
label: {
|
|
687
|
+
color: string;
|
|
688
|
+
};
|
|
689
|
+
emphasis: {
|
|
690
|
+
label: {
|
|
691
|
+
color: string;
|
|
692
|
+
};
|
|
693
|
+
};
|
|
694
|
+
};
|
|
695
|
+
};
|
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getCssVariable = getCssVariable;
|
|
7
|
+
exports.generateEChartsTheme = generateEChartsTheme;
|
|
8
|
+
exports.getShadcnEChartsTheme = getShadcnEChartsTheme;
|
|
9
|
+
const colorjs_io_1 = __importDefault(require("colorjs.io"));
|
|
10
|
+
/**
|
|
11
|
+
* 获取 CSS 变量的值,并转换为 sRGB 颜色空间的十六进制字符串
|
|
12
|
+
* @param varName CSS 变量名
|
|
13
|
+
* @param element 可选的元素,默认为 document.documentElement
|
|
14
|
+
* @returns sRGB 颜色空间的十六进制字符串
|
|
15
|
+
*/
|
|
16
|
+
function getCssVariable(varName, element = document.body) {
|
|
17
|
+
const value = window
|
|
18
|
+
.getComputedStyle(element)
|
|
19
|
+
.getPropertyValue(varName)
|
|
20
|
+
.trim();
|
|
21
|
+
if (!value) {
|
|
22
|
+
return '';
|
|
23
|
+
}
|
|
24
|
+
return new colorjs_io_1.default(value).to('srgb').toString({ format: 'hex' });
|
|
25
|
+
}
|
|
26
|
+
// 生成 ECharts 主题配置
|
|
27
|
+
function generateEChartsTheme(element = document.body) {
|
|
28
|
+
// 获取图表颜色
|
|
29
|
+
const chartColors = [
|
|
30
|
+
getCssVariable('--chart-1', element),
|
|
31
|
+
getCssVariable('--chart-2', element),
|
|
32
|
+
getCssVariable('--chart-3', element),
|
|
33
|
+
getCssVariable('--chart-4', element),
|
|
34
|
+
getCssVariable('--chart-5', element),
|
|
35
|
+
];
|
|
36
|
+
// 获取其他颜色变量
|
|
37
|
+
const background = getCssVariable('--background', element);
|
|
38
|
+
const foreground = getCssVariable('--foreground', element);
|
|
39
|
+
const muted = getCssVariable('--muted', element);
|
|
40
|
+
const mutedForeground = getCssVariable('--muted-foreground', element);
|
|
41
|
+
const border = getCssVariable('--border', element);
|
|
42
|
+
const primary = getCssVariable('--primary', element);
|
|
43
|
+
const fullTheme = {
|
|
44
|
+
color: chartColors,
|
|
45
|
+
backgroundColor: 'transparent',
|
|
46
|
+
textStyle: {
|
|
47
|
+
color: foreground,
|
|
48
|
+
},
|
|
49
|
+
title: {
|
|
50
|
+
textStyle: {
|
|
51
|
+
color: foreground,
|
|
52
|
+
},
|
|
53
|
+
subtextStyle: {
|
|
54
|
+
color: mutedForeground,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
line: {
|
|
58
|
+
itemStyle: {
|
|
59
|
+
borderWidth: 1,
|
|
60
|
+
},
|
|
61
|
+
lineStyle: {
|
|
62
|
+
width: 2,
|
|
63
|
+
},
|
|
64
|
+
symbolSize: 4,
|
|
65
|
+
symbol: 'circle',
|
|
66
|
+
smooth: false,
|
|
67
|
+
},
|
|
68
|
+
radar: {
|
|
69
|
+
itemStyle: {
|
|
70
|
+
borderWidth: 1,
|
|
71
|
+
},
|
|
72
|
+
lineStyle: {
|
|
73
|
+
width: 2,
|
|
74
|
+
},
|
|
75
|
+
symbolSize: 4,
|
|
76
|
+
symbol: 'circle',
|
|
77
|
+
smooth: false,
|
|
78
|
+
},
|
|
79
|
+
bar: {
|
|
80
|
+
itemStyle: {
|
|
81
|
+
barBorderWidth: 0,
|
|
82
|
+
barBorderColor: border,
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
pie: {
|
|
86
|
+
itemStyle: {
|
|
87
|
+
borderWidth: 0,
|
|
88
|
+
borderColor: border,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
scatter: {
|
|
92
|
+
itemStyle: {
|
|
93
|
+
borderWidth: 0,
|
|
94
|
+
borderColor: border,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
boxplot: {
|
|
98
|
+
itemStyle: {
|
|
99
|
+
borderWidth: 0,
|
|
100
|
+
borderColor: border,
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
parallel: {
|
|
104
|
+
itemStyle: {
|
|
105
|
+
borderWidth: 0,
|
|
106
|
+
borderColor: border,
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
sankey: {
|
|
110
|
+
itemStyle: {
|
|
111
|
+
borderWidth: 0,
|
|
112
|
+
borderColor: border,
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
funnel: {
|
|
116
|
+
itemStyle: {
|
|
117
|
+
borderWidth: 0,
|
|
118
|
+
borderColor: border,
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
gauge: {
|
|
122
|
+
itemStyle: {
|
|
123
|
+
borderWidth: 0,
|
|
124
|
+
borderColor: border,
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
candlestick: {
|
|
128
|
+
itemStyle: {
|
|
129
|
+
color: chartColors[0],
|
|
130
|
+
color0: chartColors[1],
|
|
131
|
+
borderColor: chartColors[0],
|
|
132
|
+
borderColor0: chartColors[1],
|
|
133
|
+
borderWidth: 1,
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
graph: {
|
|
137
|
+
itemStyle: {
|
|
138
|
+
borderWidth: 0,
|
|
139
|
+
borderColor: border,
|
|
140
|
+
},
|
|
141
|
+
lineStyle: {
|
|
142
|
+
width: 1,
|
|
143
|
+
color: mutedForeground,
|
|
144
|
+
},
|
|
145
|
+
symbolSize: 4,
|
|
146
|
+
symbol: 'circle',
|
|
147
|
+
smooth: false,
|
|
148
|
+
color: chartColors,
|
|
149
|
+
label: {
|
|
150
|
+
color: foreground,
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
map: {
|
|
154
|
+
itemStyle: {
|
|
155
|
+
areaColor: muted,
|
|
156
|
+
borderColor: border,
|
|
157
|
+
borderWidth: 0.5,
|
|
158
|
+
},
|
|
159
|
+
label: {
|
|
160
|
+
color: foreground,
|
|
161
|
+
},
|
|
162
|
+
emphasis: {
|
|
163
|
+
itemStyle: {
|
|
164
|
+
areaColor: chartColors[0],
|
|
165
|
+
borderColor: chartColors[1],
|
|
166
|
+
borderWidth: 1,
|
|
167
|
+
},
|
|
168
|
+
label: {
|
|
169
|
+
color: foreground,
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
geo: {
|
|
174
|
+
itemStyle: {
|
|
175
|
+
areaColor: muted,
|
|
176
|
+
borderColor: border,
|
|
177
|
+
borderWidth: 0.5,
|
|
178
|
+
},
|
|
179
|
+
label: {
|
|
180
|
+
color: foreground,
|
|
181
|
+
},
|
|
182
|
+
emphasis: {
|
|
183
|
+
itemStyle: {
|
|
184
|
+
areaColor: chartColors[0],
|
|
185
|
+
borderColor: chartColors[1],
|
|
186
|
+
borderWidth: 1,
|
|
187
|
+
},
|
|
188
|
+
label: {
|
|
189
|
+
color: foreground,
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
categoryAxis: {
|
|
194
|
+
axisLine: {
|
|
195
|
+
show: true,
|
|
196
|
+
lineStyle: {
|
|
197
|
+
color: border,
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
axisTick: {
|
|
201
|
+
show: true,
|
|
202
|
+
lineStyle: {
|
|
203
|
+
color: border,
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
axisLabel: {
|
|
207
|
+
show: true,
|
|
208
|
+
color: mutedForeground,
|
|
209
|
+
},
|
|
210
|
+
splitLine: {
|
|
211
|
+
show: false,
|
|
212
|
+
lineStyle: {
|
|
213
|
+
color: [border],
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
splitArea: {
|
|
217
|
+
show: false,
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
valueAxis: {
|
|
221
|
+
axisLine: {
|
|
222
|
+
show: true,
|
|
223
|
+
lineStyle: {
|
|
224
|
+
color: border,
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
axisTick: {
|
|
228
|
+
show: true,
|
|
229
|
+
lineStyle: {
|
|
230
|
+
color: border,
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
axisLabel: {
|
|
234
|
+
show: true,
|
|
235
|
+
color: mutedForeground,
|
|
236
|
+
},
|
|
237
|
+
splitLine: {
|
|
238
|
+
show: true,
|
|
239
|
+
lineStyle: {
|
|
240
|
+
color: [border],
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
splitArea: {
|
|
244
|
+
show: false,
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
logAxis: {
|
|
248
|
+
axisLine: {
|
|
249
|
+
show: true,
|
|
250
|
+
lineStyle: {
|
|
251
|
+
color: border,
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
axisTick: {
|
|
255
|
+
show: true,
|
|
256
|
+
lineStyle: {
|
|
257
|
+
color: border,
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
axisLabel: {
|
|
261
|
+
show: true,
|
|
262
|
+
color: mutedForeground,
|
|
263
|
+
},
|
|
264
|
+
splitLine: {
|
|
265
|
+
show: true,
|
|
266
|
+
lineStyle: {
|
|
267
|
+
color: [border],
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
splitArea: {
|
|
271
|
+
show: false,
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
timeAxis: {
|
|
275
|
+
axisLine: {
|
|
276
|
+
show: true,
|
|
277
|
+
lineStyle: {
|
|
278
|
+
color: border,
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
axisTick: {
|
|
282
|
+
show: true,
|
|
283
|
+
lineStyle: {
|
|
284
|
+
color: border,
|
|
285
|
+
},
|
|
286
|
+
},
|
|
287
|
+
axisLabel: {
|
|
288
|
+
show: true,
|
|
289
|
+
color: mutedForeground,
|
|
290
|
+
},
|
|
291
|
+
splitLine: {
|
|
292
|
+
show: true,
|
|
293
|
+
lineStyle: {
|
|
294
|
+
color: [border],
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
splitArea: {
|
|
298
|
+
show: false,
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
toolbox: {
|
|
302
|
+
iconStyle: {
|
|
303
|
+
borderColor: mutedForeground,
|
|
304
|
+
},
|
|
305
|
+
emphasis: {
|
|
306
|
+
iconStyle: {
|
|
307
|
+
borderColor: primary,
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
},
|
|
311
|
+
legend: {
|
|
312
|
+
textStyle: {
|
|
313
|
+
color: foreground,
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
tooltip: {
|
|
317
|
+
axisPointer: {
|
|
318
|
+
lineStyle: {
|
|
319
|
+
color: border,
|
|
320
|
+
width: 1,
|
|
321
|
+
},
|
|
322
|
+
crossStyle: {
|
|
323
|
+
color: border,
|
|
324
|
+
width: 1,
|
|
325
|
+
},
|
|
326
|
+
},
|
|
327
|
+
},
|
|
328
|
+
timeline: {
|
|
329
|
+
lineStyle: {
|
|
330
|
+
color: primary,
|
|
331
|
+
width: 1,
|
|
332
|
+
},
|
|
333
|
+
itemStyle: {
|
|
334
|
+
color: primary,
|
|
335
|
+
borderWidth: 1,
|
|
336
|
+
},
|
|
337
|
+
controlStyle: {
|
|
338
|
+
color: primary,
|
|
339
|
+
borderColor: primary,
|
|
340
|
+
borderWidth: 0.5,
|
|
341
|
+
},
|
|
342
|
+
checkpointStyle: {
|
|
343
|
+
color: chartColors[1],
|
|
344
|
+
borderColor: chartColors[1],
|
|
345
|
+
},
|
|
346
|
+
label: {
|
|
347
|
+
color: mutedForeground,
|
|
348
|
+
},
|
|
349
|
+
emphasis: {
|
|
350
|
+
itemStyle: {
|
|
351
|
+
color: chartColors[1],
|
|
352
|
+
},
|
|
353
|
+
controlStyle: {
|
|
354
|
+
color: primary,
|
|
355
|
+
borderColor: primary,
|
|
356
|
+
borderWidth: 0.5,
|
|
357
|
+
},
|
|
358
|
+
label: {
|
|
359
|
+
color: mutedForeground,
|
|
360
|
+
},
|
|
361
|
+
},
|
|
362
|
+
},
|
|
363
|
+
visualMap: {
|
|
364
|
+
color: [chartColors[0], chartColors[2]],
|
|
365
|
+
},
|
|
366
|
+
dataZoom: {
|
|
367
|
+
backgroundColor: background,
|
|
368
|
+
dataBackgroundColor: border,
|
|
369
|
+
fillerColor: `${chartColors[0]}40`, // 25% opacity
|
|
370
|
+
handleColor: primary,
|
|
371
|
+
handleSize: '100%',
|
|
372
|
+
textStyle: {
|
|
373
|
+
color: foreground,
|
|
374
|
+
},
|
|
375
|
+
},
|
|
376
|
+
markPoint: {
|
|
377
|
+
label: {
|
|
378
|
+
color: foreground,
|
|
379
|
+
},
|
|
380
|
+
emphasis: {
|
|
381
|
+
label: {
|
|
382
|
+
color: foreground,
|
|
383
|
+
},
|
|
384
|
+
},
|
|
385
|
+
},
|
|
386
|
+
};
|
|
387
|
+
return fullTheme;
|
|
388
|
+
}
|
|
389
|
+
// 获取当前主题的 ECharts 配置
|
|
390
|
+
function getShadcnEChartsTheme() {
|
|
391
|
+
// body
|
|
392
|
+
return generateEChartsTheme(document.body);
|
|
393
|
+
}
|
package/lib/preset.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lark-apaas/fullstack-rspack-preset",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"files": [
|
|
5
5
|
"lib",
|
|
6
6
|
"preset.config.js"
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"@lark-apaas/miaoda-inspector-jsx-runtime": "^1.0.0",
|
|
32
32
|
"@rspack/plugin-react-refresh": "^1.5.1",
|
|
33
33
|
"clsx": "^2.1.1",
|
|
34
|
+
"colorjs.io": "^0.5.2",
|
|
34
35
|
"dotenv": "^16.4.5",
|
|
35
36
|
"echarts": "^6.0.0",
|
|
36
37
|
"postcss-import": "^16.1.1",
|