@duxweb/dvha-core 0.1.16 → 0.1.18

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.
@@ -5,29 +5,29 @@ import { useCan as G } from "../hooks/auth.js";
5
5
  import { useConfig as H } from "../hooks/config.js";
6
6
  import "@tanstack/vue-query";
7
7
  import { useManage as J } from "../hooks/manage.js";
8
+ import "json-2-csv";
8
9
  import "lodash-es";
9
- import "pinia";
10
10
  import { useAuthStore as K } from "../stores/auth.js";
11
11
  import { useRouteStore as Q } from "../stores/route.js";
12
+ import "pinia";
12
13
  import { useManageStore as T } from "../stores/manage.js";
13
14
  import { useI18nStore as W } from "../stores/i18n.js";
14
15
  import "@vueuse/core";
15
- import "colorizr";
16
16
  import "clsx";
17
- import "json-2-csv";
17
+ import "colorizr";
18
18
  import "axios";
19
19
  const ge = /* @__PURE__ */ O({
20
20
  name: "DuxAppProvider",
21
21
  props: {},
22
22
  setup(X, {
23
- slots: u
23
+ slots: m
24
24
  }) {
25
- const f = U("dux.manage"), m = H(), s = B();
25
+ const f = U("dux.manage"), c = H(), s = B();
26
26
  return s.beforeEach(async (r, Y, n) => {
27
27
  var P, R, b, A, S, $, M, k, w, z, I, C, y, D;
28
28
  const t = r.meta.manageName, _ = r.meta.authorization === !1;
29
29
  if (!t) {
30
- const e = m.defaultManage || ((R = (P = m.manages) == null ? void 0 : P[0]) == null ? void 0 : R.name) || "";
30
+ const e = c.defaultManage || ((R = (P = c.manages) == null ? void 0 : P[0]) == null ? void 0 : R.name) || "";
31
31
  return n({
32
32
  path: `/${e}`,
33
33
  replace: !0
@@ -35,7 +35,7 @@ const ge = /* @__PURE__ */ O({
35
35
  }
36
36
  f && (f.value = t);
37
37
  const h = T(t);
38
- h.isInit() || h.setConfig((b = m.manages) == null ? void 0 : b.find((e) => e.name === t), m);
38
+ h.isInit() || h.setConfig((b = c.manages) == null ? void 0 : b.find((e) => e.name === t), c);
39
39
  const i = Q(t), a = J(t), d = K(t), l = W(t);
40
40
  if ((A = a.config) != null && A.i18nProvider && !l.isInit()) {
41
41
  const e = l.getLocale();
@@ -48,7 +48,7 @@ const ge = /* @__PURE__ */ O({
48
48
  });
49
49
  const g = (e) => e == null ? void 0 : e.map((p) => ({
50
50
  ...p,
51
- path: a.getRoutePath(p.path || "")
51
+ path: p.path ? a.getRoutePath(p.path) : void 0
52
52
  }));
53
53
  if (!i.getRouteInit()) {
54
54
  const e = (($ = a.config) == null ? void 0 : $.components) || {}, p = [];
@@ -96,29 +96,29 @@ const ge = /* @__PURE__ */ O({
96
96
  var E, F;
97
97
  if (!o.path)
98
98
  return;
99
- const c = {
99
+ const u = {
100
100
  name: o.name,
101
101
  path: o.path,
102
102
  meta: o.meta
103
103
  };
104
104
  switch (o.loader) {
105
105
  case "iframe":
106
- c.component = ((F = (E = a.config) == null ? void 0 : E.components) == null ? void 0 : F.iframe) || (() => import("../components/loader/iframe.js"));
106
+ u.component = ((F = (E = a.config) == null ? void 0 : E.components) == null ? void 0 : F.iframe) || (() => import("../components/loader/iframe.js"));
107
107
  break;
108
108
  case "link":
109
- c.beforeEnter = () => {
109
+ u.beforeEnter = () => {
110
110
  var N;
111
111
  const L = ((N = o.meta) == null ? void 0 : N.url) || o.path;
112
112
  return L && window.open(L, "_blank"), !1;
113
- }, c.component = () => Promise.resolve({
113
+ }, u.component = () => Promise.resolve({
114
114
  template: "<div></div>"
115
115
  });
116
116
  break;
117
117
  default:
118
- o.component && (c.component = o.component);
118
+ o.component && (u.component = o.component);
119
119
  break;
120
120
  }
121
- s.addRoute(`${t}.auth`, c);
121
+ s.addRoute(`${t}.auth`, u);
122
122
  }), n({
123
123
  path: ((C = r.redirectedFrom) == null ? void 0 : C.path) || r.path,
124
124
  replace: !0
@@ -139,7 +139,7 @@ const ge = /* @__PURE__ */ O({
139
139
  }), () => V(q, null, {
140
140
  default: () => {
141
141
  var r;
142
- return [(r = u.default) == null ? void 0 : r.call(u)];
142
+ return [(r = m.default) == null ? void 0 : r.call(m)];
143
143
  }
144
144
  });
145
145
  }
@@ -1,82 +1,85 @@
1
- const l = (i) => {
2
- const e = {}, c = ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900", "950"], u = ["primary", "info", "success", "warning", "error", "gray"], b = ["hover", "pressed", "focus", "disabled"];
3
- e.white = { DEFAULT: "var(--color-white)" }, e.black = { DEFAULT: "var(--color-black)" }, Object.keys(i).forEach((r) => {
4
- e[r] = {}, c.forEach((o) => {
5
- e[r][o] = `var(--base-color-${r}-${o})`;
1
+ function r(c) {
2
+ return `rgb(var(${c}))`;
3
+ }
4
+ function s(c) {
5
+ const t = {}, i = ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900", "950"], l = ["primary", "info", "success", "warning", "error", "gray"], n = ["hover", "pressed", "focus", "disabled"];
6
+ t.white = { DEFAULT: r("--ui-color-white") }, t.black = { DEFAULT: r("--ui-color-black") }, Object.keys(c).forEach((e) => {
7
+ t[e] = {}, i.forEach((o) => {
8
+ t[e][o] = r(`--base-color-${e}-${o}`);
6
9
  });
7
- }), u.forEach((r) => {
8
- e[r] = {}, e[r].DEFAULT = `var(--ui-color-${r})`, c.forEach((o) => {
9
- e[r][o] = `var(--ui-color-${r}-${o})`;
10
- }), b.forEach((o) => {
11
- e[r][o] = `var(--ui-color-${r}-${o})`;
10
+ }), l.forEach((e) => {
11
+ t[e] = {}, t[e].DEFAULT = r(`--ui-color-${e}`), i.forEach((o) => {
12
+ t[e][o] = r(`--ui-color-${e}-${o}`);
13
+ }), n.forEach((o) => {
14
+ t[e][o] = r(`--ui-color-${e}-${o}`);
12
15
  });
13
16
  });
14
- const t = {
17
+ const d = {
15
18
  // 文字颜色
16
- text: {
17
- color: "var(--ui-text)"
19
+ "text-default": {
20
+ color: r("--ui-text")
18
21
  },
19
22
  "text-dimmed": {
20
- color: "var(--ui-text-dimmed)"
23
+ color: r("--ui-text-dimmed")
21
24
  },
22
25
  "text-muted": {
23
- color: "var(--ui-text-muted)"
26
+ color: r("--ui-text-muted")
24
27
  },
25
28
  "text-toned": {
26
- color: "var(--ui-text-toned)"
29
+ color: r("--ui-text-toned")
27
30
  },
28
31
  "text-highlighted": {
29
- color: "var(--ui-text-highlighted)"
32
+ color: r("--ui-text-highlighted")
30
33
  },
31
34
  "text-inverted": {
32
- color: "var(--ui-text-inverted)"
35
+ color: r("--ui-text-inverted")
33
36
  },
34
37
  // 背景颜色
35
- bg: {
36
- "background-color": "var(--ui-bg)"
38
+ "bg-default": {
39
+ "background-color": r("--ui-bg")
37
40
  },
38
41
  "bg-muted": {
39
- "background-color": "var(--ui-bg-muted)"
42
+ "background-color": r("--ui-bg-muted")
40
43
  },
41
44
  "bg-elevated": {
42
- "background-color": "var(--ui-bg-elevated)"
45
+ "background-color": r("--ui-bg-elevated")
43
46
  },
44
47
  "bg-accented": {
45
- "background-color": "var(--ui-bg-accented)"
48
+ "background-color": r("--ui-bg-accented")
46
49
  },
47
50
  "bg-inverted": {
48
- "background-color": "var(--ui-bg-inverted)"
51
+ "background-color": r("--ui-bg-inverted")
49
52
  },
50
53
  // 边框颜色
51
- border: {
52
- "border-color": "var(--ui-border)"
54
+ "border-default": {
55
+ "border-color": r("--ui-border")
53
56
  },
54
57
  "border-muted": {
55
- "border-color": "var(--ui-border-muted)"
58
+ "border-color": r("--ui-border-muted")
56
59
  },
57
60
  "border-accented": {
58
- "border-color": "var(--ui-border-accented)"
61
+ "border-color": r("--ui-border-accented")
59
62
  },
60
63
  "border-inverted": {
61
- "border-color": "var(--ui-border-inverted)"
64
+ "border-color": r("--ui-border-inverted")
62
65
  }
63
- }, a = {};
64
- Object.entries(t).forEach(([r, o]) => {
65
- a[`.${r}`] = o;
66
+ }, u = {};
67
+ Object.entries(d).forEach(([e, o]) => {
68
+ u[`.${e}`] = o;
66
69
  });
67
- const d = [];
68
- return Object.entries(t).forEach(([r, o]) => {
69
- d.push([
70
- r,
70
+ const b = [];
71
+ return Object.entries(d).forEach(([e, o]) => {
72
+ b.push([
73
+ e,
71
74
  o
72
75
  ]);
73
76
  }), {
74
- colors: e,
75
- classes: t,
76
- rules: d,
77
- utilities: a
77
+ colors: t,
78
+ classes: d,
79
+ rules: b,
80
+ utilities: u
78
81
  };
79
- };
82
+ }
80
83
  export {
81
- l as themePreset
84
+ s as themePreset
82
85
  };
@@ -0,0 +1,13 @@
1
+ export declare const DuxLogoIcon: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ highlight: {
3
+ type: StringConstructor;
4
+ default: string;
5
+ };
6
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
7
+ highlight: {
8
+ type: StringConstructor;
9
+ default: string;
10
+ };
11
+ }>> & Readonly<{}>, {
12
+ highlight: string;
13
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1 +1,2 @@
1
1
  export * from './logo';
2
+ export * from './icon';