mvframe 1.1.3 → 1.1.8

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/dist/Config.js CHANGED
@@ -1,53 +1,72 @@
1
- import { reactive as P, onMounted as T, resolveComponent as a, openBlock as E, createBlock as F, mergeProps as L, unref as l, withCtx as n, createElementVNode as s, createVNode as t, createTextVNode as g, toDisplayString as m, nextTick as y } from "vue";
1
+ import { reactive as O, onMounted as B, resolveComponent as a, openBlock as k, createBlock as G, mergeProps as H, unref as i, withCtx as l, createElementVNode as s, createVNode as o, createTextVNode as g, toDisplayString as c, createElementBlock as j, Fragment as z, renderList as W, nextTick as y } from "vue";
2
2
  import "./vendor.js";
3
- import { MVFRAME_STORAGE_PRIMARY as h, persistMvframeTheme as c, applyMvframeTheme as d } from "./composition.js";
4
- const R = { class: "p16" }, N = { class: "m0 flexMode vc g8" }, U = { class: "flexMode vc g16 vl" }, j = { class: "m0 flexMode vc g8" }, B = { class: "flexMode vc g8 wp100" }, O = { class: "m0 flexMode vc g8" }, H = /* @__PURE__ */ Object.assign({
3
+ import { MVFRAME_DEFAULT_THEME_NAME as E, MVFRAME_STORAGE_PRIMARY as b, MVFRAME_THEME_CLASS_PREFIX as C, MVFRAME_STORAGE_THEME_NAME as X, persistMvframeTheme as d, applyMvframeTheme as p } from "./composition.js";
4
+ const Y = { class: "p16" }, q = { class: "m0 flexMode vc g8" }, J = { class: "flexMode vc g16 vl" }, K = { class: "m0 flexMode vc g8" }, Q = { class: "flexMode vl g12 wp100" }, Z = { class: "flexMode vc hb g8 wp100" }, ee = { class: "fs14 txt-p" }, te = { class: "flexMode vc g8 wp100" }, oe = { class: "m0 flexMode vc g8" }, re = /* @__PURE__ */ Object.assign({
5
5
  name: "FrameConfig",
6
6
  inheritAttrs: !1
7
7
  }, {
8
8
  __name: "Config",
9
9
  emits: ["mounted"],
10
- setup(G, { emit: k }) {
11
- const v = k, o = P({
10
+ setup(ne, { emit: V }) {
11
+ const A = V, e = O({
12
12
  loading: !1,
13
13
  primary: "#007bff",
14
+ theme: E,
14
15
  isDark: !1
15
16
  });
16
- T(() => {
17
- C(), v("mounted");
17
+ B(() => {
18
+ D(), A("mounted");
18
19
  });
19
- const p = () => {
20
- const e = getComputedStyle(document.documentElement).getPropertyValue("--color-primary").trim();
21
- o.primary = e || "#007bff";
22
- }, C = () => {
23
- const e = localStorage.getItem(h);
24
- e ? o.primary = e : p(), o.isDark = document.documentElement.classList.contains("dark");
25
- }, _ = () => {
26
- c({
27
- primary: o.primary,
28
- mode: o.isDark ? "dark" : "light"
29
- });
20
+ const u = () => {
21
+ const t = getComputedStyle(document.documentElement).getPropertyValue("--color-primary").trim();
22
+ e.primary = t || "#007bff";
30
23
  }, D = () => {
31
- const e = o.isDark ? "dark" : "light";
32
- if (!o.primary) {
33
- c({ primary: null }), d({ primary: null, mode: e }), y(() => p());
24
+ var h;
25
+ const t = localStorage.getItem(b);
26
+ t ? e.primary = t : u();
27
+ const r = [...document.documentElement.classList].find(
28
+ (_) => _.startsWith(C)
29
+ );
30
+ e.theme = (r == null ? void 0 : r.slice(C.length)) || localStorage.getItem(X) || ((h = globalThis.$config) == null ? void 0 : h.theme) || E, e.isDark = document.documentElement.classList.contains("dark");
31
+ }, v = () => {
32
+ d({
33
+ primary: e.primary,
34
+ theme: e.theme,
35
+ mode: e.isDark ? "dark" : "light"
36
+ });
37
+ }, M = () => {
38
+ const t = localStorage.getItem(b);
39
+ return t != null && t !== "" ? t : null;
40
+ }, T = () => {
41
+ const t = e.isDark ? "dark" : "light";
42
+ if (!e.primary) {
43
+ d({ primary: null }), p({ primary: null, mode: t, theme: e.theme }), y(() => u());
34
44
  return;
35
45
  }
36
- d({ primary: o.primary, mode: e }), _();
37
- }, M = () => {
38
- const e = o.isDark ? "dark" : "light", r = localStorage.getItem(h);
39
- d({
40
- primary: r != null && r !== "" ? r : null,
41
- mode: e
42
- }), c({ mode: e });
43
- }, b = () => {
44
- c({ primary: null }), d({
46
+ p({ primary: e.primary, mode: t, theme: e.theme }), v();
47
+ }, x = () => {
48
+ const t = e.isDark ? "dark" : "light";
49
+ p({
50
+ primary: M(),
51
+ mode: t,
52
+ theme: e.theme
53
+ }), d({ mode: t });
54
+ }, F = () => {
55
+ const t = e.isDark ? "dark" : "light";
56
+ p({
57
+ primary: M(),
58
+ mode: t,
59
+ theme: e.theme
60
+ }), d({ theme: e.theme }), y(() => u());
61
+ }, S = () => {
62
+ d({ primary: null }), p({
45
63
  primary: null,
46
- mode: o.isDark ? "dark" : "light"
47
- }), y(() => p());
48
- }, V = async () => {
49
- _();
50
- }, x = [
64
+ mode: e.isDark ? "dark" : "light",
65
+ theme: e.theme
66
+ }), y(() => u());
67
+ }, R = async () => {
68
+ v();
69
+ }, w = [
51
70
  "#007bff",
52
71
  "#409eff",
53
72
  "#16b1ff",
@@ -56,38 +75,47 @@ const R = { class: "p16" }, N = { class: "m0 flexMode vc g8" }, U = { class: "fl
56
75
  "#e83e8c",
57
76
  "#dc3545",
58
77
  "#fd7e14"
78
+ ], L = [
79
+ {
80
+ label: "Main",
81
+ value: "main"
82
+ },
83
+ {
84
+ label: "Glass",
85
+ value: "glass"
86
+ }
59
87
  ];
60
- return (e, r) => {
61
- const i = a("Icon"), A = a("el-color-picker"), S = a("el-button"), u = a("Card"), $ = a("el-switch"), w = a("Lang"), I = a("DrawerArea");
62
- return E(), F(I, L({
63
- loading: l(o).loading,
64
- onSubmit: V
65
- }, e.$attrs, { class: "MvcFrameConfig" }), {
66
- default: n(() => [
67
- s("div", R, [
68
- t(u, { class: "mb16" }, {
69
- header: n(() => [
70
- s("h4", N, [
71
- t(i, { name: "adjust" }),
72
- g(" " + m(e.$l("Theme color")), 1)
88
+ return (t, m) => {
89
+ const r = a("Icon"), h = a("el-color-picker"), _ = a("el-button"), f = a("Card"), P = a("el-option"), $ = a("el-select"), I = a("el-switch"), N = a("Lang"), U = a("DrawerArea");
90
+ return k(), G(U, H({
91
+ loading: i(e).loading,
92
+ onSubmit: R
93
+ }, t.$attrs, { class: "MvcFrameConfig" }), {
94
+ default: l(() => [
95
+ s("div", Y, [
96
+ o(f, { class: "mb16" }, {
97
+ header: l(() => [
98
+ s("h4", q, [
99
+ o(r, { name: "adjust" }),
100
+ g(" " + c(t.$l("Theme color")), 1)
73
101
  ])
74
102
  ]),
75
- default: n(() => [
76
- s("div", U, [
77
- t(A, {
78
- modelValue: l(o).primary,
79
- "onUpdate:modelValue": r[0] || (r[0] = (f) => l(o).primary = f),
103
+ default: l(() => [
104
+ s("div", J, [
105
+ o(h, {
106
+ modelValue: i(e).primary,
107
+ "onUpdate:modelValue": m[0] || (m[0] = (n) => i(e).primary = n),
80
108
  "color-format": "hex",
81
- predefine: x,
82
- onChange: D
109
+ predefine: w,
110
+ onChange: T
83
111
  }, null, 8, ["modelValue"]),
84
- t(S, {
112
+ o(_, {
85
113
  text: "",
86
114
  type: "primary",
87
- onClick: b
115
+ onClick: S
88
116
  }, {
89
- default: n(() => [
90
- g(m(e.$l("Restore default")), 1)
117
+ default: l(() => [
118
+ g(c(t.$l("Restore default")), 1)
91
119
  ]),
92
120
  _: 1
93
121
  })
@@ -95,35 +123,56 @@ const R = { class: "p16" }, N = { class: "m0 flexMode vc g8" }, U = { class: "fl
95
123
  ]),
96
124
  _: 1
97
125
  }),
98
- t(u, { class: "mb16" }, {
99
- header: n(() => [
100
- s("h4", j, m(e.$l("Appearance")), 1)
126
+ o(f, { class: "mb16" }, {
127
+ header: l(() => [
128
+ s("h4", K, c(t.$l("Appearance")), 1)
101
129
  ]),
102
- default: n(() => [
103
- s("div", B, [
104
- t(i, { name: "sun" }),
105
- t($, {
106
- modelValue: l(o).isDark,
107
- "onUpdate:modelValue": r[1] || (r[1] = (f) => l(o).isDark = f),
108
- "inline-prompt": "",
109
- "active-text": e.$l("Dark"),
110
- "inactive-text": e.$l("Light"),
111
- onChange: M
112
- }, null, 8, ["modelValue", "active-text", "inactive-text"]),
113
- t(i, { name: "moon" })
130
+ default: l(() => [
131
+ s("div", Q, [
132
+ s("div", Z, [
133
+ s("span", ee, c(t.$l("Theme")), 1),
134
+ o($, {
135
+ modelValue: i(e).theme,
136
+ "onUpdate:modelValue": m[1] || (m[1] = (n) => i(e).theme = n),
137
+ class: "w160",
138
+ size: "small",
139
+ onChange: F
140
+ }, {
141
+ default: l(() => [
142
+ (k(), j(z, null, W(L, (n) => o(P, {
143
+ key: n.value,
144
+ label: n.label,
145
+ value: n.value
146
+ }, null, 8, ["label", "value"])), 64))
147
+ ]),
148
+ _: 1
149
+ }, 8, ["modelValue"])
150
+ ]),
151
+ s("div", te, [
152
+ o(r, { name: "sun" }),
153
+ o(I, {
154
+ modelValue: i(e).isDark,
155
+ "onUpdate:modelValue": m[2] || (m[2] = (n) => i(e).isDark = n),
156
+ "inline-prompt": "",
157
+ "active-text": t.$l("Dark"),
158
+ "inactive-text": t.$l("Light"),
159
+ onChange: x
160
+ }, null, 8, ["modelValue", "active-text", "inactive-text"]),
161
+ o(r, { name: "moon" })
162
+ ])
114
163
  ])
115
164
  ]),
116
165
  _: 1
117
166
  }),
118
- t(u, { class: "mb16" }, {
119
- header: n(() => [
120
- s("h4", O, [
121
- t(i, { name: "earth" }),
122
- g(" " + m(e.$l("Language")), 1)
167
+ o(f, { class: "mb16" }, {
168
+ header: l(() => [
169
+ s("h4", oe, [
170
+ o(r, { name: "earth" }),
171
+ g(" " + c(t.$l("Language")), 1)
123
172
  ])
124
173
  ]),
125
- default: n(() => [
126
- t(w)
174
+ default: l(() => [
175
+ o(N)
127
176
  ]),
128
177
  _: 1
129
178
  })
@@ -135,5 +184,5 @@ const R = { class: "p16" }, N = { class: "m0 flexMode vc g8" }, U = { class: "fl
135
184
  }
136
185
  });
137
186
  export {
138
- H as default
187
+ re as default
139
188
  };