mwl-components 0.0.4 → 0.0.7

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.
@@ -0,0 +1,14 @@
1
+ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropTypes<{
2
+ icon: {
3
+ type: StringConstructor;
4
+ default: string;
5
+ };
6
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
7
+ icon: {
8
+ type: StringConstructor;
9
+ default: string;
10
+ };
11
+ }>> & Readonly<{}>, {
12
+ icon: string;
13
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
14
+ export default _default;
@@ -0,0 +1,18 @@
1
+ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropTypes<{
2
+ routeData: {
3
+ type: ObjectConstructor;
4
+ default: () => {};
5
+ };
6
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
+ handleMenuItemClick: (...args: any[]) => void;
8
+ }, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
9
+ routeData: {
10
+ type: ObjectConstructor;
11
+ default: () => {};
12
+ };
13
+ }>> & Readonly<{
14
+ onHandleMenuItemClick?: ((...args: any[]) => any) | undefined;
15
+ }>, {
16
+ routeData: Record<string, any>;
17
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
18
+ export default _default;
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
- import { defineComponent as S, useSlots as T, resolveComponent as r, createBlock as o, openBlock as l, normalizeClass as O, unref as H, createSlots as F, withCtx as s, renderSlot as w, createElementVNode as E, createElementBlock as C, createCommentVNode as h, toDisplayString as x, createVNode as R, mergeProps as D, normalizeStyle as A, createTextVNode as W, ref as G, Fragment as _, renderList as V, resolveDirective as J, withDirectives as q, normalizeProps as K, guardReactiveProps as Q, isRef as L, vShow as X } from "vue";
2
- const Z = { class: "flex items-center justify-between" }, ee = { class: "flex items-center" }, te = { class: "text-16px font-700" }, le = { class: "max-w-200px" }, ae = {
1
+ import { defineComponent as H, useSlots as B, resolveComponent as r, createBlock as o, openBlock as a, normalizeClass as G, unref as U, createSlots as N, withCtx as s, renderSlot as k, createElementVNode as $, createElementBlock as v, createCommentVNode as h, toDisplayString as x, createVNode as M, mergeProps as _, normalizeStyle as j, createTextVNode as W, ref as J, Fragment as V, renderList as D, resolveDirective as K, withDirectives as q, resolveDynamicComponent as Q, normalizeProps as X, guardReactiveProps as Z, isRef as A, vShow as ee } from "vue";
2
+ const te = { class: "flex items-center justify-between" }, ae = { class: "flex items-center" }, le = { class: "text-16px font-700" }, ne = { class: "max-w-200px" }, oe = {
3
3
  key: 0,
4
4
  class: "flex justify-end"
5
- }, ne = {
5
+ }, re = {
6
6
  key: 0,
7
7
  class: "mt-8px flex items-center"
8
- }, oe = /* @__PURE__ */ S({
8
+ }, ue = /* @__PURE__ */ H({
9
9
  name: "ContentWarp",
10
10
  __name: "index",
11
11
  props: {
@@ -13,34 +13,34 @@ const Z = { class: "flex items-center justify-between" }, ee = { class: "flex it
13
13
  message: String
14
14
  },
15
15
  setup(t) {
16
- const d = T(), c = ref("content-wrap");
17
- return (i, n) => {
18
- const m = r("ElIcon"), g = r("ElTooltip"), f = r("ElCard");
19
- return l(), o(f, {
20
- class: O([H(c), "mb-[10px]"]),
16
+ const u = B(), d = ref("content-wrap");
17
+ return (c, l) => {
18
+ const i = r("ElIcon"), g = r("ElTooltip"), f = r("ElCard");
19
+ return a(), o(f, {
20
+ class: G([U(d), "mb-[10px]"]),
21
21
  shadow: "never"
22
- }, F({
22
+ }, N({
23
23
  default: s(() => [
24
- w(i.$slots, "default", {}, void 0, !0)
24
+ k(c.$slots, "default", {}, void 0, !0)
25
25
  ]),
26
26
  _: 2
27
27
  }, [
28
28
  t.title ? {
29
29
  name: "header",
30
30
  fn: s(() => [
31
- E("div", Z, [
32
- E("div", ee, [
33
- E("span", te, x(t.title), 1),
34
- t.message ? (l(), o(g, {
31
+ $("div", te, [
32
+ $("div", ae, [
33
+ $("span", le, x(t.title), 1),
34
+ t.message ? (a(), o(g, {
35
35
  key: 0,
36
36
  effect: "dark",
37
37
  placement: "right"
38
38
  }, {
39
39
  content: s(() => [
40
- E("div", le, x(t.message), 1)
40
+ $("div", ne, x(t.message), 1)
41
41
  ]),
42
42
  default: s(() => [
43
- R(m, {
43
+ M(i, {
44
44
  size: 14,
45
45
  class: "ml-5px",
46
46
  icon: "ep:question-filled"
@@ -49,12 +49,12 @@ const Z = { class: "flex items-center justify-between" }, ee = { class: "flex it
49
49
  _: 1
50
50
  })) : h("", !0)
51
51
  ]),
52
- d.buttonTip ? (l(), C("div", ae, [
53
- w(i.$slots, "buttonTip", {}, void 0, !0)
52
+ u.buttonTip ? (a(), v("div", oe, [
53
+ k(c.$slots, "buttonTip", {}, void 0, !0)
54
54
  ])) : h("", !0)
55
55
  ]),
56
- d.descTip ? (l(), C("div", ne, [
57
- w(i.$slots, "descTip", {}, void 0, !0)
56
+ u.descTip ? (a(), v("div", re, [
57
+ k(c.$slots, "descTip", {}, void 0, !0)
58
58
  ])) : h("", !0)
59
59
  ]),
60
60
  key: "0"
@@ -62,12 +62,12 @@ const Z = { class: "flex items-center justify-between" }, ee = { class: "flex it
62
62
  ]), 1032, ["class"]);
63
63
  };
64
64
  }
65
- }), B = (t, d) => {
66
- const c = t.__vccOpts || t;
67
- for (const [i, n] of d)
68
- c[i] = n;
69
- return c;
70
- }, re = /* @__PURE__ */ B(oe, [["__scopeId", "data-v-0870eb8d"]]), ue = { class: "dialog-header" }, de = /* @__PURE__ */ S({
65
+ }), T = (t, u) => {
66
+ const d = t.__vccOpts || t;
67
+ for (const [c, l] of u)
68
+ d[c] = l;
69
+ return d;
70
+ }, de = /* @__PURE__ */ T(ue, [["__scopeId", "data-v-0870eb8d"]]), se = { class: "dialog-header" }, ce = /* @__PURE__ */ H({
71
71
  name: "Dialog",
72
72
  __name: "index",
73
73
  props: {
@@ -93,47 +93,47 @@ const Z = { class: "flex items-center justify-between" }, ee = { class: "flex it
93
93
  }
94
94
  },
95
95
  setup(t) {
96
- const d = T(), c = t, i = ref(!1), n = () => {
97
- i.value = !unref(i);
98
- }, m = ref(c.maxHeight);
96
+ const u = B(), d = t, c = ref(!1), l = () => {
97
+ c.value = !unref(c);
98
+ }, i = ref(d.maxHeight);
99
99
  watch(
100
- () => i.value,
100
+ () => c.value,
101
101
  async (f) => {
102
102
  if (await nextTick(), f) {
103
- const u = document.documentElement.offsetHeight;
104
- m.value = `${u - 55 - 40 - (d.footer ? 63 : 0)}px`;
103
+ const m = document.documentElement.offsetHeight;
104
+ i.value = `${m - 55 - 40 - (u.footer ? 63 : 0)}px`;
105
105
  } else
106
- m.value = c.maxHeight;
106
+ i.value = d.maxHeight;
107
107
  },
108
108
  {
109
109
  immediate: !0
110
110
  }
111
111
  );
112
112
  const g = computed(() => {
113
- if (c.maxHeight)
113
+ if (d.maxHeight)
114
114
  return {
115
- height: unref(m)
115
+ height: unref(i)
116
116
  };
117
117
  });
118
- return console.log(c), (f, u) => {
119
- const b = r("el-button"), y = r("ElScrollbar"), v = r("ElDialog");
120
- return l(), o(v, D(f.$attrs, {
118
+ return console.log(d), (f, m) => {
119
+ const b = r("el-button"), y = r("ElScrollbar"), C = r("ElDialog");
120
+ return a(), o(C, _(f.$attrs, {
121
121
  "close-on-click-modal": !1,
122
- fullscreen: H(i),
122
+ fullscreen: U(c),
123
123
  width: t.width,
124
124
  "destroy-on-close": "",
125
125
  draggable: "",
126
126
  "lock-scroll": "",
127
127
  class: "custom-dialog",
128
128
  "append-to-body": ""
129
- }), F({
129
+ }), N({
130
130
  header: s(() => [
131
- E("div", ue, [
132
- w(f.$slots, "title", {}, () => [
131
+ $("div", se, [
132
+ k(f.$slots, "title", {}, () => [
133
133
  W(x(t.title), 1)
134
134
  ]),
135
- E("div", { onClick: n }, [
136
- R(b, {
135
+ $("div", { onClick: l }, [
136
+ M(b, {
137
137
  link: "",
138
138
  icon: "FullScreen",
139
139
  color: "#909399"
@@ -142,30 +142,30 @@ const Z = { class: "flex items-center justify-between" }, ee = { class: "flex it
142
142
  ])
143
143
  ]),
144
144
  default: s(() => [
145
- t.scroll ? (l(), o(y, {
145
+ t.scroll ? (a(), o(y, {
146
146
  key: 0,
147
- style: A(H(g))
147
+ style: j(U(g))
148
148
  }, {
149
149
  default: s(() => [
150
- w(f.$slots, "default")
150
+ k(f.$slots, "default")
151
151
  ]),
152
152
  _: 3
153
- }, 8, ["style"])) : w(f.$slots, "default", { key: 1 })
153
+ }, 8, ["style"])) : k(f.$slots, "default", { key: 1 })
154
154
  ]),
155
155
  _: 2
156
156
  }, [
157
- d.footer ? {
157
+ u.footer ? {
158
158
  name: "footer",
159
159
  fn: s(() => [
160
- w(f.$slots, "footer")
160
+ k(f.$slots, "footer")
161
161
  ]),
162
162
  key: "0"
163
163
  } : void 0
164
164
  ]), 1040, ["fullscreen", "width"]);
165
165
  };
166
166
  }
167
- }), se = {}, ce = /* @__PURE__ */ S({
168
- ...se,
167
+ }), ie = {}, me = /* @__PURE__ */ H({
168
+ ...ie,
169
169
  name: "EasyForm",
170
170
  __name: "index",
171
171
  props: {
@@ -194,146 +194,146 @@ const Z = { class: "flex items-center justify-between" }, ee = { class: "flex it
194
194
  default: "200px"
195
195
  }
196
196
  },
197
- setup(t, { expose: d }) {
198
- const c = G();
199
- return d({
197
+ setup(t, { expose: u }) {
198
+ const d = J();
199
+ return u({
200
200
  resetFields: () => {
201
- c.value?.resetFields();
201
+ d.value?.resetFields();
202
202
  },
203
203
  getFormData: async () => {
204
- const m = await c.value.validate();
205
- return m || null;
204
+ const i = await d.value.validate();
205
+ return i || null;
206
206
  }
207
- }), (m, g) => {
208
- const f = r("el-input"), u = r("el-input-number"), b = r("el-radio"), y = r("el-radio-group"), v = r("el-checkbox"), $ = r("el-checkbox-group"), N = r("el-option"), U = r("el-select"), M = r("el-cascader"), Y = r("el-switch"), k = r("el-date-picker"), I = r("el-form-item"), P = r("el-form");
209
- return l(), o(P, {
207
+ }), (i, g) => {
208
+ const f = r("el-input"), m = r("el-input-number"), b = r("el-radio"), y = r("el-radio-group"), C = r("el-checkbox"), S = r("el-checkbox-group"), R = r("el-option"), E = r("el-select"), I = r("el-cascader"), Y = r("el-switch"), w = r("el-date-picker"), P = r("el-form-item"), z = r("el-form");
209
+ return a(), o(z, {
210
210
  ref_key: "formRef",
211
- ref: c,
211
+ ref: d,
212
212
  model: t.formData,
213
213
  "label-width": t.labelWidth,
214
214
  inline: t.inline,
215
215
  "scroll-to-error": ""
216
216
  }, {
217
217
  default: s(() => [
218
- (l(!0), C(_, null, V(t.formItems, ({ type: p, ...e }) => (l(), C(_, null, [
219
- p != "custom" && !e.hidden ? (l(), o(I, {
218
+ (a(!0), v(V, null, D(t.formItems, ({ type: p, ...e }) => (a(), v(V, null, [
219
+ p != "custom" && !e.hidden ? (a(), o(P, {
220
220
  key: 0,
221
221
  label: e.label,
222
222
  prop: e.prop,
223
223
  rules: e.rule
224
224
  }, {
225
225
  default: s(() => [
226
- p == "text" || p == "" ? (l(), o(f, D({
226
+ p == "text" || p == "" ? (a(), o(f, _({
227
227
  key: 0,
228
228
  placeholder: "请输入" + e.label
229
229
  }, { ref_for: !0 }, { ...e }, {
230
230
  modelValue: t.formData[e.prop],
231
- "onUpdate:modelValue": (a) => t.formData[e.prop] = a,
231
+ "onUpdate:modelValue": (n) => t.formData[e.prop] = n,
232
232
  "show-word-limit": "",
233
233
  style: { width: e.width ? e.width : t.itemWidth }
234
234
  }), null, 16, ["placeholder", "modelValue", "onUpdate:modelValue", "style"])) : h("", !0),
235
- p == "textarea" ? (l(), o(f, D({
235
+ p == "textarea" ? (a(), o(f, _({
236
236
  key: 1,
237
237
  ref_for: !0
238
238
  }, { ...e }, {
239
239
  modelValue: t.formData[e.prop],
240
- "onUpdate:modelValue": (a) => t.formData[e.prop] = a,
240
+ "onUpdate:modelValue": (n) => t.formData[e.prop] = n,
241
241
  type: "textarea",
242
242
  style: { width: e.width ? e.width : t.itemWidth }
243
243
  }), null, 16, ["modelValue", "onUpdate:modelValue", "style"])) : h("", !0),
244
- p == "number" ? (l(), o(u, D({
244
+ p == "number" ? (a(), o(m, _({
245
245
  key: 2,
246
246
  "controls-position": "right"
247
247
  }, { ref_for: !0 }, { ...e }, {
248
248
  modelValue: t.formData[e.prop],
249
- "onUpdate:modelValue": (a) => t.formData[e.prop] = a,
249
+ "onUpdate:modelValue": (n) => t.formData[e.prop] = n,
250
250
  style: { width: e.width ? e.width : t.itemWidth }
251
251
  }), null, 16, ["modelValue", "onUpdate:modelValue", "style"])) : h("", !0),
252
- p == "radio" ? (l(), o(y, D({
252
+ p == "radio" ? (a(), o(y, _({
253
253
  key: 3,
254
254
  modelValue: t.formData[e.prop],
255
- "onUpdate:modelValue": (a) => t.formData[e.prop] = a,
255
+ "onUpdate:modelValue": (n) => t.formData[e.prop] = n,
256
256
  style: { width: e.width ? e.width : t.itemWidth },
257
- onChange: (a) => e.change && e.change(t.formData[e.prop])
257
+ onChange: (n) => e.change && e.change(t.formData[e.prop])
258
258
  }, { ref_for: !0 }, { ...e }), {
259
259
  default: s(() => [
260
- (l(!0), C(_, null, V(e.options, (a, z) => (l(), o(b, {
261
- key: z,
262
- value: a.value
260
+ (a(!0), v(V, null, D(e.options, (n, F) => (a(), o(b, {
261
+ key: F,
262
+ value: n.value
263
263
  }, {
264
264
  default: s(() => [
265
- W(x(a.label), 1)
265
+ W(x(n.label), 1)
266
266
  ]),
267
267
  _: 2
268
268
  }, 1032, ["value"]))), 128))
269
269
  ]),
270
270
  _: 2
271
271
  }, 1040, ["modelValue", "onUpdate:modelValue", "style", "onChange"])) : h("", !0),
272
- p == "checkbox" ? (l(), o($, D({
272
+ p == "checkbox" ? (a(), o(S, _({
273
273
  key: 4,
274
274
  modelValue: t.formData[e.prop],
275
- "onUpdate:modelValue": (a) => t.formData[e.prop] = a,
275
+ "onUpdate:modelValue": (n) => t.formData[e.prop] = n,
276
276
  style: { width: e.width ? e.width : t.itemWidth },
277
- onChange: (a) => e.change && e.change(t.formData[e.prop])
277
+ onChange: (n) => e.change && e.change(t.formData[e.prop])
278
278
  }, { ref_for: !0 }, { ...e }), {
279
279
  default: s(() => [
280
- (l(!0), C(_, null, V(e.options, (a, z) => (l(), o(v, {
281
- key: z,
282
- value: a.value
280
+ (a(!0), v(V, null, D(e.options, (n, F) => (a(), o(C, {
281
+ key: F,
282
+ value: n.value
283
283
  }, {
284
284
  default: s(() => [
285
- W(x(a.label), 1)
285
+ W(x(n.label), 1)
286
286
  ]),
287
287
  _: 2
288
288
  }, 1032, ["value"]))), 128))
289
289
  ]),
290
290
  _: 2
291
291
  }, 1040, ["modelValue", "onUpdate:modelValue", "style", "onChange"])) : h("", !0),
292
- p == "select" || p == "multipleselect" ? (l(), o(U, D({
292
+ p == "select" || p == "multipleselect" ? (a(), o(E, _({
293
293
  key: 5,
294
294
  modelValue: t.formData[e.prop],
295
- "onUpdate:modelValue": (a) => t.formData[e.prop] = a,
295
+ "onUpdate:modelValue": (n) => t.formData[e.prop] = n,
296
296
  placeholder: "请选择",
297
297
  style: { width: e.width ? e.width : t.itemWidth },
298
- onChange: (a) => e.change && e.change(t.formData[e.prop])
298
+ onChange: (n) => e.change && e.change(t.formData[e.prop])
299
299
  }, { ref_for: !0 }, { ...e }), {
300
300
  default: s(() => [
301
- (l(!0), C(_, null, V(e.options, (a, z) => (l(), o(N, {
302
- key: z,
303
- label: e.defaultProp ? a[e.defaultProp.label] : a.label,
304
- value: e.defaultProp ? a[e.defaultProp.value] : a.value
301
+ (a(!0), v(V, null, D(e.options, (n, F) => (a(), o(R, {
302
+ key: F,
303
+ label: e.defaultProp ? n[e.defaultProp.label] : n.label,
304
+ value: e.defaultProp ? n[e.defaultProp.value] : n.value
305
305
  }, null, 8, ["label", "value"]))), 128))
306
306
  ]),
307
307
  _: 2
308
308
  }, 1040, ["modelValue", "onUpdate:modelValue", "style", "onChange"])) : h("", !0),
309
- p == "cascader" ? (l(), o(M, {
309
+ p == "cascader" ? (a(), o(I, {
310
310
  key: 6,
311
311
  modelValue: t.formData[e.prop],
312
- "onUpdate:modelValue": (a) => t.formData[e.prop] = a,
312
+ "onUpdate:modelValue": (n) => t.formData[e.prop] = n,
313
313
  options: e.options || [],
314
314
  props: e.defaultProp || { label: "label", value: "value" },
315
- style: A({ width: e.width ? e.width : t.itemWidth }),
315
+ style: j({ width: e.width ? e.width : t.itemWidth }),
316
316
  disabled: e.disabled,
317
317
  clearable: e.clearable,
318
318
  placeholder: e.placeholder,
319
319
  "popper-class": e.popperClass,
320
320
  teleported: e.teleported,
321
321
  "disabled-date": e.disabledDate,
322
- onChange: (a) => e.change && e.change(t.formData[e.prop])
322
+ onChange: (n) => e.change && e.change(t.formData[e.prop])
323
323
  }, null, 8, ["modelValue", "onUpdate:modelValue", "options", "props", "style", "disabled", "clearable", "placeholder", "popper-class", "teleported", "disabled-date", "onChange"])) : h("", !0),
324
- p === "switch" ? (l(), o(Y, {
324
+ p === "switch" ? (a(), o(Y, {
325
325
  key: 7,
326
326
  modelValue: t.formData[e.prop],
327
- "onUpdate:modelValue": (a) => t.formData[e.prop] = a,
327
+ "onUpdate:modelValue": (n) => t.formData[e.prop] = n,
328
328
  disabled: e.disabled,
329
- style: A({ width: e.width ? e.width : t.itemWidth }),
330
- onChange: (a) => e.change && e.change(t.formData[e.prop])
329
+ style: j({ width: e.width ? e.width : t.itemWidth }),
330
+ onChange: (n) => e.change && e.change(t.formData[e.prop])
331
331
  }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "style", "onChange"])) : h("", !0),
332
- p == "date" || p == "datetime" || p == "year" || p == "month" ? (l(), o(k, D({
332
+ p == "date" || p == "datetime" || p == "year" || p == "month" ? (a(), o(w, _({
333
333
  key: 8,
334
334
  style: { width: e.width ? e.width : t.itemWidth },
335
335
  modelValue: t.formData[e.prop],
336
- "onUpdate:modelValue": (a) => t.formData[e.prop] = a
336
+ "onUpdate:modelValue": (n) => t.formData[e.prop] = n
337
337
  }, { ref_for: !0 }, { ...e }, {
338
338
  format: e.format || "YYYY-MM-DD HH:mm:ss",
339
339
  "value-format": e.valueFormat || "YYYY-MM-DD HH:mm:ss",
@@ -342,12 +342,12 @@ const Z = { class: "flex items-center justify-between" }, ee = { class: "flex it
342
342
  placeholder: e.placeholder || "请选择",
343
343
  "disabled-date": e.disabledDate,
344
344
  type: p,
345
- onChange: (a) => e.change && e.change(t.formData[e.prop])
345
+ onChange: (n) => e.change && e.change(t.formData[e.prop])
346
346
  }), null, 16, ["style", "modelValue", "onUpdate:modelValue", "format", "value-format", "disabled", "clearable", "placeholder", "disabled-date", "type", "onChange"])) : h("", !0),
347
- p == "daterange" ? (l(), o(k, {
347
+ p == "daterange" ? (a(), o(w, {
348
348
  key: 9,
349
349
  modelValue: t.formData[e.prop],
350
- "onUpdate:modelValue": (a) => t.formData[e.prop] = a,
350
+ "onUpdate:modelValue": (n) => t.formData[e.prop] = n,
351
351
  format: e.format || "YYYY-MM-DD HH:mm:ss",
352
352
  "value-format": e.valueFormat || "YYYY-MM-DD HH:mm:ss",
353
353
  type: p,
@@ -355,19 +355,19 @@ const Z = { class: "flex items-center justify-between" }, ee = { class: "flex it
355
355
  "range-separator": "至",
356
356
  "start-placeholder": "开始日期",
357
357
  "end-placeholder": "结束日期",
358
- onChange: (a) => e.change && e.change(t.formData[e.prop])
358
+ onChange: (n) => e.change && e.change(t.formData[e.prop])
359
359
  }, null, 8, ["modelValue", "onUpdate:modelValue", "format", "value-format", "type", "disabled", "onChange"])) : h("", !0)
360
360
  ]),
361
361
  _: 2
362
362
  }, 1032, ["label", "prop", "rules"])) : h("", !0),
363
- p == "custom" ? w(m.$slots, e.prop, {
363
+ p == "custom" ? k(i.$slots, e.prop, {
364
364
  key: 1,
365
365
  item: e
366
366
  }, void 0, !0) : h("", !0)
367
367
  ], 64))), 256)),
368
- R(I, null, {
368
+ M(P, null, {
369
369
  default: s(() => [
370
- w(m.$slots, "append", {}, void 0, !0)
370
+ k(i.$slots, "append", {}, void 0, !0)
371
371
  ]),
372
372
  _: 3
373
373
  })
@@ -376,46 +376,46 @@ const Z = { class: "flex items-center justify-between" }, ee = { class: "flex it
376
376
  }, 8, ["model", "label-width", "inline"]);
377
377
  };
378
378
  }
379
- }), ie = /* @__PURE__ */ B(ce, [["__scopeId", "data-v-9fb8ae2f"]]), me = /* @__PURE__ */ S({
379
+ }), fe = /* @__PURE__ */ T(me, [["__scopeId", "data-v-9fb8ae2f"]]), pe = /* @__PURE__ */ H({
380
380
  __name: "tableColumnItem",
381
381
  props: {
382
382
  tableColumn: {}
383
383
  },
384
384
  setup(t) {
385
- const d = T(), c = t, i = () => {
386
- const { tableColumn: n } = c;
387
- return n.children?.length || delete n.children, n;
385
+ const u = B(), d = t, c = () => {
386
+ const { tableColumn: l } = d;
387
+ return l.children?.length || delete l.children, l;
388
388
  };
389
- return (n, m) => {
389
+ return (l, i) => {
390
390
  const g = r("el-table-column"), f = r("tableColumnItem", !0);
391
- return !n.tableColumn.children || n.tableColumn.children?.length == 0 ? (l(), o(g, D({ key: 0 }, { ...i() }, {
392
- prop: n.tableColumn.prop,
393
- label: n.tableColumn.label
394
- }), F({ _: 2 }, [
395
- n.tableColumn.prop && d[n.tableColumn.prop] ? {
391
+ return !l.tableColumn.children || l.tableColumn.children?.length == 0 ? (a(), o(g, _({ key: 0 }, { ...c() }, {
392
+ prop: l.tableColumn.prop,
393
+ label: l.tableColumn.label
394
+ }), N({ _: 2 }, [
395
+ l.tableColumn.prop && u[l.tableColumn.prop] ? {
396
396
  name: "default",
397
- fn: s((u) => [
398
- w(n.$slots, n.tableColumn.prop, {
399
- row: u.row
397
+ fn: s((m) => [
398
+ k(l.$slots, l.tableColumn.prop, {
399
+ row: m.row
400
400
  })
401
401
  ]),
402
402
  key: "0"
403
403
  } : void 0
404
- ]), 1040, ["prop", "label"])) : (l(), o(g, {
404
+ ]), 1040, ["prop", "label"])) : (a(), o(g, {
405
405
  key: 1,
406
- align: n.tableColumn.align,
407
- label: n.tableColumn.label
406
+ align: l.tableColumn.align,
407
+ label: l.tableColumn.label
408
408
  }, {
409
409
  default: s(() => [
410
- (l(!0), C(_, null, V(n.tableColumn.children, (u, b) => (l(), o(f, {
410
+ (a(!0), v(V, null, D(l.tableColumn.children, (m, b) => (a(), o(f, {
411
411
  key: b,
412
- "table-column": { align: u.align || n.tableColumn.align, ...u }
413
- }, F({ _: 2 }, [
414
- V(d, (y, v) => ({
415
- name: v,
416
- fn: s(({ row: $ }) => [
417
- w(n.$slots, v, { row: $ }, () => [
418
- W(x($[v]), 1)
412
+ "table-column": { align: m.align || l.tableColumn.align, ...m }
413
+ }, N({ _: 2 }, [
414
+ D(u, (y, C) => ({
415
+ name: C,
416
+ fn: s(({ row: S }) => [
417
+ k(l.$slots, C, { row: S }, () => [
418
+ W(x(S[C]), 1)
419
419
  ])
420
420
  ])
421
421
  }))
@@ -425,7 +425,7 @@ const Z = { class: "flex items-center justify-between" }, ee = { class: "flex it
425
425
  }, 8, ["align", "label"]));
426
426
  };
427
427
  }
428
- }), pe = /* @__PURE__ */ S({
428
+ }), he = /* @__PURE__ */ H({
429
429
  name: "EasyTable",
430
430
  __name: "index",
431
431
  props: {
@@ -460,75 +460,75 @@ const Z = { class: "flex items-center justify-between" }, ee = { class: "flex it
460
460
  }
461
461
  },
462
462
  setup(t) {
463
- const d = t, c = computed(() => (d.buttonWidth.toString().indexOf("px") > -1 ? d.buttonWidth.toString().slice(0, -2) : d.buttonWidth, d.buttonWidth)), i = T(), n = ref(), m = ref("auto");
463
+ const u = t, d = computed(() => (u.buttonWidth.toString().indexOf("px") > -1 ? u.buttonWidth.toString().slice(0, -2) : u.buttonWidth, u.buttonWidth)), c = B(), l = ref(), i = ref("auto");
464
464
  let g = getCurrentInstance();
465
465
  const f = () => {
466
466
  let y = "auto";
467
467
  if (g?.parent?.attrs?.class?.indexOf("content-wrap") > -1) {
468
468
  try {
469
- const U = g?.refs.tableRef, { top: M } = U?.getBoundingClientRect();
470
- y = document.documentElement.clientHeight - M - 65 - 20;
469
+ const E = g?.refs.tableRef, { top: I } = E?.getBoundingClientRect();
470
+ y = document.documentElement.clientHeight - I - 65 - 20;
471
471
  } catch {
472
472
  }
473
473
  return y;
474
474
  }
475
475
  return y;
476
- }, u = ref(), b = () => {
477
- u.value && clearTimeout(u.value), u.value = setTimeout(() => {
478
- m.value = f(), u.value = null;
476
+ }, m = ref(), b = () => {
477
+ m.value && clearTimeout(m.value), m.value = setTimeout(() => {
478
+ i.value = f(), m.value = null;
479
479
  }, 100);
480
480
  };
481
481
  return onMounted(() => {
482
- m.value = f(), window.addEventListener("resize", b);
482
+ i.value = f(), window.addEventListener("resize", b);
483
483
  }), onUnmounted(() => {
484
484
  window.removeEventListener("resize", b);
485
- }), (y, v) => {
486
- const $ = r("el-button"), N = r("el-table-column"), U = r("el-table"), M = J("hasPermi");
487
- return l(), C("div", {
485
+ }), (y, C) => {
486
+ const S = r("el-button"), R = r("el-table-column"), E = r("el-table"), I = K("hasPermi");
487
+ return a(), v("div", {
488
488
  ref_key: "tableRef",
489
- ref: n
489
+ ref: l
490
490
  }, [
491
- R(U, D({ style: { width: "100%" } }, y.$attrs, {
491
+ M(E, _({ style: { width: "100%" } }, y.$attrs, {
492
492
  data: t.data,
493
493
  height: t.height,
494
- maxHeight: t.maxHeight ? t.maxHeight : H(m)
494
+ maxHeight: t.maxHeight ? t.maxHeight : U(i)
495
495
  }), {
496
496
  default: s(() => [
497
- (l(!0), C(_, null, V(t.tableColumns, (Y, k) => (l(), o(me, {
498
- key: k,
497
+ (a(!0), v(V, null, D(t.tableColumns, (Y, w) => (a(), o(pe, {
498
+ key: w,
499
499
  "table-column": { align: t.align, ...Y }
500
- }, F({ _: 2 }, [
501
- V(i, (I, P) => ({
502
- name: P,
500
+ }, N({ _: 2 }, [
501
+ D(c, (P, z) => ({
502
+ name: z,
503
503
  fn: s(({ row: p }) => [
504
- w(y.$slots, P, { row: p }, () => [
505
- W(x(p[P]), 1)
504
+ k(y.$slots, z, { row: p }, () => [
505
+ W(x(p[z]), 1)
506
506
  ], !0)
507
507
  ])
508
508
  }))
509
509
  ]), 1032, ["table-column"]))), 128)),
510
- t.buttons && t.buttons.length ? (l(), o(N, {
510
+ t.buttons && t.buttons.length ? (a(), o(R, {
511
511
  key: 0,
512
512
  align: "center",
513
513
  fixed: "right",
514
514
  label: "操作",
515
- width: H(c)
515
+ width: U(d)
516
516
  }, {
517
517
  default: s((Y) => [
518
- (l(!0), C(_, null, V(t.buttons, (k, I) => q((l(), o($, {
519
- key: I,
520
- type: k.type.includes("del") ? "danger" : "primary",
518
+ (a(!0), v(V, null, D(t.buttons, (w, P) => q((a(), o(S, {
519
+ key: P,
520
+ type: w.type.includes("del") ? "danger" : "primary",
521
521
  onClick: () => {
522
- k.click?.(Y.row);
522
+ w.click?.(Y.row);
523
523
  },
524
524
  link: ""
525
525
  }, {
526
526
  default: s(() => [
527
- W(x(k.label), 1)
527
+ W(x(w.label), 1)
528
528
  ]),
529
529
  _: 2
530
530
  }, 1032, ["type", "onClick"])), [
531
- [M, k.permi ? [k.permi] : [""]]
531
+ [I, w.permi ? [w.permi] : [""]]
532
532
  ])), 128))
533
533
  ]),
534
534
  _: 1
@@ -539,7 +539,78 @@ const Z = { class: "flex items-center justify-between" }, ee = { class: "flex it
539
539
  ], 512);
540
540
  };
541
541
  }
542
- }), fe = /* @__PURE__ */ B(pe, [["__scopeId", "data-v-5ca5027f"]]), he = /* @__PURE__ */ S({
542
+ }), ge = /* @__PURE__ */ T(he, [["__scopeId", "data-v-5ca5027f"]]), be = {
543
+ name: "",
544
+ components: {},
545
+ props: {
546
+ icon: {
547
+ type: String,
548
+ default: ""
549
+ }
550
+ }
551
+ };
552
+ function ye(t, u, d, c, l, i) {
553
+ return d.icon ? (a(), o(Q(d.icon), {
554
+ key: 0,
555
+ class: "menu_icon"
556
+ })) : h("", !0);
557
+ }
558
+ const L = /* @__PURE__ */ T(be, [["render", ye], ["__scopeId", "data-v-261ce99a"]]), ve = /* @__PURE__ */ H({
559
+ name: "subMenu",
560
+ __name: "subMenu",
561
+ props: {
562
+ routeData: {
563
+ type: Object,
564
+ default: () => ({})
565
+ }
566
+ },
567
+ emits: ["handleMenuItemClick"],
568
+ setup(t, { emit: u }) {
569
+ const d = u;
570
+ function c(l) {
571
+ d("handleMenuItemClick", l);
572
+ }
573
+ return (l, i) => {
574
+ const g = r("subMenu", !0), f = r("el-sub-menu"), m = r("el-menu-item");
575
+ return t.routeData.children && t.routeData.children.length > 0 ? (a(), o(f, {
576
+ key: 0,
577
+ index: t.routeData.path
578
+ }, {
579
+ title: s(() => [
580
+ M(L, {
581
+ icon: t.routeData.meta.icon
582
+ }, null, 8, ["icon"]),
583
+ $("span", null, x(t.routeData.meta.title), 1)
584
+ ]),
585
+ default: s(() => [
586
+ (a(!0), v(V, null, D(t.routeData.children, (b, y) => (a(), o(g, {
587
+ onHandleMenuItemClick: c,
588
+ routeData: b,
589
+ key: y
590
+ }, null, 8, ["routeData"]))), 128))
591
+ ]),
592
+ _: 1
593
+ }, 8, ["index"])) : (a(), v("div", {
594
+ key: 1,
595
+ onClick: i[0] || (i[0] = (b) => c(t.routeData))
596
+ }, [
597
+ M(m, {
598
+ index: t.routeData.path
599
+ }, {
600
+ title: s(() => [
601
+ $("span", null, x(t.routeData.meta.title), 1)
602
+ ]),
603
+ default: s(() => [
604
+ M(L, {
605
+ icon: t.routeData.meta.icon
606
+ }, null, 8, ["icon"])
607
+ ]),
608
+ _: 1
609
+ }, 8, ["index"])
610
+ ]));
611
+ };
612
+ }
613
+ }), Ce = /* @__PURE__ */ H({
543
614
  name: "MenuTree",
544
615
  __name: "index",
545
616
  props: {
@@ -549,24 +620,24 @@ const Z = { class: "flex items-center justify-between" }, ee = { class: "flex it
549
620
  }
550
621
  },
551
622
  emits: ["handleMenuItemClick"],
552
- setup(t, { emit: d }) {
553
- const c = d, i = (n) => {
554
- c("handleMenuItemClick", n);
623
+ setup(t, { emit: u }) {
624
+ const d = u, c = (l) => {
625
+ d("handleMenuItemClick", l);
555
626
  };
556
- return (n, m) => {
557
- const g = r("sub-menu"), f = r("el-menu");
558
- return l(), o(f, K(Q(n.$attrs)), {
627
+ return (l, i) => {
628
+ const g = r("el-menu");
629
+ return a(), o(g, X(Z(l.$attrs)), {
559
630
  default: s(() => [
560
- (l(!0), C(_, null, V(t.menuList, (u) => (l(), o(g, {
561
- routeData: u,
562
- onHandleMenuItemClick: i
631
+ (a(!0), v(V, null, D(t.menuList, (f) => (a(), o(ve, {
632
+ routeData: f,
633
+ onHandleMenuItemClick: c
563
634
  }, null, 8, ["routeData"]))), 256))
564
635
  ]),
565
636
  _: 1
566
637
  }, 16);
567
638
  };
568
639
  }
569
- }), ge = /* @__PURE__ */ S({
640
+ }), ke = /* @__PURE__ */ H({
570
641
  name: "Pagination",
571
642
  __name: "index",
572
643
  props: {
@@ -594,33 +665,33 @@ const Z = { class: "flex items-center justify-between" }, ee = { class: "flex it
594
665
  onPagination: { type: Function }
595
666
  },
596
667
  emits: ["update:page", "update:limit", "pagination"],
597
- setup(t, { emit: d }) {
598
- const c = t, i = d, n = computed({
668
+ setup(t, { emit: u }) {
669
+ const d = t, c = u, l = computed({
599
670
  get() {
600
- return c.page;
671
+ return d.page;
601
672
  },
602
- set(u) {
603
- i("update:page", u);
673
+ set(m) {
674
+ c("update:page", m);
604
675
  }
605
- }), m = computed({
676
+ }), i = computed({
606
677
  get() {
607
- return c.limit;
678
+ return d.limit;
608
679
  },
609
- set(u) {
610
- i("update:limit", u);
680
+ set(m) {
681
+ c("update:limit", m);
611
682
  }
612
- }), g = (u) => {
613
- n.value * u > c.total && (n.value = 1), i("pagination", { page: n.value, limit: u });
614
- }, f = (u) => {
615
- i("pagination", { page: u, limit: m.value });
683
+ }), g = (m) => {
684
+ l.value * m > d.total && (l.value = 1), c("pagination", { page: l.value, limit: m });
685
+ }, f = (m) => {
686
+ c("pagination", { page: m, limit: i.value });
616
687
  };
617
- return (u, b) => {
688
+ return (m, b) => {
618
689
  const y = r("el-pagination");
619
- return q((l(), o(y, {
620
- "current-page": H(n),
621
- "onUpdate:currentPage": b[0] || (b[0] = (v) => L(n) ? n.value = v : null),
622
- "page-size": H(m),
623
- "onUpdate:pageSize": b[1] || (b[1] = (v) => L(m) ? m.value = v : null),
690
+ return q((a(), o(y, {
691
+ "current-page": U(l),
692
+ "onUpdate:currentPage": b[0] || (b[0] = (C) => A(l) ? l.value = C : null),
693
+ "page-size": U(i),
694
+ "onUpdate:pageSize": b[1] || (b[1] = (C) => A(i) ? i.value = C : null),
624
695
  background: !0,
625
696
  "page-sizes": [10, 20, 30, 50, 100],
626
697
  "pager-count": t.pagerCount,
@@ -630,29 +701,29 @@ const Z = { class: "flex items-center justify-between" }, ee = { class: "flex it
630
701
  onSizeChange: g,
631
702
  onCurrentChange: f
632
703
  }, null, 8, ["current-page", "page-size", "pager-count", "total"])), [
633
- [X, t.total > 0]
704
+ [ee, t.total > 0]
634
705
  ]);
635
706
  };
636
707
  }
637
- }), be = /* @__PURE__ */ B(ge, [["__scopeId", "data-v-3d378ae6"]]), ye = [
638
- re,
708
+ }), De = /* @__PURE__ */ T(ke, [["__scopeId", "data-v-3d378ae6"]]), we = [
639
709
  de,
640
- ie,
710
+ ce,
641
711
  fe,
642
- he,
643
- be
644
- ], j = [], ve = (t) => {
645
- ye.forEach((d) => {
646
- j.push(d.name), t.component(d.name, d);
647
- }), console.log("mwl-components", j);
648
- }, we = { install: ve };
712
+ ge,
713
+ Ce,
714
+ De
715
+ ], O = [], _e = (t) => {
716
+ we.forEach((u) => {
717
+ O.push(u.name), t.component(u.name, u);
718
+ }), console.log("mwl-components", O);
719
+ }, xe = { install: _e };
649
720
  export {
650
- re as ContentWarp,
651
- de as Dialog,
652
- ie as EasyForm,
653
- fe as EasyTable,
654
- he as MenuTree,
655
- be as Pagination,
656
- we as default,
657
- ve as install
721
+ de as ContentWarp,
722
+ ce as Dialog,
723
+ fe as EasyForm,
724
+ ge as EasyTable,
725
+ Ce as MenuTree,
726
+ De as Pagination,
727
+ xe as default,
728
+ _e as install
658
729
  };
@@ -1 +1 @@
1
- .el-card[data-v-0870eb8d]{background-color:transparent;margin-bottom:10px}[data-v-0870eb8d] .el-card__body:has(>.el-form){padding:18px 20px 0}[data-v-0870eb8d] .el-card__body{padding:20px}.custom-dialog{padding:0}.custom-dialog .el-dialog__header{--el-dialog-padding-primary: 20px;margin-right:0!important;border-bottom:1px solid #eee;padding:var(--el-dialog-padding-primary);padding-bottom:10px}.dialog-header{display:flex;align-items:center;justify-content:space-between;margin-right:30px}.dialog-header .fullScreen{cursor:pointer;z-index:99}.el-dialog__headerbtn{top:8px}.el-dialog__body{padding:20px 30px;color:#606266;font-size:14px}.el-dialog__footer{padding:10px 20px 20px;border-top:1px solid #eee}[data-v-9fb8ae2f] .el-form-item__label{font-size:var(--el-font-size-base)}[data-v-5ca5027f] .el-table,[data-v-5ca5027f] th.el-table__cell,[data-v-5ca5027f] tr{background-color:transparent!important}.pagination[data-v-3d378ae6]{margin-top:15px;margin-bottom:15px;float:right}@media screen and (max-width: 1370px){.pagination[data-v-3d378ae6]{margin-top:8px;margin-bottom:8px}}
1
+ .el-card[data-v-0870eb8d]{background-color:transparent;margin-bottom:10px}[data-v-0870eb8d] .el-card__body:has(>.el-form){padding:18px 20px 0}[data-v-0870eb8d] .el-card__body{padding:20px}.custom-dialog{padding:0}.custom-dialog .el-dialog__header{--el-dialog-padding-primary: 20px;margin-right:0!important;border-bottom:1px solid #eee;padding:var(--el-dialog-padding-primary);padding-bottom:10px}.dialog-header{display:flex;align-items:center;justify-content:space-between;margin-right:30px}.dialog-header .fullScreen{cursor:pointer;z-index:99}.el-dialog__headerbtn{top:8px}.el-dialog__body{padding:20px 30px;color:#606266;font-size:14px}.el-dialog__footer{padding:10px 20px 20px;border-top:1px solid #eee}[data-v-9fb8ae2f] .el-form-item__label{font-size:var(--el-font-size-base)}[data-v-5ca5027f] .el-table,[data-v-5ca5027f] th.el-table__cell,[data-v-5ca5027f] tr{background-color:transparent!important}.menu_icon[data-v-261ce99a]{width:22px;height:22px;margin-right:5px;fill:currentColor;display:inline-block;font-size:16px}.pagination[data-v-3d378ae6]{margin-top:15px;margin-bottom:15px;float:right}@media screen and (max-width: 1370px){.pagination[data-v-3d378ae6]{margin-top:8px;margin-bottom:8px}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mwl-components",
3
- "version": "0.0.4",
3
+ "version": "0.0.7",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "module": "dist/index.js",