mwl-components 0.0.7 → 0.0.9

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # my-components
1
+ # mwl-components
2
2
 
3
3
  基于vue 3.0 + ts + vite + element-plus 组件库
4
4
 
@@ -9,11 +9,33 @@
9
9
  <!-- 描述配置信息 -->
10
10
 
11
11
  ```sh
12
- vite.config.ts
12
+ vite.config.ts 文件
13
13
  ```
14
14
 
15
15
  ### Lint with [ESLint](https://eslint.org/)
16
16
 
17
+ ## 本地测试
18
+
19
+ ```sh
20
+ pnpm link 或者 npm link
21
+ ```
22
+
23
+ ### 主项目 引入
24
+
17
25
  ```sh
18
- pnpm lint
26
+ pnpm link mwl-components
27
+ ```
28
+
29
+ ### 使用 先引入 element-plus 全局注册
30
+
31
+ ```sh
32
+ import ElementPlus from 'element-plus'
33
+ import 'element-plus/dist/index.css'
34
+ import mwlComponents from 'mwl-components'
35
+ import 'mwl-components/dist/index.css'
36
+
37
+ const app = createApp(App)
38
+ app.use(ElementPlus)
39
+ app.use(mwlComponents)
40
+ app.mount('#app')
19
41
  ```
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
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 = {
1
+ import { defineComponent as H, useSlots as j, ref as M, resolveComponent as r, createBlock as o, openBlock as a, normalizeClass as G, createSlots as N, withCtx as s, renderSlot as k, createElementVNode as $, createElementBlock as v, createCommentVNode as f, toDisplayString as x, createVNode as U, watch as J, nextTick as K, computed as R, mergeProps as _, normalizeStyle as A, createTextVNode as W, Fragment as V, renderList as D, getCurrentInstance as Q, resolveDirective as X, withDirectives as q, resolveDynamicComponent as Z, normalizeProps as ee, guardReactiveProps as te, vShow as ae } from "vue";
2
+ const le = { class: "flex items-center justify-between" }, ne = { class: "flex items-center" }, oe = { class: "text-16px font-700" }, re = { class: "max-w-200px" }, ue = {
3
3
  key: 0,
4
4
  class: "flex justify-end"
5
- }, re = {
5
+ }, de = {
6
6
  key: 0,
7
7
  class: "mt-8px flex items-center"
8
- }, ue = /* @__PURE__ */ H({
8
+ }, se = /* @__PURE__ */ H({
9
9
  name: "ContentWarp",
10
10
  __name: "index",
11
11
  props: {
@@ -13,11 +13,11 @@ const te = { class: "flex items-center justify-between" }, ae = { class: "flex i
13
13
  message: String
14
14
  },
15
15
  setup(t) {
16
- const u = B(), d = ref("content-wrap");
16
+ const u = j(), d = M("content-wrap");
17
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]"]),
18
+ const m = r("ElIcon"), g = r("ElTooltip"), p = r("ElCard");
19
+ return a(), o(p, {
20
+ class: G([d.value, "mb-[10px]"]),
21
21
  shadow: "never"
22
22
  }, N({
23
23
  default: s(() => [
@@ -28,34 +28,34 @@ const te = { class: "flex items-center justify-between" }, ae = { class: "flex i
28
28
  t.title ? {
29
29
  name: "header",
30
30
  fn: s(() => [
31
- $("div", te, [
32
- $("div", ae, [
33
- $("span", le, x(t.title), 1),
31
+ $("div", le, [
32
+ $("div", ne, [
33
+ $("span", oe, x(t.title), 1),
34
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
- $("div", ne, x(t.message), 1)
40
+ $("div", re, x(t.message), 1)
41
41
  ]),
42
42
  default: s(() => [
43
- M(i, {
43
+ U(m, {
44
44
  size: 14,
45
45
  class: "ml-5px",
46
46
  icon: "ep:question-filled"
47
47
  })
48
48
  ]),
49
49
  _: 1
50
- })) : h("", !0)
50
+ })) : f("", !0)
51
51
  ]),
52
- u.buttonTip ? (a(), v("div", oe, [
52
+ u.buttonTip ? (a(), v("div", ue, [
53
53
  k(c.$slots, "buttonTip", {}, void 0, !0)
54
- ])) : h("", !0)
54
+ ])) : f("", !0)
55
55
  ]),
56
- u.descTip ? (a(), v("div", re, [
56
+ u.descTip ? (a(), v("div", de, [
57
57
  k(c.$slots, "descTip", {}, void 0, !0)
58
- ])) : h("", !0)
58
+ ])) : f("", !0)
59
59
  ]),
60
60
  key: "0"
61
61
  } : void 0
@@ -67,7 +67,7 @@ const te = { class: "flex items-center justify-between" }, ae = { class: "flex i
67
67
  for (const [c, l] of u)
68
68
  d[c] = l;
69
69
  return d;
70
- }, de = /* @__PURE__ */ T(ue, [["__scopeId", "data-v-0870eb8d"]]), se = { class: "dialog-header" }, ce = /* @__PURE__ */ H({
70
+ }, ce = /* @__PURE__ */ T(se, [["__scopeId", "data-v-15c93817"]]), ie = { class: "dialog-header" }, me = /* @__PURE__ */ H({
71
71
  name: "Dialog",
72
72
  __name: "index",
73
73
  props: {
@@ -93,33 +93,33 @@ const te = { class: "flex items-center justify-between" }, ae = { class: "flex i
93
93
  }
94
94
  },
95
95
  setup(t) {
96
- const u = B(), d = t, c = ref(!1), l = () => {
96
+ const u = j(), d = t, c = M(!1), l = () => {
97
97
  c.value = !unref(c);
98
- }, i = ref(d.maxHeight);
99
- watch(
98
+ }, m = M(d.maxHeight);
99
+ J(
100
100
  () => c.value,
101
- async (f) => {
102
- if (await nextTick(), f) {
103
- const m = document.documentElement.offsetHeight;
104
- i.value = `${m - 55 - 40 - (u.footer ? 63 : 0)}px`;
101
+ async (p) => {
102
+ if (await K(), p) {
103
+ const i = document.documentElement.offsetHeight;
104
+ m.value = `${i - 55 - 40 - (u.footer ? 63 : 0)}px`;
105
105
  } else
106
- i.value = d.maxHeight;
106
+ m.value = d.maxHeight;
107
107
  },
108
108
  {
109
109
  immediate: !0
110
110
  }
111
111
  );
112
- const g = computed(() => {
112
+ const g = R(() => {
113
113
  if (d.maxHeight)
114
114
  return {
115
- height: unref(i)
115
+ height: unref(m)
116
116
  };
117
117
  });
118
- return console.log(d), (f, m) => {
118
+ return console.log(d), (p, i) => {
119
119
  const b = r("el-button"), y = r("ElScrollbar"), C = r("ElDialog");
120
- return a(), o(C, _(f.$attrs, {
120
+ return a(), o(C, _(p.$attrs, {
121
121
  "close-on-click-modal": !1,
122
- fullscreen: U(c),
122
+ fullscreen: c.value,
123
123
  width: t.width,
124
124
  "destroy-on-close": "",
125
125
  draggable: "",
@@ -128,12 +128,12 @@ const te = { class: "flex items-center justify-between" }, ae = { class: "flex i
128
128
  "append-to-body": ""
129
129
  }), N({
130
130
  header: s(() => [
131
- $("div", se, [
132
- k(f.$slots, "title", {}, () => [
131
+ $("div", ie, [
132
+ k(p.$slots, "title", {}, () => [
133
133
  W(x(t.title), 1)
134
134
  ]),
135
135
  $("div", { onClick: l }, [
136
- M(b, {
136
+ U(b, {
137
137
  link: "",
138
138
  icon: "FullScreen",
139
139
  color: "#909399"
@@ -144,28 +144,28 @@ const te = { class: "flex items-center justify-between" }, ae = { class: "flex i
144
144
  default: s(() => [
145
145
  t.scroll ? (a(), o(y, {
146
146
  key: 0,
147
- style: j(U(g))
147
+ style: A(g.value)
148
148
  }, {
149
149
  default: s(() => [
150
- k(f.$slots, "default")
150
+ k(p.$slots, "default")
151
151
  ]),
152
152
  _: 3
153
- }, 8, ["style"])) : k(f.$slots, "default", { key: 1 })
153
+ }, 8, ["style"])) : k(p.$slots, "default", { key: 1 })
154
154
  ]),
155
155
  _: 2
156
156
  }, [
157
157
  u.footer ? {
158
158
  name: "footer",
159
159
  fn: s(() => [
160
- k(f.$slots, "footer")
160
+ k(p.$slots, "footer")
161
161
  ]),
162
162
  key: "0"
163
163
  } : void 0
164
164
  ]), 1040, ["fullscreen", "width"]);
165
165
  };
166
166
  }
167
- }), ie = {}, me = /* @__PURE__ */ H({
168
- ...ie,
167
+ }), pe = {}, he = /* @__PURE__ */ H({
168
+ ...pe,
169
169
  name: "EasyForm",
170
170
  __name: "index",
171
171
  props: {
@@ -195,17 +195,17 @@ const te = { class: "flex items-center justify-between" }, ae = { class: "flex i
195
195
  }
196
196
  },
197
197
  setup(t, { expose: u }) {
198
- const d = J();
198
+ const d = M();
199
199
  return u({
200
200
  resetFields: () => {
201
201
  d.value?.resetFields();
202
202
  },
203
203
  getFormData: async () => {
204
- const i = await d.value.validate();
205
- return i || null;
204
+ const m = await d.value.validate();
205
+ return m || null;
206
206
  }
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");
207
+ }), (m, g) => {
208
+ const p = r("el-input"), i = r("el-input-number"), b = r("el-radio"), y = r("el-radio-group"), C = r("el-checkbox"), S = r("el-checkbox-group"), B = 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
209
  return a(), o(z, {
210
210
  ref_key: "formRef",
211
211
  ref: d,
@@ -215,15 +215,15 @@ const te = { class: "flex items-center justify-between" }, ae = { class: "flex i
215
215
  "scroll-to-error": ""
216
216
  }, {
217
217
  default: s(() => [
218
- (a(!0), v(V, null, D(t.formItems, ({ type: p, ...e }) => (a(), v(V, null, [
219
- p != "custom" && !e.hidden ? (a(), o(P, {
218
+ (a(!0), v(V, null, D(t.formItems, ({ type: h, ...e }) => (a(), v(V, null, [
219
+ h != "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 == "" ? (a(), o(f, _({
226
+ h == "text" || h == "" ? (a(), o(p, _({
227
227
  key: 0,
228
228
  placeholder: "请输入" + e.label
229
229
  }, { ref_for: !0 }, { ...e }, {
@@ -231,8 +231,8 @@ const te = { class: "flex items-center justify-between" }, ae = { class: "flex i
231
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
- }), null, 16, ["placeholder", "modelValue", "onUpdate:modelValue", "style"])) : h("", !0),
235
- p == "textarea" ? (a(), o(f, _({
234
+ }), null, 16, ["placeholder", "modelValue", "onUpdate:modelValue", "style"])) : f("", !0),
235
+ h == "textarea" ? (a(), o(p, _({
236
236
  key: 1,
237
237
  ref_for: !0
238
238
  }, { ...e }, {
@@ -240,16 +240,16 @@ const te = { class: "flex items-center justify-between" }, ae = { class: "flex i
240
240
  "onUpdate:modelValue": (n) => t.formData[e.prop] = n,
241
241
  type: "textarea",
242
242
  style: { width: e.width ? e.width : t.itemWidth }
243
- }), null, 16, ["modelValue", "onUpdate:modelValue", "style"])) : h("", !0),
244
- p == "number" ? (a(), o(m, _({
243
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "style"])) : f("", !0),
244
+ h == "number" ? (a(), o(i, _({
245
245
  key: 2,
246
246
  "controls-position": "right"
247
247
  }, { ref_for: !0 }, { ...e }, {
248
248
  modelValue: t.formData[e.prop],
249
249
  "onUpdate:modelValue": (n) => t.formData[e.prop] = n,
250
250
  style: { width: e.width ? e.width : t.itemWidth }
251
- }), null, 16, ["modelValue", "onUpdate:modelValue", "style"])) : h("", !0),
252
- p == "radio" ? (a(), o(y, _({
251
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "style"])) : f("", !0),
252
+ h == "radio" ? (a(), o(y, _({
253
253
  key: 3,
254
254
  modelValue: t.formData[e.prop],
255
255
  "onUpdate:modelValue": (n) => t.formData[e.prop] = n,
@@ -268,8 +268,8 @@ const te = { class: "flex items-center justify-between" }, ae = { class: "flex i
268
268
  }, 1032, ["value"]))), 128))
269
269
  ]),
270
270
  _: 2
271
- }, 1040, ["modelValue", "onUpdate:modelValue", "style", "onChange"])) : h("", !0),
272
- p == "checkbox" ? (a(), o(S, _({
271
+ }, 1040, ["modelValue", "onUpdate:modelValue", "style", "onChange"])) : f("", !0),
272
+ h == "checkbox" ? (a(), o(S, _({
273
273
  key: 4,
274
274
  modelValue: t.formData[e.prop],
275
275
  "onUpdate:modelValue": (n) => t.formData[e.prop] = n,
@@ -288,8 +288,8 @@ const te = { class: "flex items-center justify-between" }, ae = { class: "flex i
288
288
  }, 1032, ["value"]))), 128))
289
289
  ]),
290
290
  _: 2
291
- }, 1040, ["modelValue", "onUpdate:modelValue", "style", "onChange"])) : h("", !0),
292
- p == "select" || p == "multipleselect" ? (a(), o(E, _({
291
+ }, 1040, ["modelValue", "onUpdate:modelValue", "style", "onChange"])) : f("", !0),
292
+ h == "select" || h == "multipleselect" ? (a(), o(E, _({
293
293
  key: 5,
294
294
  modelValue: t.formData[e.prop],
295
295
  "onUpdate:modelValue": (n) => t.formData[e.prop] = n,
@@ -298,21 +298,21 @@ const te = { class: "flex items-center justify-between" }, ae = { class: "flex i
298
298
  onChange: (n) => e.change && e.change(t.formData[e.prop])
299
299
  }, { ref_for: !0 }, { ...e }), {
300
300
  default: s(() => [
301
- (a(!0), v(V, null, D(e.options, (n, F) => (a(), o(R, {
301
+ (a(!0), v(V, null, D(e.options, (n, F) => (a(), o(B, {
302
302
  key: F,
303
303
  label: e.defaultProp ? n[e.defaultProp.label] : n.label,
304
304
  value: e.defaultProp ? n[e.defaultProp.value] : n.value
305
305
  }, null, 8, ["label", "value"]))), 128))
306
306
  ]),
307
307
  _: 2
308
- }, 1040, ["modelValue", "onUpdate:modelValue", "style", "onChange"])) : h("", !0),
309
- p == "cascader" ? (a(), o(I, {
308
+ }, 1040, ["modelValue", "onUpdate:modelValue", "style", "onChange"])) : f("", !0),
309
+ h == "cascader" ? (a(), o(I, {
310
310
  key: 6,
311
311
  modelValue: t.formData[e.prop],
312
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: j({ width: e.width ? e.width : t.itemWidth }),
315
+ style: A({ width: e.width ? e.width : t.itemWidth }),
316
316
  disabled: e.disabled,
317
317
  clearable: e.clearable,
318
318
  placeholder: e.placeholder,
@@ -320,16 +320,16 @@ const te = { class: "flex items-center justify-between" }, ae = { class: "flex i
320
320
  teleported: e.teleported,
321
321
  "disabled-date": e.disabledDate,
322
322
  onChange: (n) => e.change && e.change(t.formData[e.prop])
323
- }, null, 8, ["modelValue", "onUpdate:modelValue", "options", "props", "style", "disabled", "clearable", "placeholder", "popper-class", "teleported", "disabled-date", "onChange"])) : h("", !0),
324
- p === "switch" ? (a(), o(Y, {
323
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "options", "props", "style", "disabled", "clearable", "placeholder", "popper-class", "teleported", "disabled-date", "onChange"])) : f("", !0),
324
+ h === "switch" ? (a(), o(Y, {
325
325
  key: 7,
326
326
  modelValue: t.formData[e.prop],
327
327
  "onUpdate:modelValue": (n) => t.formData[e.prop] = n,
328
328
  disabled: e.disabled,
329
- style: j({ width: e.width ? e.width : t.itemWidth }),
329
+ style: A({ width: e.width ? e.width : t.itemWidth }),
330
330
  onChange: (n) => e.change && e.change(t.formData[e.prop])
331
- }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "style", "onChange"])) : h("", !0),
332
- p == "date" || p == "datetime" || p == "year" || p == "month" ? (a(), o(w, _({
331
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "style", "onChange"])) : f("", !0),
332
+ h == "date" || h == "datetime" || h == "year" || h == "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],
@@ -341,33 +341,33 @@ const te = { class: "flex items-center justify-between" }, ae = { class: "flex i
341
341
  clearable: e.clearable,
342
342
  placeholder: e.placeholder || "请选择",
343
343
  "disabled-date": e.disabledDate,
344
- type: p,
344
+ type: h,
345
345
  onChange: (n) => e.change && e.change(t.formData[e.prop])
346
- }), null, 16, ["style", "modelValue", "onUpdate:modelValue", "format", "value-format", "disabled", "clearable", "placeholder", "disabled-date", "type", "onChange"])) : h("", !0),
347
- p == "daterange" ? (a(), o(w, {
346
+ }), null, 16, ["style", "modelValue", "onUpdate:modelValue", "format", "value-format", "disabled", "clearable", "placeholder", "disabled-date", "type", "onChange"])) : f("", !0),
347
+ h == "daterange" ? (a(), o(w, {
348
348
  key: 9,
349
349
  modelValue: t.formData[e.prop],
350
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
- type: p,
353
+ type: h,
354
354
  disabled: e.disabled,
355
355
  "range-separator": "至",
356
356
  "start-placeholder": "开始日期",
357
357
  "end-placeholder": "结束日期",
358
358
  onChange: (n) => e.change && e.change(t.formData[e.prop])
359
- }, null, 8, ["modelValue", "onUpdate:modelValue", "format", "value-format", "type", "disabled", "onChange"])) : h("", !0)
359
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "format", "value-format", "type", "disabled", "onChange"])) : f("", !0)
360
360
  ]),
361
361
  _: 2
362
- }, 1032, ["label", "prop", "rules"])) : h("", !0),
363
- p == "custom" ? k(i.$slots, e.prop, {
362
+ }, 1032, ["label", "prop", "rules"])) : f("", !0),
363
+ h == "custom" ? k(m.$slots, e.prop, {
364
364
  key: 1,
365
365
  item: e
366
- }, void 0, !0) : h("", !0)
366
+ }, void 0, !0) : f("", !0)
367
367
  ], 64))), 256)),
368
- M(P, null, {
368
+ U(P, null, {
369
369
  default: s(() => [
370
- k(i.$slots, "append", {}, void 0, !0)
370
+ k(m.$slots, "append", {}, void 0, !0)
371
371
  ]),
372
372
  _: 3
373
373
  })
@@ -376,27 +376,27 @@ const te = { class: "flex items-center justify-between" }, ae = { class: "flex i
376
376
  }, 8, ["model", "label-width", "inline"]);
377
377
  };
378
378
  }
379
- }), fe = /* @__PURE__ */ T(me, [["__scopeId", "data-v-9fb8ae2f"]]), pe = /* @__PURE__ */ H({
379
+ }), fe = /* @__PURE__ */ T(he, [["__scopeId", "data-v-9fb8ae2f"]]), ge = /* @__PURE__ */ H({
380
380
  __name: "tableColumnItem",
381
381
  props: {
382
382
  tableColumn: {}
383
383
  },
384
384
  setup(t) {
385
- const u = B(), d = t, c = () => {
385
+ const u = j(), d = t, c = () => {
386
386
  const { tableColumn: l } = d;
387
387
  return l.children?.length || delete l.children, l;
388
388
  };
389
- return (l, i) => {
390
- const g = r("el-table-column"), f = r("tableColumnItem", !0);
389
+ return (l, m) => {
390
+ const g = r("el-table-column"), p = r("tableColumnItem", !0);
391
391
  return !l.tableColumn.children || l.tableColumn.children?.length == 0 ? (a(), o(g, _({ key: 0 }, { ...c() }, {
392
392
  prop: l.tableColumn.prop,
393
393
  label: l.tableColumn.label
394
394
  }), N({ _: 2 }, [
395
395
  l.tableColumn.prop && u[l.tableColumn.prop] ? {
396
396
  name: "default",
397
- fn: s((m) => [
397
+ fn: s((i) => [
398
398
  k(l.$slots, l.tableColumn.prop, {
399
- row: m.row
399
+ row: i.row
400
400
  })
401
401
  ]),
402
402
  key: "0"
@@ -407,9 +407,9 @@ const te = { class: "flex items-center justify-between" }, ae = { class: "flex i
407
407
  label: l.tableColumn.label
408
408
  }, {
409
409
  default: s(() => [
410
- (a(!0), v(V, null, D(l.tableColumn.children, (m, b) => (a(), o(f, {
410
+ (a(!0), v(V, null, D(l.tableColumn.children, (i, b) => (a(), o(p, {
411
411
  key: b,
412
- "table-column": { align: m.align || l.tableColumn.align, ...m }
412
+ "table-column": { align: i.align || l.tableColumn.align, ...i }
413
413
  }, N({ _: 2 }, [
414
414
  D(u, (y, C) => ({
415
415
  name: C,
@@ -425,7 +425,7 @@ const te = { class: "flex items-center justify-between" }, ae = { class: "flex i
425
425
  }, 8, ["align", "label"]));
426
426
  };
427
427
  }
428
- }), he = /* @__PURE__ */ H({
428
+ }), be = /* @__PURE__ */ H({
429
429
  name: "EasyTable",
430
430
  __name: "index",
431
431
  props: {
@@ -460,9 +460,9 @@ const te = { class: "flex items-center justify-between" }, ae = { class: "flex i
460
460
  }
461
461
  },
462
462
  setup(t) {
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
- let g = getCurrentInstance();
465
- const f = () => {
463
+ const u = t, d = R(() => (u.buttonWidth.toString().indexOf("px") > -1 ? u.buttonWidth.toString().slice(0, -2) : u.buttonWidth, u.buttonWidth)), c = j(), l = M(), m = M("auto");
464
+ let g = Q();
465
+ const p = () => {
466
466
  let y = "auto";
467
467
  if (g?.parent?.attrs?.class?.indexOf("content-wrap") > -1) {
468
468
  try {
@@ -473,46 +473,46 @@ const te = { class: "flex items-center justify-between" }, ae = { class: "flex i
473
473
  return y;
474
474
  }
475
475
  return y;
476
- }, m = ref(), b = () => {
477
- m.value && clearTimeout(m.value), m.value = setTimeout(() => {
478
- i.value = f(), m.value = null;
476
+ }, i = M(), b = () => {
477
+ i.value && clearTimeout(i.value), i.value = setTimeout(() => {
478
+ m.value = p(), i.value = null;
479
479
  }, 100);
480
480
  };
481
481
  return onMounted(() => {
482
- i.value = f(), window.addEventListener("resize", b);
482
+ m.value = p(), window.addEventListener("resize", b);
483
483
  }), onUnmounted(() => {
484
484
  window.removeEventListener("resize", b);
485
485
  }), (y, C) => {
486
- const S = r("el-button"), R = r("el-table-column"), E = r("el-table"), I = K("hasPermi");
486
+ const S = r("el-button"), B = r("el-table-column"), E = r("el-table"), I = X("hasPermi");
487
487
  return a(), v("div", {
488
488
  ref_key: "tableRef",
489
489
  ref: l
490
490
  }, [
491
- M(E, _({ style: { width: "100%" } }, y.$attrs, {
491
+ U(E, _({ style: { width: "100%" } }, y.$attrs, {
492
492
  data: t.data,
493
493
  height: t.height,
494
- maxHeight: t.maxHeight ? t.maxHeight : U(i)
494
+ maxHeight: t.maxHeight ? t.maxHeight : m.value
495
495
  }), {
496
496
  default: s(() => [
497
- (a(!0), v(V, null, D(t.tableColumns, (Y, w) => (a(), o(pe, {
497
+ (a(!0), v(V, null, D(t.tableColumns, (Y, w) => (a(), o(ge, {
498
498
  key: w,
499
499
  "table-column": { align: t.align, ...Y }
500
500
  }, N({ _: 2 }, [
501
501
  D(c, (P, z) => ({
502
502
  name: z,
503
- fn: s(({ row: p }) => [
504
- k(y.$slots, z, { row: p }, () => [
505
- W(x(p[z]), 1)
503
+ fn: s(({ row: h }) => [
504
+ k(y.$slots, z, { row: h }, () => [
505
+ W(x(h[z]), 1)
506
506
  ], !0)
507
507
  ])
508
508
  }))
509
509
  ]), 1032, ["table-column"]))), 128)),
510
- t.buttons && t.buttons.length ? (a(), o(R, {
510
+ t.buttons && t.buttons.length ? (a(), o(B, {
511
511
  key: 0,
512
512
  align: "center",
513
513
  fixed: "right",
514
514
  label: "操作",
515
- width: U(d)
515
+ width: d.value
516
516
  }, {
517
517
  default: s((Y) => [
518
518
  (a(!0), v(V, null, D(t.buttons, (w, P) => q((a(), o(S, {
@@ -532,14 +532,14 @@ const te = { class: "flex items-center justify-between" }, ae = { class: "flex i
532
532
  ])), 128))
533
533
  ]),
534
534
  _: 1
535
- }, 8, ["width"])) : h("", !0)
535
+ }, 8, ["width"])) : f("", !0)
536
536
  ]),
537
537
  _: 3
538
538
  }, 16, ["data", "height", "maxHeight"])
539
539
  ], 512);
540
540
  };
541
541
  }
542
- }), ge = /* @__PURE__ */ T(he, [["__scopeId", "data-v-5ca5027f"]]), be = {
542
+ }), ye = /* @__PURE__ */ T(be, [["__scopeId", "data-v-217a24bd"]]), ve = {
543
543
  name: "",
544
544
  components: {},
545
545
  props: {
@@ -549,13 +549,13 @@ const te = { class: "flex items-center justify-between" }, ae = { class: "flex i
549
549
  }
550
550
  }
551
551
  };
552
- function ye(t, u, d, c, l, i) {
553
- return d.icon ? (a(), o(Q(d.icon), {
552
+ function Ce(t, u, d, c, l, m) {
553
+ return d.icon ? (a(), o(Z(d.icon), {
554
554
  key: 0,
555
555
  class: "menu_icon"
556
- })) : h("", !0);
556
+ })) : f("", !0);
557
557
  }
558
- const L = /* @__PURE__ */ T(be, [["render", ye], ["__scopeId", "data-v-261ce99a"]]), ve = /* @__PURE__ */ H({
558
+ const L = /* @__PURE__ */ T(ve, [["render", Ce], ["__scopeId", "data-v-261ce99a"]]), ke = /* @__PURE__ */ H({
559
559
  name: "subMenu",
560
560
  __name: "subMenu",
561
561
  props: {
@@ -570,14 +570,14 @@ const L = /* @__PURE__ */ T(be, [["render", ye], ["__scopeId", "data-v-261ce99a"
570
570
  function c(l) {
571
571
  d("handleMenuItemClick", l);
572
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, {
573
+ return (l, m) => {
574
+ const g = r("subMenu", !0), p = r("el-sub-menu"), i = r("el-menu-item");
575
+ return t.routeData.children && t.routeData.children.length > 0 ? (a(), o(p, {
576
576
  key: 0,
577
577
  index: t.routeData.path
578
578
  }, {
579
579
  title: s(() => [
580
- M(L, {
580
+ U(L, {
581
581
  icon: t.routeData.meta.icon
582
582
  }, null, 8, ["icon"]),
583
583
  $("span", null, x(t.routeData.meta.title), 1)
@@ -592,16 +592,16 @@ const L = /* @__PURE__ */ T(be, [["render", ye], ["__scopeId", "data-v-261ce99a"
592
592
  _: 1
593
593
  }, 8, ["index"])) : (a(), v("div", {
594
594
  key: 1,
595
- onClick: i[0] || (i[0] = (b) => c(t.routeData))
595
+ onClick: m[0] || (m[0] = (b) => c(t.routeData))
596
596
  }, [
597
- M(m, {
597
+ U(i, {
598
598
  index: t.routeData.path
599
599
  }, {
600
600
  title: s(() => [
601
601
  $("span", null, x(t.routeData.meta.title), 1)
602
602
  ]),
603
603
  default: s(() => [
604
- M(L, {
604
+ U(L, {
605
605
  icon: t.routeData.meta.icon
606
606
  }, null, 8, ["icon"])
607
607
  ]),
@@ -610,7 +610,7 @@ const L = /* @__PURE__ */ T(be, [["render", ye], ["__scopeId", "data-v-261ce99a"
610
610
  ]));
611
611
  };
612
612
  }
613
- }), Ce = /* @__PURE__ */ H({
613
+ }), De = /* @__PURE__ */ H({
614
614
  name: "MenuTree",
615
615
  __name: "index",
616
616
  props: {
@@ -624,12 +624,12 @@ const L = /* @__PURE__ */ T(be, [["render", ye], ["__scopeId", "data-v-261ce99a"
624
624
  const d = u, c = (l) => {
625
625
  d("handleMenuItemClick", l);
626
626
  };
627
- return (l, i) => {
627
+ return (l, m) => {
628
628
  const g = r("el-menu");
629
- return a(), o(g, X(Z(l.$attrs)), {
629
+ return a(), o(g, ee(te(l.$attrs)), {
630
630
  default: s(() => [
631
- (a(!0), v(V, null, D(t.menuList, (f) => (a(), o(ve, {
632
- routeData: f,
631
+ (a(!0), v(V, null, D(t.menuList, (p) => (a(), o(ke, {
632
+ routeData: p,
633
633
  onHandleMenuItemClick: c
634
634
  }, null, 8, ["routeData"]))), 256))
635
635
  ]),
@@ -637,7 +637,7 @@ const L = /* @__PURE__ */ T(be, [["render", ye], ["__scopeId", "data-v-261ce99a"
637
637
  }, 16);
638
638
  };
639
639
  }
640
- }), ke = /* @__PURE__ */ H({
640
+ }), we = /* @__PURE__ */ H({
641
641
  name: "Pagination",
642
642
  __name: "index",
643
643
  props: {
@@ -666,32 +666,32 @@ const L = /* @__PURE__ */ T(be, [["render", ye], ["__scopeId", "data-v-261ce99a"
666
666
  },
667
667
  emits: ["update:page", "update:limit", "pagination"],
668
668
  setup(t, { emit: u }) {
669
- const d = t, c = u, l = computed({
669
+ const d = t, c = u, l = R({
670
670
  get() {
671
671
  return d.page;
672
672
  },
673
- set(m) {
674
- c("update:page", m);
673
+ set(i) {
674
+ c("update:page", i);
675
675
  }
676
- }), i = computed({
676
+ }), m = R({
677
677
  get() {
678
678
  return d.limit;
679
679
  },
680
- set(m) {
681
- c("update:limit", m);
680
+ set(i) {
681
+ c("update:limit", i);
682
682
  }
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 });
683
+ }), g = (i) => {
684
+ l.value * i > d.total && (l.value = 1), c("pagination", { page: l.value, limit: i });
685
+ }, p = (i) => {
686
+ c("pagination", { page: i, limit: m.value });
687
687
  };
688
- return (m, b) => {
688
+ return (i, b) => {
689
689
  const y = r("el-pagination");
690
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),
691
+ "current-page": l.value,
692
+ "onUpdate:currentPage": b[0] || (b[0] = (C) => l.value = C),
693
+ "page-size": m.value,
694
+ "onUpdate:pageSize": b[1] || (b[1] = (C) => m.value = C),
695
695
  background: !0,
696
696
  "page-sizes": [10, 20, 30, 50, 100],
697
697
  "pager-count": t.pagerCount,
@@ -699,31 +699,31 @@ const L = /* @__PURE__ */ T(be, [["render", ye], ["__scopeId", "data-v-261ce99a"
699
699
  class: "pagination",
700
700
  layout: "total, sizes, prev, pager, next, jumper",
701
701
  onSizeChange: g,
702
- onCurrentChange: f
702
+ onCurrentChange: p
703
703
  }, null, 8, ["current-page", "page-size", "pager-count", "total"])), [
704
- [ee, t.total > 0]
704
+ [ae, t.total > 0]
705
705
  ]);
706
706
  };
707
707
  }
708
- }), De = /* @__PURE__ */ T(ke, [["__scopeId", "data-v-3d378ae6"]]), we = [
709
- de,
708
+ }), _e = /* @__PURE__ */ T(we, [["__scopeId", "data-v-1e34e383"]]), Ve = [
710
709
  ce,
710
+ me,
711
711
  fe,
712
- ge,
713
- Ce,
714
- De
715
- ], O = [], _e = (t) => {
716
- we.forEach((u) => {
712
+ ye,
713
+ De,
714
+ _e
715
+ ], O = [], xe = (t) => {
716
+ Ve.forEach((u) => {
717
717
  O.push(u.name), t.component(u.name, u);
718
718
  }), console.log("mwl-components", O);
719
- }, xe = { install: _e };
719
+ }, He = { install: xe };
720
720
  export {
721
- de as ContentWarp,
722
- ce as Dialog,
721
+ ce as ContentWarp,
722
+ me as Dialog,
723
723
  fe as EasyForm,
724
- ge as EasyTable,
725
- Ce as MenuTree,
726
- De as Pagination,
727
- xe as default,
728
- _e as install
724
+ ye as EasyTable,
725
+ De as MenuTree,
726
+ _e as Pagination,
727
+ He as default,
728
+ xe as install
729
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}.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}}
1
+ .el-card[data-v-15c93817]{background-color:transparent;margin-bottom:10px}[data-v-15c93817] .el-card__body:has(>.el-form){padding:18px 20px 0}[data-v-15c93817] .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-217a24bd] .el-table,[data-v-217a24bd] th.el-table__cell,[data-v-217a24bd] 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-1e34e383]{margin-top:15px;margin-bottom:15px;float:right}@media screen and (max-width: 1370px){.pagination[data-v-1e34e383]{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.7",
3
+ "version": "0.0.9",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 zzm
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.