mrxy-yk 1.2.11 → 1.3.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.
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, shallowRef, onMounted, openBlock, createElementBlock, createBlock, unref, createCommentVNode, createElementVNode, normalizeClass, normalizeStyle, renderSlot } from "vue";
2
2
  import { EChartsUtil } from "../../utils/echarts/utils/index.js";
3
3
  import { echarts } from "../../utils/echarts/index.js";
4
- import { initDarkTheme } from "../../utils/echarts/themes/index.js";
4
+ import { initDefaultTheme, initDarkTheme } from "../../utils/echarts/themes/index.js";
5
5
  import _sfc_main$1 from "../empty/Empty.vue.js";
6
6
  /* empty css */
7
7
  import { EcBasicOption } from "../../utils/echarts/modules/coordinate/basic.js";
@@ -38,11 +38,9 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
38
38
  let chartTheme = props.theme;
39
39
  if (props.theme === "auto") {
40
40
  const classList = [...document.documentElement.classList.values()];
41
- if (classList.includes("dark")) {
42
- chartTheme = "dark";
43
- }
41
+ chartTheme = classList.includes("dark") ? "dark" : "default";
44
42
  }
45
- if (chartTheme === "default") chartTheme = void 0;
43
+ if (chartTheme === "default") initDefaultTheme();
46
44
  if (chartTheme === "dark") initDarkTheme();
47
45
  return chartTheme;
48
46
  }
@@ -28,4 +28,5 @@ export declare const EmptyStatusExtendConfig: Record<Capitalize<string>, EmptyOp
28
28
  */
29
29
  export declare const EChartsThemeConfig: {
30
30
  dark: Record<string, any>;
31
+ default: Record<string, any>;
31
32
  };
@@ -11,7 +11,8 @@ const AMapConfig = {
11
11
  };
12
12
  const EmptyStatusExtendConfig = {};
13
13
  const EChartsThemeConfig = {
14
- dark: null
14
+ dark: null,
15
+ default: null
15
16
  };
16
17
  export {
17
18
  AMapConfig,
@@ -0,0 +1,2 @@
1
+ declare function getThemeConfig(): any;
2
+ export default getThemeConfig;
@@ -0,0 +1,411 @@
1
+ import { EChartsThemeConfig } from "../../../config/index.js";
2
+ import { ObjectUtil } from "../../prototype/lib/ObjectUtil.js";
3
+ function getThemeConfig() {
4
+ const colorPalette = [
5
+ "#5470c6",
6
+ "#91cc75",
7
+ "#fac858",
8
+ "#ee6666",
9
+ "#73c0de",
10
+ "#3ba272",
11
+ "#fc8452",
12
+ "#9a60b4",
13
+ "#ea7ccc"
14
+ ];
15
+ const theme = {
16
+ color: colorPalette,
17
+ backgroundColor: "rgba(0, 0, 0, 0)",
18
+ textStyle: {},
19
+ title: {
20
+ textStyle: {
21
+ color: "#464646"
22
+ },
23
+ subtextStyle: {
24
+ color: "#6E7079"
25
+ }
26
+ },
27
+ line: {
28
+ itemStyle: {
29
+ borderWidth: 1
30
+ },
31
+ lineStyle: {
32
+ width: 2
33
+ },
34
+ symbolSize: 4,
35
+ symbol: "emptyCircle",
36
+ smooth: false
37
+ },
38
+ radar: {
39
+ itemStyle: {
40
+ borderWidth: 1
41
+ },
42
+ lineStyle: {
43
+ width: 2
44
+ },
45
+ symbolSize: 4,
46
+ symbol: "emptyCircle",
47
+ smooth: false
48
+ },
49
+ bar: {
50
+ itemStyle: {
51
+ barBorderWidth: 0,
52
+ barBorderColor: "#ccc"
53
+ }
54
+ },
55
+ pie: {
56
+ itemStyle: {
57
+ borderWidth: 0,
58
+ borderColor: "#ccc"
59
+ }
60
+ },
61
+ scatter: {
62
+ itemStyle: {
63
+ borderWidth: 0,
64
+ borderColor: "#ccc"
65
+ }
66
+ },
67
+ boxplot: {
68
+ itemStyle: {
69
+ borderWidth: 0,
70
+ borderColor: "#ccc"
71
+ }
72
+ },
73
+ parallel: {
74
+ itemStyle: {
75
+ borderWidth: 0,
76
+ borderColor: "#ccc"
77
+ }
78
+ },
79
+ sankey: {
80
+ itemStyle: {
81
+ borderWidth: 0,
82
+ borderColor: "#ccc"
83
+ }
84
+ },
85
+ funnel: {
86
+ itemStyle: {
87
+ borderWidth: 0,
88
+ borderColor: "#ccc"
89
+ }
90
+ },
91
+ gauge: {
92
+ itemStyle: {
93
+ borderWidth: 0,
94
+ borderColor: "#ccc"
95
+ }
96
+ },
97
+ candlestick: {
98
+ itemStyle: {
99
+ color: "#eb5454",
100
+ color0: "#47b262",
101
+ borderColor: "#eb5454",
102
+ borderColor0: "#47b262",
103
+ borderWidth: 1
104
+ }
105
+ },
106
+ graph: {
107
+ itemStyle: {
108
+ borderWidth: 0,
109
+ borderColor: "#ccc"
110
+ },
111
+ lineStyle: {
112
+ width: 1,
113
+ color: "#aaa"
114
+ },
115
+ symbolSize: 4,
116
+ symbol: "emptyCircle",
117
+ smooth: false,
118
+ color: [
119
+ "#5470c6",
120
+ "#91cc75",
121
+ "#fac858",
122
+ "#ee6666",
123
+ "#73c0de",
124
+ "#3ba272",
125
+ "#fc8452",
126
+ "#9a60b4",
127
+ "#ea7ccc"
128
+ ],
129
+ label: {
130
+ color: "#eee"
131
+ }
132
+ },
133
+ map: {
134
+ itemStyle: {
135
+ areaColor: "#eee",
136
+ borderColor: "#444",
137
+ borderWidth: 0.5
138
+ },
139
+ label: {
140
+ color: "#000"
141
+ },
142
+ emphasis: {
143
+ itemStyle: {
144
+ areaColor: "rgba(255,215,0,0.8)",
145
+ borderColor: "#444",
146
+ borderWidth: 1
147
+ },
148
+ label: {
149
+ color: "rgb(100,0,0)"
150
+ }
151
+ }
152
+ },
153
+ geo: {
154
+ itemStyle: {
155
+ areaColor: "#eee",
156
+ borderColor: "#444",
157
+ borderWidth: 0.5
158
+ },
159
+ label: {
160
+ color: "#000"
161
+ },
162
+ emphasis: {
163
+ itemStyle: {
164
+ areaColor: "rgba(255,215,0,0.8)",
165
+ borderColor: "#444",
166
+ borderWidth: 1
167
+ },
168
+ label: {
169
+ color: "rgb(100,0,0)"
170
+ }
171
+ }
172
+ },
173
+ categoryAxis: {
174
+ axisLine: {
175
+ show: true,
176
+ lineStyle: {
177
+ color: "#6E7079"
178
+ }
179
+ },
180
+ axisTick: {
181
+ show: true,
182
+ lineStyle: {
183
+ color: "#6E7079"
184
+ }
185
+ },
186
+ axisLabel: {
187
+ show: true,
188
+ color: "#6E7079"
189
+ },
190
+ splitLine: {
191
+ show: false,
192
+ lineStyle: {
193
+ color: [
194
+ "#E0E6F1"
195
+ ]
196
+ }
197
+ },
198
+ splitArea: {
199
+ show: false,
200
+ areaStyle: {
201
+ color: [
202
+ "rgba(250,250,250,0.2)",
203
+ "rgba(210,219,238,0.2)"
204
+ ]
205
+ }
206
+ }
207
+ },
208
+ valueAxis: {
209
+ axisLine: {
210
+ show: false,
211
+ lineStyle: {
212
+ color: "#6E7079"
213
+ }
214
+ },
215
+ axisTick: {
216
+ show: false,
217
+ lineStyle: {
218
+ color: "#6E7079"
219
+ }
220
+ },
221
+ axisLabel: {
222
+ show: true,
223
+ color: "#6E7079"
224
+ },
225
+ splitLine: {
226
+ show: true,
227
+ lineStyle: {
228
+ color: [
229
+ "#E0E6F1"
230
+ ],
231
+ type: "dashed"
232
+ }
233
+ },
234
+ splitArea: {
235
+ show: false,
236
+ areaStyle: {
237
+ color: [
238
+ "rgba(250,250,250,0.2)",
239
+ "rgba(210,219,238,0.2)"
240
+ ]
241
+ }
242
+ }
243
+ },
244
+ logAxis: {
245
+ axisLine: {
246
+ show: false,
247
+ lineStyle: {
248
+ color: "#6E7079"
249
+ }
250
+ },
251
+ axisTick: {
252
+ show: false,
253
+ lineStyle: {
254
+ color: "#6E7079"
255
+ }
256
+ },
257
+ axisLabel: {
258
+ show: true,
259
+ color: "#6E7079"
260
+ },
261
+ splitLine: {
262
+ show: true,
263
+ lineStyle: {
264
+ color: [
265
+ "#E0E6F1"
266
+ ]
267
+ }
268
+ },
269
+ splitArea: {
270
+ show: false,
271
+ areaStyle: {
272
+ color: [
273
+ "rgba(250,250,250,0.2)",
274
+ "rgba(210,219,238,0.2)"
275
+ ]
276
+ }
277
+ }
278
+ },
279
+ timeAxis: {
280
+ axisLine: {
281
+ show: true,
282
+ lineStyle: {
283
+ color: "#6E7079"
284
+ }
285
+ },
286
+ axisTick: {
287
+ show: true,
288
+ lineStyle: {
289
+ color: "#6E7079"
290
+ }
291
+ },
292
+ axisLabel: {
293
+ show: true,
294
+ color: "#6E7079"
295
+ },
296
+ splitLine: {
297
+ show: false,
298
+ lineStyle: {
299
+ color: [
300
+ "#E0E6F1"
301
+ ]
302
+ }
303
+ },
304
+ splitArea: {
305
+ show: false,
306
+ areaStyle: {
307
+ color: [
308
+ "rgba(250,250,250,0.2)",
309
+ "rgba(210,219,238,0.2)"
310
+ ]
311
+ }
312
+ }
313
+ },
314
+ toolbox: {
315
+ iconStyle: {
316
+ borderColor: "#999"
317
+ },
318
+ emphasis: {
319
+ iconStyle: {
320
+ borderColor: "#666"
321
+ }
322
+ }
323
+ },
324
+ legend: {
325
+ textStyle: {
326
+ color: "#333"
327
+ },
328
+ left: "center",
329
+ right: "auto",
330
+ top: 0,
331
+ bottom: 10
332
+ },
333
+ tooltip: {
334
+ axisPointer: {
335
+ lineStyle: {
336
+ color: "#ccc",
337
+ width: 1
338
+ },
339
+ crossStyle: {
340
+ color: "#ccc",
341
+ width: 1
342
+ }
343
+ }
344
+ },
345
+ timeline: {
346
+ lineStyle: {
347
+ color: "#DAE1F5",
348
+ width: 2
349
+ },
350
+ itemStyle: {
351
+ color: "#A4B1D7",
352
+ borderWidth: 1
353
+ },
354
+ controlStyle: {
355
+ color: "#A4B1D7",
356
+ borderColor: "#A4B1D7",
357
+ borderWidth: 1
358
+ },
359
+ checkpointStyle: {
360
+ color: "#316bf3",
361
+ borderColor: "#fff"
362
+ },
363
+ label: {
364
+ color: "#A4B1D7"
365
+ },
366
+ emphasis: {
367
+ itemStyle: {
368
+ color: "#FFF"
369
+ },
370
+ controlStyle: {
371
+ color: "#A4B1D7",
372
+ borderColor: "#A4B1D7",
373
+ borderWidth: 1
374
+ },
375
+ label: {
376
+ color: "#A4B1D7"
377
+ }
378
+ }
379
+ },
380
+ visualMap: {
381
+ color: [
382
+ "#bf444c",
383
+ "#d88273",
384
+ "#f6efa6"
385
+ ]
386
+ },
387
+ markPoint: {
388
+ label: {
389
+ color: "#eee"
390
+ },
391
+ emphasis: {
392
+ label: {
393
+ color: "#eee"
394
+ }
395
+ }
396
+ },
397
+ grid: {
398
+ left: "10%",
399
+ right: "10%",
400
+ top: 60,
401
+ bottom: 70
402
+ }
403
+ };
404
+ if (EChartsThemeConfig.default) {
405
+ ObjectUtil.assignDeep(theme, EChartsThemeConfig.default);
406
+ }
407
+ return theme;
408
+ }
409
+ export {
410
+ getThemeConfig as default
411
+ };
@@ -1 +1,2 @@
1
1
  export declare function initDarkTheme(): void;
2
+ export declare function initDefaultTheme(): void;
@@ -1,11 +1,19 @@
1
1
  import { echarts } from "../index.js";
2
- import getThemeConfig from "./dark.js";
2
+ import getThemeConfig$1 from "./dark.js";
3
+ import getThemeConfig from "./default.js";
3
4
  let isDarkThemeInit = false;
4
5
  function initDarkTheme() {
5
6
  if (isDarkThemeInit) return;
6
- echarts.registerTheme("dark", getThemeConfig());
7
+ echarts.registerTheme("dark", getThemeConfig$1());
7
8
  isDarkThemeInit = true;
8
9
  }
10
+ let isDefaultThemeInit = false;
11
+ function initDefaultTheme() {
12
+ if (isDefaultThemeInit) return;
13
+ echarts.registerTheme("default", getThemeConfig());
14
+ isDefaultThemeInit = true;
15
+ }
9
16
  export {
10
- initDarkTheme
17
+ initDarkTheme,
18
+ initDefaultTheme
11
19
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mrxy-yk",
3
- "version": "1.2.11",
3
+ "version": "1.3.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "A collection of Vue 3 components and utilities",
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "mrxy-yk",
4
- "version": "1.2.11",
4
+ "version": "1.3.1",
5
5
  "js-types-syntax": "typescript",
6
6
  "contributions": {
7
7
  "html": {