mwl-components 0.1.1 → 0.1.3

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.js CHANGED
@@ -1,11 +1,37 @@
1
- import { defineComponent as H, useSlots as W, ref as I, resolveComponent as d, createBlock as f, openBlock as a, normalizeClass as Q, createSlots as j, withCtx as i, renderSlot as _, createElementVNode as S, createElementBlock as v, createCommentVNode as D, toDisplayString as $, createVNode as Y, watch as X, nextTick as Z, computed as F, unref as A, mergeProps as T, normalizeStyle as L, createTextVNode as U, getCurrentInstance as q, Fragment as M, renderList as z, resolveDynamicComponent as E, h as N, onMounted as ee, onUnmounted as te, withDirectives as G, vShow as J, normalizeProps as ne, guardReactiveProps as oe } from "vue";
2
- const ae = { class: "flex items-center justify-between" }, le = { class: "flex items-center" }, re = { class: "text-16px font-700" }, se = { class: "max-w-200px" }, ce = {
3
- key: 0,
4
- class: "flex justify-end"
5
- }, ue = {
1
+ import { defineComponent as M, useAttrs as X, ref as Y, resolveComponent as d, createBlock as p, openBlock as r, mergeProps as P, withCtx as i, renderSlot as C, useSlots as V, normalizeClass as Z, createSlots as L, createElementVNode as I, createElementBlock as x, createCommentVNode as E, toDisplayString as $, watch as ee, nextTick as te, computed as O, unref as B, normalizeStyle as U, createTextVNode as j, createVNode as N, mergeModels as ne, useModel as oe, getCurrentInstance as K, Fragment as D, renderList as W, resolveDynamicComponent as H, h as z, inject as ae, onMounted as le, onUnmounted as re, withDirectives as G, vShow as J, normalizeProps as se, guardReactiveProps as ue } from "vue";
2
+ import { configProviderContextKey as ce } from "element-plus";
3
+ const ie = /* @__PURE__ */ M({
4
+ name: "EasyButton",
5
+ inheritAttrs: !1,
6
+ __name: "index",
7
+ setup(e) {
8
+ const { onClick: n, ...t } = X(), s = Y(!1), c = async () => {
9
+ console.log("Button clicked"), s.value = !0;
10
+ try {
11
+ await n?.();
12
+ } catch (u) {
13
+ console.error("Error in button onClick handler:", u);
14
+ } finally {
15
+ s.value = !1;
16
+ }
17
+ };
18
+ return (u, g) => {
19
+ const o = d("el-button");
20
+ return r(), p(o, P(t, {
21
+ loading: s.value,
22
+ onClick: c
23
+ }), {
24
+ default: i(() => [
25
+ C(u.$slots, "default")
26
+ ]),
27
+ _: 3
28
+ }, 16, ["loading"]);
29
+ };
30
+ }
31
+ }), de = { class: "card-header" }, me = {
6
32
  key: 0,
7
- class: "mt-8px flex items-center"
8
- }, ie = /* @__PURE__ */ H({
33
+ class: "card-header__message"
34
+ }, pe = /* @__PURE__ */ M({
9
35
  name: "ContentWarp",
10
36
  __name: "index",
11
37
  props: {
@@ -13,61 +39,44 @@ const ae = { class: "flex items-center justify-between" }, le = { class: "flex i
13
39
  message: String
14
40
  },
15
41
  setup(e) {
16
- const t = W(), n = I("content-wrap");
42
+ const n = V(), t = Y("content-wrap");
17
43
  return (s, c) => {
18
- const p = d("ElIcon"), l = d("ElTooltip"), o = d("ElCard");
19
- return a(), f(o, {
20
- class: Q([n.value, "mb-[10px]"]),
44
+ const u = d("ElCard");
45
+ return r(), p(u, {
46
+ class: Z([t.value]),
21
47
  shadow: "never"
22
- }, j({
48
+ }, L({
23
49
  default: i(() => [
24
- _(s.$slots, "default", {}, void 0, !0)
50
+ C(s.$slots, "default", {}, void 0, !0)
25
51
  ]),
26
52
  _: 2
27
53
  }, [
28
54
  e.title ? {
29
55
  name: "header",
30
56
  fn: i(() => [
31
- S("div", ae, [
32
- S("div", le, [
33
- S("span", re, $(e.title), 1),
34
- e.message ? (a(), f(l, {
35
- key: 0,
36
- effect: "dark",
37
- placement: "right"
38
- }, {
39
- content: i(() => [
40
- S("div", se, $(e.message), 1)
41
- ]),
42
- default: i(() => [
43
- Y(p, {
44
- size: 14,
45
- class: "ml-5px",
46
- icon: "ep:question-filled"
47
- })
48
- ]),
49
- _: 1
50
- })) : D("", !0)
51
- ]),
52
- t.buttonTip ? (a(), v("div", ce, [
53
- _(s.$slots, "buttonTip", {}, void 0, !0)
54
- ])) : D("", !0)
55
- ]),
56
- t.descTip ? (a(), v("div", ue, [
57
- _(s.$slots, "descTip", {}, void 0, !0)
58
- ])) : D("", !0)
57
+ I("div", de, [
58
+ I("span", null, $(e.title), 1),
59
+ e.message ? (r(), x("span", me, $(e.message), 1)) : E("", !0)
60
+ ])
59
61
  ]),
60
62
  key: "0"
63
+ } : void 0,
64
+ n.footer ? {
65
+ name: "footer",
66
+ fn: i(() => [
67
+ C(s.$slots, "footer", {}, void 0, !0)
68
+ ]),
69
+ key: "1"
61
70
  } : void 0
62
71
  ]), 1032, ["class"]);
63
72
  };
64
73
  }
65
- }), P = (e, t) => {
66
- const n = e.__vccOpts || e;
67
- for (const [s, c] of t)
68
- n[s] = c;
69
- return n;
70
- }, de = /* @__PURE__ */ P(ie, [["__scopeId", "data-v-6e7d743c"]]), me = { class: "dialog-header" }, pe = /* @__PURE__ */ H({
74
+ }), F = (e, n) => {
75
+ const t = e.__vccOpts || e;
76
+ for (const [s, c] of n)
77
+ t[s] = c;
78
+ return t;
79
+ }, fe = /* @__PURE__ */ F(pe, [["__scopeId", "data-v-fdaaba5e"]]), ge = { class: "dialog-header" }, he = /* @__PURE__ */ M({
71
80
  name: "Dialog",
72
81
  __name: "index",
73
82
  props: {
@@ -85,7 +94,7 @@ const ae = { class: "flex items-center justify-between" }, le = { class: "flex i
85
94
  },
86
95
  width: {
87
96
  type: String,
88
- default: "50%"
97
+ default: "61.8%"
89
98
  },
90
99
  maxHeight: {
91
100
  type: [String, Number],
@@ -93,64 +102,65 @@ const ae = { class: "flex items-center justify-between" }, le = { class: "flex i
93
102
  }
94
103
  },
95
104
  setup(e) {
96
- const t = W(), n = e, s = I(n.fullscreen), c = () => {
97
- s.value = !A(s);
98
- }, p = I(n.maxHeight);
99
- X(
105
+ const n = V(), t = e, s = Y(t.fullscreen), c = () => {
106
+ s.value = !B(s);
107
+ }, u = Y(t.maxHeight);
108
+ ee(
100
109
  () => s.value,
101
110
  async (o) => {
102
- if (await Z(), o) {
103
- const u = document.documentElement.offsetHeight;
104
- p.value = `${u - 55 - 40 - (t.footer ? 63 : 0)}px`;
111
+ if (await te(), o) {
112
+ const a = document.documentElement.offsetHeight;
113
+ u.value = `${a - 55 - 40 - (n.footer ? 63 : 0)}px`;
105
114
  } else
106
- p.value = n.maxHeight;
115
+ u.value = t.maxHeight;
107
116
  },
108
117
  {
109
118
  immediate: !0
110
119
  }
111
120
  );
112
- const l = F(() => {
113
- if (n.maxHeight)
121
+ const g = O(() => {
122
+ if (t.maxHeight)
114
123
  return {
115
- height: A(p)
124
+ height: B(u)
116
125
  };
117
126
  });
118
- return (o, u) => {
119
- const h = d("FullScreen"), k = d("el-icon"), g = d("ElScrollbar"), m = d("ElDialog");
120
- return a(), f(m, T(o.$attrs, {
127
+ return (o, a) => {
128
+ const f = d("FullScreen"), k = d("el-icon"), _ = d("ElScrollbar"), h = d("ElDialog");
129
+ return r(), p(h, P({
121
130
  "close-on-click-modal": !1,
122
- fullscreen: s.value,
123
- width: e.width,
124
131
  "destroy-on-close": "",
125
132
  draggable: "",
126
133
  "lock-scroll": "",
127
134
  class: "custom-dialog",
128
135
  "append-to-body": ""
129
- }), j({
136
+ }, o.$attrs, {
137
+ fullscreen: s.value,
138
+ width: e.width
139
+ }), L({
130
140
  default: i(() => [
131
- e.scroll ? (a(), f(g, {
141
+ e.scroll ? (r(), p(_, {
132
142
  key: 0,
133
- style: L(l.value)
143
+ style: U(g.value)
134
144
  }, {
135
145
  default: i(() => [
136
- _(o.$slots, "default")
146
+ C(o.$slots, "default")
137
147
  ]),
138
148
  _: 3
139
- }, 8, ["style"])) : _(o.$slots, "default", { key: 1 })
149
+ }, 8, ["style"])) : C(o.$slots, "default", { key: 1 })
140
150
  ]),
141
151
  _: 2
142
152
  }, [
143
153
  e.title ? {
144
154
  name: "header",
145
155
  fn: i(() => [
146
- S("div", me, [
147
- _(o.$slots, "title", {}, () => [
148
- U($(e.title), 1)
156
+ I("div", ge, [
157
+ C(o.$slots, "title", {}, () => [
158
+ j($(e.title), 1)
149
159
  ]),
150
- S("div", { onClick: c }, [
151
- Y(k, { class: "fullScreen" }, {
160
+ I("div", { onClick: c }, [
161
+ N(k, { class: "fullScreen" }, {
152
162
  default: i(() => [
153
- Y(h)
163
+ N(f)
154
164
  ]),
155
165
  _: 1
156
166
  })
@@ -159,34 +169,37 @@ const ae = { class: "flex items-center justify-between" }, le = { class: "flex i
159
169
  ]),
160
170
  key: "0"
161
171
  } : void 0,
162
- t.footer ? {
172
+ n.footer ? {
163
173
  name: "footer",
164
174
  fn: i(() => [
165
- _(o.$slots, "footer")
175
+ C(o.$slots, "footer")
166
176
  ]),
167
177
  key: "1"
168
178
  } : void 0
169
179
  ]), 1040, ["fullscreen", "width"]);
170
180
  };
171
181
  }
172
- }), fe = { key: 1 }, ge = (e) => {
173
- let t = e.label;
174
- return e.label && typeof e.label == "function" && (t = e.label()), e.type.indexOf("select") > -1 || e.type.indexOf("cascader") > -1 || e.type.indexOf("date") > -1 ? `请选择${t}` : `请输入${t}`;
175
- }, R = {
182
+ }), ye = { key: 1 }, be = (e) => {
183
+ let n = e.label;
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
+ return `请选择${n}`;
186
+ if (e.type.indexOf("text") > -1 || e.type.indexOf("number") > -1)
187
+ return `请输入${n}`;
188
+ }, T = {
176
189
  valueFormat: "YYYY-MM-DD HH:mm:ss",
177
190
  format: "YYYY-MM-DD HH:mm:ss"
178
- }, he = (e) => {
179
- const { options: t } = e;
191
+ }, ve = (e) => {
192
+ const { options: n } = e;
180
193
  return {
181
- default: () => t?.map((n) => N(d("el-option"), {
182
- label: n.label,
183
- value: n.value,
184
- key: n.value
194
+ default: () => n?.map((t) => z(d("el-option"), {
195
+ label: t.label,
196
+ value: t.value,
197
+ key: t.value
185
198
  }))
186
199
  };
187
- }, O = {
200
+ }, A = {
188
201
  clearable: !0
189
- }, ye = [
202
+ }, ke = [
190
203
  {
191
204
  type: "slider",
192
205
  component: "el-slider"
@@ -195,14 +208,14 @@ const ae = { class: "flex items-center justify-between" }, le = { class: "flex i
195
208
  type: "text",
196
209
  component: "el-input",
197
210
  attrs: {
198
- ...O
211
+ ...A
199
212
  }
200
213
  },
201
214
  {
202
215
  type: "textarea",
203
216
  component: "el-input",
204
217
  attrs: {
205
- ...O
218
+ ...A
206
219
  }
207
220
  },
208
221
  {
@@ -220,15 +233,15 @@ const ae = { class: "flex items-center justify-between" }, le = { class: "flex i
220
233
  type: "checkbox",
221
234
  component: "el-checkbox-group",
222
235
  slots: (e) => {
223
- const { options: t } = e;
236
+ const { options: n } = e;
224
237
  return {
225
- default: () => t?.map((n) => N(
238
+ default: () => n?.map((t) => z(
226
239
  d("el-checkbox"),
227
240
  {
228
- value: n.value
241
+ value: t.value
229
242
  },
230
243
  {
231
- default: () => n.label
244
+ default: () => t.label
232
245
  }
233
246
  ))
234
247
  };
@@ -238,15 +251,15 @@ const ae = { class: "flex items-center justify-between" }, le = { class: "flex i
238
251
  type: "radio",
239
252
  component: "el-radio-group",
240
253
  slots: (e) => {
241
- const { options: t } = e;
254
+ const { options: n } = e;
242
255
  return {
243
- default: () => t?.map((n) => N(
256
+ default: () => n?.map((t) => z(
244
257
  d("el-radio"),
245
258
  {
246
- value: n.value
259
+ value: t.value
247
260
  },
248
261
  {
249
- default: () => n.label
262
+ default: () => t.label
250
263
  }
251
264
  ))
252
265
  };
@@ -255,7 +268,7 @@ const ae = { class: "flex items-center justify-between" }, le = { class: "flex i
255
268
  {
256
269
  type: "select",
257
270
  component: "el-select",
258
- slots: he
271
+ slots: ve
259
272
  },
260
273
  {
261
274
  type: "select-v2",
@@ -265,7 +278,7 @@ const ae = { class: "flex items-center justify-between" }, le = { class: "flex i
265
278
  type: "tree-select",
266
279
  component: "el-tree-select",
267
280
  attrs: {
268
- ...O,
281
+ ...A,
269
282
  checkStrictly: !0,
270
283
  //是否严格的遵循父子不互相关联的做法,默认为 false
271
284
  renderAfterExpand: !0
@@ -286,7 +299,7 @@ const ae = { class: "flex items-center justify-between" }, le = { class: "flex i
286
299
  component: "el-date-picker",
287
300
  attrs: {
288
301
  showConfirm: !1,
289
- ...R
302
+ ...T
290
303
  }
291
304
  },
292
305
  {
@@ -308,14 +321,14 @@ const ae = { class: "flex items-center justify-between" }, le = { class: "flex i
308
321
  }
309
322
  },
310
323
  {
311
- type: "datetimerange,daterange,,monthrange,yearrange",
324
+ type: "datetimerange,daterange,monthrange,yearrange",
312
325
  component: "el-date-picker",
313
326
  attrs: {
314
327
  showConfirm: !1,
315
328
  rangeSeparator: "至",
316
329
  startPlaceholder: "开始日期",
317
330
  endPlaceholder: "结束日期",
318
- ...R
331
+ ...T
319
332
  }
320
333
  },
321
334
  {
@@ -333,19 +346,19 @@ const ae = { class: "flex items-center justify-between" }, le = { class: "flex i
333
346
  type: "custom",
334
347
  component: "el-form-item"
335
348
  }
336
- ], be = /* @__PURE__ */ H({
349
+ ], _e = /* @__PURE__ */ M({
337
350
  name: "EasyForm",
338
351
  __name: "index",
339
- props: {
352
+ props: /* @__PURE__ */ ne({
340
353
  inline: {
341
354
  type: Boolean,
342
355
  default: !0
343
356
  },
344
- // 表单数据对象
345
- formData: {
346
- type: Object,
347
- required: !0
348
- },
357
+ // // 表单数据对象
358
+ // formData: {
359
+ // type: Object as PropType<Record<string, any>>,
360
+ // required: true,
361
+ // },
349
362
  // 表单项配置数组
350
363
  formItems: {
351
364
  type: Array,
@@ -361,96 +374,108 @@ const ae = { class: "flex items-center justify-between" }, le = { class: "flex i
361
374
  type: [String],
362
375
  default: "200px"
363
376
  }
364
- },
377
+ }, {
378
+ modelValue: {
379
+ default: {},
380
+ type: Object
381
+ },
382
+ modelModifiers: {}
383
+ }),
384
+ emits: ["update:modelValue"],
365
385
  setup(e) {
366
- const t = q(), n = (l) => {
367
- s(l, "formRef");
368
- }, s = (l, o) => {
369
- if (!l) {
370
- delete t?.exposeProxy?.[o], delete t?.exposed?.[o];
386
+ const n = oe(e, "modelValue"), t = K(), s = (o) => {
387
+ c(o, "formRef");
388
+ }, c = (o, a) => {
389
+ if (!o) {
390
+ delete t?.exposeProxy?.[a], delete t?.exposed?.[a];
371
391
  return;
372
392
  }
373
393
  t.exposeProxy = {
374
394
  ...t?.exposed,
375
- [o]: l
395
+ [a]: o
376
396
  }, t.exposed = {
377
397
  ...t?.exposed,
378
- [o]: l
398
+ [a]: o
379
399
  };
380
- }, c = W(), p = (l, o, u) => {
381
- const { value: h, component: k, ...g } = o, m = ye.find((b) => b.type.indexOf(l) > -1), C = m?.component === "el-select" && o.props, y = o.options && !C ? m?.slots?.(o) : {};
382
- if (!m && !o.component)
383
- return new Error(`未找到type为${l}的组件且当前也未传递component`);
384
- const r = E(m?.component || k);
385
- if (r)
386
- return N(
387
- r,
400
+ }, u = V(), g = (o, a, f) => {
401
+ const { value: k, component: _, ...h } = a, m = ke.find(
402
+ (b) => !!o && b.type.indexOf(o) > -1
403
+ ), w = m?.component === "el-select" && a.props, y = a.options && !w ? m?.slots?.(a) : {};
404
+ if (!m && !a.component)
405
+ return new Error(`未找到type为${o}的组件且当前也未传递component`);
406
+ const l = H(m?.component || _);
407
+ if (l)
408
+ return z(
409
+ l,
388
410
  {
389
411
  ...m?.attrs,
390
412
  // 这里的ref还是从配置注入吧。不是每次都要用到ref
391
413
  // ref: (el: any) => {
392
414
  // setRefs(el, formItem.prop)
393
415
  // },
394
- ...g,
416
+ ...h,
395
417
  //外部传入的 优先级最高
396
- placeholder: g.placeholder || ge(o)
418
+ placeholder: h.placeholder || be(a)
397
419
  },
398
- { ...y, ...u }
420
+ { ...y, ...f }
399
421
  );
400
422
  };
401
- return (l, o) => {
402
- const u = d("el-form-item"), h = d("el-form");
403
- return a(), f(h, T({
404
- model: e.formData,
423
+ return (o, a) => {
424
+ const f = d("el-form-item"), k = d("el-form");
425
+ return r(), p(k, P({
426
+ model: n.value,
405
427
  "label-width": e.labelWidth,
406
428
  inline: e.inline,
407
429
  "scroll-to-error": !0
408
- }, { ...l.$attrs }, {
409
- ref: n,
430
+ }, { ...o.$attrs }, {
431
+ ref: s,
410
432
  class: "easy-form"
411
433
  }), {
412
434
  default: i(() => [
413
- (a(!0), v(M, null, z(e.formItems, ({ id: k, type: g, rule: m, width: C, slots: y, ...r }) => (a(), v(M, null, [
414
- g != "custom" && !r.hidden ? (a(), f(u, T({
415
- key: 0,
416
- ref_for: !0
417
- }, { ...r }), {
435
+ (r(!0), x(D, null, W(e.formItems, ({ id: _, type: h, rule: m, width: w, slots: y, ...l }, b) => (r(), x(D, null, [
436
+ h != "custom" && !l.hidden ? (r(), p(f, {
437
+ prop: l.prop,
438
+ key: b,
439
+ "label-width": l.labelWidth,
440
+ rules: m,
441
+ required: l.required
442
+ }, {
418
443
  label: i(() => [
419
- r.label && typeof r.label == "function" ? (a(), f(E(r.label), { key: 0 })) : (a(), v("span", fe, $(r.label), 1))
444
+ l.label && typeof l.label == "function" ? (r(), p(H(l.label), { key: 0 })) : (r(), x("span", ye, $(l.label), 1))
420
445
  ]),
421
446
  default: i(() => [
422
- c[r.prop] ? _(l.$slots, r.prop, {
447
+ u[l.prop] ? C(o.$slots, l.prop, {
423
448
  key: 0,
424
- item: r
425
- }, void 0, !0) : (a(), f(E(p(g, { ...r, type: g }, y)), {
449
+ item: l
450
+ }, void 0, !0) : (r(), p(H(g(h, { ...l, type: h }, y)), {
426
451
  key: 1,
427
- modelValue: e.formData[r.prop],
428
- "onUpdate:modelValue": (b) => e.formData[r.prop] = b,
452
+ modelValue: n.value[l.prop],
453
+ "onUpdate:modelValue": (v) => n.value[l.prop] = v,
429
454
  modelModifiers: { trim: !0 },
430
- style: L({ width: C || e.itemWidth })
455
+ style: U({ width: w || e.itemWidth })
431
456
  }, null, 8, ["modelValue", "onUpdate:modelValue", "style"]))
432
457
  ]),
433
458
  _: 2
434
- }, 1040)) : D("", !0),
435
- g == "custom" ? (a(), v(M, { key: 1 }, [
436
- y?.[r.prop] ? (a(), f(E(y[r.prop]), { key: 0 })) : _(l.$slots, r.prop, {
459
+ }, 1032, ["prop", "label-width", "rules", "required"])) : E("", !0),
460
+ h == "custom" ? (r(), x(D, { key: 1 }, [
461
+ y?.[l.prop] ? (r(), p(H(y[l.prop]), { key: 0 })) : C(o.$slots, l.prop, {
437
462
  key: 1,
438
- item: { width: C, rule: m, ...r }
463
+ item: { width: w, rule: m, ...l }
439
464
  }, void 0, !0)
440
- ], 64)) : D("", !0)
465
+ ], 64)) : E("", !0)
441
466
  ], 64))), 256)),
442
- c.append ? (a(), f(u, { key: 0 }, {
467
+ u.append ? (r(), p(f, { key: 0 }, {
443
468
  default: i(() => [
444
- _(l.$slots, "append", {}, void 0, !0)
469
+ C(o.$slots, "append", {}, void 0, !0)
445
470
  ]),
446
471
  _: 3
447
- })) : D("", !0)
472
+ })) : E("", !0)
448
473
  ]),
449
474
  _: 3
450
475
  }, 16, ["model", "label-width", "inline"]);
451
476
  };
452
477
  }
453
- }), ve = /* @__PURE__ */ P(be, [["__scopeId", "data-v-eb8139e8"]]), ke = /* @__PURE__ */ H({
478
+ }), xe = /* @__PURE__ */ F(_e, [["__scopeId", "data-v-ebcd5674"]]), Ce = /* @__PURE__ */ M({
454
479
  name: "EasyTable",
455
480
  __name: "index",
456
481
  props: {
@@ -489,104 +514,105 @@ const ae = { class: "flex items-center justify-between" }, le = { class: "flex i
489
514
  }
490
515
  },
491
516
  setup(e) {
492
- const t = e, n = F(() => t.buttonWidth.toString().indexOf("px") > -1 ? t.buttonWidth.toString().slice(0, -2) : t.buttonWidth), s = I(), c = I("auto");
493
- let p = q();
494
- const l = () => {
517
+ const n = ae(ce), t = e, s = O(() => t.buttonWidth.toString().indexOf("px") > -1 ? t.buttonWidth.toString().slice(0, -2) : t.buttonWidth), c = Y(), u = Y("auto");
518
+ let g = K();
519
+ const o = () => {
495
520
  let m = "auto";
496
- if (p?.parent?.attrs?.class?.indexOf("content-wrap") > -1) {
497
- const r = t.footerHeight;
521
+ if (g?.parent?.attrs?.class?.indexOf("content-wrap") > -1) {
522
+ let l = t.footerHeight;
523
+ n?.value?.size === "small" ? l = l - 8 : n?.value?.size === "large" && (l = l + 8);
498
524
  try {
499
- const b = p?.refs.tableRef, { top: x } = b?.getBoundingClientRect();
500
- m = document.documentElement.clientHeight - x - r - 20;
525
+ const b = g?.refs.tableRef, { top: v } = b?.getBoundingClientRect();
526
+ m = document.documentElement.clientHeight - v - l - 20;
501
527
  } catch {
502
528
  }
503
529
  return m;
504
530
  }
505
531
  return m;
506
- }, o = I(), u = () => {
507
- o.value && clearTimeout(o.value), o.value = setTimeout(() => {
508
- c.value = l(), o.value = null;
532
+ }, a = Y(), f = () => {
533
+ a.value && clearTimeout(a.value), a.value = setTimeout(() => {
534
+ u.value = o(), a.value = null;
509
535
  }, 100);
510
536
  };
511
- ee(() => {
512
- c.value = l(), window.addEventListener("resize", u);
513
- }), te(() => {
514
- window.removeEventListener("resize", u);
537
+ le(() => {
538
+ u.value = o(), window.addEventListener("resize", f);
539
+ }), re(() => {
540
+ window.removeEventListener("resize", f);
515
541
  });
516
- const h = d("el-table-column"), k = W(), g = (m) => {
517
- const { slots: C = {}, children: y = [], ...r } = m;
542
+ const k = d("el-table-column"), _ = V(), h = (m) => {
543
+ const { slots: w = {}, children: y = [], ...l } = m;
518
544
  if (y && y.length > 0) {
519
- const b = y.map((x) => g(x));
520
- return N(
521
- h,
545
+ const b = y.map((v) => h(v));
546
+ return z(
547
+ k,
522
548
  {
523
549
  align: t.align,
524
- ...r
550
+ ...l
525
551
  },
526
552
  // default 插槽默认使用 childrenNode 不能被slots 覆盖
527
- { ...C, default: () => b }
553
+ { ...w, default: () => b }
528
554
  );
529
555
  }
530
- return N(
531
- h,
556
+ return z(
557
+ k,
532
558
  {
533
559
  align: t.align,
534
- ...r
560
+ ...l
535
561
  },
536
562
  // 最里层的表格列 default 插槽 slots传递的优先级最高 模版直接传递的可被 slots 覆盖
537
563
  {
538
- default: (b) => k[m.prop] && k[m.prop](b),
539
- ...C
564
+ default: (b) => _[m.prop] && _[m.prop](b),
565
+ ...w
540
566
  }
541
567
  );
542
568
  };
543
- return (m, C) => {
544
- const y = d("el-button"), r = d("el-table-column"), b = d("el-table");
545
- return a(), v("div", {
569
+ return (m, w) => {
570
+ const y = d("el-button"), l = d("el-table-column"), b = d("el-table");
571
+ return r(), x("div", {
546
572
  ref_key: "tableRef",
547
- ref: s
573
+ ref: c
548
574
  }, [
549
- Y(b, T({ style: { width: "100%" } }, m.$attrs, {
575
+ N(b, P({ style: { width: "100%" } }, m.$attrs, {
550
576
  data: e.data,
551
577
  height: e.height,
552
- maxHeight: e.maxHeight ? e.maxHeight : c.value
578
+ maxHeight: e.maxHeight ? e.maxHeight : u.value
553
579
  }), {
554
580
  default: i(() => [
555
- (a(!0), v(M, null, z(e.tableColumns, (x, w) => (a(), f(E(g(x)), { key: w }))), 128)),
556
- e.buttons && e.buttons.length ? (a(), f(r, {
581
+ (r(!0), x(D, null, W(e.tableColumns, (v, S) => (r(), p(H(h(v)), { key: S }))), 128)),
582
+ e.buttons && e.buttons.length ? (r(), p(l, {
557
583
  key: 0,
558
584
  align: "center",
559
585
  fixed: "right",
560
586
  label: "操作",
561
- width: n.value
587
+ width: s.value
562
588
  }, {
563
- default: i((x) => [
564
- (a(!0), v(M, null, z(e.buttons, (w, K) => G((a(), f(y, T({ ref_for: !0 }, { ...w }, {
565
- key: K,
566
- type: w.type.includes("del") ? "danger" : "primary",
589
+ default: i((v) => [
590
+ (r(!0), x(D, null, W(e.buttons, (S, Q) => G((r(), p(y, P({ ref_for: !0 }, { ...S }, {
591
+ key: Q,
592
+ type: S.type.includes("del") ? "danger" : "primary",
567
593
  onClick: () => {
568
- w.click?.(x.row);
594
+ S.click?.(v.row);
569
595
  },
570
- disabled: w.disabled?.(x.row) || !1,
571
- link: w.link?.(x.row) || !0
596
+ disabled: S.disabled?.(v.row) || !1,
597
+ link: S.link?.(v.row) || !0
572
598
  }), {
573
599
  default: i(() => [
574
- U($(w.label), 1)
600
+ j($(S.label), 1)
575
601
  ]),
576
602
  _: 2
577
603
  }, 1040, ["type", "onClick", "disabled", "link"])), [
578
- [J, w.show?.(x.row) || !0]
604
+ [J, S.show?.(v.row) || !0]
579
605
  ])), 128))
580
606
  ]),
581
607
  _: 1
582
- }, 8, ["width"])) : D("", !0)
608
+ }, 8, ["width"])) : E("", !0)
583
609
  ]),
584
610
  _: 1
585
611
  }, 16, ["data", "height", "maxHeight"])
586
612
  ], 512);
587
613
  };
588
614
  }
589
- }), xe = /* @__PURE__ */ P(ke, [["__scopeId", "data-v-6bcfc120"]]), _e = {
615
+ }), we = /* @__PURE__ */ F(Ce, [["__scopeId", "data-v-1c87357b"]]), Se = {
590
616
  name: "",
591
617
  components: {},
592
618
  props: {
@@ -596,13 +622,13 @@ const ae = { class: "flex items-center justify-between" }, le = { class: "flex i
596
622
  }
597
623
  }
598
624
  };
599
- function Ce(e, t, n, s, c, p) {
600
- return n.icon ? (a(), f(E(n.icon), {
625
+ function Me(e, n, t, s, c, u) {
626
+ return t.icon ? (r(), p(H(t.icon), {
601
627
  key: 0,
602
628
  class: "menu_icon"
603
- })) : D("", !0);
629
+ })) : E("", !0);
604
630
  }
605
- const V = /* @__PURE__ */ P(_e, [["render", Ce], ["__scopeId", "data-v-261ce99a"]]), we = /* @__PURE__ */ H({
631
+ const R = /* @__PURE__ */ F(Se, [["render", Me], ["__scopeId", "data-v-261ce99a"]]), Ye = /* @__PURE__ */ M({
606
632
  name: "subMenu",
607
633
  __name: "subMenu",
608
634
  props: {
@@ -612,43 +638,43 @@ const V = /* @__PURE__ */ P(_e, [["render", Ce], ["__scopeId", "data-v-261ce99a"
612
638
  }
613
639
  },
614
640
  emits: ["handleMenuItemClick"],
615
- setup(e, { emit: t }) {
616
- const n = t;
641
+ setup(e, { emit: n }) {
642
+ const t = n;
617
643
  function s(c) {
618
- n("handleMenuItemClick", c);
644
+ t("handleMenuItemClick", c);
619
645
  }
620
- return (c, p) => {
621
- const l = d("subMenu", !0), o = d("el-sub-menu"), u = d("el-menu-item");
622
- return e.routeData.children && e.routeData.children.length > 0 ? (a(), f(o, {
646
+ return (c, u) => {
647
+ const g = d("subMenu", !0), o = d("el-sub-menu"), a = d("el-menu-item");
648
+ return e.routeData.children && e.routeData.children.length > 0 ? (r(), p(o, {
623
649
  key: 0,
624
650
  index: e.routeData.path
625
651
  }, {
626
652
  title: i(() => [
627
- Y(V, {
653
+ N(R, {
628
654
  icon: e.routeData.meta.icon
629
655
  }, null, 8, ["icon"]),
630
- S("span", null, $(e.routeData.meta.title), 1)
656
+ I("span", null, $(e.routeData.meta.title), 1)
631
657
  ]),
632
658
  default: i(() => [
633
- (a(!0), v(M, null, z(e.routeData.children, (h, k) => (a(), f(l, {
659
+ (r(!0), x(D, null, W(e.routeData.children, (f, k) => (r(), p(g, {
634
660
  onHandleMenuItemClick: s,
635
- routeData: h,
661
+ routeData: f,
636
662
  key: k
637
663
  }, null, 8, ["routeData"]))), 128))
638
664
  ]),
639
665
  _: 1
640
- }, 8, ["index"])) : (a(), v("div", {
666
+ }, 8, ["index"])) : (r(), x("div", {
641
667
  key: 1,
642
- onClick: p[0] || (p[0] = (h) => s(e.routeData))
668
+ onClick: u[0] || (u[0] = (f) => s(e.routeData))
643
669
  }, [
644
- Y(u, {
670
+ N(a, {
645
671
  index: e.routeData.path
646
672
  }, {
647
673
  title: i(() => [
648
- S("span", null, $(e.routeData.meta.title), 1)
674
+ I("span", null, $(e.routeData.meta.title), 1)
649
675
  ]),
650
676
  default: i(() => [
651
- Y(V, {
677
+ N(R, {
652
678
  icon: e.routeData.meta.icon
653
679
  }, null, 8, ["icon"])
654
680
  ]),
@@ -657,7 +683,7 @@ const V = /* @__PURE__ */ P(_e, [["render", Ce], ["__scopeId", "data-v-261ce99a"
657
683
  ]));
658
684
  };
659
685
  }
660
- }), Se = /* @__PURE__ */ H({
686
+ }), De = /* @__PURE__ */ M({
661
687
  name: "MenuTree",
662
688
  __name: "index",
663
689
  props: {
@@ -667,15 +693,15 @@ const V = /* @__PURE__ */ P(_e, [["render", Ce], ["__scopeId", "data-v-261ce99a"
667
693
  }
668
694
  },
669
695
  emits: ["handleMenuItemClick"],
670
- setup(e, { emit: t }) {
671
- const n = t, s = (c) => {
672
- n("handleMenuItemClick", c);
696
+ setup(e, { emit: n }) {
697
+ const t = n, s = (c) => {
698
+ t("handleMenuItemClick", c);
673
699
  };
674
- return (c, p) => {
675
- const l = d("el-menu");
676
- return a(), f(l, ne(oe(c.$attrs)), {
700
+ return (c, u) => {
701
+ const g = d("el-menu");
702
+ return r(), p(g, se(ue(c.$attrs)), {
677
703
  default: i(() => [
678
- (a(!0), v(M, null, z(e.menuList, (o) => (a(), f(we, {
704
+ (r(!0), x(D, null, W(e.menuList, (o) => (r(), p(Ye, {
679
705
  routeData: o,
680
706
  onHandleMenuItemClick: s
681
707
  }, null, 8, ["routeData"]))), 256))
@@ -684,7 +710,7 @@ const V = /* @__PURE__ */ P(_e, [["render", Ce], ["__scopeId", "data-v-261ce99a"
684
710
  }, 16);
685
711
  };
686
712
  }
687
- }), De = /* @__PURE__ */ H({
713
+ }), $e = /* @__PURE__ */ M({
688
714
  name: "Pagination",
689
715
  __name: "index",
690
716
  props: {
@@ -712,67 +738,70 @@ const V = /* @__PURE__ */ P(_e, [["render", Ce], ["__scopeId", "data-v-261ce99a"
712
738
  onPagination: { type: Function }
713
739
  },
714
740
  emits: ["update:page", "update:limit", "pagination"],
715
- setup(e, { emit: t }) {
716
- const n = e, s = t, c = F({
741
+ setup(e, { emit: n }) {
742
+ const t = e, s = n, c = O({
717
743
  get() {
718
- return n.page;
744
+ return t.page;
719
745
  },
720
- set(u) {
721
- s("update:page", u);
746
+ set(a) {
747
+ s("update:page", a);
722
748
  }
723
- }), p = F({
749
+ }), u = O({
724
750
  get() {
725
- return n.limit;
751
+ return t.limit;
726
752
  },
727
- set(u) {
728
- s("update:limit", u);
753
+ set(a) {
754
+ s("update:limit", a);
729
755
  }
730
- }), l = (u) => {
731
- c.value * u > n.total && (c.value = 1), s("pagination", { page: c.value, limit: u });
732
- }, o = (u) => {
733
- s("pagination", { page: u, limit: p.value });
756
+ }), g = (a) => {
757
+ c.value * a > t.total && (c.value = 1), s("pagination", { page: c.value, limit: a });
758
+ }, o = (a) => {
759
+ s("pagination", { page: a, limit: u.value });
734
760
  };
735
- return (u, h) => {
761
+ return (a, f) => {
736
762
  const k = d("el-pagination");
737
- return G((a(), f(k, {
763
+ return G((r(), p(k, {
738
764
  "current-page": c.value,
739
- "onUpdate:currentPage": h[0] || (h[0] = (g) => c.value = g),
740
- "page-size": p.value,
741
- "onUpdate:pageSize": h[1] || (h[1] = (g) => p.value = g),
765
+ "onUpdate:currentPage": f[0] || (f[0] = (_) => c.value = _),
766
+ "page-size": u.value,
767
+ "onUpdate:pageSize": f[1] || (f[1] = (_) => u.value = _),
742
768
  background: !0,
743
769
  "page-sizes": [10, 20, 30, 50, 100],
744
770
  "pager-count": e.pagerCount,
745
771
  total: e.total,
746
772
  class: "pagination",
747
773
  layout: "total, sizes, prev, pager, next, jumper",
748
- onSizeChange: l,
774
+ onSizeChange: g,
749
775
  onCurrentChange: o
750
776
  }, null, 8, ["current-page", "page-size", "pager-count", "total"])), [
751
777
  [J, e.total > 0]
752
778
  ]);
753
779
  };
754
780
  }
755
- }), Ye = /* @__PURE__ */ P(De, [["__scopeId", "data-v-1e34e383"]]), Me = [
756
- de,
757
- pe,
758
- ve,
759
- // EasyFormH,
781
+ }), He = /* @__PURE__ */ F($e, [["__scopeId", "data-v-1e34e383"]]), Ee = [
782
+ ie,
783
+ fe,
784
+ he,
760
785
  xe,
761
- Se,
762
- Ye
763
- ], B = [], $e = (e, t) => {
764
- Me.forEach((n) => {
765
- B.push(n.name), e.component(n.name, n);
766
- }), console.log("mwl-components", B);
767
- }, Ee = { install: $e };
786
+ // EasyFormH,
787
+ we,
788
+ De,
789
+ He
790
+ ], q = [], Ne = (e, n) => {
791
+ Ee.forEach((t) => {
792
+ q.push(t.name), e.component(t.name, t);
793
+ }), console.log("mwl-components", q);
794
+ }, Pe = { install: Ne };
768
795
  export {
769
- de as ContentWarp,
770
- pe as Dialog,
771
- ve as EasyForm,
772
- xe as EasyTable,
773
- Se as MenuTree,
774
- Ye as Pagination,
775
- ye as componentsMap,
776
- Ee as default,
777
- $e as install
796
+ fe as ContentWarp,
797
+ he as Dialog,
798
+ ie as EasyButton,
799
+ xe as EasyForm,
800
+ we as EasyTable,
801
+ De as MenuTree,
802
+ He as Pagination,
803
+ ke as componentsMap,
804
+ Pe as default,
805
+ be as getPlaceholder,
806
+ Ne as install
778
807
  };