mwl-components 0.1.5 → 0.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/README.md +1191 -57
- package/dist/ContextMenu/index.d.ts +12 -20
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +3 -589
- package/dist/index.es.js +148 -145
- package/dist/index.umd.js +1 -1
- package/dist/types/index.d.ts +4 -0
- package/package.json +3 -2
- /package/dist/MenuTree/{components/index.vue.d.ts → index.vue.d.ts} +0 -0
package/dist/index.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { configProviderContextKey as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as $, useAttrs as ee, ref as w, resolveComponent as g, createBlock as y, openBlock as s, mergeProps as P, withCtx as h, renderSlot as S, useSlots as F, normalizeClass as te, createSlots as U, createElementVNode as D, createElementBlock as b, createCommentVNode as I, toDisplayString as Y, watch as ne, nextTick as oe, computed as T, unref as B, normalizeStyle as V, createTextVNode as X, createVNode as N, mergeModels as ae, useModel as le, getCurrentInstance as K, Fragment as H, renderList as z, resolveDynamicComponent as L, h as O, inject as se, onMounted as G, onUnmounted as re, withDirectives as J, vShow as Q, normalizeProps as ie, guardReactiveProps as ue, withModifiers as ce } from "vue";
|
|
2
|
+
import { configProviderContextKey as de } from "element-plus";
|
|
3
|
+
const me = /* @__PURE__ */ $({
|
|
4
4
|
name: "EasyButton",
|
|
5
5
|
inheritAttrs: !1,
|
|
6
6
|
__name: "index",
|
|
7
7
|
setup(e) {
|
|
8
|
-
const { onClick: n, ...t } =
|
|
8
|
+
const { onClick: n, ...t } = ee(), l = w(!1), i = async () => {
|
|
9
9
|
console.log("Button clicked"), l.value = !0;
|
|
10
10
|
try {
|
|
11
11
|
await n?.();
|
|
@@ -16,22 +16,22 @@ const Z = /* @__PURE__ */ E({
|
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
return (u, c) => {
|
|
19
|
-
const a =
|
|
20
|
-
return s(),
|
|
19
|
+
const a = g("el-button");
|
|
20
|
+
return s(), y(a, P(t, {
|
|
21
21
|
loading: l.value,
|
|
22
22
|
onClick: i
|
|
23
23
|
}), {
|
|
24
24
|
default: h(() => [
|
|
25
|
-
|
|
25
|
+
S(u.$slots, "default")
|
|
26
26
|
]),
|
|
27
27
|
_: 3
|
|
28
28
|
}, 16, ["loading"]);
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
}),
|
|
31
|
+
}), pe = { class: "card-header" }, he = {
|
|
32
32
|
key: 0,
|
|
33
33
|
class: "card-header__message"
|
|
34
|
-
},
|
|
34
|
+
}, fe = /* @__PURE__ */ $({
|
|
35
35
|
name: "ContentWarp",
|
|
36
36
|
__name: "index",
|
|
37
37
|
props: {
|
|
@@ -41,22 +41,22 @@ const Z = /* @__PURE__ */ E({
|
|
|
41
41
|
setup(e) {
|
|
42
42
|
const n = F(), t = w("content-wrap");
|
|
43
43
|
return (l, i) => {
|
|
44
|
-
const u =
|
|
45
|
-
return s(),
|
|
46
|
-
class:
|
|
44
|
+
const u = g("ElCard");
|
|
45
|
+
return s(), y(u, {
|
|
46
|
+
class: te([t.value]),
|
|
47
47
|
shadow: "never"
|
|
48
48
|
}, U({
|
|
49
49
|
default: h(() => [
|
|
50
|
-
|
|
50
|
+
S(l.$slots, "default", {}, void 0, !0)
|
|
51
51
|
]),
|
|
52
52
|
_: 2
|
|
53
53
|
}, [
|
|
54
54
|
e.title ? {
|
|
55
55
|
name: "header",
|
|
56
56
|
fn: h(() => [
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
e.message ? (s(), b("span",
|
|
57
|
+
D("div", pe, [
|
|
58
|
+
D("span", null, Y(e.title), 1),
|
|
59
|
+
e.message ? (s(), b("span", he, Y(e.message), 1)) : I("", !0)
|
|
60
60
|
])
|
|
61
61
|
]),
|
|
62
62
|
key: "0"
|
|
@@ -64,19 +64,19 @@ const Z = /* @__PURE__ */ E({
|
|
|
64
64
|
n.footer ? {
|
|
65
65
|
name: "footer",
|
|
66
66
|
fn: h(() => [
|
|
67
|
-
|
|
67
|
+
S(l.$slots, "footer", {}, void 0, !0)
|
|
68
68
|
]),
|
|
69
69
|
key: "1"
|
|
70
70
|
} : void 0
|
|
71
71
|
]), 1032, ["class"]);
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
|
-
}),
|
|
74
|
+
}), W = (e, n) => {
|
|
75
75
|
const t = e.__vccOpts || e;
|
|
76
76
|
for (const [l, i] of n)
|
|
77
77
|
t[l] = i;
|
|
78
78
|
return t;
|
|
79
|
-
},
|
|
79
|
+
}, ge = /* @__PURE__ */ W(fe, [["__scopeId", "data-v-fdaaba5e"]]), ye = { class: "dialog-header" }, ve = /* @__PURE__ */ $({
|
|
80
80
|
name: "Dialog",
|
|
81
81
|
__name: "index",
|
|
82
82
|
props: {
|
|
@@ -103,12 +103,12 @@ const Z = /* @__PURE__ */ E({
|
|
|
103
103
|
},
|
|
104
104
|
setup(e) {
|
|
105
105
|
const n = F(), t = e, l = w(t.fullscreen), i = () => {
|
|
106
|
-
l.value = !
|
|
106
|
+
l.value = !B(l);
|
|
107
107
|
}, u = w(t.maxHeight);
|
|
108
|
-
|
|
108
|
+
ne(
|
|
109
109
|
() => l.value,
|
|
110
110
|
async (a) => {
|
|
111
|
-
if (await
|
|
111
|
+
if (await oe(), a) {
|
|
112
112
|
const o = document.documentElement.offsetHeight;
|
|
113
113
|
u.value = `${o - 55 - 40 - (n.footer ? 63 : 0)}px`;
|
|
114
114
|
} else
|
|
@@ -118,15 +118,15 @@ const Z = /* @__PURE__ */ E({
|
|
|
118
118
|
immediate: !0
|
|
119
119
|
}
|
|
120
120
|
);
|
|
121
|
-
const c =
|
|
121
|
+
const c = T(() => {
|
|
122
122
|
if (t.maxHeight)
|
|
123
123
|
return {
|
|
124
|
-
height:
|
|
124
|
+
height: B(u)
|
|
125
125
|
};
|
|
126
126
|
});
|
|
127
127
|
return (a, o) => {
|
|
128
|
-
const m =
|
|
129
|
-
return s(),
|
|
128
|
+
const m = g("FullScreen"), d = g("el-icon"), f = g("ElScrollbar"), v = g("ElDialog");
|
|
129
|
+
return s(), y(v, P({
|
|
130
130
|
"close-on-click-modal": !1,
|
|
131
131
|
"destroy-on-close": "",
|
|
132
132
|
draggable: "",
|
|
@@ -138,26 +138,26 @@ const Z = /* @__PURE__ */ E({
|
|
|
138
138
|
width: e.width
|
|
139
139
|
}), U({
|
|
140
140
|
default: h(() => [
|
|
141
|
-
e.scroll ? (s(),
|
|
141
|
+
e.scroll ? (s(), y(f, {
|
|
142
142
|
key: 0,
|
|
143
143
|
style: V(c.value)
|
|
144
144
|
}, {
|
|
145
145
|
default: h(() => [
|
|
146
|
-
|
|
146
|
+
S(a.$slots, "default")
|
|
147
147
|
]),
|
|
148
148
|
_: 3
|
|
149
|
-
}, 8, ["style"])) :
|
|
149
|
+
}, 8, ["style"])) : S(a.$slots, "default", { key: 1 })
|
|
150
150
|
]),
|
|
151
151
|
_: 2
|
|
152
152
|
}, [
|
|
153
153
|
e.title ? {
|
|
154
154
|
name: "header",
|
|
155
155
|
fn: h(() => [
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
X(
|
|
156
|
+
D("div", ye, [
|
|
157
|
+
S(a.$slots, "title", {}, () => [
|
|
158
|
+
X(Y(e.title), 1)
|
|
159
159
|
]),
|
|
160
|
-
|
|
160
|
+
D("div", { onClick: i }, [
|
|
161
161
|
N(d, { class: "fullScreen" }, {
|
|
162
162
|
default: h(() => [
|
|
163
163
|
N(m)
|
|
@@ -172,14 +172,14 @@ const Z = /* @__PURE__ */ E({
|
|
|
172
172
|
n.footer ? {
|
|
173
173
|
name: "footer",
|
|
174
174
|
fn: h(() => [
|
|
175
|
-
|
|
175
|
+
S(a.$slots, "footer")
|
|
176
176
|
]),
|
|
177
177
|
key: "1"
|
|
178
178
|
} : void 0
|
|
179
179
|
]), 1040, ["fullscreen", "width"]);
|
|
180
180
|
};
|
|
181
181
|
}
|
|
182
|
-
}),
|
|
182
|
+
}), be = { key: 1 }, xe = (e) => {
|
|
183
183
|
let n = e.label;
|
|
184
184
|
if (e.label && typeof e.label == "function" && (n = e.label()), e.type.indexOf("select") > -1 || e.type.indexOf("cascader") > -1 || e.type.indexOf("date") > -1)
|
|
185
185
|
return `请选择${n}`;
|
|
@@ -188,10 +188,10 @@ const Z = /* @__PURE__ */ E({
|
|
|
188
188
|
}, R = {
|
|
189
189
|
valueFormat: "YYYY-MM-DD HH:mm:ss",
|
|
190
190
|
format: "YYYY-MM-DD HH:mm:ss"
|
|
191
|
-
},
|
|
191
|
+
}, ke = (e) => {
|
|
192
192
|
const { options: n } = e;
|
|
193
193
|
return {
|
|
194
|
-
default: () => n?.map((t) => O(
|
|
194
|
+
default: () => n?.map((t) => O(g("el-option"), {
|
|
195
195
|
label: t.label,
|
|
196
196
|
value: t.value,
|
|
197
197
|
key: t.value
|
|
@@ -199,7 +199,7 @@ const Z = /* @__PURE__ */ E({
|
|
|
199
199
|
};
|
|
200
200
|
}, A = {
|
|
201
201
|
clearable: !0
|
|
202
|
-
},
|
|
202
|
+
}, Ce = [
|
|
203
203
|
{
|
|
204
204
|
type: "slider",
|
|
205
205
|
component: "el-slider"
|
|
@@ -236,7 +236,7 @@ const Z = /* @__PURE__ */ E({
|
|
|
236
236
|
const { options: n } = e;
|
|
237
237
|
return {
|
|
238
238
|
default: () => n?.map((t) => O(
|
|
239
|
-
|
|
239
|
+
g("el-checkbox"),
|
|
240
240
|
{
|
|
241
241
|
value: t.value
|
|
242
242
|
},
|
|
@@ -254,7 +254,7 @@ const Z = /* @__PURE__ */ E({
|
|
|
254
254
|
const { options: n } = e;
|
|
255
255
|
return {
|
|
256
256
|
default: () => n?.map((t) => O(
|
|
257
|
-
|
|
257
|
+
g("el-radio"),
|
|
258
258
|
{
|
|
259
259
|
value: t.value
|
|
260
260
|
},
|
|
@@ -268,7 +268,7 @@ const Z = /* @__PURE__ */ E({
|
|
|
268
268
|
{
|
|
269
269
|
type: "select",
|
|
270
270
|
component: "el-select",
|
|
271
|
-
slots:
|
|
271
|
+
slots: ke
|
|
272
272
|
},
|
|
273
273
|
{
|
|
274
274
|
type: "select-v2",
|
|
@@ -346,10 +346,10 @@ const Z = /* @__PURE__ */ E({
|
|
|
346
346
|
type: "custom",
|
|
347
347
|
component: "el-form-item"
|
|
348
348
|
}
|
|
349
|
-
],
|
|
349
|
+
], we = /* @__PURE__ */ $({
|
|
350
350
|
name: "EasyForm",
|
|
351
351
|
__name: "index",
|
|
352
|
-
props: /* @__PURE__ */
|
|
352
|
+
props: /* @__PURE__ */ ae({
|
|
353
353
|
inline: {
|
|
354
354
|
type: Boolean,
|
|
355
355
|
default: !0
|
|
@@ -383,7 +383,7 @@ const Z = /* @__PURE__ */ E({
|
|
|
383
383
|
}),
|
|
384
384
|
emits: ["update:modelValue"],
|
|
385
385
|
setup(e) {
|
|
386
|
-
const n =
|
|
386
|
+
const n = le(e, "modelValue"), t = K(), l = (a) => {
|
|
387
387
|
i(a, "formRef");
|
|
388
388
|
}, i = (a, o) => {
|
|
389
389
|
if (!a) {
|
|
@@ -398,7 +398,7 @@ const Z = /* @__PURE__ */ E({
|
|
|
398
398
|
[o]: a
|
|
399
399
|
};
|
|
400
400
|
}, u = F(), c = (a, o, m) => {
|
|
401
|
-
const { value: d, component: f, ...v } = o, p =
|
|
401
|
+
const { value: d, component: f, ...v } = o, p = Ce.find(
|
|
402
402
|
(k) => !!a && k.type.indexOf(a) > -1
|
|
403
403
|
), _ = p?.component === "el-select" && o.props, x = o.options && !_ ? p?.slots?.(o) : {};
|
|
404
404
|
if (!p && !o.component)
|
|
@@ -415,14 +415,14 @@ const Z = /* @__PURE__ */ E({
|
|
|
415
415
|
// },
|
|
416
416
|
...v,
|
|
417
417
|
//外部传入的 优先级最高
|
|
418
|
-
placeholder: v.placeholder ||
|
|
418
|
+
placeholder: v.placeholder || xe(o)
|
|
419
419
|
},
|
|
420
420
|
{ ...x, ...m }
|
|
421
421
|
);
|
|
422
422
|
};
|
|
423
423
|
return (a, o) => {
|
|
424
|
-
const m =
|
|
425
|
-
return s(),
|
|
424
|
+
const m = g("el-form-item"), d = g("el-form");
|
|
425
|
+
return s(), y(d, P({
|
|
426
426
|
model: n.value,
|
|
427
427
|
"label-width": e.labelWidth,
|
|
428
428
|
inline: e.inline,
|
|
@@ -433,7 +433,7 @@ const Z = /* @__PURE__ */ E({
|
|
|
433
433
|
}), {
|
|
434
434
|
default: h(() => [
|
|
435
435
|
(s(!0), b(H, null, z(e.formItems, ({ id: f, type: v, rule: p, width: _, slots: x, ...r }, k) => (s(), b(H, null, [
|
|
436
|
-
v != "custom" && !r.hidden ? (s(),
|
|
436
|
+
v != "custom" && !r.hidden ? (s(), y(m, {
|
|
437
437
|
prop: r.prop,
|
|
438
438
|
key: k,
|
|
439
439
|
"label-width": r.labelWidth,
|
|
@@ -441,13 +441,13 @@ const Z = /* @__PURE__ */ E({
|
|
|
441
441
|
required: r.required
|
|
442
442
|
}, {
|
|
443
443
|
label: h(() => [
|
|
444
|
-
r.label && typeof r.label == "function" ? (s(),
|
|
444
|
+
r.label && typeof r.label == "function" ? (s(), y(L(r.label), { key: 0 })) : (s(), b("span", be, Y(r.label), 1))
|
|
445
445
|
]),
|
|
446
446
|
default: h(() => [
|
|
447
|
-
u[r.prop] ?
|
|
447
|
+
u[r.prop] ? S(a.$slots, r.prop, {
|
|
448
448
|
key: 0,
|
|
449
449
|
item: r
|
|
450
|
-
}, void 0, !0) : (s(),
|
|
450
|
+
}, void 0, !0) : (s(), y(L(c(v, { ...r, type: v }, x)), {
|
|
451
451
|
key: 1,
|
|
452
452
|
modelValue: n.value[r.prop],
|
|
453
453
|
"onUpdate:modelValue": (C) => n.value[r.prop] = C,
|
|
@@ -458,15 +458,15 @@ const Z = /* @__PURE__ */ E({
|
|
|
458
458
|
_: 2
|
|
459
459
|
}, 1032, ["prop", "label-width", "rules", "required"])) : I("", !0),
|
|
460
460
|
v == "custom" ? (s(), b(H, { key: 1 }, [
|
|
461
|
-
x?.[r.prop] ? (s(),
|
|
461
|
+
x?.[r.prop] ? (s(), y(L(x[r.prop]), { key: 0 })) : S(a.$slots, r.prop, {
|
|
462
462
|
key: 1,
|
|
463
463
|
item: { width: _, rule: p, ...r }
|
|
464
464
|
}, void 0, !0)
|
|
465
465
|
], 64)) : I("", !0)
|
|
466
466
|
], 64))), 256)),
|
|
467
|
-
u.append ? (s(),
|
|
467
|
+
u.append ? (s(), y(m, { key: 0 }, {
|
|
468
468
|
default: h(() => [
|
|
469
|
-
|
|
469
|
+
S(a.$slots, "append", {}, void 0, !0)
|
|
470
470
|
]),
|
|
471
471
|
_: 3
|
|
472
472
|
})) : I("", !0)
|
|
@@ -475,7 +475,7 @@ const Z = /* @__PURE__ */ E({
|
|
|
475
475
|
}, 16, ["model", "label-width", "inline"]);
|
|
476
476
|
};
|
|
477
477
|
}
|
|
478
|
-
}),
|
|
478
|
+
}), _e = /* @__PURE__ */ W(we, [["__scopeId", "data-v-ebcd5674"]]), Se = /* @__PURE__ */ $({
|
|
479
479
|
name: "EasyTable",
|
|
480
480
|
__name: "index",
|
|
481
481
|
props: {
|
|
@@ -514,7 +514,7 @@ const Z = /* @__PURE__ */ E({
|
|
|
514
514
|
}
|
|
515
515
|
},
|
|
516
516
|
setup(e) {
|
|
517
|
-
const n =
|
|
517
|
+
const n = se(de), t = e, l = T(() => t.buttonWidth.toString().indexOf("px") > -1 ? t.buttonWidth.toString().slice(0, -2) : t.buttonWidth), i = w(), u = w("auto");
|
|
518
518
|
let c = K();
|
|
519
519
|
const a = () => {
|
|
520
520
|
let p = "auto";
|
|
@@ -536,10 +536,10 @@ const Z = /* @__PURE__ */ E({
|
|
|
536
536
|
};
|
|
537
537
|
G(() => {
|
|
538
538
|
u.value = a(), window.addEventListener("resize", m);
|
|
539
|
-
}),
|
|
539
|
+
}), re(() => {
|
|
540
540
|
window.removeEventListener("resize", m);
|
|
541
541
|
});
|
|
542
|
-
const d =
|
|
542
|
+
const d = g("el-table-column"), f = F(), v = (p) => {
|
|
543
543
|
const { slots: _ = {}, children: x = [], ...r } = p;
|
|
544
544
|
if (x && x.length > 0) {
|
|
545
545
|
const k = x.map((C) => v(C));
|
|
@@ -567,19 +567,19 @@ const Z = /* @__PURE__ */ E({
|
|
|
567
567
|
);
|
|
568
568
|
};
|
|
569
569
|
return (p, _) => {
|
|
570
|
-
const x =
|
|
570
|
+
const x = g("el-button"), r = g("el-table-column"), k = g("el-table");
|
|
571
571
|
return s(), b("div", {
|
|
572
572
|
ref_key: "tableRef",
|
|
573
573
|
ref: i
|
|
574
574
|
}, [
|
|
575
|
-
N(k,
|
|
575
|
+
N(k, P({ style: { width: "100%" } }, p.$attrs, {
|
|
576
576
|
data: e.data,
|
|
577
577
|
height: e.height,
|
|
578
578
|
maxHeight: e.maxHeight ? e.maxHeight : u.value
|
|
579
579
|
}), {
|
|
580
580
|
default: h(() => [
|
|
581
|
-
(s(!0), b(H, null, z(e.tableColumns, (C,
|
|
582
|
-
e.buttons && e.buttons.length ? (s(),
|
|
581
|
+
(s(!0), b(H, null, z(e.tableColumns, (C, M) => (s(), y(L(v(C)), { key: M }))), 128)),
|
|
582
|
+
e.buttons && e.buttons.length ? (s(), y(r, {
|
|
583
583
|
key: 0,
|
|
584
584
|
align: "center",
|
|
585
585
|
fixed: "right",
|
|
@@ -587,21 +587,21 @@ const Z = /* @__PURE__ */ E({
|
|
|
587
587
|
width: l.value
|
|
588
588
|
}, {
|
|
589
589
|
default: h((C) => [
|
|
590
|
-
(s(!0), b(H, null, z(e.buttons, (
|
|
591
|
-
key:
|
|
592
|
-
type:
|
|
590
|
+
(s(!0), b(H, null, z(e.buttons, (M, Z) => J((s(), y(x, P({ ref_for: !0 }, { ...M }, {
|
|
591
|
+
key: Z,
|
|
592
|
+
type: M.type.includes("del") ? "danger" : "primary",
|
|
593
593
|
onClick: () => {
|
|
594
|
-
|
|
594
|
+
M.click?.(C.row);
|
|
595
595
|
},
|
|
596
|
-
disabled:
|
|
597
|
-
link:
|
|
596
|
+
disabled: M.disabled?.(C.row) || !1,
|
|
597
|
+
link: M.link?.(C.row) || !0
|
|
598
598
|
}), {
|
|
599
599
|
default: h(() => [
|
|
600
|
-
X(
|
|
600
|
+
X(Y(M.label), 1)
|
|
601
601
|
]),
|
|
602
602
|
_: 2
|
|
603
603
|
}, 1040, ["type", "onClick", "disabled", "link"])), [
|
|
604
|
-
[Q,
|
|
604
|
+
[Q, M.show?.(C.row) || !0]
|
|
605
605
|
])), 128))
|
|
606
606
|
]),
|
|
607
607
|
_: 1
|
|
@@ -612,7 +612,7 @@ const Z = /* @__PURE__ */ E({
|
|
|
612
612
|
], 512);
|
|
613
613
|
};
|
|
614
614
|
}
|
|
615
|
-
}),
|
|
615
|
+
}), Me = /* @__PURE__ */ W(Se, [["__scopeId", "data-v-1c87357b"]]), $e = {
|
|
616
616
|
name: "",
|
|
617
617
|
components: {},
|
|
618
618
|
props: {
|
|
@@ -622,13 +622,13 @@ const Z = /* @__PURE__ */ E({
|
|
|
622
622
|
}
|
|
623
623
|
}
|
|
624
624
|
};
|
|
625
|
-
function
|
|
626
|
-
return t.icon ? (s(),
|
|
625
|
+
function Ee(e, n, t, l, i, u) {
|
|
626
|
+
return t.icon ? (s(), y(L(t.icon), {
|
|
627
627
|
key: 0,
|
|
628
628
|
class: "menu_icon"
|
|
629
629
|
})) : I("", !0);
|
|
630
630
|
}
|
|
631
|
-
const j = /* @__PURE__ */
|
|
631
|
+
const j = /* @__PURE__ */ W($e, [["render", Ee], ["__scopeId", "data-v-261ce99a"]]), He = /* @__PURE__ */ $({
|
|
632
632
|
name: "subMenu",
|
|
633
633
|
__name: "subMenu",
|
|
634
634
|
props: {
|
|
@@ -644,8 +644,8 @@ const j = /* @__PURE__ */ B(De, [["render", Ye], ["__scopeId", "data-v-261ce99a"
|
|
|
644
644
|
t("handleMenuItemClick", i);
|
|
645
645
|
}
|
|
646
646
|
return (i, u) => {
|
|
647
|
-
const c =
|
|
648
|
-
return e.routeData.children && e.routeData.children.length > 0 ? (s(),
|
|
647
|
+
const c = g("subMenu", !0), a = g("el-sub-menu"), o = g("el-menu-item");
|
|
648
|
+
return e.routeData.children && e.routeData.children.length > 0 ? (s(), y(a, {
|
|
649
649
|
key: 0,
|
|
650
650
|
index: e.routeData.path
|
|
651
651
|
}, {
|
|
@@ -653,10 +653,10 @@ const j = /* @__PURE__ */ B(De, [["render", Ye], ["__scopeId", "data-v-261ce99a"
|
|
|
653
653
|
N(j, {
|
|
654
654
|
icon: e.routeData.meta.icon
|
|
655
655
|
}, null, 8, ["icon"]),
|
|
656
|
-
|
|
656
|
+
D("span", null, Y(e.routeData.meta.title), 1)
|
|
657
657
|
]),
|
|
658
658
|
default: h(() => [
|
|
659
|
-
(s(!0), b(H, null, z(e.routeData.children, (m, d) => (s(),
|
|
659
|
+
(s(!0), b(H, null, z(e.routeData.children, (m, d) => (s(), y(c, {
|
|
660
660
|
onHandleMenuItemClick: l,
|
|
661
661
|
routeData: m,
|
|
662
662
|
key: d
|
|
@@ -671,7 +671,7 @@ const j = /* @__PURE__ */ B(De, [["render", Ye], ["__scopeId", "data-v-261ce99a"
|
|
|
671
671
|
index: e.routeData.path
|
|
672
672
|
}, {
|
|
673
673
|
title: h(() => [
|
|
674
|
-
|
|
674
|
+
D("span", null, Y(e.routeData.meta.title), 1)
|
|
675
675
|
]),
|
|
676
676
|
default: h(() => [
|
|
677
677
|
N(j, {
|
|
@@ -683,7 +683,7 @@ const j = /* @__PURE__ */ B(De, [["render", Ye], ["__scopeId", "data-v-261ce99a"
|
|
|
683
683
|
]));
|
|
684
684
|
};
|
|
685
685
|
}
|
|
686
|
-
}),
|
|
686
|
+
}), Ye = /* @__PURE__ */ $({
|
|
687
687
|
name: "MenuTree",
|
|
688
688
|
__name: "index",
|
|
689
689
|
props: {
|
|
@@ -698,10 +698,10 @@ const j = /* @__PURE__ */ B(De, [["render", Ye], ["__scopeId", "data-v-261ce99a"
|
|
|
698
698
|
t("handleMenuItemClick", i);
|
|
699
699
|
};
|
|
700
700
|
return (i, u) => {
|
|
701
|
-
const c =
|
|
702
|
-
return s(),
|
|
701
|
+
const c = g("el-menu");
|
|
702
|
+
return s(), y(c, ie(ue(i.$attrs)), {
|
|
703
703
|
default: h(() => [
|
|
704
|
-
(s(!0), b(H, null, z(e.menuList, (a) => (s(),
|
|
704
|
+
(s(!0), b(H, null, z(e.menuList, (a) => (s(), y(He, {
|
|
705
705
|
routeData: a,
|
|
706
706
|
onHandleMenuItemClick: l
|
|
707
707
|
}, null, 8, ["routeData"]))), 256))
|
|
@@ -710,7 +710,7 @@ const j = /* @__PURE__ */ B(De, [["render", Ye], ["__scopeId", "data-v-261ce99a"
|
|
|
710
710
|
}, 16);
|
|
711
711
|
};
|
|
712
712
|
}
|
|
713
|
-
}),
|
|
713
|
+
}), De = /* @__PURE__ */ $({
|
|
714
714
|
name: "Pagination",
|
|
715
715
|
__name: "index",
|
|
716
716
|
props: {
|
|
@@ -739,14 +739,14 @@ const j = /* @__PURE__ */ B(De, [["render", Ye], ["__scopeId", "data-v-261ce99a"
|
|
|
739
739
|
},
|
|
740
740
|
emits: ["update:page", "update:limit", "pagination"],
|
|
741
741
|
setup(e, { emit: n }) {
|
|
742
|
-
const t = e, l = n, i =
|
|
742
|
+
const t = e, l = n, i = T({
|
|
743
743
|
get() {
|
|
744
744
|
return t.page;
|
|
745
745
|
},
|
|
746
746
|
set(o) {
|
|
747
747
|
l("update:page", o);
|
|
748
748
|
}
|
|
749
|
-
}), u =
|
|
749
|
+
}), u = T({
|
|
750
750
|
get() {
|
|
751
751
|
return t.limit;
|
|
752
752
|
},
|
|
@@ -759,8 +759,8 @@ const j = /* @__PURE__ */ B(De, [["render", Ye], ["__scopeId", "data-v-261ce99a"
|
|
|
759
759
|
l("pagination", { page: o, limit: u.value });
|
|
760
760
|
};
|
|
761
761
|
return (o, m) => {
|
|
762
|
-
const d =
|
|
763
|
-
return J((s(),
|
|
762
|
+
const d = g("el-pagination");
|
|
763
|
+
return J((s(), y(d, {
|
|
764
764
|
"current-page": i.value,
|
|
765
765
|
"onUpdate:currentPage": m[0] || (m[0] = (f) => i.value = f),
|
|
766
766
|
"page-size": u.value,
|
|
@@ -778,7 +778,7 @@ const j = /* @__PURE__ */ B(De, [["render", Ye], ["__scopeId", "data-v-261ce99a"
|
|
|
778
778
|
]);
|
|
779
779
|
};
|
|
780
780
|
}
|
|
781
|
-
}),
|
|
781
|
+
}), Le = /* @__PURE__ */ W(De, [["__scopeId", "data-v-1e34e383"]]), Ie = ["onClick", "onMouseover"], Ne = /* @__PURE__ */ $({
|
|
782
782
|
name: "EasyContextMenu",
|
|
783
783
|
__name: "index",
|
|
784
784
|
props: {
|
|
@@ -826,7 +826,7 @@ const j = /* @__PURE__ */ B(De, [["render", Ye], ["__scopeId", "data-v-261ce99a"
|
|
|
826
826
|
console.log("blur"), l.value = !1;
|
|
827
827
|
});
|
|
828
828
|
});
|
|
829
|
-
const o =
|
|
829
|
+
const o = T(() => n.maxHeight == "auto" ? "auto" : n.maxHeight.toString().indexOf("px") > -1 ? n.maxHeight : `${n.maxHeight}px`), m = T(() => ({
|
|
830
830
|
backgroundColor: n.backgroundColor,
|
|
831
831
|
left: `${i.value.x}px`,
|
|
832
832
|
top: `${i.value.y}px`,
|
|
@@ -837,25 +837,25 @@ const j = /* @__PURE__ */ B(De, [["render", Ye], ["__scopeId", "data-v-261ce99a"
|
|
|
837
837
|
ref_key: "contextMenu",
|
|
838
838
|
ref: a
|
|
839
839
|
}, [
|
|
840
|
-
|
|
841
|
-
style: { ...
|
|
840
|
+
D("div", P({ class: "easy-context-menu" }, d.$attrs, {
|
|
841
|
+
style: { ...B(m) },
|
|
842
842
|
ref_key: "menuListRef",
|
|
843
843
|
ref: c
|
|
844
844
|
}), [
|
|
845
845
|
(s(!0), b(H, null, z(e.menuList, (v, p) => (s(), b("div", {
|
|
846
846
|
key: p,
|
|
847
|
-
onContextmenu: f[0] || (f[0] =
|
|
847
|
+
onContextmenu: f[0] || (f[0] = ce(() => {
|
|
848
848
|
}, ["stop"])),
|
|
849
849
|
onClick: v.onClick,
|
|
850
850
|
onMouseover: (_) => t.value = p,
|
|
851
851
|
onMouseout: f[1] || (f[1] = (_) => t.value = -1),
|
|
852
|
-
style: V(
|
|
853
|
-
},
|
|
852
|
+
style: V(B(t) === p ? n.hoverItemStyle : "")
|
|
853
|
+
}, Y(v.label), 45, Ie))), 128))
|
|
854
854
|
], 16)
|
|
855
855
|
], 512));
|
|
856
856
|
}
|
|
857
|
-
}),
|
|
858
|
-
class
|
|
857
|
+
}), Pe = /* @__PURE__ */ W(Ne, [["__scopeId", "data-v-f9f5bc05"]]);
|
|
858
|
+
class E {
|
|
859
859
|
// 右键菜单的节点
|
|
860
860
|
vnode = null;
|
|
861
861
|
// 右键菜单的配置
|
|
@@ -882,25 +882,35 @@ class S {
|
|
|
882
882
|
};
|
|
883
883
|
// 当前右键菜单的dom节点
|
|
884
884
|
menu = null;
|
|
885
|
+
// 是否单例
|
|
886
|
+
single = !0;
|
|
887
|
+
boundHide = this.hideMenu.bind(this);
|
|
888
|
+
// 绑定this 事件移除使用
|
|
889
|
+
boundShow = this.showMenu.bind(this);
|
|
890
|
+
// 绑定this 事件移除使用
|
|
885
891
|
// 实例
|
|
886
892
|
static #t = null;
|
|
887
893
|
static getInstance() {
|
|
888
|
-
return
|
|
894
|
+
return E.#t || (E.#t = new E(), E.#t.single = !0), E.#t;
|
|
889
895
|
}
|
|
890
|
-
|
|
891
|
-
|
|
896
|
+
/**
|
|
897
|
+
* 这个函数的用途写在这里
|
|
898
|
+
* @param {type} single 是否单例 默认是true
|
|
899
|
+
*/
|
|
900
|
+
constructor(n) {
|
|
901
|
+
this.single = !1, n && this.create(n);
|
|
892
902
|
}
|
|
893
903
|
create(n) {
|
|
894
|
-
const t =
|
|
904
|
+
const t = this.single ? E.getInstance() : this;
|
|
895
905
|
return t.vnode !== n.target && t.destroy(), t.vnode = n.target || null, t.#e = { ...t.#e, ...n }, t.#o(), t;
|
|
896
906
|
}
|
|
897
907
|
// 初始化
|
|
898
908
|
#o() {
|
|
899
|
-
this.defaultStyle = { ...this.defaultStyle, ...this.#e.style }, this.hoverStyle = { ...this.hoverStyle, ...this.#e.hoverStyle }, this.vnode && this.vnode?.addEventListener(this.#e.event || "contextmenu", this.
|
|
909
|
+
this.defaultStyle = { ...this.defaultStyle, ...this.#e.style }, this.hoverStyle = { ...this.hoverStyle, ...this.#e.hoverStyle }, this.vnode && this.vnode?.addEventListener(this.#e.event || "contextmenu", this.boundShow), document.addEventListener("click", this.boundHide), document.addEventListener("keydown", this.boundHide), document.addEventListener("contextmenu", this.boundHide);
|
|
900
910
|
}
|
|
901
911
|
// 销毁右键菜单
|
|
902
912
|
destroy() {
|
|
903
|
-
this.vnode?.removeEventListener(this.#e.event || "contextmenu", this.
|
|
913
|
+
this.vnode?.removeEventListener(this.#e.event || "contextmenu", this.boundShow), document.removeEventListener("click", this.boundHide), document.removeEventListener("keydown", this.boundHide), document.removeEventListener("contextmenu", this.boundHide), this.resetContextMenu();
|
|
904
914
|
}
|
|
905
915
|
// 重置右键菜单
|
|
906
916
|
resetContextMenu() {
|
|
@@ -921,19 +931,25 @@ class S {
|
|
|
921
931
|
* 手动显示右键菜单 需要传入一个事件对象
|
|
922
932
|
*/
|
|
923
933
|
showMenu(n) {
|
|
924
|
-
|
|
934
|
+
document.dispatchEvent(new MouseEvent("contextmenu", {
|
|
935
|
+
bubbles: !0,
|
|
936
|
+
// 是否冒泡
|
|
937
|
+
// cancelable: true, // 是否可以取消默认事件
|
|
938
|
+
view: window
|
|
939
|
+
// 视图
|
|
940
|
+
})), this.#a(n);
|
|
925
941
|
}
|
|
926
942
|
/**
|
|
927
943
|
* 隐藏右键菜单
|
|
928
944
|
*/
|
|
929
945
|
hideMenu() {
|
|
930
|
-
|
|
946
|
+
this.#n();
|
|
931
947
|
}
|
|
932
948
|
// 显示右键菜单
|
|
933
949
|
#a(n) {
|
|
934
950
|
if (n.preventDefault(), n.stopPropagation(), this.#e.menuList.length === 0)
|
|
935
951
|
return;
|
|
936
|
-
if (this.vnode || (this.vnode = n.target),
|
|
952
|
+
if (this.vnode || (this.vnode = n.target), this.#n(), !this.menu) {
|
|
937
953
|
const c = document.createElement("div");
|
|
938
954
|
c.className = this.#e.classNames || "", this.menu = c, this.#e.menuList.forEach((a) => {
|
|
939
955
|
const o = document.createElement("div");
|
|
@@ -967,47 +983,34 @@ class S {
|
|
|
967
983
|
}, 0), this.menu.scrollTo(0, 0);
|
|
968
984
|
}
|
|
969
985
|
}
|
|
970
|
-
const
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
986
|
+
const Be = E.getInstance(), Te = [
|
|
987
|
+
me,
|
|
988
|
+
ge,
|
|
989
|
+
ve,
|
|
990
|
+
_e,
|
|
975
991
|
// EasyFormH,
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
], q = [],
|
|
981
|
-
|
|
992
|
+
Me,
|
|
993
|
+
Ye,
|
|
994
|
+
Le,
|
|
995
|
+
Pe
|
|
996
|
+
], q = [], ze = (e, n) => {
|
|
997
|
+
Te.forEach((t) => {
|
|
982
998
|
q.push(t.name), e.component(t.name, t);
|
|
983
999
|
}), console.log("mwl-components", q);
|
|
984
|
-
}, Fe = {
|
|
985
|
-
install: Oe,
|
|
986
|
-
EasyButton: Z,
|
|
987
|
-
ContentWarp: ee,
|
|
988
|
-
Dialog: te,
|
|
989
|
-
EasyForm: ae,
|
|
990
|
-
// EasyFormH,
|
|
991
|
-
EasyTable: le,
|
|
992
|
-
MenuTree: se,
|
|
993
|
-
Pagination: re,
|
|
994
|
-
EasyContextMenu: ie,
|
|
995
|
-
componentsMap: oe,
|
|
996
|
-
getPlaceholder: ne,
|
|
997
|
-
ContextMenu: Pe
|
|
998
|
-
};
|
|
1000
|
+
}, Fe = { install: ze };
|
|
999
1001
|
export {
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1002
|
+
ge as ContentWarp,
|
|
1003
|
+
E as ContextMenu,
|
|
1004
|
+
ve as Dialog,
|
|
1005
|
+
me as EasyButton,
|
|
1006
|
+
Pe as EasyContextMenu,
|
|
1007
|
+
_e as EasyForm,
|
|
1008
|
+
Me as EasyTable,
|
|
1009
|
+
Ye as MenuTree,
|
|
1010
|
+
Le as Pagination,
|
|
1011
|
+
Ce as componentsMap,
|
|
1012
|
+
Be as contextMenu,
|
|
1010
1013
|
Fe as default,
|
|
1011
|
-
|
|
1012
|
-
|
|
1014
|
+
xe as getPlaceholder,
|
|
1015
|
+
ze as install
|
|
1013
1016
|
};
|