mwl-components 0.1.0 → 0.1.2

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