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/dist/index.es.js CHANGED
@@ -1,11 +1,11 @@
1
- import { defineComponent as E, useAttrs as ce, ref as w, resolveComponent as y, createBlock as g, openBlock as s, mergeProps as T, withCtx as h, renderSlot as M, useSlots as F, normalizeClass as de, createSlots as U, createElementVNode as Y, createElementBlock as b, createCommentVNode as I, toDisplayString as D, watch as me, nextTick as pe, computed as P, unref as W, normalizeStyle as V, createTextVNode as X, createVNode as N, mergeModels as he, useModel as fe, getCurrentInstance as K, Fragment as H, renderList as z, resolveDynamicComponent as L, h as O, inject as ye, onMounted as G, onUnmounted as ge, withDirectives as J, vShow as Q, normalizeProps as ve, guardReactiveProps as be, withModifiers as xe } from "vue";
2
- import { configProviderContextKey as ke } from "element-plus";
3
- const Z = /* @__PURE__ */ E({
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 } = ce(), l = w(!1), i = async () => {
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 = y("el-button");
20
- return s(), g(a, T(t, {
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
- M(u.$slots, "default")
25
+ S(u.$slots, "default")
26
26
  ]),
27
27
  _: 3
28
28
  }, 16, ["loading"]);
29
29
  };
30
30
  }
31
- }), Ce = { class: "card-header" }, we = {
31
+ }), pe = { class: "card-header" }, he = {
32
32
  key: 0,
33
33
  class: "card-header__message"
34
- }, _e = /* @__PURE__ */ E({
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 = y("ElCard");
45
- return s(), g(u, {
46
- class: de([t.value]),
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
- M(l.$slots, "default", {}, void 0, !0)
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
- Y("div", Ce, [
58
- Y("span", null, D(e.title), 1),
59
- e.message ? (s(), b("span", we, D(e.message), 1)) : I("", !0)
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
- M(l.$slots, "footer", {}, void 0, !0)
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
- }), B = (e, n) => {
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
- }, ee = /* @__PURE__ */ B(_e, [["__scopeId", "data-v-fdaaba5e"]]), Se = { class: "dialog-header" }, te = /* @__PURE__ */ E({
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 = !W(l);
106
+ l.value = !B(l);
107
107
  }, u = w(t.maxHeight);
108
- me(
108
+ ne(
109
109
  () => l.value,
110
110
  async (a) => {
111
- if (await pe(), a) {
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 = P(() => {
121
+ const c = T(() => {
122
122
  if (t.maxHeight)
123
123
  return {
124
- height: W(u)
124
+ height: B(u)
125
125
  };
126
126
  });
127
127
  return (a, o) => {
128
- const m = y("FullScreen"), d = y("el-icon"), f = y("ElScrollbar"), v = y("ElDialog");
129
- return s(), g(v, T({
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(), g(f, {
141
+ e.scroll ? (s(), y(f, {
142
142
  key: 0,
143
143
  style: V(c.value)
144
144
  }, {
145
145
  default: h(() => [
146
- M(a.$slots, "default")
146
+ S(a.$slots, "default")
147
147
  ]),
148
148
  _: 3
149
- }, 8, ["style"])) : M(a.$slots, "default", { key: 1 })
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
- Y("div", Se, [
157
- M(a.$slots, "title", {}, () => [
158
- X(D(e.title), 1)
156
+ D("div", ye, [
157
+ S(a.$slots, "title", {}, () => [
158
+ X(Y(e.title), 1)
159
159
  ]),
160
- Y("div", { onClick: i }, [
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
- M(a.$slots, "footer")
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
- }), Me = { key: 1 }, ne = (e) => {
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
- }, $e = (e) => {
191
+ }, ke = (e) => {
192
192
  const { options: n } = e;
193
193
  return {
194
- default: () => n?.map((t) => O(y("el-option"), {
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
- }, oe = [
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
- y("el-checkbox"),
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
- y("el-radio"),
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: $e
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
- ], Ee = /* @__PURE__ */ E({
349
+ ], we = /* @__PURE__ */ $({
350
350
  name: "EasyForm",
351
351
  __name: "index",
352
- props: /* @__PURE__ */ he({
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 = fe(e, "modelValue"), t = K(), l = (a) => {
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 = oe.find(
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 || ne(o)
418
+ placeholder: v.placeholder || xe(o)
419
419
  },
420
420
  { ...x, ...m }
421
421
  );
422
422
  };
423
423
  return (a, o) => {
424
- const m = y("el-form-item"), d = y("el-form");
425
- return s(), g(d, T({
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(), g(m, {
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(), g(L(r.label), { key: 0 })) : (s(), b("span", Me, D(r.label), 1))
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] ? M(a.$slots, r.prop, {
447
+ u[r.prop] ? S(a.$slots, r.prop, {
448
448
  key: 0,
449
449
  item: r
450
- }, void 0, !0) : (s(), g(L(c(v, { ...r, type: v }, x)), {
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(), g(L(x[r.prop]), { key: 0 })) : M(a.$slots, r.prop, {
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(), g(m, { key: 0 }, {
467
+ u.append ? (s(), y(m, { key: 0 }, {
468
468
  default: h(() => [
469
- M(a.$slots, "append", {}, void 0, !0)
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
- }), ae = /* @__PURE__ */ B(Ee, [["__scopeId", "data-v-ebcd5674"]]), He = /* @__PURE__ */ E({
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 = ye(ke), t = e, l = P(() => t.buttonWidth.toString().indexOf("px") > -1 ? t.buttonWidth.toString().slice(0, -2) : t.buttonWidth), i = w(), u = w("auto");
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
- }), ge(() => {
539
+ }), re(() => {
540
540
  window.removeEventListener("resize", m);
541
541
  });
542
- const d = y("el-table-column"), f = F(), v = (p) => {
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 = y("el-button"), r = y("el-table-column"), k = y("el-table");
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, T({ style: { width: "100%" } }, p.$attrs, {
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, $) => (s(), g(L(v(C)), { key: $ }))), 128)),
582
- e.buttons && e.buttons.length ? (s(), g(r, {
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, ($, ue) => J((s(), g(x, T({ ref_for: !0 }, { ...$ }, {
591
- key: ue,
592
- type: $.type.includes("del") ? "danger" : "primary",
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
- $.click?.(C.row);
594
+ M.click?.(C.row);
595
595
  },
596
- disabled: $.disabled?.(C.row) || !1,
597
- link: $.link?.(C.row) || !0
596
+ disabled: M.disabled?.(C.row) || !1,
597
+ link: M.link?.(C.row) || !0
598
598
  }), {
599
599
  default: h(() => [
600
- X(D($.label), 1)
600
+ X(Y(M.label), 1)
601
601
  ]),
602
602
  _: 2
603
603
  }, 1040, ["type", "onClick", "disabled", "link"])), [
604
- [Q, $.show?.(C.row) || !0]
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
- }), le = /* @__PURE__ */ B(He, [["__scopeId", "data-v-1c87357b"]]), De = {
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 Ye(e, n, t, l, i, u) {
626
- return t.icon ? (s(), g(L(t.icon), {
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__ */ B(De, [["render", Ye], ["__scopeId", "data-v-261ce99a"]]), Le = /* @__PURE__ */ E({
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 = y("subMenu", !0), a = y("el-sub-menu"), o = y("el-menu-item");
648
- return e.routeData.children && e.routeData.children.length > 0 ? (s(), g(a, {
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
- Y("span", null, D(e.routeData.meta.title), 1)
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(), g(c, {
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
- Y("span", null, D(e.routeData.meta.title), 1)
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
- }), se = /* @__PURE__ */ E({
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 = y("el-menu");
702
- return s(), g(c, ve(be(i.$attrs)), {
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(), g(Le, {
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
- }), Ie = /* @__PURE__ */ E({
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 = P({
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 = P({
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 = y("el-pagination");
763
- return J((s(), g(d, {
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
- }), re = /* @__PURE__ */ B(Ie, [["__scopeId", "data-v-1e34e383"]]), Ne = ["onClick", "onMouseover"], Te = /* @__PURE__ */ E({
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 = P(() => n.maxHeight == "auto" ? "auto" : n.maxHeight.toString().indexOf("px") > -1 ? n.maxHeight : `${n.maxHeight}px`), m = P(() => ({
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
- Y("div", T({ class: "easy-context-menu" }, d.$attrs, {
841
- style: { ...W(m) },
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] = xe(() => {
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(W(t) === p ? n.hoverItemStyle : "")
853
- }, D(v.label), 45, Ne))), 128))
852
+ style: V(B(t) === p ? n.hoverItemStyle : "")
853
+ }, Y(v.label), 45, Ie))), 128))
854
854
  ], 16)
855
855
  ], 512));
856
856
  }
857
- }), ie = /* @__PURE__ */ B(Te, [["__scopeId", "data-v-f9f5bc05"]]);
858
- class S {
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 S.#t || (S.#t = new S()), S.#t;
894
+ return E.#t || (E.#t = new E(), E.#t.single = !0), E.#t;
889
895
  }
890
- constructor() {
891
- S.#t || (S.#t = this);
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 = S.getInstance();
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.showMenu), document.addEventListener("click", this.hideMenu), document.addEventListener("keydown", this.hideMenu);
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.showMenu), document.removeEventListener("click", this.hideMenu), document.removeEventListener("keydown", this.hideMenu), this.resetContextMenu();
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
- S.#t.#a(n);
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
- S.#t.#n();
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), console.log(this, "this"), this.#n(), !this.menu) {
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 Pe = S.getInstance(), ze = [
971
- Z,
972
- ee,
973
- te,
974
- ae,
986
+ const Be = E.getInstance(), Te = [
987
+ me,
988
+ ge,
989
+ ve,
990
+ _e,
975
991
  // EasyFormH,
976
- le,
977
- se,
978
- re,
979
- ie
980
- ], q = [], Oe = (e, n) => {
981
- ze.forEach((t) => {
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
- ee as ContentWarp,
1001
- Pe as ContextMenu,
1002
- te as Dialog,
1003
- Z as EasyButton,
1004
- ie as EasyContextMenu,
1005
- ae as EasyForm,
1006
- le as EasyTable,
1007
- se as MenuTree,
1008
- re as Pagination,
1009
- oe as componentsMap,
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
- ne as getPlaceholder,
1012
- Oe as install
1014
+ xe as getPlaceholder,
1015
+ ze as install
1013
1016
  };