mvframe 1.0.18 → 1.0.58

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,108 +1,53 @@
1
- import { reactive as B, onMounted as G, computed as C, resolveComponent as c, openBlock as p, createBlock as M, mergeProps as z, unref as s, withCtx as l, createElementVNode as r, createVNode as a, createTextVNode as v, toDisplayString as m, createElementBlock as V, Fragment as Y, renderList as q, createCommentVNode as H, nextTick as D } from "vue";
2
- import { MVFRAME_STORAGE_PRIMARY as S, persistMvframeTheme as g, applyMvframeTheme as _, MVFRAME_STORAGE_LANG as w } from "./composition.js";
3
- const J = { class: "p16" }, K = { class: "m0 flexMode vc g8" }, Q = { class: "flexMode vc g16 vl" }, W = { class: "m0 flexMode vc g8" }, X = { class: "flexMode vc g8 wp100" }, Z = { class: "m0 flexMode vc g8" }, ee = {
4
- key: 0,
5
- class: "langPrefix flexMode vc g4 noShrink"
6
- }, te = { class: "langTag fs12 txt-tip" }, ne = { class: "flexMode vc g8 vl" }, oe = { class: "langTag fs12 txt-tip noShrink" }, le = { class: "txt-p" }, ie = /* @__PURE__ */ Object.assign({
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";
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({
7
5
  name: "FrameConfig",
8
6
  inheritAttrs: !1
9
7
  }, {
10
8
  __name: "Config",
11
9
  emits: ["mounted"],
12
- setup(ae, { emit: T }) {
13
- const A = T, t = B({
10
+ setup(G, { emit: k }) {
11
+ const v = k, o = P({
14
12
  loading: !1,
15
13
  primary: "#007bff",
16
- isDark: !1,
17
- lang: "en_us"
14
+ isDark: !1
18
15
  });
19
- G(() => {
20
- E(), A("mounted");
16
+ T(() => {
17
+ C(), v("mounted");
21
18
  });
22
- const f = () => {
19
+ const p = () => {
23
20
  const e = getComputedStyle(document.documentElement).getPropertyValue("--color-primary").trim();
24
- t.primary = e || "#007bff";
25
- }, E = () => {
26
- var d;
27
- const e = localStorage.getItem(S);
28
- e ? t.primary = e : f(), t.isDark = document.documentElement.classList.contains("dark");
29
- const n = ((d = globalThis.$getLang) == null ? void 0 : d.call(globalThis)) || "en_us", i = x.filter((u) => u.use !== !1).map((u) => u.value);
30
- t.lang = i.includes(n) ? n : "en_us";
31
- }, y = () => {
32
- g({
33
- primary: t.primary,
34
- mode: t.isDark ? "dark" : "light"
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"
35
29
  });
36
- }, $ = () => {
37
- const e = t.isDark ? "dark" : "light";
38
- if (!t.primary) {
39
- g({ primary: null }), _({ primary: null, mode: e }), D(() => f());
30
+ }, D = () => {
31
+ const e = o.isDark ? "dark" : "light";
32
+ if (!o.primary) {
33
+ c({ primary: null }), d({ primary: null, mode: e }), y(() => p());
40
34
  return;
41
35
  }
42
- _({ primary: t.primary, mode: e }), y();
43
- }, I = () => {
44
- const e = t.isDark ? "dark" : "light", n = localStorage.getItem(S);
45
- _({
46
- primary: n != null && n !== "" ? n : null,
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,
47
41
  mode: e
48
- }), g({ mode: e });
49
- }, L = () => {
50
- g({ primary: null }), _({
42
+ }), c({ mode: e });
43
+ }, b = () => {
44
+ c({ primary: null }), d({
51
45
  primary: null,
52
- mode: t.isDark ? "dark" : "light"
53
- }), D(() => f());
54
- }, F = (e) => {
55
- var i;
56
- const n = localStorage.getItem(w) || ((i = globalThis.$config) == null ? void 0 : i.lang) || "en_us";
57
- e == null || e === n || (localStorage.setItem(w, e), window.location.reload());
58
- }, P = async () => {
59
- y();
60
- }, k = C(
61
- () => x.filter((e) => e.use !== !1)
62
- ), b = C(() => k.value.find((e) => e.value === t.lang) ?? null), x = [
63
- {
64
- label: "English",
65
- icon: "us",
66
- txt: "EN",
67
- value: "en_us",
68
- use: !0
69
- },
70
- {
71
- label: "简体中文",
72
- icon: "cn",
73
- txt: "简",
74
- value: "zh_cn",
75
- use: !0
76
- },
77
- {
78
- label: "繁體中文",
79
- icon: "hk",
80
- txt: "繁",
81
- value: "zh_tw",
82
- use: !0
83
- },
84
- {
85
- label: "日本語",
86
- icon: "jp",
87
- txt: "日",
88
- value: "ja_jp",
89
- use: !0
90
- },
91
- {
92
- label: "한국어",
93
- icon: "kr",
94
- txt: "한",
95
- value: "ko_kr",
96
- use: !0
97
- },
98
- {
99
- label: "Tiếng Việt",
100
- icon: "vn",
101
- txt: "Vi",
102
- value: "vi_vn",
103
- use: !0
104
- }
105
- ], R = [
46
+ mode: o.isDark ? "dark" : "light"
47
+ }), y(() => p());
48
+ }, V = async () => {
49
+ _();
50
+ }, x = [
106
51
  "#007bff",
107
52
  "#409eff",
108
53
  "#16b1ff",
@@ -112,37 +57,37 @@ const J = { class: "p16" }, K = { class: "m0 flexMode vc g8" }, Q = { class: "fl
112
57
  "#dc3545",
113
58
  "#fd7e14"
114
59
  ];
115
- return (e, n) => {
116
- const i = c("Icon"), d = c("el-color-picker"), u = c("el-button"), h = c("Card"), N = c("el-switch"), j = c("el-option"), O = c("el-select"), U = c("DrawerArea");
117
- return p(), M(U, z({
118
- loading: s(t).loading,
119
- onSubmit: P
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
120
65
  }, e.$attrs, { class: "MvcFrameConfig" }), {
121
- default: l(() => [
122
- r("div", J, [
123
- a(h, { class: "mb16" }, {
124
- header: l(() => [
125
- r("h4", K, [
126
- a(i, { name: "adjust" }),
127
- v(" " + m(e.$l("Theme color")), 1)
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)
128
73
  ])
129
74
  ]),
130
- default: l(() => [
131
- r("div", Q, [
132
- a(d, {
133
- modelValue: s(t).primary,
134
- "onUpdate:modelValue": n[0] || (n[0] = (o) => s(t).primary = o),
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),
135
80
  "color-format": "hex",
136
- predefine: R,
137
- onChange: $
81
+ predefine: x,
82
+ onChange: D
138
83
  }, null, 8, ["modelValue"]),
139
- a(u, {
84
+ t(S, {
140
85
  text: "",
141
86
  type: "primary",
142
- onClick: L
87
+ onClick: b
143
88
  }, {
144
- default: l(() => [
145
- v(m(e.$l("Restore default")), 1)
89
+ default: n(() => [
90
+ g(m(e.$l("Restore default")), 1)
146
91
  ]),
147
92
  _: 1
148
93
  })
@@ -150,63 +95,35 @@ const J = { class: "p16" }, K = { class: "m0 flexMode vc g8" }, Q = { class: "fl
150
95
  ]),
151
96
  _: 1
152
97
  }),
153
- a(h, { class: "mb16" }, {
154
- header: l(() => [
155
- r("h4", W, m(e.$l("Appearance")), 1)
98
+ t(u, { class: "mb16" }, {
99
+ header: n(() => [
100
+ s("h4", j, m(e.$l("Appearance")), 1)
156
101
  ]),
157
- default: l(() => [
158
- r("div", X, [
159
- a(i, { name: "sun" }),
160
- a(N, {
161
- modelValue: s(t).isDark,
162
- "onUpdate:modelValue": n[1] || (n[1] = (o) => s(t).isDark = o),
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),
163
108
  "inline-prompt": "",
164
109
  "active-text": e.$l("Dark"),
165
110
  "inactive-text": e.$l("Light"),
166
- onChange: I
111
+ onChange: M
167
112
  }, null, 8, ["modelValue", "active-text", "inactive-text"]),
168
- a(i, { name: "moon" })
113
+ t(i, { name: "moon" })
169
114
  ])
170
115
  ]),
171
116
  _: 1
172
117
  }),
173
- a(h, { class: "mb16" }, {
174
- header: l(() => [
175
- r("h4", Z, [
176
- a(i, { name: "earth" }),
177
- v(" " + m(e.$l("Language")), 1)
118
+ t(u, { class: "mb16" }, {
119
+ header: n(() => [
120
+ s("h4", O, [
121
+ t(i, { name: "earth" }),
122
+ g(" " + m(e.$l("Language")), 1)
178
123
  ])
179
124
  ]),
180
- default: l(() => [
181
- a(O, {
182
- modelValue: s(t).lang,
183
- "onUpdate:modelValue": n[2] || (n[2] = (o) => s(t).lang = o),
184
- class: "langSelect w160",
185
- teleported: !0,
186
- onChange: F
187
- }, {
188
- prefix: l(() => [
189
- s(b) ? (p(), V("div", ee, [
190
- r("span", te, m(s(b).txt), 1)
191
- ])) : H("", !0)
192
- ]),
193
- default: l(() => [
194
- (p(!0), V(Y, null, q(s(k), (o) => (p(), M(j, {
195
- key: o.value,
196
- label: o.label,
197
- value: o.value
198
- }, {
199
- default: l(() => [
200
- r("div", ne, [
201
- r("span", oe, m(o.txt), 1),
202
- r("span", le, m(o.label), 1)
203
- ])
204
- ]),
205
- _: 2
206
- }, 1032, ["label", "value"]))), 128))
207
- ]),
208
- _: 1
209
- }, 8, ["modelValue"])
125
+ default: n(() => [
126
+ t(w)
210
127
  ]),
211
128
  _: 1
212
129
  })
@@ -218,5 +135,5 @@ const J = { class: "p16" }, K = { class: "m0 flexMode vc g8" }, Q = { class: "fl
218
135
  }
219
136
  });
220
137
  export {
221
- ie as default
138
+ H as default
222
139
  };