@vrojs/element-plus 0.0.18 → 0.0.19

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.
@@ -1,71 +1,71 @@
1
- import { defineComponent as V, computed as A, reactive as D, createBlock as c, openBlock as a, unref as i, mergeProps as s, withCtx as l, renderSlot as p, normalizeProps as M, guardReactiveProps as z, createElementBlock as P, createCommentVNode as F, Fragment as v, renderList as w, withModifiers as T, createTextVNode as f, toDisplayString as b, createVNode as h, normalizeClass as K } from "vue";
1
+ import { defineComponent as M, computed as P, reactive as z, createBlock as u, openBlock as a, unref as s, mergeProps as c, withCtx as l, renderSlot as f, normalizeProps as k, guardReactiveProps as v, createElementBlock as w, createCommentVNode as F, Fragment as T, renderList as h, withModifiers as E, createTextVNode as p, toDisplayString as b, createVNode as L, normalizeClass as K } from "vue";
2
2
  import { pick as S, typedKeys as j, isFunction as R, isPromiseLike as q } from "@daysnap/utils";
3
- import { ElTableColumn as G, ElButton as E, ElDropdown as H, ElDropdownMenu as J, ElDropdownItem as O } from "element-plus";
3
+ import { ElTableColumn as G, ElButton as _, ElDropdown as H, ElDropdownMenu as J, ElDropdownItem as O } from "element-plus";
4
4
  import { useLocale as Q } from "../locale/useLocale.js";
5
5
  import { elTableColumnProps as U } from "../utils/elTableColumnProps.js";
6
6
  import "@vrojs/base";
7
7
  import { vroElTableActionsColumnProps as W } from "./types.js";
8
- const to = /* @__PURE__ */ V({
8
+ const to = /* @__PURE__ */ M({
9
9
  name: "VroElTableActionsColumn",
10
10
  __name: "vro-el-table-actions-column",
11
11
  props: W,
12
- setup(L) {
13
- const d = L, { t: g } = Q(), _ = A(() => {
12
+ setup(B) {
13
+ const d = B, { t: g } = Q(), N = P(() => {
14
14
  const o = S(d, j(U));
15
15
  return {
16
16
  ...o,
17
17
  label: d.label ?? g("tableActionsColumn.label"),
18
18
  className: ["vro-el-table-actions-column-cell", o.className].filter(Boolean).join(" ")
19
19
  };
20
- }), B = A(() => d.moreText ?? g("tableActionsColumn.moreText")), $ = D(/* @__PURE__ */ new Map()), m = (o, n, e) => (typeof o == "function" ? o(n, e) : o).filter((r) => !(R(r.hidden) ? r.hidden(n, e) : r.hidden)), u = (o, n) => o.key ?? `${n}-${o.label}`, y = (o, n, e) => !!$.get(`${n}-${u(o, e)}`), k = (o, n, e, t) => {
21
- $.set(`${n}-${u(o, e)}`, t);
22
- }, C = async (o, n, e, t) => {
23
- const r = o.onAction?.(n, e);
24
- if (!(!o.buttonProps?.icon || !q(r))) {
25
- k(o, e, t, !0);
20
+ }), V = P(() => d.moreText ?? g("tableActionsColumn.moreText")), $ = z(/* @__PURE__ */ new Map()), m = (o, r, e) => (typeof o == "function" ? o(r, e) : o).filter((n) => !(R(n.hidden) ? n.hidden(r, e) : n.hidden)), i = (o, r) => o.key ?? `${r}-${o.label}`, C = (o, r, e) => !!$.get(`${r}-${i(o, e)}`), y = (o, r, e, t) => {
21
+ $.set(`${r}-${i(o, e)}`, t);
22
+ }, A = async (o, r, e, t) => {
23
+ const n = o.onAction?.(r, e);
24
+ if (!(!o.buttonProps?.icon || !q(n))) {
25
+ y(o, e, t, !0);
26
26
  try {
27
- await r;
27
+ await n;
28
28
  } finally {
29
- k(o, e, t, !1);
29
+ y(o, e, t, !1);
30
30
  }
31
31
  }
32
32
  };
33
- return (o, n) => (a(), c(i(G), s(_.value, { class: "vro-el-table-actions-column" }), {
33
+ return (o, r) => (a(), u(s(G), c(N.value, { class: "vro-el-table-actions-column" }), {
34
34
  default: l((e) => [
35
- p(o.$slots, "default", M(z(e)), () => [
36
- (a(!0), P(v, null, w(m(o.actions, e.row, e.$index), (t, r) => (a(), c(i(E), s({
37
- key: u(t, r)
38
- }, { ref_for: !0 }, { link: !0, type: "primary", ...t.buttonProps }, {
39
- loading: y(t, e.$index, r),
40
- onClick: T((N) => C(t, e.row, e.$index, r), ["stop"])
35
+ f(o.$slots, "default", k(v(e)), () => [
36
+ (a(!0), w(T, null, h(m(o.actions, e.row, e.$index), (t, n) => (a(), u(s(_), c({
37
+ key: i(t, n)
38
+ }, { ref_for: !0 }, t.buttonProps, {
39
+ loading: C(t, e.$index, n),
40
+ onClick: E((D) => A(t, e.row, e.$index, n), ["stop"])
41
41
  }), {
42
42
  default: l(() => [
43
- p(o.$slots, "action", s({ ref_for: !0 }, { ...e, action: t }), () => [
44
- f(b(t.label), 1)
43
+ f(o.$slots, "action", c({ ref_for: !0 }, { ...e, action: t }), () => [
44
+ p(b(t.label), 1)
45
45
  ])
46
46
  ]),
47
47
  _: 2
48
48
  }, 1040, ["loading", "onClick"]))), 128)),
49
- m(o.moreActions, e.row, e.$index).length ? (a(), c(i(H), {
49
+ m(o.moreActions, e.row, e.$index).length ? (a(), u(s(H), {
50
50
  key: 0,
51
51
  trigger: o.moreTrigger
52
52
  }, {
53
53
  dropdown: l(() => [
54
- h(i(J), null, {
54
+ L(s(J), null, {
55
55
  default: l(() => [
56
- (a(!0), P(v, null, w(m(o.moreActions, e.row, e.$index), (t, r) => (a(), c(i(O), {
57
- key: u(t, r),
56
+ (a(!0), w(T, null, h(m(o.moreActions, e.row, e.$index), (t, n) => (a(), u(s(O), {
57
+ key: i(t, n),
58
58
  class: K([
59
59
  "vro-el-table-actions-column-dropdown-action",
60
60
  t.buttonProps?.type && `is-${t.buttonProps.type}`
61
61
  ]),
62
62
  icon: t.buttonProps?.icon,
63
- disabled: t.buttonProps?.disabled || y(t, e.$index, r),
64
- onClick: T((N) => C(t, e.row, e.$index, r), ["stop"])
63
+ disabled: t.buttonProps?.disabled || C(t, e.$index, n),
64
+ onClick: E((D) => A(t, e.row, e.$index, n), ["stop"])
65
65
  }, {
66
66
  default: l(() => [
67
- p(o.$slots, "more-action", s({ ref_for: !0 }, { ...e, action: t }), () => [
68
- f(b(t.label), 1)
67
+ f(o.$slots, "more-action", c({ ref_for: !0 }, { ...e, action: t }), () => [
68
+ p(b(t.label), 1)
69
69
  ])
70
70
  ]),
71
71
  _: 2
@@ -75,12 +75,9 @@ const to = /* @__PURE__ */ V({
75
75
  }, 1024)
76
76
  ]),
77
77
  default: l(() => [
78
- h(i(E), s({
79
- type: "primary",
80
- link: ""
81
- }, o.moreButtonProps), {
78
+ L(s(_), k(v(o.moreButtonProps)), {
82
79
  default: l(() => [
83
- f(b(B.value), 1)
80
+ p(b(V.value), 1)
84
81
  ]),
85
82
  _: 1
86
83
  }, 16)