@aplus-frontend/ui 0.1.37 → 0.1.39

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.
Files changed (51) hide show
  1. package/es/src/ap-descriptions/formatter/index.mjs +24 -24
  2. package/es/src/ap-form/interface.d.ts +29 -1
  3. package/es/src/ap-form/modal-form/index.vue.mjs +56 -47
  4. package/es/src/ap-form/style/drawer-form.css +10 -0
  5. package/es/src/ap-table/ap-table.vue.mjs +69 -68
  6. package/es/src/ap-table/components/setting/modal/index.vue2.mjs +1 -1
  7. package/es/src/ap-table/hooks/use-table-column-state.d.ts +2 -2
  8. package/es/src/ap-table/hooks/use-table-column-state.mjs +37 -37
  9. package/es/src/ap-table/style/ap-table.css +6 -0
  10. package/es/src/business/ap-card/ApCard.vue2.mjs +18 -20
  11. package/es/src/business/ap-select-layout/interface.d.ts +1 -0
  12. package/es/src/business/ap-select-layout/select-layout.vue2.mjs +66 -62
  13. package/es/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +23 -0
  14. package/es/src/business/ap-table-modal/hooks/use-create-table-modal.mjs +41 -24
  15. package/es/src/business/ap-table-modal/hooks/use-table-modal.d.ts +24 -0
  16. package/es/src/business/ap-table-modal/hooks/use-table-modal.mjs +12 -11
  17. package/es/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +24 -0
  18. package/es/src/business/ap-table-modal/hooks/use-table-select-modal.mjs +11 -10
  19. package/es/src/business/ap-table-modal/index.d.ts +21 -0
  20. package/es/src/business/ap-table-modal/table-modal.vue.d.ts +21 -0
  21. package/es/src/business/ap-table-modal/table-modal.vue2.mjs +31 -30
  22. package/es/src/business/index.d.ts +1 -0
  23. package/es/src/theme/ap-form/drawer-form.css +10 -0
  24. package/es/src/theme/ap-table/ap-table.css +6 -0
  25. package/es/src/theme/css-var/index.mjs +10 -0
  26. package/lib/src/ap-descriptions/formatter/index.js +1 -1
  27. package/lib/src/ap-form/interface.d.ts +29 -1
  28. package/lib/src/ap-form/modal-form/index.vue.js +1 -1
  29. package/lib/src/ap-form/style/drawer-form.css +10 -0
  30. package/lib/src/ap-table/ap-table.vue.js +1 -1
  31. package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
  32. package/lib/src/ap-table/hooks/use-table-column-state.d.ts +2 -2
  33. package/lib/src/ap-table/hooks/use-table-column-state.js +1 -1
  34. package/lib/src/ap-table/style/ap-table.css +6 -0
  35. package/lib/src/business/ap-card/ApCard.vue2.js +1 -1
  36. package/lib/src/business/ap-select-layout/interface.d.ts +1 -0
  37. package/lib/src/business/ap-select-layout/select-layout.vue2.js +1 -1
  38. package/lib/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +23 -0
  39. package/lib/src/business/ap-table-modal/hooks/use-create-table-modal.js +1 -1
  40. package/lib/src/business/ap-table-modal/hooks/use-table-modal.d.ts +24 -0
  41. package/lib/src/business/ap-table-modal/hooks/use-table-modal.js +1 -1
  42. package/lib/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +24 -0
  43. package/lib/src/business/ap-table-modal/hooks/use-table-select-modal.js +1 -1
  44. package/lib/src/business/ap-table-modal/index.d.ts +21 -0
  45. package/lib/src/business/ap-table-modal/table-modal.vue.d.ts +21 -0
  46. package/lib/src/business/ap-table-modal/table-modal.vue2.js +1 -1
  47. package/lib/src/business/index.d.ts +1 -0
  48. package/lib/src/theme/ap-form/drawer-form.css +10 -0
  49. package/lib/src/theme/ap-table/ap-table.css +6 -0
  50. package/lib/src/theme/css-var/index.js +1 -1
  51. package/package.json +1 -1
@@ -47,7 +47,7 @@ const ne = {
47
47
  }
48
48
  }) : null;
49
49
  function I() {
50
- V(B(w));
50
+ V(B(e(w)));
51
51
  }
52
52
  function O() {
53
53
  var t, o;
@@ -1,5 +1,5 @@
1
1
  import { ApColumnState, ApTableSettingType } from '../interface';
2
- import { Ref, ComputedRef } from 'vue';
2
+ import { Ref, ComputedRef, ShallowRef } from 'vue';
3
3
  export declare const useTableColumnState: (columnSetting: ApTableSettingType, initialColumnState: ApColumnState[]) => {
4
4
  columnState: Ref<{
5
5
  key: string | number;
@@ -16,7 +16,7 @@ export declare const useTableColumnState: (columnSetting: ApTableSettingType, in
16
16
  setColumnState: (nextColumnState: ApColumnState[]) => void;
17
17
  isAllSelected: ComputedRef<boolean>;
18
18
  toggleSelectAll: () => void;
19
- columnStateBackup: ApColumnState[];
19
+ columnStateBackup: ShallowRef<ApColumnState[]>;
20
20
  setColumnStateBackup: (nextBackup: ApColumnState[]) => void;
21
21
  cacheColumnStateIfNeeded: (nextColumnState: ApColumnState[]) => void;
22
22
  };
@@ -1,50 +1,50 @@
1
- import { ref as _, unref as i, computed as j, watchEffect as z } from "vue";
1
+ import { ref as R, shallowRef as _, unref as i, computed as j, watchEffect as z } from "vue";
2
2
  import { isDef as D } from "../../utils/index.mjs";
3
- import G, { customCloneColumnStates as k, getColumnStateString as R } from "../components/setting/utils.mjs";
4
- import { useInjectApTable as W } from "../context.mjs";
5
- import { isObject as v, mergeWith as E, isBoolean as X, omit as q, isNumber as N } from "lodash-unified";
6
- function f(r, o) {
3
+ import G, { customCloneColumnStates as A, getColumnStateString as W } from "../components/setting/utils.mjs";
4
+ import { useInjectApTable as X } from "../context.mjs";
5
+ import { isObject as k, mergeWith as E, isBoolean as q, omit as H, isNumber as N } from "lodash-unified";
6
+ function u(r, n) {
7
7
  r.forEach((t) => {
8
8
  var c;
9
- o(t), (c = t.children) != null && c.length && f(t.children, o);
9
+ n(t), (c = t.children) != null && c.length && u(t.children, n);
10
10
  });
11
11
  }
12
- function H(r, o) {
13
- if (!o)
12
+ function L(r, n) {
13
+ if (!n)
14
14
  return {};
15
- const t = r.getItem(o);
15
+ const t = r.getItem(n);
16
16
  return t ? JSON.parse(t) : {};
17
17
  }
18
- function I(r, o) {
19
- if (v(r) && v(o))
20
- return E({}, r, o, I);
18
+ function I(r, n) {
19
+ if (k(r) && k(n))
20
+ return E({}, r, n, I);
21
21
  }
22
- const B = Number.MAX_SAFE_INTEGER, Z = (r, o) => {
23
- const t = _(o);
24
- let c = k(o);
25
- const { columnsBackup: h, updateColumns: u } = W(), T = r.persistenceType || "localStorage", S = window[T];
22
+ const B = Number.MAX_SAFE_INTEGER, $ = (r, n) => {
23
+ const t = R(n), c = _(
24
+ A(n)
25
+ ), { columnsBackup: h, updateColumns: f } = X(), T = r.persistenceType || "localStorage", S = window[T];
26
26
  function F() {
27
- const e = H(
27
+ const e = L(
28
28
  S,
29
29
  r.persistenceKey
30
- ), n = E(
30
+ ), o = E(
31
31
  {},
32
32
  r.defaultValue || {},
33
33
  e,
34
34
  I
35
35
  ), l = i(h);
36
- function b(M, d, x) {
36
+ function v(M, d, b) {
37
37
  return M.map((s) => {
38
- var A;
38
+ var x;
39
39
  const a = (d == null ? void 0 : d[s.key]) || {}, m = {
40
40
  key: s.key,
41
41
  label: s.title,
42
42
  show: !0,
43
- fixed: x ? x.fixed : X(s.fixed) ? s.fixed ? "left" : void 0 : s.fixed,
43
+ fixed: b ? b.fixed : q(s.fixed) ? s.fixed ? "left" : void 0 : s.fixed,
44
44
  disabled: !1,
45
- ...q(a, "children")
45
+ ...H(a, "children")
46
46
  };
47
- return m.children = (A = s.children) != null && A.length ? b(
47
+ return m.children = (x = s.children) != null && x.length ? v(
48
48
  s.children,
49
49
  a.children,
50
50
  m
@@ -53,49 +53,49 @@ const B = Number.MAX_SAFE_INTEGER, Z = (r, o) => {
53
53
  (s, a) => (N(s.order) ? s.order : B) - (N(a.order) ? a.order : B)
54
54
  );
55
55
  }
56
- return b(l || [], n);
56
+ return v(l || [], o);
57
57
  }
58
58
  const g = j(() => i(t).every((e) => e.show));
59
59
  function p() {
60
60
  const e = i(t);
61
- f(e, (n) => {
62
- !n.disabled && (n.show = !0);
61
+ u(e, (o) => {
62
+ !o.disabled && (o.show = !0);
63
63
  });
64
64
  }
65
65
  function C() {
66
66
  const e = i(t);
67
- f(e, (n) => {
68
- !n.disabled && (n.show = !1);
67
+ u(e, (o) => {
68
+ !o.disabled && (o.show = !1);
69
69
  });
70
70
  }
71
71
  function O() {
72
72
  i(g) ? C() : p();
73
73
  }
74
- function K(e, n) {
75
- f(i(t), (l) => {
76
- l.key === e && (l.show = D(n) ? n : !l.show);
74
+ function K(e, o) {
75
+ u(i(t), (l) => {
76
+ l.key === e && (l.show = D(o) ? o : !l.show);
77
77
  });
78
78
  }
79
79
  function w(e) {
80
80
  t.value = e;
81
81
  }
82
82
  function J(e) {
83
- c = e;
83
+ c.value = e;
84
84
  }
85
85
  function y(e) {
86
86
  if (r.persistenceKey) {
87
- const n = R(e);
88
- S.setItem(r.persistenceKey, JSON.stringify(n));
87
+ const o = W(e);
88
+ S.setItem(r.persistenceKey, JSON.stringify(o));
89
89
  }
90
90
  }
91
91
  return z(() => {
92
92
  const e = F();
93
- w(e), u == null || u(
93
+ w(e), f == null || f(
94
94
  G(
95
95
  i(h),
96
96
  i(e)
97
97
  )
98
- ), c = k(e), y(e);
98
+ ), c.value = A(e), y(e);
99
99
  }), {
100
100
  columnState: t,
101
101
  selectAll: p,
@@ -110,5 +110,5 @@ const B = Number.MAX_SAFE_INTEGER, Z = (r, o) => {
110
110
  };
111
111
  };
112
112
  export {
113
- Z as useTableColumnState
113
+ $ as useTableColumnState
114
114
  };
@@ -126,3 +126,9 @@
126
126
  word-break: break-all;
127
127
  flex: 1;
128
128
  }
129
+ .aplus-ap-table-setting-trigger-button {
130
+ color: var(--ap-table-setting-button-color, #8896B0);
131
+ }
132
+ .aplus-ap-table-setting-trigger-button:hover {
133
+ color: unset;
134
+ }
@@ -1,4 +1,4 @@
1
- import { defineComponent as g, computed as r, openBlock as t, createElementBlock as s, normalizeClass as C, unref as x, normalizeStyle as h, createBlock as a, mergeProps as S, createSlots as B, withCtx as P, isVNode as p, resolveDynamicComponent as y, toDisplayString as _, createCommentVNode as N, renderSlot as $ } from "vue";
1
+ import { defineComponent as g, computed as r, openBlock as t, createElementBlock as s, normalizeClass as C, unref as u, normalizeStyle as h, createBlock as a, mergeProps as S, createSlots as B, withCtx as x, isVNode as P, resolveDynamicComponent as y, toDisplayString as _, createCommentVNode as N, renderSlot as $ } from "vue";
2
2
  import "./index.css";
3
3
  import "../ap-title/ApTitle.vue.mjs";
4
4
  import { omit as b } from "lodash-unified";
@@ -12,44 +12,42 @@ const V = { key: 1 }, j = { key: 1 }, H = /* @__PURE__ */ g({
12
12
  padding: {}
13
13
  },
14
14
  setup(k) {
15
- const e = k, { b: f } = z("ap-card"), m = r(
15
+ const e = k, { b: f } = z("ap-card"), v = r(
16
16
  () => b((e == null ? void 0 : e.titleProps) || {}, ["prefix", "suffix"])
17
- ), c = r(
18
- () => {
19
- var n;
20
- return (n = Object.keys(m.value || {})) == null ? void 0 : n.length;
21
- }
22
- ), v = r(() => e.padding ?? (c.value ? "14px 24px 24px" : "24px"));
17
+ ), m = r(() => {
18
+ var n;
19
+ return (n = Object.keys((e == null ? void 0 : e.titleProps) || {})) == null ? void 0 : n.length;
20
+ }), p = r(() => e.padding ?? (m.value ? "14px 24px 24px" : "24px"));
23
21
  return (n, w) => {
24
- var d, u;
22
+ var c, d;
25
23
  return t(), s("div", {
26
- class: C([x(f)()]),
24
+ class: C([u(f)()]),
27
25
  style: h({
28
- padding: v.value
26
+ padding: p.value
29
27
  })
30
28
  }, [
31
- c.value ? (t(), a(D, S({
29
+ m.value ? (t(), a(D, S({
32
30
  key: 0,
33
- class: [`${x(f)()}-title`]
31
+ class: [`${u(f)()}-title`]
34
32
  }, {
35
- ...m.value
33
+ ...v.value
36
34
  }), B({ _: 2 }, [
37
- (d = e == null ? void 0 : e.titleProps) != null && d.suffix ? {
35
+ (c = e == null ? void 0 : e.titleProps) != null && c.suffix ? {
38
36
  name: "suffix",
39
- fn: P(() => {
37
+ fn: x(() => {
40
38
  var i, o, l;
41
39
  return [
42
- p((i = e == null ? void 0 : e.titleProps) == null ? void 0 : i.suffix) ? (t(), a(y((o = e == null ? void 0 : e.titleProps) == null ? void 0 : o.suffix), { key: 0 })) : (t(), s("div", V, _((l = e == null ? void 0 : e.titleProps) == null ? void 0 : l.suffix), 1))
40
+ P((i = e == null ? void 0 : e.titleProps) == null ? void 0 : i.suffix) ? (t(), a(y((o = e == null ? void 0 : e.titleProps) == null ? void 0 : o.suffix), { key: 0 })) : (t(), s("div", V, _((l = e == null ? void 0 : e.titleProps) == null ? void 0 : l.suffix), 1))
43
41
  ];
44
42
  }),
45
43
  key: "0"
46
44
  } : void 0,
47
- (u = e == null ? void 0 : e.titleProps) != null && u.prefix ? {
45
+ (d = e == null ? void 0 : e.titleProps) != null && d.prefix ? {
48
46
  name: "prefix",
49
- fn: P(() => {
47
+ fn: x(() => {
50
48
  var i, o, l;
51
49
  return [
52
- p((i = e == null ? void 0 : e.titleProps) == null ? void 0 : i.prefix) ? (t(), a(y((o = e == null ? void 0 : e.titleProps) == null ? void 0 : o.prefix), { key: 0 })) : (t(), s("div", j, _((l = e == null ? void 0 : e.titleProps) == null ? void 0 : l.prefix), 1))
50
+ P((i = e == null ? void 0 : e.titleProps) == null ? void 0 : i.prefix) ? (t(), a(y((o = e == null ? void 0 : e.titleProps) == null ? void 0 : o.prefix), { key: 0 })) : (t(), s("div", j, _((l = e == null ? void 0 : e.titleProps) == null ? void 0 : l.prefix), 1))
53
51
  ];
54
52
  }),
55
53
  key: "1"
@@ -5,5 +5,6 @@ export interface ApSelectItem {
5
5
  export interface ApSelectLayoutProps<T extends ApSelectItem> {
6
6
  title: string;
7
7
  request: () => Promise<T[]>;
8
+ onSearch?: (item: T, val: string) => boolean;
8
9
  defaultFold?: boolean;
9
10
  }
@@ -1,4 +1,4 @@
1
- import { defineComponent as M, ref as s, computed as O, onMounted as U, openBlock as p, createElementBlock as v, normalizeClass as n, unref as e, createVNode as r, Transition as W, withCtx as i, withDirectives as S, createElementVNode as a, toDisplayString as $, createTextVNode as x, Fragment as z, renderList as R, renderSlot as A, vShow as N, createCommentVNode as j } from "vue";
1
+ import { defineComponent as M, ref as r, computed as O, onMounted as U, openBlock as p, createElementBlock as f, normalizeClass as o, unref as e, createVNode as d, Transition as W, withCtx as u, withDirectives as E, createElementVNode as s, toDisplayString as $, createTextVNode as x, Fragment as z, renderList as R, renderSlot as A, vShow as N, createCommentVNode as j } from "vue";
2
2
  import "../../ap-field/index.mjs";
3
3
  import { IconApLeftarrow as G, IconApMenu as H } from "@aplus-frontend/icon";
4
4
  import "../../config-provider/index.mjs";
@@ -12,127 +12,131 @@ const X = ["onClick"], de = /* @__PURE__ */ M({
12
12
  props: {
13
13
  title: {},
14
14
  request: {},
15
+ onSearch: {},
15
16
  defaultFold: { type: Boolean, default: !1 }
16
17
  },
17
18
  emits: ["onSelect", "afterEnter", "afterLeave"],
18
19
  setup(_, { emit: w }) {
19
- const { b: m, be: f, bem: d } = P("ap-select-layout"), c = _, h = w, y = s(), u = s(c.defaultFold), C = s(!c.defaultFold), g = s(), T = s(), b = s(), k = s(""), L = () => {
20
- u.value = !u.value, g.value = !1, T.value = !1;
20
+ const { b: m, be: h, bem: i } = P("ap-select-layout"), a = _, y = w, C = r(), v = r(a.defaultFold), g = r(!a.defaultFold), S = r(), T = r(), b = r(), k = r(""), L = () => {
21
+ v.value = !v.value, S.value = !1, T.value = !1;
21
22
  }, F = (t) => {
22
- b.value = t, h("onSelect", t);
23
+ b.value = t, y("onSelect", t);
23
24
  }, B = K((t) => {
24
- var l;
25
- k.value = (l = t.target) == null ? void 0 : l.value;
25
+ var n;
26
+ k.value = (n = t.target) == null ? void 0 : n.value;
26
27
  }, 500), q = O(() => {
27
28
  var t;
28
- return (t = y.value) == null ? void 0 : t.filter((l) => l.name.includes(k.value));
29
+ return (t = C.value) == null ? void 0 : t.filter((n) => {
30
+ var c, l;
31
+ return a != null && a.onSearch ? (c = a.onSearch) == null ? void 0 : c.call(a, n, k.value) : (l = n == null ? void 0 : n.name) == null ? void 0 : l.includes(k.value);
32
+ });
29
33
  }), D = (t) => {
30
- C.value = !0, h("afterEnter", t);
34
+ g.value = !0, y("afterEnter", t);
31
35
  }, I = (t) => {
32
- C.value = !1, h("afterLeave", t);
36
+ g.value = !1, y("afterLeave", t);
33
37
  };
34
38
  return U(() => {
35
- c.request().then((t) => {
36
- var l;
37
- y.value = t, F((l = y.value) == null ? void 0 : l[0]);
39
+ a.request().then((t) => {
40
+ var n;
41
+ C.value = t, F((n = C.value) == null ? void 0 : n[0]);
38
42
  });
39
- }), (t, l) => {
40
- var E;
41
- return p(), v("div", {
42
- class: n(e(m)())
43
+ }), (t, n) => {
44
+ var c;
45
+ return p(), f("div", {
46
+ class: o(e(m)())
43
47
  }, [
44
- r(W, {
48
+ d(W, {
45
49
  mode: "out-in",
46
50
  onAfterEnter: D,
47
51
  onAfterLeave: I
48
52
  }, {
49
- default: i(() => [
50
- S(a("div", {
51
- class: n(e(m)("side"))
53
+ default: u(() => [
54
+ E(s("div", {
55
+ class: o(e(m)("side"))
52
56
  }, [
53
- a("div", {
54
- class: n(e(f)("side", "header"))
57
+ s("div", {
58
+ class: o(e(h)("side", "header"))
55
59
  }, [
56
- a("h3", null, $(c.title), 1),
57
- a("div", {
58
- class: n(e(d)("side", "header", "imgWrap"))
60
+ s("h3", null, $(a.title), 1),
61
+ s("div", {
62
+ class: o(e(i)("side", "header", "imgWrap"))
59
63
  }, [
60
- r(e(V), {
61
- open: g.value,
62
- "onUpdate:open": l[0] || (l[0] = (o) => g.value = o)
64
+ d(e(V), {
65
+ open: S.value,
66
+ "onUpdate:open": n[0] || (n[0] = (l) => S.value = l)
63
67
  }, {
64
- title: i(() => [
68
+ title: u(() => [
65
69
  x("收起")
66
70
  ]),
67
- default: i(() => [
68
- r(e(G), { onClick: L })
71
+ default: u(() => [
72
+ d(e(G), { onClick: L })
69
73
  ]),
70
74
  _: 1
71
75
  }, 8, ["open"])
72
76
  ], 2)
73
77
  ], 2),
74
- a("div", {
75
- class: n(e(f)("side", "body"))
78
+ s("div", {
79
+ class: o(e(h)("side", "body"))
76
80
  }, [
77
- a("div", {
78
- class: n(e(d)("side", "body", "search"))
81
+ s("div", {
82
+ class: o(e(i)("side", "body", "search"))
79
83
  }, [
80
- r(e(Q), {
84
+ d(e(Q), {
81
85
  placeholder: "请输入",
82
86
  onChange: e(B)
83
87
  }, null, 8, ["onChange"])
84
88
  ], 2),
85
- a("div", {
86
- class: n(e(d)("side", "body", "scroll"))
89
+ s("div", {
90
+ class: o(e(i)("side", "body", "scroll"))
87
91
  }, [
88
- (p(!0), v(z, null, R(q.value, (o) => S((p(), v("div", {
89
- key: o.value,
90
- class: n(`${e(d)("side", "body", "scroll-item")} ${b.value === o ? "active" : ""}`),
91
- onClick: (Y) => F(o)
92
+ (p(!0), f(z, null, R(q.value, (l) => E((p(), f("div", {
93
+ key: l.value,
94
+ class: o(`${e(i)("side", "body", "scroll-item")} ${b.value === l ? "active" : ""}`),
95
+ onClick: (Y) => F(l)
92
96
  }, [
93
- A(t.$slots, "itemRender", { item: o }, () => [
94
- r(e(J), {
95
- ellipsis: { tooltip: o.name },
96
- content: `${o.name}`
97
+ A(t.$slots, "itemRender", { item: l }, () => [
98
+ d(e(J), {
99
+ ellipsis: { tooltip: l.name },
100
+ content: `${l.name}`
97
101
  }, null, 8, ["ellipsis", "content"])
98
102
  ])
99
103
  ], 10, X)), [
100
- [N, C.value]
104
+ [N, g.value]
101
105
  ])), 128))
102
106
  ], 2)
103
107
  ], 2)
104
108
  ], 2), [
105
- [N, !u.value]
109
+ [N, !v.value]
106
110
  ])
107
111
  ]),
108
112
  _: 3
109
113
  }),
110
- a("div", {
111
- class: n(e(m)("content"))
114
+ s("div", {
115
+ class: o(e(m)("content"))
112
116
  }, [
113
- a("div", {
114
- class: n(e(f)("content", "header"))
117
+ s("div", {
118
+ class: o(e(h)("content", "header"))
115
119
  }, [
116
- u.value ? (p(), v("div", {
120
+ v.value ? (p(), f("div", {
117
121
  key: 0,
118
- class: n(e(d)("content", "header", "imgWrap"))
122
+ class: o(e(i)("content", "header", "imgWrap"))
119
123
  }, [
120
- r(e(V), {
124
+ d(e(V), {
121
125
  open: T.value,
122
- "onUpdate:open": l[1] || (l[1] = (o) => T.value = o)
126
+ "onUpdate:open": n[1] || (n[1] = (l) => T.value = l)
123
127
  }, {
124
- title: i(() => [
128
+ title: u(() => [
125
129
  x("展开")
126
130
  ]),
127
- default: i(() => [
128
- r(e(H), { onClick: L })
131
+ default: u(() => [
132
+ d(e(H), { onClick: L })
129
133
  ]),
130
134
  _: 1
131
135
  }, 8, ["open"])
132
136
  ], 2)) : j("", !0),
133
- a("div", {
134
- class: n(e(d)("content", "header", "title"))
135
- }, $((E = b.value) == null ? void 0 : E.name), 3)
137
+ s("div", {
138
+ class: o(e(i)("content", "header", "title"))
139
+ }, $((c = b.value) == null ? void 0 : c.name), 3)
136
140
  ], 2),
137
141
  A(t.$slots, "default")
138
142
  ], 2)
@@ -1,7 +1,30 @@
1
1
  import { OpenOptions, UseCreateTableModalProps, OpenReturnType } from '../interface';
2
+ import { Recordable } from '../../../type';
3
+ import { TableColumnsType } from 'ant-design-vue';
2
4
  export declare function useCreateTableModal(props: UseCreateTableModalProps): {
3
5
  readonly openModal: <T>(selected?: any[], options?: OpenOptions) => Promise< OpenReturnType<T> | undefined>;
4
6
  readonly closeModal: () => void;
5
7
  readonly destroy: () => void;
8
+ readonly reloadApTableData: () => void;
9
+ readonly resetApTableData: () => void;
10
+ readonly getApTableInstance: () => {
11
+ submit: () => void;
12
+ reset: () => void;
13
+ refresh: () => void;
14
+ setSearchFormValues: (fields: Partial< Recordable>) => void;
15
+ getSearchFormValues: () => Partial< Recordable>;
16
+ dataSource: any;
17
+ rowSelection?: {
18
+ select: (item: any) => void;
19
+ selectAll: () => void;
20
+ unSelectAll: () => void;
21
+ selectedRows: any[];
22
+ unSelect: (item: any) => void;
23
+ isSelected: (item: any) => boolean;
24
+ clearAll: () => void;
25
+ toggleSelect: (item: any) => void;
26
+ } | undefined;
27
+ getShownColumns: () => TableColumnsType<any>;
28
+ } | null | undefined;
6
29
  readonly isDestroyed: true;
7
30
  };
@@ -1,40 +1,57 @@
1
- import { ref as v, defineComponent as C, h as r, render as a, onUnmounted as y } from "vue";
1
+ import { ref as T, defineComponent as g, h as r, render as u, onUnmounted as C } from "vue";
2
2
  import "../table-modal.vue.mjs";
3
3
  import "../../../index.mjs";
4
- import { omit as h } from "lodash-unified";
5
- import { ConfigProvider as M, globalConfigCached as b } from "../../../config-provider/config-provider.mjs";
6
- import g from "../table-modal.vue2.mjs";
7
- function E(d) {
8
- let o = !0;
9
- const i = document.body, t = v(), { destroyOnUnmounted: s = !0 } = d, n = document.createElement("div"), u = () => {
10
- const e = C({
4
+ import { omit as y } from "lodash-unified";
5
+ import { ConfigProvider as A, globalConfigCached as h } from "../../../config-provider/config-provider.mjs";
6
+ import I from "../table-modal.vue2.mjs";
7
+ function E(l) {
8
+ let n = !0;
9
+ const s = document.body, t = T(), { destroyOnUnmounted: i = !0 } = l, a = document.createElement("div"), m = () => {
10
+ const e = g({
11
11
  setup() {
12
12
  return () => r(
13
- M,
14
- { ...b.value },
15
- r(g, {
16
- ...h(d, "destroyOnUnmounted"),
13
+ A,
14
+ { ...h.value },
15
+ r(I, {
16
+ ...y(l, "destroyOnUnmounted"),
17
17
  ref: t
18
18
  })
19
19
  );
20
20
  }
21
21
  });
22
- i.appendChild(n), a(r(e), n), o = !1;
23
- }, l = () => {
22
+ s.appendChild(a), u(r(e), a), n = !1;
23
+ }, c = () => {
24
24
  var e;
25
- (e = t.value) == null || e.close(), o || setTimeout(() => {
26
- a(null, n), i.removeChild(n), o = !0;
25
+ (e = t.value) == null || e.close(), n || setTimeout(() => {
26
+ u(null, a), s.removeChild(a), n = !0;
27
27
  }, 400);
28
- }, c = async (e = [], p = {}) => {
29
- var m;
30
- return t.value || u(), (m = t.value) == null ? void 0 : m.open(e, p);
31
- }, f = () => {
28
+ }, f = async (e = [], o = {}) => {
29
+ var d;
30
+ return t.value || m(), (d = t.value) == null ? void 0 : d.open(e, o);
31
+ }, p = () => {
32
32
  var e;
33
- o || (e = t.value) == null || e.close();
33
+ n || (e = t.value) == null || e.close();
34
+ }, v = () => {
35
+ var e, o;
36
+ (o = (e = t.value) == null ? void 0 : e.getApTableInstance()) == null || o.submit();
37
+ }, b = () => {
38
+ var e, o;
39
+ (o = (e = t.value) == null ? void 0 : e.getApTableInstance()) == null || o.reset();
40
+ };
41
+ return C(() => {
42
+ i && c();
43
+ }), {
44
+ openModal: f,
45
+ closeModal: p,
46
+ destroy: c,
47
+ reloadApTableData: v,
48
+ resetApTableData: b,
49
+ getApTableInstance: () => {
50
+ var e;
51
+ return (e = t.value) == null ? void 0 : e.getApTableInstance();
52
+ },
53
+ isDestroyed: n
34
54
  };
35
- return y(() => {
36
- s && l();
37
- }), { openModal: c, closeModal: f, destroy: l, isDestroyed: o };
38
55
  }
39
56
  export {
40
57
  E as useCreateTableModal
@@ -1,6 +1,30 @@
1
1
  import { ApTableModalProps, OpenOptions } from '../interface';
2
+ import { Recordable } from '../../../type';
3
+ import { TableColumnsType } from 'ant-design-vue';
2
4
  /** 函数式调用弹框表格 */
3
5
  export declare function useTableModal<TableRowType = Record<string, any>>(props: ApTableModalProps<TableRowType>): {
6
+ reloadApTableData: () => void;
7
+ resetApTableData: () => void;
8
+ getApTableInstance: () => {
9
+ submit: () => void;
10
+ reset: () => void;
11
+ refresh: () => void;
12
+ setSearchFormValues: (fields: Partial< Recordable>) => void;
13
+ getSearchFormValues: () => Partial< Recordable>;
14
+ dataSource: any;
15
+ rowSelection?: {
16
+ select: (item: any) => void;
17
+ selectAll: () => void;
18
+ unSelectAll: () => void;
19
+ selectedRows: any[];
20
+ unSelect: (item: any) => void;
21
+ isSelected: (item: any) => boolean;
22
+ clearAll: () => void;
23
+ toggleSelect: (item: any) => void;
24
+ } | undefined;
25
+ getShownColumns: () => TableColumnsType<any>;
26
+ } | null | undefined;
27
+ isDestroyed: true;
4
28
  open: (options?: OpenOptions) => Promise<void>;
5
29
  destroy: () => void;
6
30
  close: () => void;
@@ -1,8 +1,8 @@
1
- import { onUnmounted as d } from "vue";
2
- import { merge as p } from "lodash-unified";
3
- import { useCreateTableModal as f } from "./use-create-table-modal.mjs";
4
- function P(l) {
5
- const t = p(l, {
1
+ import { onUnmounted as p } from "vue";
2
+ import { merge as f } from "lodash-unified";
3
+ import { useCreateTableModal as u } from "./use-create-table-modal.mjs";
4
+ function T(t) {
5
+ const l = f(t, {
6
6
  ...{
7
7
  footer: null
8
8
  },
@@ -11,19 +11,20 @@ function P(l) {
11
11
  },
12
12
  destroyOnUnmounted: !1,
13
13
  isRenderModalTitleSuffix: !1
14
- }), { destroy: o, openModal: r, closeModal: s } = f(t), a = async (n) => {
15
- r([], n);
14
+ }), { destroy: o, openModal: r, closeModal: s, ...a } = u(l), n = async (d) => {
15
+ r([], d);
16
16
  }, e = () => {
17
17
  s();
18
18
  };
19
- return d(() => {
19
+ return p(() => {
20
20
  e(), o();
21
21
  }), {
22
- open: a,
22
+ open: n,
23
23
  destroy: o,
24
- close: e
24
+ close: e,
25
+ ...a
25
26
  };
26
27
  }
27
28
  export {
28
- P as useTableModal
29
+ T as useTableModal
29
30
  };