mwl-components 0.1.0 → 0.1.1

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