yxuse 1.0.60 → 1.0.62

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/lib/index.es5.js CHANGED
@@ -1,4 +1,21 @@
1
- const t = {
1
+ var b = (r, e, o) => new Promise((a, t) => {
2
+ var n = (c) => {
3
+ try {
4
+ l(o.next(c));
5
+ } catch (i) {
6
+ t(i);
7
+ }
8
+ }, g = (c) => {
9
+ try {
10
+ l(o.throw(c));
11
+ } catch (i) {
12
+ t(i);
13
+ }
14
+ }, l = (c) => c.done ? a(c.value) : Promise.resolve(c.value).then(n, g);
15
+ l((o = o.apply(r, e)).next());
16
+ });
17
+ import { g as u } from "./index.es4.js";
18
+ const A = {
2
19
  green: {
3
20
  common: {
4
21
  color: {
@@ -46,7 +63,7 @@ const t = {
46
63
  background: "rgba(103, 186, 145, 0.10)",
47
64
  "border-color": "rgba(80, 165, 122, 1)",
48
65
  "text-color": "rgba(80, 165, 122, 1)",
49
- "active-background-color": "rgba(80, 165, 122, 1)",
66
+ "active-background": "rgba(80, 165, 122, 1)",
50
67
  "active-border-color": "rgba(154, 209, 162, 1)",
51
68
  "active-text-color": "#fff"
52
69
  },
@@ -73,19 +90,19 @@ const t = {
73
90
  "checked-background": "#9BE9C2"
74
91
  },
75
92
  input: {
76
- background: "rgba(237, 246, 239, 1)",
77
- "border-color": "rgba(80, 165, 122, 1)",
78
- color: "rgba(29, 75, 52, 1)",
79
- "placeholder-color": "rgba(80, 165, 122, 1)",
80
- "hover-background": "rgba(237, 246, 239, 0.30)",
81
- "hover-border-color": "rgba(80, 165, 122, 1)",
82
- "hover-color": "rgba(80, 165, 122, 1)",
83
- "active-background": "rgba(237, 246, 239, 0.30)",
84
- "active-border-color": "rgba(80, 165, 122, 1)",
85
- "active-color": "rgba(80, 165, 122, 1)",
86
- "disabled-background": "rgba(219, 232, 221, 1)",
87
- "disabled-border-color": "#fff",
88
- "disabled-color": "rgba(80, 165, 122, 0.5)",
93
+ color: "#1D4B34",
94
+ background: "#FFFFFF",
95
+ "border-color": "#A8B6AF",
96
+ "placeholder-color": "rgba(29,75,52,0.5)",
97
+ "hover-background": "#FFFFFF",
98
+ "hover-border-color": "#50A57A",
99
+ "hover-color": "#1D4B34",
100
+ "active-background": "#FFFFFF",
101
+ "active-border-color": "#50A57A",
102
+ "active-color": "#1D4B34",
103
+ "disabled-background": "#FBFBFB",
104
+ "disabled-border-color": "#7B8A83",
105
+ "disabled-color": "#7B8A83",
89
106
  "append-background": "transparent",
90
107
  "append-color": "#50A57A"
91
108
  },
@@ -108,14 +125,15 @@ const t = {
108
125
  table: {
109
126
  "header-background": "#67BA91",
110
127
  "header-text-color": "#fff",
111
- "row-background": "#D1EFDA",
112
- "row-odd-background": "#EAF9ED",
128
+ "row-background": "#F8FFF9",
129
+ "row-odd-background": "#EDFBF1",
113
130
  //奇数行色值
114
- "row-border-bottom-color": "#9AD1A2",
131
+ "row-border-bottom-color": "transparent",
115
132
  "row-text-color": "#1D4B34",
116
- "row-error-background": "linear-gradient(90deg, #FFCECB 0%, rgba(255,235,233,0.35) 100%)",
117
- "row-warning-background": "linear-gradient(90deg, #FFE4BC 0%, rgba(255,250,233,0.35) 100%)",
118
- "row-hover-background": "linear-gradient(90deg, #D5ECBE 0%, rgba(234,255,233,0.35) 100%)",
133
+ "row-success-background": "linear-gradient(82deg, rgba(85,196,39,0.22) 0%, rgba(85,196,39,0) 100%)",
134
+ "row-error-background": "linear-gradient(82deg, rgba(234,111,111,0.22) 0%, rgba(234,111,111,0) 100%)",
135
+ "row-warning-background": "linear-gradient(82deg, rgba(248,184,90,0.22) 0%, rgba(248,184,90,0) 100%)",
136
+ "row-hover-background": "linear-gradient(82deg, #CBF7DD 0%, #EEFFF1 100%)",
119
137
  "row-hover-text-color": "rgba(29, 75, 52, 1)"
120
138
  },
121
139
  chart: {
@@ -365,45 +383,78 @@ const t = {
365
383
  cloud: {},
366
384
  "station-control-center": {}
367
385
  }
368
- }, g = "yxTheme", l = "green", i = () => {
369
- const r = c();
370
- localStorage.getItem(g) || localStorage.setItem(g, r);
371
- const o = document.documentElement, e = t[r].common;
372
- Object.keys(e).forEach((a) => {
373
- Object.keys(e[a]).forEach((n) => {
374
- const b = `--${a}-${n}`;
375
- o.style.setProperty(b, e[a][n]);
386
+ }, k = () => b(void 0, null, function* () {
387
+ let r = d(), e = "";
388
+ const { data: o } = yield u();
389
+ if (r)
390
+ e = o.find((t) => t.id === r).themeUrl;
391
+ else {
392
+ const n = o.find((g) => g.defaultTheme === 1) || o[0];
393
+ e = n.themeUrl, r = n.id;
394
+ }
395
+ const a = yield m(e);
396
+ F({ themeCssVar: a, themeId: r });
397
+ }), F = ({ themeCssVar: r, themeId: e }) => {
398
+ const o = localStorage.getItem("ttcGlobalState") || "{}", a = JSON.parse(o);
399
+ a.theme = {
400
+ themeCssVar: r,
401
+ id: e
402
+ }, localStorage.setItem("ttcGlobalState", JSON.stringify(a));
403
+ }, p = (r) => b(void 0, null, function* () {
404
+ const e = yield m(r.themeUrl);
405
+ F({ themeCssVar: e, themeId: r == null ? void 0 : r.id });
406
+ }), f = () => {
407
+ const r = s(), e = document.documentElement;
408
+ Object.keys(r).forEach((o) => {
409
+ Object.keys(r[o]).forEach((a) => {
410
+ const t = `--${o}-${a}`;
411
+ e.style.setProperty(t, r[o][a]);
376
412
  });
377
413
  });
378
- }, d = (r) => {
379
- localStorage.setItem(g, r), i();
380
- }, c = () => localStorage.getItem(g) || l, u = (r) => {
381
- const o = c();
382
- return t[o][r] || {};
383
- }, F = (r) => {
384
- const o = c();
385
- return t[o].common[r] || {};
386
- }, s = (r) => {
387
- const o = c(), e = t[o][r], a = document.documentElement;
388
- Object.keys(e).forEach((n) => {
389
- const b = `--${n}`;
390
- a.style.setProperty(b, e[n]);
414
+ }, m = (r) => b(void 0, null, function* () {
415
+ const o = yield (yield fetch(r)).json(), a = document.documentElement;
416
+ return Object.keys(o).forEach((t) => {
417
+ Object.keys(o[t]).forEach((n) => {
418
+ const g = `--${t}-${n}`;
419
+ a.style.setProperty(g, o[t][n]);
420
+ });
421
+ }), o;
422
+ }), h = () => b(void 0, null, function* () {
423
+ const { data: r } = yield u(), e = r.find((a) => a.defaultTheme === 1);
424
+ return e ? e.themeUrl : r[0].themeUrl;
425
+ }), d = () => {
426
+ var o;
427
+ const r = localStorage.getItem("ttcGlobalState"), e = r && ((o = JSON.parse(r)) == null ? void 0 : o.theme);
428
+ return (e == null ? void 0 : e.id) || null;
429
+ }, s = () => {
430
+ var o;
431
+ const r = localStorage.getItem("ttcGlobalState");
432
+ return (r && ((o = JSON.parse(r)) == null ? void 0 : o.theme)).themeCssVar;
433
+ }, B = (r) => s()[r] || {}, E = (r) => {
434
+ const e = d(), o = A[e][r], a = document.documentElement;
435
+ Object.keys(o).forEach((t) => {
436
+ const n = `--${t}`;
437
+ a.style.setProperty(n, o[t]);
391
438
  });
392
- }, A = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
439
+ }, w = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
393
440
  __proto__: null,
394
- changeTheme: d,
395
- getCurTheme: c,
396
- getGroupColor: F,
397
- getSystemThemeConfig: u,
398
- install: i,
399
- installSystemTheme: s
441
+ changeTheme: p,
442
+ getCurTheme: d,
443
+ getCurThemeCssVar: s,
444
+ getDefaultThemeUrl: h,
445
+ getGroupColor: B,
446
+ install: k,
447
+ installSystemTheme: E,
448
+ updateTheme: f
400
449
  }, Symbol.toStringTag, { value: "Module" }));
401
450
  export {
402
- u as a,
403
- F as b,
404
- d as c,
405
- s as d,
406
- c as g,
407
- i,
408
- A as t
451
+ d as a,
452
+ s as b,
453
+ p as c,
454
+ B as d,
455
+ E as e,
456
+ h as g,
457
+ k as i,
458
+ w as t,
459
+ f as u
409
460
  };
Binary file