br-dionysus 0.2.0 → 0.3.0

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.
@@ -1,34 +1,34 @@
1
- import { defineComponent as K, openBlock as v, createElementBlock as f, renderSlot as M, onMounted as I, ref as V, watch as z, computed as k, nextTick as P, createCommentVNode as C, createElementVNode as u, normalizeStyle as Q, Fragment as Y, renderList as Z, toDisplayString as ee, withModifiers as te, pushScopeId as oe, popScopeId as ne, reactive as ae, resolveComponent as H, createVNode as D, useSlots as le, unref as R, normalizeClass as se, createBlock as ie, withCtx as re } from "vue";
2
- const ce = /* @__PURE__ */ K({
1
+ import { defineComponent as W, openBlock as _, createElementBlock as g, renderSlot as K, onMounted as E, ref as B, watch as T, computed as I, nextTick as Q, createCommentVNode as F, createElementVNode as d, normalizeStyle as Y, Fragment as Z, renderList as ee, toDisplayString as ce, withModifiers as de, pushScopeId as te, popScopeId as oe, reactive as ne, resolveComponent as w, createVNode as S, useSlots as ue, unref as h, normalizeClass as me, createBlock as le, withCtx as N, createTextVNode as D } from "vue";
2
+ const pe = /* @__PURE__ */ W({
3
3
  __name: "index",
4
4
  emits: ["click"],
5
- setup(n, { emit: d }) {
6
- const t = d;
7
- return (o, s) => (v(), f("button", {
5
+ setup(t, { emit: a }) {
6
+ const e = a;
7
+ return (o, l) => (_(), g("button", {
8
8
  class: "my-button",
9
- onClick: s[0] || (s[0] = (h) => t("click", h))
9
+ onClick: l[0] || (l[0] = (r) => e("click", r))
10
10
  }, [
11
- M(o.$slots, "default", {}, void 0, !0)
11
+ K(o.$slots, "default", {}, void 0, !0)
12
12
  ]));
13
13
  }
14
- }), F = (n, d) => {
15
- const t = n.__vccOpts || n;
16
- for (const [o, s] of d)
17
- t[o] = s;
18
- return t;
19
- }, ue = /* @__PURE__ */ F(ce, [["__scopeId", "data-v-2a480934"]]), W = {
20
- install(n) {
21
- n.component("my-button", ue);
14
+ }), j = (t, a) => {
15
+ const e = t.__vccOpts || t;
16
+ for (const [o, l] of a)
17
+ e[o] = l;
18
+ return e;
19
+ }, fe = /* @__PURE__ */ j(pe, [["__scopeId", "data-v-2a480934"]]), H = {
20
+ install(t) {
21
+ t.component("my-button", fe);
22
22
  }
23
- }, de = {}, ve = { class: "my-foo" };
24
- function me(n, d) {
25
- return v(), f("div", ve, " 我是测试组件组件 ");
23
+ }, ve = {}, ye = { class: "my-foo" };
24
+ function he(t, a) {
25
+ return _(), g("div", ye, " 我是测试组件组件 ");
26
26
  }
27
- const pe = /* @__PURE__ */ F(de, [["render", me], ["__scopeId", "data-v-1f1035fb"]]), j = {
28
- install(n) {
29
- n.component("my-foo", pe);
27
+ const _e = /* @__PURE__ */ j(ve, [["render", he], ["__scopeId", "data-v-1f1035fb"]]), L = {
28
+ install(t) {
29
+ t.component("my-foo", _e);
30
30
  }
31
- }, N = (n) => (oe("data-v-edfffe70"), n = n(), ne(), n), fe = { class: "g-box" }, he = /* @__PURE__ */ N(() => /* @__PURE__ */ u("svg", {
31
+ }, A = (t) => (te("data-v-edfffe70"), t = t(), oe(), t), be = { class: "g-box" }, ge = /* @__PURE__ */ A(() => /* @__PURE__ */ d("svg", {
32
32
  t: "1704703004061",
33
33
  class: "icon",
34
34
  viewBox: "0 0 1024 1024",
@@ -38,16 +38,16 @@ const pe = /* @__PURE__ */ F(de, [["render", me], ["__scopeId", "data-v-1f1035fb
38
38
  width: "16",
39
39
  height: "16"
40
40
  }, [
41
- /* @__PURE__ */ u("path", {
41
+ /* @__PURE__ */ d("path", {
42
42
  d: "M671.807 927.804l-415.632-415.804 415.632-415.803 63.445 63.616-352.017 352.209 352.017 352.102z",
43
43
  fill: "#272636",
44
44
  "p-id": "4357"
45
45
  })
46
- ], -1)), ye = [
47
- he
48
- ], _e = { class: "g-dionysus-box" }, be = ["data-active", "data-active-before", "data-active-after", "onMouseenter", "data-hover", "data-hover-before", "data-hover-after", "onClick"], ge = { class: "u-gp" }, ke = /* @__PURE__ */ N(() => /* @__PURE__ */ u("i", { class: "u-icon j-icon" }, null, -1)), xe = { class: "u-sn" }, Se = ["onClick"], Ve = /* @__PURE__ */ N(() => /* @__PURE__ */ u("i", { class: "s-icon" }, null, -1)), we = [
49
- Ve
50
- ], ze = { class: "u-icon-box" }, Ce = /* @__PURE__ */ N(() => /* @__PURE__ */ u("svg", {
46
+ ], -1)), ke = [
47
+ ge
48
+ ], Ce = { class: "g-dionysus-box" }, Se = ["data-active", "data-active-before", "data-active-after", "onMouseenter", "data-hover", "data-hover-before", "data-hover-after", "onClick"], we = { class: "u-gp" }, xe = /* @__PURE__ */ A(() => /* @__PURE__ */ d("i", { class: "u-icon j-icon" }, null, -1)), Ve = { class: "u-sn" }, $e = ["onClick"], ze = /* @__PURE__ */ A(() => /* @__PURE__ */ d("i", { class: "s-icon" }, null, -1)), Me = [
49
+ ze
50
+ ], Ie = { class: "u-icon-box" }, Be = /* @__PURE__ */ A(() => /* @__PURE__ */ d("svg", {
51
51
  t: "1704703004061",
52
52
  class: "icon",
53
53
  viewBox: "0 0 1024 1024",
@@ -57,14 +57,14 @@ const pe = /* @__PURE__ */ F(de, [["render", me], ["__scopeId", "data-v-1f1035fb
57
57
  width: "16",
58
58
  height: "16"
59
59
  }, [
60
- /* @__PURE__ */ u("path", {
60
+ /* @__PURE__ */ d("path", {
61
61
  d: "M671.807 927.804l-415.632-415.804 415.632-415.803 63.445 63.616-352.017 352.209 352.017 352.102z",
62
62
  fill: "#272636",
63
63
  "p-id": "4357"
64
64
  })
65
- ], -1)), Be = [
66
- Ce
67
- ], $e = /* @__PURE__ */ K({
65
+ ], -1)), Fe = [
66
+ Be
67
+ ], Pe = /* @__PURE__ */ W({
68
68
  __name: "index",
69
69
  props: {
70
70
  modelValue: { default: () => [] },
@@ -74,158 +74,158 @@ const pe = /* @__PURE__ */ F(de, [["render", me], ["__scopeId", "data-v-1f1035fb
74
74
  primaryBackgroundColor: { default: null }
75
75
  },
76
76
  emits: ["close", "click"],
77
- setup(n, { emit: d }) {
78
- const t = (e) => ({
79
- horizontal: e.scrollWidth > e.clientWidth,
80
- vertical: e.scrollHeight > e.clientHeight
81
- }), o = n, s = (e, l = 100) => {
82
- e = e.replace("#", "").toLowerCase(), e.length === 3 && (e = e.split("").map((E) => E + E).join(""));
83
- let a = parseInt(e.substring(0, 2), 16), p = parseInt(e.substring(2, 4), 16), g = parseInt(e.substring(4, 6), 16);
84
- return a += Math.round((255 - a) * (l / 100)), p += Math.round((255 - p) * (l / 100)), g += Math.round((255 - g) * (l / 100)), a = a.toString(16).padStart(2, "0"), p = p.toString(16).padStart(2, "0"), g = g.toString(16).padStart(2, "0"), `#${a}${p}${g}`;
77
+ setup(t, { emit: a }) {
78
+ const e = (n) => ({
79
+ horizontal: n.scrollWidth > n.clientWidth,
80
+ vertical: n.scrollHeight > n.clientHeight
81
+ }), o = t, l = (n, m = 100) => {
82
+ n = n.replace("#", "").toLowerCase(), n.length === 3 && (n = n.split("").map((O) => O + O).join(""));
83
+ let i = parseInt(n.substring(0, 2), 16), k = parseInt(n.substring(2, 4), 16), z = parseInt(n.substring(4, 6), 16);
84
+ return i += Math.round((255 - i) * (m / 100)), k += Math.round((255 - k) * (m / 100)), z += Math.round((255 - z) * (m / 100)), i = i.toString(16).padStart(2, "0"), k = k.toString(16).padStart(2, "0"), z = z.toString(16).padStart(2, "0"), `#${i}${k}${z}`;
85
85
  };
86
- I(() => {
86
+ E(() => {
87
87
  if (document.documentElement.style.setProperty("--br-dionysus-primary-color", o.primaryColor), o.primaryBackgroundColor)
88
88
  return !1;
89
- document.documentElement.style.setProperty("--br-dionysus-primary-bg-color", s(o.primaryColor, 90));
89
+ document.documentElement.style.setProperty("--br-dionysus-primary-bg-color", l(o.primaryColor, 90));
90
90
  });
91
- const h = V(o.activeKey);
92
- z(
91
+ const r = B(o.activeKey);
92
+ T(
93
93
  () => o.activeKey,
94
- (e) => {
95
- h.value = e;
94
+ (n) => {
95
+ r.value = n;
96
96
  }
97
97
  );
98
- const w = d, r = k(() => o.modelValue.map((e) => ({
99
- key: e.key,
100
- title: e.title
101
- }))), y = () => {
102
- r.value.forEach((e, l) => {
103
- const a = ".j-dionysus-list-box .j-li:nth-of-type(" + (l + 1) + ") .j-icon", p = document.querySelector(a);
104
- if (!p || p.children.length)
98
+ const b = a, c = I(() => o.modelValue.map((n) => ({
99
+ key: n.key,
100
+ title: n.title
101
+ }))), f = () => {
102
+ c.value.forEach((n, m) => {
103
+ const i = ".j-dionysus-list-box .j-li:nth-of-type(" + (m + 1) + ") .j-icon", k = document.querySelector(i);
104
+ if (!k || k.children.length)
105
105
  return !1;
106
- const g = document.querySelector('[data-key="' + e.key + '"]');
107
- if (!g)
106
+ const z = document.querySelector('[data-key="' + n.key + '"]');
107
+ if (!z)
108
108
  return !1;
109
- const E = g.cloneNode(!0);
110
- p.appendChild(E);
109
+ const O = z.cloneNode(!0);
110
+ k.appendChild(O);
111
111
  });
112
112
  };
113
- z(
114
- () => r.value,
113
+ T(
114
+ () => c.value,
115
115
  () => {
116
- P(() => {
117
- y();
116
+ Q(() => {
117
+ f();
118
118
  });
119
119
  }
120
- ), I(() => {
121
- y();
120
+ ), E(() => {
121
+ f();
122
122
  });
123
- const _ = V(!1), m = V(0), c = V(0), B = k(() => {
124
- const e = c.value > m.value ? m.value : c.value;
123
+ const u = B(!1), s = B(0), v = B(0), $ = I(() => {
124
+ const n = v.value > s.value ? s.value : v.value;
125
125
  return {
126
- transform: "translateX(-" + (_.value ? e : 0) + "px)"
126
+ transform: "translateX(-" + (u.value ? n : 0) + "px)"
127
127
  };
128
- }), i = () => {
129
- c.value = c.value < 300 ? 0 : c.value - 300;
130
- }, b = () => {
131
- c.value = c.value > m.value - 300 ? m.value : c.value + 300;
128
+ }), p = () => {
129
+ v.value = v.value < 300 ? 0 : v.value - 300;
130
+ }, C = () => {
131
+ v.value = v.value > s.value - 300 ? s.value : v.value + 300;
132
132
  }, x = () => {
133
- const e = document.querySelector(".g-tab-page-box");
134
- if (!e)
133
+ const n = document.querySelector(".g-tab-page-box");
134
+ if (!n)
135
135
  return !1;
136
- const { horizontal: l } = t(e);
137
- _.value = l, l && (m.value = e.scrollWidth - e.clientWidth);
136
+ const { horizontal: m } = e(n);
137
+ u.value = m, m && (s.value = n.scrollWidth - n.clientWidth);
138
138
  };
139
- z(
140
- () => r.value,
139
+ T(
140
+ () => c.value,
141
141
  () => {
142
- P(() => {
142
+ Q(() => {
143
143
  x();
144
144
  });
145
145
  }
146
- ), I(() => {
146
+ ), E(() => {
147
147
  x();
148
148
  });
149
- const S = new ResizeObserver(() => {
149
+ const V = new ResizeObserver(() => {
150
150
  x();
151
151
  });
152
- I(() => {
153
- const e = document.querySelector(".g-tab-page-box");
154
- if (!e)
152
+ E(() => {
153
+ const n = document.querySelector(".g-tab-page-box");
154
+ if (!n)
155
155
  return !1;
156
- S.observe(e);
156
+ V.observe(n);
157
157
  });
158
- const L = k(() => {
159
- var l;
160
- const e = r.value.findIndex((a) => a.key === o.activeKey);
161
- return e === -1 ? -1 : (l = r.value[e - 1]) == null ? void 0 : l.key;
162
- }), T = k(() => {
163
- var l;
164
- const e = r.value.findIndex((a) => a.key === o.activeKey);
165
- return e === -1 ? -1 : (l = r.value[e + 1]) == null ? void 0 : l.key;
166
- }), $ = V(2), U = k(() => {
167
- var l;
168
- const e = r.value.findIndex((a) => a.key === $.value);
169
- return e === -1 ? -1 : (l = r.value[e - 1]) == null ? void 0 : l.key;
170
- }), X = k(() => {
171
- var l;
172
- const e = r.value.findIndex((a) => a.key === $.value);
173
- return e === -1 ? -1 : (l = r.value[e + 1]) == null ? void 0 : l.key;
174
- }), G = (e) => {
175
- w("click", e);
176
- }, J = (e = []) => {
177
- w("close", e);
158
+ const q = I(() => {
159
+ var m;
160
+ const n = c.value.findIndex((i) => i.key === o.activeKey);
161
+ return n === -1 ? -1 : (m = c.value[n - 1]) == null ? void 0 : m.key;
162
+ }), y = I(() => {
163
+ var m;
164
+ const n = c.value.findIndex((i) => i.key === o.activeKey);
165
+ return n === -1 ? -1 : (m = c.value[n + 1]) == null ? void 0 : m.key;
166
+ }), P = B(2), ae = I(() => {
167
+ var m;
168
+ const n = c.value.findIndex((i) => i.key === P.value);
169
+ return n === -1 ? -1 : (m = c.value[n - 1]) == null ? void 0 : m.key;
170
+ }), se = I(() => {
171
+ var m;
172
+ const n = c.value.findIndex((i) => i.key === P.value);
173
+ return n === -1 ? -1 : (m = c.value[n + 1]) == null ? void 0 : m.key;
174
+ }), re = (n) => {
175
+ b("click", n);
176
+ }, ie = (n = []) => {
177
+ b("close", n);
178
178
  };
179
- return (e, l) => (v(), f("div", fe, [
180
- _.value ? (v(), f("button", {
179
+ return (n, m) => (_(), g("div", be, [
180
+ u.value ? (_(), g("button", {
181
181
  key: 0,
182
182
  class: "u-page-btn s-previous-btn",
183
- onClick: i
184
- }, ye)) : C("", !0),
185
- u("div", _e, [
186
- u("ul", {
183
+ onClick: p
184
+ }, ke)) : F("", !0),
185
+ d("div", Ce, [
186
+ d("ul", {
187
187
  class: "g-tab-page-box j-dionysus-list-box",
188
- style: Q(B.value),
189
- onMouseleave: l[0] || (l[0] = (a) => $.value = -1)
188
+ style: Y($.value),
189
+ onMouseleave: m[0] || (m[0] = (i) => P.value = -1)
190
190
  }, [
191
- (v(!0), f(Y, null, Z(o.modelValue, (a) => (v(), f("li", {
191
+ (_(!0), g(Z, null, ee(o.modelValue, (i) => (_(), g("li", {
192
192
  class: "u-li j-li",
193
- key: a.key,
194
- "data-active": o.activeKey === a.key,
195
- "data-active-before": L.value === a.key,
196
- "data-active-after": T.value === a.key,
197
- onMouseenter: (p) => $.value = a.key,
198
- "data-hover": $.value === a.key,
199
- "data-hover-before": U.value === a.key,
200
- "data-hover-after": X.value === a.key,
201
- onClick: (p) => G(a.key)
193
+ key: i.key,
194
+ "data-active": o.activeKey === i.key,
195
+ "data-active-before": q.value === i.key,
196
+ "data-active-after": y.value === i.key,
197
+ onMouseenter: (k) => P.value = i.key,
198
+ "data-hover": P.value === i.key,
199
+ "data-hover-before": ae.value === i.key,
200
+ "data-hover-after": se.value === i.key,
201
+ onClick: (k) => re(i.key)
202
202
  }, [
203
- u("div", ge, [
204
- ke,
205
- u("span", xe, ee(a.title), 1),
206
- u("div", {
203
+ d("div", we, [
204
+ xe,
205
+ d("span", Ve, ce(i.title), 1),
206
+ d("div", {
207
207
  class: "u-btn",
208
- onClick: te((p) => J([a.key]), ["stop"])
209
- }, we, 8, Se)
208
+ onClick: de((k) => ie([i.key]), ["stop"])
209
+ }, Me, 8, $e)
210
210
  ])
211
- ], 40, be))), 128))
211
+ ], 40, Se))), 128))
212
212
  ], 36)
213
213
  ]),
214
- u("div", ze, [
215
- M(e.$slots, "icon", {}, void 0, !0)
214
+ d("div", Ie, [
215
+ K(n.$slots, "icon", {}, void 0, !0)
216
216
  ]),
217
- _.value ? (v(), f("button", {
217
+ u.value ? (_(), g("button", {
218
218
  key: 1,
219
219
  class: "u-page-btn s-next-btn",
220
- onClick: b
221
- }, Be)) : C("", !0)
220
+ onClick: C
221
+ }, Fe)) : F("", !0)
222
222
  ]));
223
223
  }
224
- }), Ie = /* @__PURE__ */ F($e, [["__scopeId", "data-v-edfffe70"]]), q = {
225
- install(n) {
226
- n.component("tab-page", Ie);
224
+ }), Ne = /* @__PURE__ */ j(Pe, [["__scopeId", "data-v-edfffe70"]]), R = {
225
+ install(t) {
226
+ t.component("tab-page", Ne);
227
227
  }
228
- }, Me = ["data-is-table-mini", "data-no-spacing"], Fe = ["data-size", "data-thousandth-place", "data-focus", "value", "data-disabled"], Ee = /* @__PURE__ */ K({
228
+ }, Ee = ["data-is-table-mini", "data-no-spacing"], Te = ["data-size", "data-thousandth-place", "data-focus", "value", "data-disabled"], je = /* @__PURE__ */ W({
229
229
  __name: "index",
230
230
  props: {
231
231
  modelValue: {
@@ -274,186 +274,371 @@ const pe = /* @__PURE__ */ F(de, [["render", me], ["__scopeId", "data-v-1f1035fb
274
274
  }
275
275
  },
276
276
  emits: ["update:modelValue", "change", "focus", "blur"],
277
- setup(n, { emit: d }) {
278
- const t = n, o = ae({
277
+ setup(t, { emit: a }) {
278
+ const e = t, o = ne({
279
279
  vValue: null,
280
280
  isFocus: !1,
281
281
  vSize: null,
282
282
  isTableMini: !1
283
- }), s = d, h = k(() => (o.vValue || "").toLocaleString("en-US", { maximumFractionDigits: 6 })), w = k(() => t.max >= t.min ? t.max : t.min);
284
- z(() => t.modelValue, () => {
285
- r();
286
- }), z(() => t.size, () => {
287
- y();
283
+ }), l = a, r = I(() => (o.vValue || "").toLocaleString("en-US", { maximumFractionDigits: 6 })), b = I(() => e.max >= e.min ? e.max : e.min);
284
+ T(() => e.modelValue, () => {
285
+ c();
286
+ }), T(() => e.size, () => {
287
+ f();
288
288
  });
289
- const r = () => {
290
- if (t.modelValue === "" || t.modelValue === null || t.modelValue === void 0)
289
+ const c = () => {
290
+ if (e.modelValue === "" || e.modelValue === null || e.modelValue === void 0)
291
291
  return o.vValue = void 0, !1;
292
- if (t.modelValue > t.max || t.modelValue < t.min)
293
- return s("update:modelValue", o.vValue), !1;
294
- o.vValue = t.modelValue;
295
- }, y = () => {
296
- const i = {
292
+ if (e.modelValue > e.max || e.modelValue < e.min)
293
+ return l("update:modelValue", o.vValue), !1;
294
+ o.vValue = e.modelValue;
295
+ }, f = () => {
296
+ const p = {
297
297
  large: "large",
298
298
  small: "small",
299
299
  mini: "mini",
300
300
  "table-mini": "mini"
301
301
  };
302
- o.vSize = i[t.size], o.isTableMini = t.size === "table-mini";
303
- }, _ = () => {
302
+ o.vSize = p[e.size], o.isTableMini = e.size === "table-mini";
303
+ }, u = () => {
304
304
  if (o.vValue === void 0)
305
- return s("update:modelValue", null), !1;
306
- s("update:modelValue", o.vValue);
307
- }, m = (i) => {
308
- if (i === void 0)
309
- return s("update:modelValue", null), !1;
310
- _(), s("change", i);
311
- }, c = () => {
312
- o.isFocus = !0, s("focus", o.vValue);
313
- }, B = () => {
314
- o.isFocus = !1, s("blur", o.vValue);
305
+ return l("update:modelValue", null), !1;
306
+ l("update:modelValue", o.vValue);
307
+ }, s = (p) => {
308
+ if (p === void 0)
309
+ return l("update:modelValue", null), !1;
310
+ u(), l("change", p);
311
+ }, v = () => {
312
+ o.isFocus = !0, l("focus", o.vValue);
313
+ }, $ = () => {
314
+ o.isFocus = !1, l("blur", o.vValue);
315
315
  };
316
- return r(), y(), (i, b) => {
317
- const x = H("el-input-number");
318
- return v(), f("div", {
316
+ return c(), f(), (p, C) => {
317
+ const x = w("el-input-number");
318
+ return _(), g("div", {
319
319
  class: "g-m-input-number-box",
320
320
  "data-is-table-mini": o.isTableMini,
321
- "data-no-spacing": t.noSpacing
321
+ "data-no-spacing": e.noSpacing
322
322
  }, [
323
- D(x, {
323
+ S(x, {
324
324
  class: "m-input-number",
325
325
  modelValue: o.vValue,
326
- "onUpdate:modelValue": b[0] || (b[0] = (S) => o.vValue = S),
326
+ "onUpdate:modelValue": C[0] || (C[0] = (V) => o.vValue = V),
327
327
  size: o.vSize,
328
- min: t.min,
329
- max: w.value,
328
+ min: e.min,
329
+ max: b.value,
330
330
  controls: !1,
331
- disabled: t.disabled,
332
- placeholder: t.placeholder,
333
- step: t.step,
334
- stepStrictly: t.stepStrictly,
335
- "data-thousandth-place": t.thousandthPlace,
331
+ disabled: e.disabled,
332
+ placeholder: e.placeholder,
333
+ step: e.step,
334
+ stepStrictly: e.stepStrictly,
335
+ "data-thousandth-place": e.thousandthPlace,
336
336
  "data-focus": o.isFocus,
337
- noBorder: t.noBorder,
338
- onChange: b[1] || (b[1] = (S) => {
339
- m(S), _();
337
+ noBorder: e.noBorder,
338
+ onChange: C[1] || (C[1] = (V) => {
339
+ s(V), u();
340
340
  }),
341
- onFocus: c,
342
- onBlur: B
341
+ onFocus: v,
342
+ onBlur: $
343
343
  }, null, 8, ["modelValue", "size", "min", "max", "disabled", "placeholder", "step", "stepStrictly", "data-thousandth-place", "data-focus", "noBorder"]),
344
- t.thousandthPlace ? (v(), f("input", {
344
+ e.thousandthPlace ? (_(), g("input", {
345
345
  key: 0,
346
346
  class: "u-text",
347
347
  type: "text",
348
348
  "data-size": o.vSize,
349
- "data-thousandth-place": t.thousandthPlace,
349
+ "data-thousandth-place": e.thousandthPlace,
350
350
  "data-focus": o.isFocus,
351
- value: h.value,
352
- "data-disabled": t.disabled,
351
+ value: r.value,
352
+ "data-disabled": e.disabled,
353
353
  readonly: ""
354
- }, null, 8, Fe)) : C("", !0)
355
- ], 8, Me);
354
+ }, null, 8, Te)) : F("", !0)
355
+ ], 8, Ee);
356
356
  };
357
357
  }
358
- }), Ke = /* @__PURE__ */ F(Ee, [["__scopeId", "data-v-0539abf7"]]), A = {
359
- install(n) {
360
- n.component("m-input-number", Ke);
358
+ }), Ke = /* @__PURE__ */ j(je, [["__scopeId", "data-v-0539abf7"]]), J = {
359
+ install(t) {
360
+ t.component("m-input-number", Ke);
361
361
  }
362
- }, Ne = { class: "g-inline-box" }, We = {
362
+ }, We = { class: "g-inline-box" }, Oe = {
363
363
  key: 1,
364
364
  class: "m-inline",
365
365
  dataCover: ""
366
- }, je = ["data-unfold", "data-single-line"], qe = { class: "u-btn-gp" }, Ae = /* @__PURE__ */ K({
366
+ }, Ae = ["data-unfold", "data-single-line"], Ue = { class: "u-btn-gp" }, qe = /* @__PURE__ */ W({
367
367
  __name: "index",
368
368
  props: {
369
369
  minWidth: { default: "200px" },
370
370
  maxWidth: { default: "300px" }
371
371
  },
372
372
  emits: ["switch"],
373
- setup(n, { emit: d }) {
374
- const t = n, o = (i = 24) => Array.from(Array(Number(i) || 24), () => Math.floor(Math.random() * 36).toString(36)).join(""), s = () => {
375
- document.documentElement.style.setProperty("--m-inline-min-width", t.minWidth), document.documentElement.style.setProperty("--m-inline-max-width", t.maxWidth);
373
+ setup(t, { emit: a }) {
374
+ const e = t, o = (p = 24) => Array.from(Array(Number(p) || 24), () => Math.floor(Math.random() * 36).toString(36)).join(""), l = () => {
375
+ document.documentElement.style.setProperty("--m-inline-min-width", e.minWidth), document.documentElement.style.setProperty("--m-inline-max-width", e.maxWidth);
376
376
  };
377
- z(
378
- () => [t.minWidth, t.maxWidth],
377
+ T(
378
+ () => [e.minWidth, e.maxWidth],
379
379
  () => {
380
- s();
380
+ l();
381
381
  }
382
- ), s();
383
- const h = le(), w = d, r = "j-" + o(8), y = () => {
384
- const i = document.querySelector("." + r + " [data-box]");
385
- if (!i)
382
+ ), l();
383
+ const r = ue(), b = a, c = "j-" + o(8), f = () => {
384
+ const p = document.querySelector("." + c + " [data-box]");
385
+ if (!p)
386
386
  return !1;
387
- const b = i.querySelectorAll("." + r + " [data-item]");
388
- return i.clientWidth < b.length * 200;
389
- }, _ = new ResizeObserver(() => {
390
- m.value = y();
391
- }), m = V(!1);
392
- I(() => {
393
- const i = document.querySelector("[data-box]");
394
- if (!i)
387
+ const C = p.querySelectorAll("." + c + " [data-item]");
388
+ return p.clientWidth < C.length * 200;
389
+ }, u = new ResizeObserver(() => {
390
+ s.value = f();
391
+ }), s = B(!1);
392
+ E(() => {
393
+ const p = document.querySelector("[data-box]");
394
+ if (!p)
395
395
  return !1;
396
- m.value = y(), _.observe(i);
396
+ s.value = f(), u.observe(p);
397
397
  });
398
- const c = V(!1), B = () => {
399
- c.value = !c.value, w("switch", c.value);
398
+ const v = B(!1), $ = () => {
399
+ v.value = !v.value, b("switch", v.value);
400
400
  };
401
- return (i, b) => {
402
- const x = H("DArrowRight"), S = H("el-icon");
403
- return v(), f("div", Ne, [
404
- R(h).inlineBtn ? (v(), f("div", {
401
+ return (p, C) => {
402
+ const x = w("DArrowRight"), V = w("el-icon");
403
+ return _(), g("div", We, [
404
+ h(r).inlineBtn ? (_(), g("div", {
405
405
  key: 0,
406
406
  class: "m-inline-btn",
407
- onClick: y
407
+ onClick: f
408
408
  }, [
409
- M(i.$slots, "inlineBtn", {}, void 0, !0)
410
- ])) : C("", !0),
411
- R(h).default ? (v(), f("div", We, [
412
- u("div", {
413
- class: se(["u-row", r]),
414
- "data-unfold": c.value,
415
- "data-single-line": !m.value
409
+ K(p.$slots, "inlineBtn", {}, void 0, !0)
410
+ ])) : F("", !0),
411
+ h(r).default ? (_(), g("div", Oe, [
412
+ d("div", {
413
+ class: me(["u-row", c]),
414
+ "data-unfold": v.value,
415
+ "data-single-line": !s.value
416
416
  }, [
417
- M(i.$slots, "default", {}, void 0, !0)
418
- ], 8, je),
419
- u("div", qe, [
420
- M(i.$slots, "submitBtn", {}, void 0, !0),
421
- m.value ? (v(), ie(S, {
417
+ K(p.$slots, "default", {}, void 0, !0)
418
+ ], 8, Ae),
419
+ d("div", Ue, [
420
+ K(p.$slots, "submitBtn", {}, void 0, !0),
421
+ s.value ? (_(), le(V, {
422
422
  key: 0,
423
423
  class: "u-btn-unfold",
424
- onClick: B,
425
- "data-unfold": c.value
424
+ onClick: $,
425
+ "data-unfold": v.value
426
426
  }, {
427
- default: re(() => [
428
- D(x)
427
+ default: N(() => [
428
+ S(x)
429
429
  ]),
430
430
  _: 1
431
- }, 8, ["data-unfold"])) : C("", !0)
431
+ }, 8, ["data-unfold"])) : F("", !0)
432
432
  ])
433
- ])) : C("", !0)
433
+ ])) : F("", !0)
434
434
  ]);
435
435
  };
436
436
  }
437
- }), Oe = /* @__PURE__ */ F(Ae, [["__scopeId", "data-v-6b32beca"]]), O = {
438
- install(n) {
439
- n.component("m-inline", Oe);
437
+ }), De = /* @__PURE__ */ j(qe, [["__scopeId", "data-v-6b32beca"]]), X = {
438
+ install(t) {
439
+ t.component("m-inline", De);
440
440
  }
441
- }, Pe = {
442
- install(n) {
443
- var d, t, o, s, h;
444
- (d = W.install) == null || d.call(W, n), (t = j.install) == null || t.call(j, n), (o = q.install) == null || o.call(q, n), (s = A.install) == null || s.call(A, n), (h = O.install) == null || h.call(O, n);
441
+ }, M = (t, a = 100) => {
442
+ t = t.replace("#", "").toLowerCase(), t.length === 3 && (t = t.split("").map((r) => r + r).join(""));
443
+ let e = parseInt(t.substring(0, 2), 16), o = parseInt(t.substring(2, 4), 16), l = parseInt(t.substring(4, 6), 16);
444
+ return a > 0 && (e += Math.round((255 - e) * (a / 100)), o += Math.round((255 - o) * (a / 100)), l += Math.round((255 - l) * (a / 100))), a <= 0 && (e += Math.round(e * (a / 100)), o += Math.round(o * (a / 100)), l += Math.round(l * (a / 100))), e = e.toString(16).padStart(2, "0"), o = o.toString(16).padStart(2, "0"), l = l.toString(16).padStart(2, "0"), `#${e}${o}${l}`;
445
+ }, He = () => {
446
+ const t = {
447
+ darkTheme: !1,
448
+ followSystem: !1,
449
+ primaryColor: "#646CFF"
450
+ };
451
+ localStorage.getItem("skinConfig") === null && localStorage.setItem("skinConfig", JSON.stringify(t));
452
+ const a = ne(JSON.parse(localStorage.getItem("skinConfig"))), e = (c) => {
453
+ a.primaryColor = c, l(), b();
454
+ }, o = () => {
455
+ a.darkTheme = t.darkTheme, a.followSystem = t.followSystem, a.primaryColor = t.primaryColor, l(), b();
456
+ }, l = () => {
457
+ const c = a.darkTheme || a.followSystem && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches, f = (s) => c ? -s : s, u = document.documentElement.style;
458
+ u.setProperty("--el-color-primary", a.primaryColor), u.setProperty("--el-color-primary-dark-2", M(a.primaryColor, f(50))), u.setProperty("--el-color-primary-light-3", M(a.primaryColor, f(25))), u.setProperty("--el-color-primary-light-5", M(a.primaryColor, f(40))), u.setProperty("--el-color-primary-light-7", M(a.primaryColor, f(60))), u.setProperty("--el-color-primary-light-8", M(a.primaryColor, f(75))), u.setProperty("--el-color-primary-light-9", M(a.primaryColor, f(90))), u.setProperty("--m-scrollbar-thumb-color", M(a.primaryColor, f(70))), u.setProperty("--m-scrollbar-thumb-hover-color", M(a.primaryColor, f(50))), r(c);
459
+ }, r = (c = !1) => {
460
+ document.documentElement.setAttribute("data-dark", String(c));
461
+ }, b = () => {
462
+ localStorage.setItem("skinConfig", JSON.stringify(a));
463
+ };
464
+ return {
465
+ skinConfig: a,
466
+ reset: o,
467
+ setPrimaryColor: e,
468
+ apply: l,
469
+ save: b,
470
+ switchDark: r
471
+ };
472
+ }, U = (t) => (te("data-v-b9f65c6d"), t = t(), oe(), t), Le = { class: "g-skin-config-box" }, Re = /* @__PURE__ */ U(() => /* @__PURE__ */ d("svg", {
473
+ t: "1706517168459",
474
+ class: "icon",
475
+ viewBox: "0 0 1024 1024",
476
+ version: "1.1",
477
+ xmlns: "http://www.w3.org/2000/svg",
478
+ "p-id": "4378",
479
+ width: "24",
480
+ height: "24"
481
+ }, [
482
+ /* @__PURE__ */ d("path", {
483
+ d: "M533.333333 853.333333c179.2 0 320-145.066667 320-320S708.266667 213.333333 533.333333 213.333333 213.333333 358.4 213.333333 533.333333c0 93.866667 34.133333 132.266667 115.2 157.866667 8.533333 4.266667 12.8 4.266667 21.333334 8.533333 4.266667 0 21.333333 4.266667 21.333333 8.533334 51.2 17.066667 76.8 25.6 98.133333 51.2 17.066667 17.066667 29.866667 38.4 42.666667 59.733333 4.266667 8.533333 8.533333 17.066667 8.533333 21.333333 8.533333 0 8.533333 8.533333 12.8 12.8z m0 42.666667c-59.733333 0-21.333333-42.666667-89.6-110.933333-64-64-273.066667-25.6-273.066666-251.733334C170.666667 332.8 332.8 170.666667 533.333333 170.666667S896 332.8 896 533.333333 733.866667 896 533.333333 896z m72.533334-106.666667c-42.666667 0-76.8-34.133333-76.8-76.8s34.133333-72.533333 76.8-72.533333 76.8 34.133333 76.8 72.533333-34.133333 76.8-76.8 76.8z m0-42.666666c17.066667 0 34.133333-12.8 34.133333-34.133334s-12.8-29.866667-34.133333-29.866666-34.133333 12.8-34.133334 29.866666 17.066667 34.133333 34.133334 34.133334zM640 384c-25.6 0-42.666667-17.066667-42.666667-42.666667s17.066667-42.666667 42.666667-42.666666 42.666667 17.066667 42.666667 42.666666-17.066667 42.666667-42.666667 42.666667z m-119.466667-34.133333c-25.6 0-42.666667-17.066667-42.666666-42.666667s17.066667-42.666667 42.666666-42.666667 42.666667 17.066667 42.666667 42.666667-17.066667 42.666667-42.666667 42.666667zM725.333333 469.333333c-25.6 0-42.666667-17.066667-42.666666-42.666666s17.066667-42.666667 42.666666-42.666667 42.666667 17.066667 42.666667 42.666667-17.066667 42.666667-42.666667 42.666666zM405.333333 384c-25.6 0-42.666667-17.066667-42.666666-42.666667s17.066667-42.666667 42.666666-42.666666 42.666667 17.066667 42.666667 42.666666-17.066667 42.666667-42.666667 42.666667z",
484
+ fill: "#444444",
485
+ "p-id": "4379"
486
+ })
487
+ ], -1)), Je = [
488
+ Re
489
+ ], Xe = /* @__PURE__ */ U(() => /* @__PURE__ */ d("h2", { class: "u-tt" }, "主题配置", -1)), Ge = { class: "u-box" }, Qe = { class: "u-group" }, Ye = /* @__PURE__ */ U(() => /* @__PURE__ */ d("label", null, "深色主题", -1)), Ze = { class: "u-group" }, et = /* @__PURE__ */ U(() => /* @__PURE__ */ d("label", null, "跟随系统", -1)), tt = { class: "u-list" }, ot = ["onClick"], nt = { class: "u-pc" }, lt = /* @__PURE__ */ W({
490
+ __name: "index",
491
+ setup(t, { expose: a }) {
492
+ const e = B(!1), o = () => {
493
+ e.value = !0;
494
+ }, l = He(), r = l.skinConfig, b = [
495
+ "#1690ff",
496
+ "#419eff",
497
+ "#007aff",
498
+ "#59c8fa",
499
+ "#646CFF",
500
+ "#536dfe",
501
+ "#646cff",
502
+ "#9c28b0",
503
+ "#af52de",
504
+ "#0096c7",
505
+ "#04c1d4",
506
+ "#35c759",
507
+ "#42a047",
508
+ "#7cb342",
509
+ "#c0ca34",
510
+ "#78dec7",
511
+ "#e53834",
512
+ "#d81a60",
513
+ "#f4511e",
514
+ "#fb8c01",
515
+ "#ffb300",
516
+ "#fdd835",
517
+ "#6d4c41",
518
+ "#546e7a"
519
+ ], c = (u) => ({
520
+ background: u
521
+ });
522
+ return E(() => {
523
+ l.apply();
524
+ }), a({
525
+ setSkin: (u) => {
526
+ r.darkTheme = u.darkTheme, r.followSystem = u.followSystem, r.primaryColor = u.primaryColor, l.apply(), l.save();
527
+ }
528
+ }), (u, s) => {
529
+ const v = w("el-divider"), $ = w("el-switch"), p = w("Check"), C = w("el-icon"), x = w("el-color-picker"), V = w("el-button"), q = w("el-drawer");
530
+ return _(), g("div", Le, [
531
+ d("div", {
532
+ class: "u-btn",
533
+ onClick: o
534
+ }, Je),
535
+ S(q, {
536
+ modelValue: e.value,
537
+ "onUpdate:modelValue": s[6] || (s[6] = (y) => e.value = y),
538
+ direction: "rtl",
539
+ withHeader: !1,
540
+ size: "300"
541
+ }, {
542
+ default: N(() => [
543
+ Xe,
544
+ d("div", Ge, [
545
+ S(v, { class: "u-box-tt" }, {
546
+ default: N(() => [
547
+ D("主题模式")
548
+ ]),
549
+ _: 1
550
+ }),
551
+ d("div", Qe, [
552
+ Ye,
553
+ S($, {
554
+ modelValue: h(r).darkTheme,
555
+ "onUpdate:modelValue": s[0] || (s[0] = (y) => h(r).darkTheme = y),
556
+ onChange: s[1] || (s[1] = (y) => {
557
+ h(l).apply(), h(l).save();
558
+ })
559
+ }, null, 8, ["modelValue"])
560
+ ]),
561
+ d("div", Ze, [
562
+ et,
563
+ S($, {
564
+ modelValue: h(r).followSystem,
565
+ "onUpdate:modelValue": s[2] || (s[2] = (y) => h(r).followSystem = y),
566
+ onChange: s[3] || (s[3] = (y) => {
567
+ h(l).apply(), h(l).save();
568
+ })
569
+ }, null, 8, ["modelValue"])
570
+ ]),
571
+ S(v, { class: "u-box-tt" }, {
572
+ default: N(() => [
573
+ D("系统主题")
574
+ ]),
575
+ _: 1
576
+ }),
577
+ d("ul", tt, [
578
+ (_(), g(Z, null, ee(b, (y) => d("li", {
579
+ class: "u-li",
580
+ key: y
581
+ }, [
582
+ d("div", {
583
+ class: "u-color",
584
+ style: Y(c(y)),
585
+ onClick: (P) => h(l).setPrimaryColor(y)
586
+ }, [
587
+ h(r).primaryColor === y ? (_(), le(C, { key: 0 }, {
588
+ default: N(() => [
589
+ S(p)
590
+ ]),
591
+ _: 1
592
+ })) : F("", !0)
593
+ ], 12, ot)
594
+ ])), 64))
595
+ ]),
596
+ d("div", nt, [
597
+ S(x, {
598
+ modelValue: h(r).primaryColor,
599
+ "onUpdate:modelValue": s[4] || (s[4] = (y) => h(r).primaryColor = y),
600
+ "color-format": "hex",
601
+ onChange: s[5] || (s[5] = (y) => h(l).setPrimaryColor(h(r).primaryColor))
602
+ }, null, 8, ["modelValue"])
603
+ ]),
604
+ S(V, {
605
+ type: "warning",
606
+ onClick: h(l).reset
607
+ }, {
608
+ default: N(() => [
609
+ D(" 重置当前配置 ")
610
+ ]),
611
+ _: 1
612
+ }, 8, ["onClick"])
613
+ ])
614
+ ]),
615
+ _: 1
616
+ }, 8, ["modelValue"])
617
+ ]);
618
+ };
619
+ }
620
+ }), at = /* @__PURE__ */ j(lt, [["__scopeId", "data-v-b9f65c6d"]]), G = {
621
+ install(t) {
622
+ t.component("skin-config", at);
623
+ }
624
+ }, rt = {
625
+ install(t) {
626
+ var a, e, o, l, r, b;
627
+ (a = H.install) == null || a.call(H, t), (e = L.install) == null || e.call(L, t), (o = R.install) == null || o.call(R, t), (l = J.install) == null || l.call(J, t), (r = X.install) == null || r.call(X, t), (b = G.install) == null || b.call(G, t);
445
628
  }
446
629
  };
447
630
  export {
448
- ue as Button,
449
- W as ButtonPlugin,
450
- pe as Foo,
451
- j as FooPlugin,
452
- Oe as MInline,
453
- O as MInlinePlugin,
631
+ fe as Button,
632
+ H as ButtonPlugin,
633
+ _e as Foo,
634
+ L as FooPlugin,
635
+ De as MInline,
636
+ X as MInlinePlugin,
454
637
  Ke as MInputNumber,
455
- A as MInputNumberPlugin,
456
- Ie as TabPage,
457
- q as TabPagePlugin,
458
- Pe as default
638
+ J as MInputNumberPlugin,
639
+ at as SkinConfig,
640
+ G as SkinConfigPlugin,
641
+ Ne as TabPage,
642
+ R as TabPagePlugin,
643
+ rt as default
459
644
  };