@duxweb/dvha-core 1.1.30 → 1.1.31

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.
Files changed (159) hide show
  1. package/dist/cjs/_virtual/_rolldown/runtime.cjs +1 -0
  2. package/dist/cjs/components/auth/can.cjs +1 -1
  3. package/dist/cjs/components/auth/index.cjs +1 -0
  4. package/dist/cjs/components/common/icon.cjs +1 -1
  5. package/dist/cjs/components/common/index.cjs +1 -0
  6. package/dist/cjs/components/common/logo.cjs +1 -1
  7. package/dist/cjs/components/index.cjs +1 -0
  8. package/dist/cjs/components/loader/iframe.cjs +1 -1
  9. package/dist/cjs/components/loader/index.cjs +1 -0
  10. package/dist/cjs/components/loader/loader.cjs +1 -1
  11. package/dist/cjs/components/loader/remote/index.cjs +1 -0
  12. package/dist/cjs/components/loader/remote/loader.cjs +1 -1
  13. package/dist/cjs/components/loader/remote/render.cjs +1 -1
  14. package/dist/cjs/components/overlay/index.cjs +1 -0
  15. package/dist/cjs/components/overlay/overlay.cjs +1 -1
  16. package/dist/cjs/components/status/error.cjs +1 -1
  17. package/dist/cjs/components/status/exception.cjs +1 -1
  18. package/dist/cjs/components/status/index.cjs +1 -0
  19. package/dist/cjs/components/status/notAuthorized.cjs +1 -1
  20. package/dist/cjs/components/status/notFound.cjs +1 -1
  21. package/dist/cjs/config/color.cjs +1 -1
  22. package/dist/cjs/directive/index.cjs +1 -0
  23. package/dist/cjs/directive/permission.cjs +1 -1
  24. package/dist/cjs/hooks/auth.cjs +1 -1
  25. package/dist/cjs/hooks/config.cjs +1 -1
  26. package/dist/cjs/hooks/data.cjs +1 -1
  27. package/dist/cjs/hooks/export.cjs +1 -1
  28. package/dist/cjs/hooks/exportCsv.cjs +2 -2
  29. package/dist/cjs/hooks/form.cjs +1 -1
  30. package/dist/cjs/hooks/formExtend.cjs +1 -1
  31. package/dist/cjs/hooks/formValidate.cjs +1 -1
  32. package/dist/cjs/hooks/i18n.cjs +1 -1
  33. package/dist/cjs/hooks/import.cjs +1 -1
  34. package/dist/cjs/hooks/importCsv.cjs +2 -2
  35. package/dist/cjs/hooks/index.cjs +1 -0
  36. package/dist/cjs/hooks/json/index.cjs +1 -1
  37. package/dist/cjs/hooks/json/utils/contextManager.cjs +1 -1
  38. package/dist/cjs/hooks/json/utils/expressionParser.cjs +1 -1
  39. package/dist/cjs/hooks/json/vFor.cjs +1 -1
  40. package/dist/cjs/hooks/json/vIf.cjs +1 -1
  41. package/dist/cjs/hooks/json/vModel.cjs +1 -1
  42. package/dist/cjs/hooks/json/vOn.cjs +1 -1
  43. package/dist/cjs/hooks/json/vShow.cjs +1 -1
  44. package/dist/cjs/hooks/json/vText.cjs +1 -1
  45. package/dist/cjs/hooks/json.cjs +1 -1
  46. package/dist/cjs/hooks/list.cjs +1 -1
  47. package/dist/cjs/hooks/manage.cjs +1 -1
  48. package/dist/cjs/hooks/menu.cjs +1 -1
  49. package/dist/cjs/hooks/overlay.cjs +1 -1
  50. package/dist/cjs/hooks/select.cjs +1 -1
  51. package/dist/cjs/hooks/theme.cjs +4 -8
  52. package/dist/cjs/hooks/tree.cjs +1 -1
  53. package/dist/cjs/hooks/upload/index.cjs +1 -0
  54. package/dist/cjs/hooks/upload/local.cjs +1 -1
  55. package/dist/cjs/hooks/upload/s3.cjs +1 -1
  56. package/dist/cjs/hooks/upload.cjs +1 -1
  57. package/dist/cjs/index.cjs +1 -1
  58. package/dist/cjs/main.cjs +1 -1
  59. package/dist/cjs/preset/authProvider.cjs +1 -1
  60. package/dist/cjs/preset/dataProvider.cjs +1 -1
  61. package/dist/cjs/preset/i18nProvider.cjs +1 -1
  62. package/dist/cjs/preset/index.cjs +1 -0
  63. package/dist/cjs/provider/app.cjs +1 -1
  64. package/dist/cjs/provider/index.cjs +1 -0
  65. package/dist/cjs/provider/tab.cjs +1 -1
  66. package/dist/cjs/router/index.cjs +1 -0
  67. package/dist/cjs/router/route.cjs +1 -1
  68. package/dist/cjs/stores/auth.cjs +1 -1
  69. package/dist/cjs/stores/i18n.cjs +1 -1
  70. package/dist/cjs/stores/index.cjs +1 -0
  71. package/dist/cjs/stores/jsonSchema.cjs +1 -1
  72. package/dist/cjs/stores/manage.cjs +1 -1
  73. package/dist/cjs/stores/route.cjs +1 -1
  74. package/dist/cjs/stores/tab.cjs +1 -1
  75. package/dist/cjs/stores/theme.cjs +1 -1
  76. package/dist/cjs/utils/bus.cjs +1 -1
  77. package/dist/cjs/utils/index.cjs +1 -0
  78. package/dist/cjs/utils/theme.cjs +8 -8
  79. package/dist/cjs/utils/tree.cjs +1 -1
  80. package/dist/esm/_virtual/_rolldown/runtime.js +9 -0
  81. package/dist/esm/components/auth/can.js +17 -36
  82. package/dist/esm/components/auth/index.js +1 -0
  83. package/dist/esm/components/common/icon.js +16 -24
  84. package/dist/esm/components/common/index.js +2 -0
  85. package/dist/esm/components/common/logo.js +50 -49
  86. package/dist/esm/components/index.js +14 -0
  87. package/dist/esm/components/loader/iframe.js +16 -18
  88. package/dist/esm/components/loader/index.js +1 -0
  89. package/dist/esm/components/loader/loader.js +11 -40
  90. package/dist/esm/components/loader/remote/index.js +2 -0
  91. package/dist/esm/components/loader/remote/loader.js +118 -156
  92. package/dist/esm/components/loader/remote/render.js +12 -17
  93. package/dist/esm/components/overlay/index.js +1 -0
  94. package/dist/esm/components/overlay/overlay.js +54 -70
  95. package/dist/esm/components/status/error.js +7 -9
  96. package/dist/esm/components/status/exception.js +21 -37
  97. package/dist/esm/components/status/index.js +4 -0
  98. package/dist/esm/components/status/notAuthorized.js +7 -9
  99. package/dist/esm/components/status/notFound.js +7 -9
  100. package/dist/esm/config/color.js +288 -290
  101. package/dist/esm/directive/index.js +1 -0
  102. package/dist/esm/directive/permission.js +7 -27
  103. package/dist/esm/hooks/auth.js +154 -120
  104. package/dist/esm/hooks/config.js +11 -9
  105. package/dist/esm/hooks/data.js +416 -415
  106. package/dist/esm/hooks/export.js +32 -36
  107. package/dist/esm/hooks/exportCsv.js +42 -46
  108. package/dist/esm/hooks/form.js +86 -95
  109. package/dist/esm/hooks/formExtend.js +36 -40
  110. package/dist/esm/hooks/formValidate.js +22 -25
  111. package/dist/esm/hooks/i18n.js +14 -18
  112. package/dist/esm/hooks/import.js +45 -54
  113. package/dist/esm/hooks/importCsv.js +90 -83
  114. package/dist/esm/hooks/index.js +31 -0
  115. package/dist/esm/hooks/json/index.js +14 -22
  116. package/dist/esm/hooks/json/utils/contextManager.js +35 -26
  117. package/dist/esm/hooks/json/utils/expressionParser.js +100 -123
  118. package/dist/esm/hooks/json/vFor.js +50 -55
  119. package/dist/esm/hooks/json/vIf.js +17 -16
  120. package/dist/esm/hooks/json/vModel.js +96 -106
  121. package/dist/esm/hooks/json/vOn.js +30 -32
  122. package/dist/esm/hooks/json/vShow.js +20 -22
  123. package/dist/esm/hooks/json/vText.js +44 -51
  124. package/dist/esm/hooks/json.js +131 -132
  125. package/dist/esm/hooks/list.js +150 -184
  126. package/dist/esm/hooks/manage.js +25 -22
  127. package/dist/esm/hooks/menu.js +57 -61
  128. package/dist/esm/hooks/overlay.js +6 -23
  129. package/dist/esm/hooks/select.js +84 -94
  130. package/dist/esm/hooks/theme.js +289 -219
  131. package/dist/esm/hooks/tree.js +43 -47
  132. package/dist/esm/hooks/upload/index.js +2 -0
  133. package/dist/esm/hooks/upload/local.js +24 -30
  134. package/dist/esm/hooks/upload/s3.js +70 -80
  135. package/dist/esm/hooks/upload.js +256 -272
  136. package/dist/esm/index.js +150 -141
  137. package/dist/esm/main.js +24 -45
  138. package/dist/esm/preset/authProvider.js +62 -68
  139. package/dist/esm/preset/dataProvider.js +154 -180
  140. package/dist/esm/preset/i18nProvider.js +28 -30
  141. package/dist/esm/preset/index.js +3 -0
  142. package/dist/esm/provider/app.js +124 -151
  143. package/dist/esm/provider/index.js +2 -0
  144. package/dist/esm/provider/tab.js +49 -66
  145. package/dist/esm/router/index.js +1 -0
  146. package/dist/esm/router/route.js +39 -46
  147. package/dist/esm/stores/auth.js +51 -46
  148. package/dist/esm/stores/i18n.js +32 -29
  149. package/dist/esm/stores/index.js +7 -0
  150. package/dist/esm/stores/jsonSchema.js +47 -34
  151. package/dist/esm/stores/manage.js +63 -48
  152. package/dist/esm/stores/route.js +60 -56
  153. package/dist/esm/stores/tab.js +55 -60
  154. package/dist/esm/stores/theme.js +48 -55
  155. package/dist/esm/utils/bus.js +3 -5
  156. package/dist/esm/utils/index.js +3 -0
  157. package/dist/esm/utils/theme.js +110 -93
  158. package/dist/esm/utils/tree.js +28 -37
  159. package/package.json +1 -1
@@ -1,220 +1,290 @@
1
- import { useColorMode as H, useCycleList as J } from "@vueuse/core";
2
- import { hex2rgb as K } from "colorizr";
3
- import { storeToRefs as P } from "pinia";
4
- import { watchEffect as Q, computed as b, watch as W, readonly as L } from "vue";
5
- import { themeColor as X } from "../config/color.js";
6
- import "lodash-es";
7
- import { useThemeStore as Y } from "../stores/theme.js";
8
- import { useManage as Z } from "./manage.js";
9
- function ie() {
10
- const s = Y(), { mode: j } = P(s), $ = H({
11
- storageRef: j
12
- }), u = Z(), { state: S, next: B, go: v } = J(["dark", "light", "auto"], {
13
- initialValue: $.store.value
14
- });
15
- Q(() => {
16
- $.value = S.value;
17
- });
18
- const V = (t) => {
19
- switch (t) {
20
- case "auto":
21
- v(2);
22
- break;
23
- case "light":
24
- v(1);
25
- break;
26
- case "dark":
27
- v(0);
28
- break;
29
- }
30
- }, d = b(() => {
31
- const { system: t, store: e } = $;
32
- return e.value === "auto" ? t.value === "dark" : e.value === "dark";
33
- }), M = b(() => d.value ? {
34
- logo: u.config?.theme?.darkLogo,
35
- appLogo: u.config?.theme?.appDarkLogo,
36
- banner: u.config?.theme?.darkBanner
37
- } : {
38
- logo: u.config?.theme?.logo,
39
- appLogo: u.config?.theme?.appLogo,
40
- banner: u.config?.theme?.banner
41
- }), r = { ...{
42
- colors: X,
43
- // 色彩类型
44
- colorTypes: ["primary", "info", "success", "warning", "error", "gray"],
45
- // 色彩色阶
46
- colorShades: ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900", "950"],
47
- // 色彩场景
48
- colorScenes: {
49
- light: {
50
- default: { default: "600", hover: "600", pressed: "700", focus: "500", disabled: "300" }
51
- },
52
- dark: {
53
- default: { default: "500", hover: "400", pressed: "300", focus: "500", disabled: "600" }
54
- }
55
- },
56
- // 语义颜色
57
- colorSemantic: {
58
- light: {
59
- text: { dimmed: "300", muted: "400", toned: "600", base: "800", highlighted: "900", inverted: "white" },
60
- bg: { base: "white", muted: "50", elevated: "100", accented: "200", inverted: "900" },
61
- border: { base: "100", muted: "200", accented: "300", inverted: "900" }
62
- },
63
- dark: {
64
- text: { dimmed: "600", muted: "500", toned: "300", base: "400", highlighted: "100", inverted: "black" },
65
- bg: { base: "950", muted: "900", elevated: "800", accented: "700", inverted: "100" },
66
- border: { base: "900", muted: "800", accented: "700", inverted: "100" }
67
- }
68
- },
69
- colorBase: { white: "#ffffff", black: "#000000" }
70
- }, ...u.config?.theme?.config }, { colorShades: C, colorTypes: x } = r, f = b(() => s.theme), h = b(() => Object.keys(r.colors)), k = ["default", "hover", "pressed", "focus", "disabled"];
71
- function y() {
72
- return d.value ? r.colorScenes.dark : r.colorScenes.light;
73
- }
74
- function w(t, e) {
75
- const o = y(), l = o.default;
76
- if (o.overrides?.[t]) {
77
- const i = o.overrides[t]?.[e];
78
- if (i)
79
- return i;
80
- }
81
- return l[e] || "500";
82
- }
83
- function T(t, e) {
84
- const o = f.value[t];
85
- return r.colors[o]?.[e] || "";
86
- }
87
- function n(t, e, o) {
88
- const c = (d.value ? r.colorSemantic.dark : r.colorSemantic.light)[t][e];
89
- return c === "white" || c === "black" ? `var(--ui-color-${c})` : `var(--base-color-${o}-${c})`;
90
- }
91
- const p = (t) => {
92
- const e = K(t);
93
- return `${e.r} ${e.g} ${e.b}`;
94
- };
95
- function I() {
96
- const t = [];
97
- Object.entries(r.colors).forEach(([c, i]) => {
98
- typeof i == "object" && Object.entries(i).forEach(([a, m]) => {
99
- try {
100
- t.push(`--base-color-${c}-${a}: ${p(m)};`);
101
- } catch {
102
- t.push(`--base-color-${c}-${a}: ${m};`);
103
- }
104
- });
105
- });
106
- const e = [];
107
- x.forEach((c) => {
108
- const i = f.value[c];
109
- C.forEach((a) => {
110
- e.push(`--ui-color-${c}-${a}: var(--base-color-${i}-${a});`);
111
- }), k.forEach((a) => {
112
- const m = w(c, a);
113
- a === "default" ? e.push(`--ui-color-${c}: var(--base-color-${i}-${m});`) : e.push(`--ui-color-${c}-${a}: var(--base-color-${i}-${m});`);
114
- });
115
- });
116
- const o = f.value.gray, l = [
117
- `--ui-color-white: ${p(r.colorBase?.white || "#ffffff")};`,
118
- `--ui-color-black: ${p(r.colorBase?.black || "#000000")};`,
119
- `--ui-text-dimmed: ${n("text", "dimmed", o)};`,
120
- `--ui-text-muted: ${n("text", "muted", o)};`,
121
- `--ui-text-toned: ${n("text", "toned", o)};`,
122
- `--ui-text: ${n("text", "base", o)};`,
123
- `--ui-text-highlighted: ${n("text", "highlighted", o)};`,
124
- `--ui-text-inverted: ${n("text", "inverted", o)};`,
125
- `--ui-bg: ${n("bg", "base", o)};`,
126
- `--ui-bg-muted: ${n("bg", "muted", o)};`,
127
- `--ui-bg-elevated: ${n("bg", "elevated", o)};`,
128
- `--ui-bg-accented: ${n("bg", "accented", o)};`,
129
- `--ui-bg-inverted: ${n("bg", "inverted", o)};`,
130
- `--ui-border: ${n("border", "base", o)};`,
131
- `--ui-border-muted: ${n("border", "muted", o)};`,
132
- `--ui-border-accented: ${n("border", "accented", o)};`,
133
- `--ui-border-inverted: ${n("border", "inverted", o)};`
134
- ];
135
- return `:root {
136
- ${t.join(`
137
- `)}
138
- ${e.join(`
139
- `)}
140
- ${l.join(`
141
- `)}
142
- }`;
143
- }
144
- let g = null;
145
- function E() {
146
- const t = I();
147
- g || (g = document.createElement("style"), g.id = "dvha-variables", document.head.appendChild(g)), g.textContent = t;
148
- }
149
- function O() {
150
- s.cssInit || (s.setCssInit(), E());
151
- }
152
- W([f, d], () => {
153
- s.cssInit && E();
154
- }, { deep: !0, immediate: !1 });
155
- function R(t, e) {
156
- h.value.includes(e) ? s.setThemeColor(t, e) : console.warn(`Color "${e}" is not available`);
157
- }
158
- function z(t) {
159
- s.setThemeColors(t);
160
- }
161
- function D() {
162
- s.resetTheme();
163
- }
164
- function G(t, e, o = !1) {
165
- return o ? `--ui-color-${t}-${e}` : T(t, e);
166
- }
167
- function U(t, e, o = !1) {
168
- if (e || (e = "default"), o)
169
- return e === "default" ? `--ui-color-${t})` : `--ui-color-${t}-${e})`;
170
- const l = w(t, e);
171
- return T(t, l);
172
- }
173
- function q(t, e, o = !1) {
174
- if (o) {
175
- let a;
176
- switch (t) {
177
- case "text":
178
- a = e === "base" ? "--ui-text" : `--ui-text-${e}`;
179
- break;
180
- case "bg":
181
- a = e === "base" ? "--ui-bg" : `--ui-bg-${e}`;
182
- break;
183
- case "border":
184
- a = e === "base" ? "--ui-border" : `--ui-border-${e}`;
185
- break;
186
- default:
187
- a = `--ui-${t}-${e}`;
188
- }
189
- return `${a}`;
190
- }
191
- const l = f.value.gray, i = (d.value ? r.colorSemantic.dark : r.colorSemantic.light)[t][e];
192
- return i === "white" ? r.colorBase?.white || "#ffffff" : i === "black" ? r.colorBase?.black || "#000000" : r.colors[l]?.[i] || "";
193
- }
194
- const A = b(() => h.value?.filter((t) => ["slate", "gray", "zinc", "neutral", "stone"].includes(t))), F = b(() => h.value?.filter((t) => !["slate", "gray", "zinc", "neutral", "stone"].includes(t)));
195
- return {
196
- toggle: B,
197
- mode: S,
198
- setMode: V,
199
- isDark: d,
200
- resources: M,
201
- config: L(r),
202
- colorMapping: L(f),
203
- colors: h,
204
- neutralColors: A,
205
- primaryColors: F,
206
- colorShades: C,
207
- colorTypes: x,
208
- colorScenes: k,
209
- cssInit: O,
210
- cssReset: D,
211
- setColor: R,
212
- setColors: z,
213
- getSceneColor: U,
214
- getShadeColor: G,
215
- getSemanticColor: q
216
- };
1
+ import { themeColor as e } from "../config/color.js";
2
+ import { useThemeStore as t } from "../stores/theme.js";
3
+ import "../stores/index.js";
4
+ import { useManage as n } from "./manage.js";
5
+ import { computed as r, readonly as i, watch as a, watchEffect as o } from "vue";
6
+ import { storeToRefs as s } from "pinia";
7
+ import { useColorMode as c, useCycleList as l } from "@vueuse/core";
8
+ import { hex2rgb as u } from "colorizr";
9
+ function d() {
10
+ let d = t(), { mode: f } = s(d), p = c({ storageRef: f }), m = n(), { state: h, next: g, go: _ } = l([
11
+ "dark",
12
+ "light",
13
+ "auto"
14
+ ], { initialValue: p.store.value });
15
+ o(() => {
16
+ p.value = h.value;
17
+ });
18
+ let v = (e) => {
19
+ switch (e) {
20
+ case "auto":
21
+ _(2);
22
+ break;
23
+ case "light":
24
+ _(1);
25
+ break;
26
+ case "dark":
27
+ _(0);
28
+ break;
29
+ }
30
+ }, y = r(() => {
31
+ let { system: e, store: t } = p;
32
+ return t.value === "auto" ? e.value === "dark" : t.value === "dark";
33
+ }), b = r(() => y.value ? {
34
+ logo: m.config?.theme?.darkLogo,
35
+ appLogo: m.config?.theme?.appDarkLogo,
36
+ banner: m.config?.theme?.darkBanner
37
+ } : {
38
+ logo: m.config?.theme?.logo,
39
+ appLogo: m.config?.theme?.appLogo,
40
+ banner: m.config?.theme?.banner
41
+ }), x = {
42
+ colors: e,
43
+ colorTypes: [
44
+ "primary",
45
+ "info",
46
+ "success",
47
+ "warning",
48
+ "error",
49
+ "gray"
50
+ ],
51
+ colorShades: [
52
+ "50",
53
+ "100",
54
+ "200",
55
+ "300",
56
+ "400",
57
+ "500",
58
+ "600",
59
+ "700",
60
+ "800",
61
+ "900",
62
+ "950"
63
+ ],
64
+ colorScenes: {
65
+ light: { default: {
66
+ default: "600",
67
+ hover: "600",
68
+ pressed: "700",
69
+ focus: "500",
70
+ disabled: "300"
71
+ } },
72
+ dark: { default: {
73
+ default: "500",
74
+ hover: "400",
75
+ pressed: "300",
76
+ focus: "500",
77
+ disabled: "600"
78
+ } }
79
+ },
80
+ colorSemantic: {
81
+ light: {
82
+ text: {
83
+ dimmed: "300",
84
+ muted: "400",
85
+ toned: "600",
86
+ base: "800",
87
+ highlighted: "900",
88
+ inverted: "white"
89
+ },
90
+ bg: {
91
+ base: "white",
92
+ muted: "50",
93
+ elevated: "100",
94
+ accented: "200",
95
+ inverted: "900"
96
+ },
97
+ border: {
98
+ base: "100",
99
+ muted: "200",
100
+ accented: "300",
101
+ inverted: "900"
102
+ }
103
+ },
104
+ dark: {
105
+ text: {
106
+ dimmed: "600",
107
+ muted: "500",
108
+ toned: "300",
109
+ base: "400",
110
+ highlighted: "100",
111
+ inverted: "black"
112
+ },
113
+ bg: {
114
+ base: "950",
115
+ muted: "900",
116
+ elevated: "800",
117
+ accented: "700",
118
+ inverted: "100"
119
+ },
120
+ border: {
121
+ base: "900",
122
+ muted: "800",
123
+ accented: "700",
124
+ inverted: "100"
125
+ }
126
+ }
127
+ },
128
+ colorBase: {
129
+ white: "#ffffff",
130
+ black: "#000000"
131
+ },
132
+ ...m.config?.theme?.config
133
+ }, { colorShades: S, colorTypes: C } = x, w = r(() => d.theme), T = r(() => Object.keys(x.colors)), E = [
134
+ "default",
135
+ "hover",
136
+ "pressed",
137
+ "focus",
138
+ "disabled"
139
+ ];
140
+ function D() {
141
+ return y.value ? x.colorScenes.dark : x.colorScenes.light;
142
+ }
143
+ function O(e, t) {
144
+ let n = D(), r = n.default;
145
+ if (n.overrides?.[e]) {
146
+ let r = n.overrides[e]?.[t];
147
+ if (r) return r;
148
+ }
149
+ return r[t] || "500";
150
+ }
151
+ function k(e, t) {
152
+ let n = w.value[e];
153
+ return x.colors[n]?.[t] || "";
154
+ }
155
+ function A(e, t, n) {
156
+ let r = (y.value ? x.colorSemantic.dark : x.colorSemantic.light)[e][t];
157
+ return r === "white" || r === "black" ? `var(--ui-color-${r})` : `var(--base-color-${n}-${r})`;
158
+ }
159
+ let j = (e) => {
160
+ let t = u(e);
161
+ return `${t.r} ${t.g} ${t.b}`;
162
+ };
163
+ function M() {
164
+ let e = [];
165
+ Object.entries(x.colors).forEach(([t, n]) => {
166
+ typeof n == "object" && Object.entries(n).forEach(([n, r]) => {
167
+ try {
168
+ e.push(`--base-color-${t}-${n}: ${j(r)};`);
169
+ } catch {
170
+ e.push(`--base-color-${t}-${n}: ${r};`);
171
+ }
172
+ });
173
+ });
174
+ let t = [];
175
+ C.forEach((e) => {
176
+ let n = w.value[e];
177
+ S.forEach((r) => {
178
+ t.push(`--ui-color-${e}-${r}: var(--base-color-${n}-${r});`);
179
+ }), E.forEach((r) => {
180
+ let i = O(e, r);
181
+ r === "default" ? t.push(`--ui-color-${e}: var(--base-color-${n}-${i});`) : t.push(`--ui-color-${e}-${r}: var(--base-color-${n}-${i});`);
182
+ });
183
+ });
184
+ let n = w.value.gray, r = [
185
+ `--ui-color-white: ${j(x.colorBase?.white || "#ffffff")};`,
186
+ `--ui-color-black: ${j(x.colorBase?.black || "#000000")};`,
187
+ `--ui-text-dimmed: ${A("text", "dimmed", n)};`,
188
+ `--ui-text-muted: ${A("text", "muted", n)};`,
189
+ `--ui-text-toned: ${A("text", "toned", n)};`,
190
+ `--ui-text: ${A("text", "base", n)};`,
191
+ `--ui-text-highlighted: ${A("text", "highlighted", n)};`,
192
+ `--ui-text-inverted: ${A("text", "inverted", n)};`,
193
+ `--ui-bg: ${A("bg", "base", n)};`,
194
+ `--ui-bg-muted: ${A("bg", "muted", n)};`,
195
+ `--ui-bg-elevated: ${A("bg", "elevated", n)};`,
196
+ `--ui-bg-accented: ${A("bg", "accented", n)};`,
197
+ `--ui-bg-inverted: ${A("bg", "inverted", n)};`,
198
+ `--ui-border: ${A("border", "base", n)};`,
199
+ `--ui-border-muted: ${A("border", "muted", n)};`,
200
+ `--ui-border-accented: ${A("border", "accented", n)};`,
201
+ `--ui-border-inverted: ${A("border", "inverted", n)};`
202
+ ];
203
+ return `:root {\n ${e.join("\n ")}\n ${t.join("\n ")}\n ${r.join("\n ")}\n}`;
204
+ }
205
+ let N = null;
206
+ function P() {
207
+ let e = M();
208
+ N || (N = document.createElement("style"), N.id = "dvha-variables", document.head.appendChild(N)), N.textContent = e;
209
+ }
210
+ function F() {
211
+ d.cssInit || (d.setCssInit(), P());
212
+ }
213
+ a([w, y], () => {
214
+ d.cssInit && P();
215
+ }, {
216
+ deep: !0,
217
+ immediate: !1
218
+ });
219
+ function I(e, t) {
220
+ T.value.includes(t) ? d.setThemeColor(e, t) : console.warn(`Color "${t}" is not available`);
221
+ }
222
+ function L(e) {
223
+ d.setThemeColors(e);
224
+ }
225
+ function R() {
226
+ d.resetTheme();
227
+ }
228
+ function z(e, t, n = !1) {
229
+ return n ? `--ui-color-${e}-${t}` : k(e, t);
230
+ }
231
+ function B(e, t, n = !1) {
232
+ return t ||= "default", n ? t === "default" ? `--ui-color-${e})` : `--ui-color-${e}-${t})` : k(e, O(e, t));
233
+ }
234
+ function V(e, t, n = !1) {
235
+ if (n) {
236
+ let n;
237
+ switch (e) {
238
+ case "text":
239
+ n = t === "base" ? "--ui-text" : `--ui-text-${t}`;
240
+ break;
241
+ case "bg":
242
+ n = t === "base" ? "--ui-bg" : `--ui-bg-${t}`;
243
+ break;
244
+ case "border":
245
+ n = t === "base" ? "--ui-border" : `--ui-border-${t}`;
246
+ break;
247
+ default: n = `--ui-${e}-${t}`;
248
+ }
249
+ return `${n}`;
250
+ }
251
+ let r = w.value.gray, i = (y.value ? x.colorSemantic.dark : x.colorSemantic.light)[e][t];
252
+ return i === "white" ? x.colorBase?.white || "#ffffff" : i === "black" ? x.colorBase?.black || "#000000" : x.colors[r]?.[i] || "";
253
+ }
254
+ let H = r(() => T.value?.filter((e) => [
255
+ "slate",
256
+ "gray",
257
+ "zinc",
258
+ "neutral",
259
+ "stone"
260
+ ].includes(e))), U = r(() => T.value?.filter((e) => ![
261
+ "slate",
262
+ "gray",
263
+ "zinc",
264
+ "neutral",
265
+ "stone"
266
+ ].includes(e)));
267
+ return {
268
+ toggle: g,
269
+ mode: h,
270
+ setMode: v,
271
+ isDark: y,
272
+ resources: b,
273
+ config: i(x),
274
+ colorMapping: i(w),
275
+ colors: T,
276
+ neutralColors: H,
277
+ primaryColors: U,
278
+ colorShades: S,
279
+ colorTypes: C,
280
+ colorScenes: E,
281
+ cssInit: F,
282
+ cssReset: R,
283
+ setColor: I,
284
+ setColors: L,
285
+ getSceneColor: B,
286
+ getShadeColor: z,
287
+ getSemanticColor: V
288
+ };
217
289
  }
218
- export {
219
- ie as useTheme
220
- };
290
+ export { d as useTheme };
@@ -1,48 +1,44 @@
1
- import { computed as r, unref as c, reactive as y, watch as f } from "vue";
2
- import "../utils/bus.js";
3
- import { arrayToTree as K, treeToArr as O } from "../utils/tree.js";
4
- import { useList as g } from "./data.js";
5
- function j(e) {
6
- const u = r(() => c(e.path) || ""), s = r(() => c(e.params) || {}), h = r(() => c(e.providerName)), i = y({
7
- ...s.value
8
- });
9
- f(s, (a) => {
10
- const o = a || {};
11
- Object.keys(i).forEach((n) => {
12
- n in o || delete i[n];
13
- }), Object.entries(o).forEach(([n, t]) => {
14
- i[n] = t;
15
- });
16
- }, {
17
- deep: !0,
18
- immediate: !0
19
- });
20
- const { data: d, isLoading: m } = g({
21
- get path() {
22
- return u.value;
23
- },
24
- filters: i,
25
- get providerName() {
26
- return h.value;
27
- }
28
- }), l = r(() => e.converTree ? K(d.value?.data || [], {
29
- idKey: e.treeOptions?.valueKey || "id",
30
- parentKey: e.treeOptions?.parentKey || "parent_id",
31
- sortKey: e.treeOptions?.sortKey || "sort",
32
- childrenKey: e.treeOptions?.childrenKey || "children"
33
- }) : d.value?.data || []), v = r(() => O(l.value, e.treeOptions?.valueKey || "id", e.treeOptions?.childrenKey || "children")), p = r(() => m.value);
34
- return {
35
- options: r(() => {
36
- const a = (o) => o.map((n) => {
37
- const t = { ...n };
38
- return Array.isArray(t.children) && (t.children.length === 0 ? delete t.children : t.children = a(t.children)), t;
39
- });
40
- return a(l.value || []);
41
- }),
42
- loading: p,
43
- expanded: v
44
- };
1
+ import { useList as e } from "./data.js";
2
+ import { arrayToTree as t, treeToArr as n } from "../utils/tree.js";
3
+ import "../utils/index.js";
4
+ import { computed as r, reactive as i, unref as a, watch as o } from "vue";
5
+ function s(s) {
6
+ let c = r(() => a(s.path) || ""), l = r(() => a(s.params) || {}), u = r(() => a(s.providerName)), d = i({ ...l.value });
7
+ o(l, (e) => {
8
+ let t = e || {};
9
+ Object.keys(d).forEach((e) => {
10
+ e in t || delete d[e];
11
+ }), Object.entries(t).forEach(([e, t]) => {
12
+ d[e] = t;
13
+ });
14
+ }, {
15
+ deep: !0,
16
+ immediate: !0
17
+ });
18
+ let { data: f, isLoading: p } = e({
19
+ get path() {
20
+ return c.value;
21
+ },
22
+ filters: d,
23
+ get providerName() {
24
+ return u.value;
25
+ }
26
+ }), m = r(() => s.converTree ? t(f.value?.data || [], {
27
+ idKey: s.treeOptions?.valueKey || "id",
28
+ parentKey: s.treeOptions?.parentKey || "parent_id",
29
+ sortKey: s.treeOptions?.sortKey || "sort",
30
+ childrenKey: s.treeOptions?.childrenKey || "children"
31
+ }) : f.value?.data || []), h = r(() => n(m.value, s.treeOptions?.valueKey || "id", s.treeOptions?.childrenKey || "children")), g = r(() => p.value);
32
+ return {
33
+ options: r(() => {
34
+ let e = (t) => t.map((t) => {
35
+ let n = { ...t };
36
+ return Array.isArray(n.children) && (n.children.length === 0 ? delete n.children : n.children = e(n.children)), n;
37
+ });
38
+ return e(m.value || []);
39
+ }),
40
+ loading: g,
41
+ expanded: h
42
+ };
45
43
  }
46
- export {
47
- j as useTree
48
- };
44
+ export { s as useTree };
@@ -0,0 +1,2 @@
1
+ import "./local.js";
2
+ import "./s3.js";