@aplus-frontend/ui 6.38.0 → 6.39.1

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 (131) hide show
  1. package/es/index.mjs +110 -104
  2. package/es/src/ag-grid/hooks/use-columns-def.mjs +73 -71
  3. package/es/src/ag-grid/index.vue.mjs +201 -200
  4. package/es/src/ag-grid/interface.d.ts +14 -0
  5. package/es/src/ap-form/drawer-form/index.vue.d.ts +4 -0
  6. package/es/src/ap-form/modal-form/index.vue.d.ts +9 -1
  7. package/es/src/ap-modal/utils/createModal.mjs +34 -36
  8. package/es/src/ap-table/components/setting/modal/index.vue2.mjs +72 -71
  9. package/es/src/ap-table/interface.d.ts +6 -0
  10. package/es/src/business/ag-grid-modal/constants.d.ts +4 -0
  11. package/es/src/business/ag-grid-modal/constants.mjs +6 -0
  12. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +33 -0
  13. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +50 -0
  14. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +3 -0
  15. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.mjs +95 -0
  16. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -0
  17. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.mjs +165 -0
  18. package/es/src/business/ag-grid-modal/hooks/use-modal-title.d.ts +24 -0
  19. package/es/src/business/ag-grid-modal/hooks/use-modal-title.mjs +49 -0
  20. package/es/src/business/ag-grid-modal/index.d.ts +3 -0
  21. package/es/src/business/ag-grid-modal/index.mjs +8 -0
  22. package/es/src/business/ag-grid-modal/interface.d.ts +141 -0
  23. package/es/src/business/ag-grid-modal/modal-layout/index.vue.d.ts +44 -0
  24. package/es/src/business/ag-grid-modal/modal-layout/index.vue.mjs +4 -0
  25. package/es/src/business/ag-grid-modal/modal-layout/index.vue2.mjs +106 -0
  26. package/es/src/business/ag-grid-modal/selected-items/default.vue.d.ts +25 -0
  27. package/es/src/business/ag-grid-modal/selected-items/default.vue.mjs +4 -0
  28. package/es/src/business/ag-grid-modal/selected-items/default.vue2.mjs +33 -0
  29. package/es/src/business/ag-grid-modal/selected-items/index.d.ts +36 -0
  30. package/es/src/business/ag-grid-modal/selected-items/index.mjs +8 -0
  31. package/es/src/business/ag-grid-modal/selected-items/style/css.d.ts +0 -0
  32. package/es/src/business/ag-grid-modal/selected-items/style/css.js +1 -0
  33. package/es/src/business/ag-grid-modal/selected-items/style/index.d.ts +0 -0
  34. package/es/src/business/ag-grid-modal/selected-items/style/index.js +1 -0
  35. package/es/src/business/ag-grid-modal/style/css.d.ts +0 -0
  36. package/es/src/business/ag-grid-modal/style/css.js +1 -0
  37. package/es/src/business/ag-grid-modal/style/index.d.ts +0 -0
  38. package/es/src/business/ag-grid-modal/style/index.js +1 -0
  39. package/es/src/business/ag-grid-modal/utils.d.ts +54 -0
  40. package/es/src/business/ag-grid-modal/utils.mjs +72 -0
  41. package/es/src/business/ag-grid-modal/wrapper/index.vue.d.ts +23 -0
  42. package/es/src/business/ag-grid-modal/wrapper/index.vue.mjs +4 -0
  43. package/es/src/business/ag-grid-modal/wrapper/index.vue2.mjs +25 -0
  44. package/es/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +1 -0
  45. package/es/src/business/ap-table-modal/hooks/use-table-modal.d.ts +1 -0
  46. package/es/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +1 -0
  47. package/es/src/business/ap-table-modal/index.d.ts +3 -0
  48. package/es/src/business/ap-table-modal/table-modal.vue.d.ts +1 -0
  49. package/es/src/business/ap-table-modal/table-modal.vue2.mjs +23 -23
  50. package/es/src/business/hooks/usePageListApTable.d.ts +1 -0
  51. package/es/src/business/index.d.ts +1 -0
  52. package/es/src/business/index.mjs +55 -54
  53. package/es/src/index.mjs +95 -89
  54. package/es/src/path-map.mjs +4 -1
  55. package/es/src/version.d.ts +1 -1
  56. package/es/src/version.mjs +1 -1
  57. package/lib/index.js +1 -1
  58. package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
  59. package/lib/src/ag-grid/index.vue.js +1 -1
  60. package/lib/src/ag-grid/interface.d.ts +14 -0
  61. package/lib/src/ap-form/drawer-form/index.vue.d.ts +4 -0
  62. package/lib/src/ap-form/modal-form/index.vue.d.ts +9 -1
  63. package/lib/src/ap-modal/utils/createModal.js +1 -1
  64. package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
  65. package/lib/src/ap-table/interface.d.ts +6 -0
  66. package/lib/src/business/ag-grid-modal/constants.d.ts +4 -0
  67. package/lib/src/business/ag-grid-modal/constants.js +1 -0
  68. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +33 -0
  69. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.js +1 -0
  70. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +3 -0
  71. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.js +1 -0
  72. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -0
  73. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.js +1 -0
  74. package/lib/src/business/ag-grid-modal/hooks/use-modal-title.d.ts +24 -0
  75. package/lib/src/business/ag-grid-modal/hooks/use-modal-title.js +1 -0
  76. package/lib/src/business/ag-grid-modal/index.d.ts +3 -0
  77. package/lib/src/business/ag-grid-modal/index.js +1 -0
  78. package/lib/src/business/ag-grid-modal/interface.d.ts +141 -0
  79. package/lib/src/business/ag-grid-modal/modal-layout/index.vue.d.ts +44 -0
  80. package/lib/src/business/ag-grid-modal/modal-layout/index.vue.js +1 -0
  81. package/lib/src/business/ag-grid-modal/modal-layout/index.vue2.js +1 -0
  82. package/lib/src/business/ag-grid-modal/selected-items/default.vue.d.ts +25 -0
  83. package/lib/src/business/ag-grid-modal/selected-items/default.vue.js +1 -0
  84. package/lib/src/business/ag-grid-modal/selected-items/default.vue2.js +1 -0
  85. package/lib/src/business/ag-grid-modal/selected-items/index.d.ts +36 -0
  86. package/lib/src/business/ag-grid-modal/selected-items/index.js +1 -0
  87. package/lib/src/business/ag-grid-modal/selected-items/style/css.cjs +1 -0
  88. package/lib/src/business/ag-grid-modal/selected-items/style/css.d.ts +0 -0
  89. package/lib/src/business/ag-grid-modal/selected-items/style/index.cjs +1 -0
  90. package/lib/src/business/ag-grid-modal/selected-items/style/index.d.ts +0 -0
  91. package/lib/src/business/ag-grid-modal/style/css.cjs +1 -0
  92. package/lib/src/business/ag-grid-modal/style/css.d.ts +0 -0
  93. package/lib/src/business/ag-grid-modal/style/index.cjs +1 -0
  94. package/lib/src/business/ag-grid-modal/style/index.d.ts +0 -0
  95. package/lib/src/business/ag-grid-modal/utils.d.ts +54 -0
  96. package/lib/src/business/ag-grid-modal/utils.js +1 -0
  97. package/lib/src/business/ag-grid-modal/wrapper/index.vue.d.ts +23 -0
  98. package/lib/src/business/ag-grid-modal/wrapper/index.vue.js +1 -0
  99. package/lib/src/business/ag-grid-modal/wrapper/index.vue2.js +1 -0
  100. package/lib/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +1 -0
  101. package/lib/src/business/ap-table-modal/hooks/use-table-modal.d.ts +1 -0
  102. package/lib/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +1 -0
  103. package/lib/src/business/ap-table-modal/index.d.ts +3 -0
  104. package/lib/src/business/ap-table-modal/table-modal.vue.d.ts +1 -0
  105. package/lib/src/business/ap-table-modal/table-modal.vue2.js +1 -1
  106. package/lib/src/business/hooks/usePageListApTable.d.ts +1 -0
  107. package/lib/src/business/index.d.ts +1 -0
  108. package/lib/src/business/index.js +1 -1
  109. package/lib/src/index.js +1 -1
  110. package/lib/src/path-map.js +1 -1
  111. package/lib/src/version.d.ts +1 -1
  112. package/lib/src/version.js +1 -1
  113. package/package.json +3 -3
  114. package/theme/ag-grid/index.css +3 -0
  115. package/theme/ag-grid-modal/index.css +789 -0
  116. package/theme/ag-grid-modal/index.less +73 -0
  117. package/theme/ag-grid-modal/selected-items.css +72 -0
  118. package/theme/ag-grid-modal/selected-items.less +34 -0
  119. package/theme/ap-form/ap-form-item.css +3 -0
  120. package/theme/ap-form/ap-form-item.less +3 -0
  121. package/theme/ap-form/index.css +3 -0
  122. package/theme/ap-form/search-form.css +3 -0
  123. package/theme/ap-grid/index.css +3 -0
  124. package/theme/ap-table/ap-table.css +3 -0
  125. package/theme/ap-table-modal/index.css +3 -0
  126. package/theme/ap-upload/index.css +5 -0
  127. package/theme/ap-upload/multiple-file.css +5 -0
  128. package/theme/ap-upload/multiple-file.less +6 -0
  129. package/theme/editable-table/index.css +3 -0
  130. package/theme/index.css +96 -0
  131. package/theme/index.less +2 -0
@@ -980,6 +980,10 @@ declare const __VLS_component: DefineComponent<ApFormDrawerFormProps, {
980
980
  type: BooleanConstructor;
981
981
  default: boolean;
982
982
  };
983
+ loading: {
984
+ type: BooleanConstructor;
985
+ default: boolean;
986
+ };
983
987
  }>>, "open" | "onUpdate:open">;
984
988
  }, {}, {}, {}, string, ComponentProvideOptions, false, {
985
989
  formRef: ({
@@ -912,7 +912,15 @@ declare const __VLS_component: DefineComponent<ApFormModalFormProps, {
912
912
  type: PropType<string | number | Partial<Record< Breakpoint, string | number>>>;
913
913
  default: string | number | Partial<Record< Breakpoint, string | number>>;
914
914
  };
915
- footer: VueTypeValidableDef<any>;
915
+ footer: {
916
+ type: PropType< VueNode | ((params: {
917
+ originNode: VueNode;
918
+ extra: {
919
+ okBtn: VueNode;
920
+ cancelBtn: VueNode;
921
+ };
922
+ }) => VueNode)>;
923
+ };
916
924
  okText: VueTypeValidableDef<any>;
917
925
  okType: PropType<LegacyButtonType>;
918
926
  cancelText: VueTypeValidableDef<any>;
@@ -1,38 +1,39 @@
1
- import { defineComponent as w, createVNode as l, mergeProps as P, render as h, h as N } from "vue";
2
- import { Modal as L } from "@aplus-frontend/antdv";
3
- import { ConfigProvider as M, globalConfigCached as C } from "../../config-provider/config-provider.mjs";
4
- import { omit as A } from "lodash-unified";
5
- import { isNumeric as D } from "@aplus-frontend/utils";
1
+ import { render as m, defineComponent as b, createVNode as l, mergeProps as k, h as w } from "vue";
2
+ import { Modal as P } from "@aplus-frontend/antdv";
3
+ import { ConfigProvider as N, globalConfigCached as f } from "../../config-provider/config-provider.mjs";
4
+ import { omit as L } from "lodash-unified";
5
+ import { isNumeric as M } from "@aplus-frontend/utils";
6
6
  import "../../config-provider/index.mjs";
7
- import { getContainerDom as u, getModalGlobalAppContext as E } from "./util.mjs";
8
- import { getTopWindow as G } from "../../utils/index.mjs";
9
- import { useNamespace as H } from "../../config-provider/hooks/use-namespace.mjs";
10
- const F = (a) => {
7
+ import { getContainerDom as u, getModalGlobalAppContext as A } from "./util.mjs";
8
+ import { getTopWindow as E } from "../../utils/index.mjs";
9
+ import { useNamespace as T } from "../../config-provider/hooks/use-namespace.mjs";
10
+ const z = (p) => {
11
11
  let o, t;
12
12
  const {
13
- destroyOnClose: p = !0,
13
+ destroyOnClose: a = !0,
14
14
  wrapperOffset: n = !1
15
- } = a, {
15
+ } = p, {
16
16
  b: s
17
- } = H("ap-modal");
18
- let m = !1;
17
+ } = T("ap-modal");
19
18
  function i() {
20
- o && o(!1), m = !0;
19
+ o && o(!1), setTimeout(() => {
20
+ m(null, r), r.parentElement?.removeChild(r);
21
+ }, 500);
21
22
  }
22
- function g() {
23
+ function h() {
23
24
  o && o(!0);
24
25
  }
25
26
  function c() {
26
27
  o && o(!1);
27
28
  }
28
- function x(e) {
29
+ function C(e) {
29
30
  t && t(e);
30
31
  }
31
- const O = /* @__PURE__ */ w({
32
+ const g = /* @__PURE__ */ b({
32
33
  data() {
33
34
  return {
34
- open: p,
35
- props: a
35
+ open: a,
36
+ props: p
36
37
  };
37
38
  },
38
39
  created() {
@@ -51,7 +52,7 @@ const F = (a) => {
51
52
  const e = this.props?.content?.component?.exposed ?? void 0;
52
53
  await this.props?.onCancel(e);
53
54
  }
54
- p ? i() : c();
55
+ a ? i() : c();
55
56
  },
56
57
  async handleOk() {
57
58
  try {
@@ -63,7 +64,7 @@ const F = (a) => {
63
64
  }
64
65
  t({
65
66
  confirmLoading: !1
66
- }), p ? i() : c();
67
+ }), a ? i() : c();
67
68
  } catch {
68
69
  t({
69
70
  confirmLoading: !1
@@ -72,9 +73,9 @@ const F = (a) => {
72
73
  }
73
74
  },
74
75
  render() {
75
- const e = A(this.props, ["onCancel", "onOk", "open", "onUpdate:open", "getContainer", "icon"]);
76
- return l(M, C.value, {
77
- default: () => [l(L, P({
76
+ const e = L(this.props, ["onCancel", "onOk", "open", "onUpdate:open", "getContainer", "icon"]);
77
+ return l(N, f.value, {
78
+ default: () => [l(P, k({
78
79
  class: {
79
80
  [s()]: !0,
80
81
  [s("wrapper")]: n
@@ -83,32 +84,29 @@ const F = (a) => {
83
84
  }, e, {
84
85
  open: this.open,
85
86
  onCancel: this.handleCancel,
86
- onOk: this.handleOk,
87
- afterOpenChange: (f) => {
88
- !f && m && (h(null, r), r.parentElement?.removeChild(r)), e?.afterOpenChange && e?.afterOpenChange?.(f);
89
- }
87
+ onOk: this.handleOk
90
88
  }), {
91
89
  default: () => [l("div", {
92
90
  class: {
93
91
  [s("body-wrapper")]: n
94
92
  },
95
93
  style: n === !1 ? {} : {
96
- maxHeight: `calc(100vh - ${(n === !0 ? 100 : D(n) ? Number(n) : 100) * 2}px)`
94
+ maxHeight: `calc(100vh - ${(n === !0 ? 100 : M(n) ? Number(n) : 100) * 2}px)`
97
95
  }
98
96
  }, [this.props?.content])]
99
97
  })]
100
98
  });
101
99
  }
102
- }), v = u(C?.value?.getPopupContainer), y = u(a.getContainer), b = v || y || G().document.body, r = document.createElement("div");
103
- b.appendChild(r);
104
- const d = N(O), k = E();
105
- return d.appContext = a.appContext || k || d.appContext, h(d, r), {
100
+ }), x = u(f?.value?.getPopupContainer), v = u(p.getContainer), O = x || v || E().document.body, r = document.createElement("div");
101
+ O.appendChild(r);
102
+ const d = w(g), y = A();
103
+ return d.appContext = p.appContext || y || d.appContext, m(d, r), {
106
104
  destroy: i,
107
- update: x,
108
- open: g,
105
+ update: C,
106
+ open: h,
109
107
  close: c
110
108
  };
111
109
  };
112
110
  export {
113
- F as createModal
111
+ z as createModal
114
112
  };
@@ -1,18 +1,18 @@
1
- import { defineComponent as G, ref as b, unref as e, computed as L, useSlots as M, createVNode as t, cloneVNode as P, createElementBlock as q, openBlock as k, Fragment as H, createBlock as J, createCommentVNode as Q, resolveDynamicComponent as W, withCtx as u, createElementVNode as a, normalizeClass as s, toDisplayString as m, createTextVNode as v, isRef as X } from "vue";
2
- import { Button as y, Modal as Y, RadioGroup as Z, RadioButton as T, Divider as x } from "@aplus-frontend/antdv";
3
- import { getSingleVNode as ee } from "../../../../utils/slot.mjs";
4
- import { useInjectApTable as te } from "../../../context.mjs";
1
+ import { defineComponent as L, ref as v, unref as e, computed as M, useSlots as P, createVNode as t, cloneVNode as q, createElementBlock as H, openBlock as h, Fragment as J, createBlock as Q, createCommentVNode as W, resolveDynamicComponent as X, withCtx as u, withDirectives as Y, createElementVNode as s, normalizeClass as i, toDisplayString as c, createTextVNode as S, isRef as Z, vShow as ee } from "vue";
2
+ import { Button as y, Modal as te, RadioGroup as le, RadioButton as T, Divider as x } from "@aplus-frontend/antdv";
3
+ import { getSingleVNode as ne } from "../../../../utils/slot.mjs";
4
+ import { useInjectApTable as ae } from "../../../context.mjs";
5
5
  import "../tree-select/index.vue.mjs";
6
- import { useTableColumnState as le } from "../../../hooks/use-table-column-state.mjs";
6
+ import { useTableColumnState as oe } from "../../../hooks/use-table-column-state.mjs";
7
7
  import "../../../../config-provider/index.mjs";
8
8
  import "../sorter/index.vue.mjs";
9
- import ne, { customCloneColumnStates as B } from "../utils.mjs";
10
- import { SettingOutlined as oe } from "@ant-design/icons-vue";
11
- import { useLocale as ae } from "../../../../config-provider/hooks/use-locale.mjs";
9
+ import se, { customCloneColumnStates as B } from "../utils.mjs";
10
+ import { SettingOutlined as ie } from "@ant-design/icons-vue";
11
+ import { useLocale as ue } from "../../../../config-provider/hooks/use-locale.mjs";
12
12
  import { useNamespace as N } from "../../../../config-provider/hooks/use-namespace.mjs";
13
- import se from "../tree-select/index.vue2.mjs";
14
- import ie from "../sorter/index.vue2.mjs";
15
- const Te = /* @__PURE__ */ G({
13
+ import re from "../tree-select/index.vue2.mjs";
14
+ import pe from "../sorter/index.vue2.mjs";
15
+ const Be = /* @__PURE__ */ L({
16
16
  name: "ApTableSetting",
17
17
  __name: "index",
18
18
  props: {
@@ -20,85 +20,86 @@ const Te = /* @__PURE__ */ G({
20
20
  default: () => ({})
21
21
  }
22
22
  },
23
- setup(h) {
24
- const c = h, {
25
- columnsBackup: _,
26
- size: z,
27
- updateSize: A,
28
- updateColumns: V
29
- } = te(), d = b(e(z)), R = L(() => c.config.persistenceKey), {
30
- columnState: l,
31
- setColumnState: w,
32
- isAllSelected: D,
33
- toggleSelectAll: O,
34
- columnStateBackup: U,
35
- setColumnStateBackup: E,
36
- cacheColumnStateIfNeeded: I
37
- } = le(c.config, R, []), {
38
- t: n
39
- } = ae(), {
23
+ setup(_) {
24
+ const m = _, {
25
+ columnsBackup: z,
26
+ size: A,
27
+ updateSize: V,
28
+ updateColumns: w
29
+ } = ae(), d = v(e(A)), R = M(() => m.config.persistenceKey), {
30
+ columnState: n,
31
+ setColumnState: D,
32
+ isAllSelected: O,
33
+ toggleSelectAll: U,
34
+ columnStateBackup: E,
35
+ setColumnStateBackup: I,
36
+ cacheColumnStateIfNeeded: K
37
+ } = oe(m.config, R, []), {
38
+ t: a
39
+ } = ue(), {
40
40
  b: f,
41
41
  be: g
42
42
  } = N("ap-column-setting"), {
43
- b: K
44
- } = N("ap-table"), r = b(!1), $ = M(), C = ee($.trigger) || t(y, {
45
- icon: t(oe, null, null),
46
- class: K("setting-trigger-button")
47
- }, null), S = C ? P(C, {
43
+ b: $
44
+ } = N("ap-table"), r = v(!1), C = v(!1), j = P(), b = ne(j.trigger) || t(y, {
45
+ icon: t(ie, null, null),
46
+ class: $("setting-trigger-button")
47
+ }, null), k = b ? q(b, {
48
48
  onClick: () => {
49
49
  r.value = !0;
50
50
  }
51
51
  }) : null;
52
- function j() {
53
- w(B(e(U)));
54
- }
55
52
  function F() {
56
- V?.(ne(e(_), e(l))), A?.(e(d)), r.value = !1;
57
- const p = B(l.value);
58
- E(p), I(p), c.config?.onChange?.(p);
53
+ D(B(e(E)));
54
+ }
55
+ function G() {
56
+ w?.(se(e(z), e(n))), V?.(e(d)), r.value = !1;
57
+ const p = B(n.value);
58
+ I(p), K(p), m.config?.onChange?.(p);
59
59
  }
60
- return (p, o) => (k(), q(H, null, [e(S) ? (k(), J(W(e(S)), {
60
+ return (p, o) => (h(), H(J, null, [e(k) ? (h(), Q(X(e(k)), {
61
61
  key: 0
62
- })) : Q("", !0), t(e(Y), {
62
+ })) : W("", !0), t(e(te), {
63
63
  open: r.value,
64
- "onUpdate:open": o[2] || (o[2] = (i) => r.value = i),
65
- title: e(n)("ap.apTable.setting.title"),
64
+ "onUpdate:open": o[2] || (o[2] = (l) => r.value = l),
65
+ title: e(a)("ap.apTable.setting.title"),
66
66
  width: 900,
67
67
  centered: !0,
68
68
  "body-style": {
69
69
  padding: "0px !important",
70
70
  height: "450px"
71
71
  },
72
- onOk: F
72
+ "after-open-change": (l) => C.value = l,
73
+ onOk: G
73
74
  }, {
74
- default: u(() => [a("div", {
75
- class: s(e(f)("wrapper"))
76
- }, [a("div", {
77
- class: s(e(f)("left"))
78
- }, [a("div", {
79
- class: s(e(g)("left", "header"))
80
- }, [a("div", null, [a("span", {
81
- class: s(e(g)("left", "header-tips"))
82
- }, m(e(n)("ap.apTable.setting.selectAllTip")), 3), t(e(y), {
75
+ default: u(() => [Y(s("div", {
76
+ class: i(e(f)("wrapper"))
77
+ }, [s("div", {
78
+ class: i(e(f)("left"))
79
+ }, [s("div", {
80
+ class: i(e(g)("left", "header"))
81
+ }, [s("div", null, [s("span", {
82
+ class: i(e(g)("left", "header-tips"))
83
+ }, c(e(a)("ap.apTable.setting.selectAllTip")), 3), t(e(y), {
83
84
  type: "link",
84
85
  size: "small",
85
- onClick: e(O)
86
+ onClick: e(U)
86
87
  }, {
87
- default: u(() => [v(m(e(D) ? e(n)("ap.apTable.setting.unSelectAll") : e(n)("ap.apTable.setting.selectAll")), 1)]),
88
+ default: u(() => [S(c(e(O) ? e(a)("ap.apTable.setting.unSelectAll") : e(a)("ap.apTable.setting.selectAll")), 1)]),
88
89
  _: 1
89
- }, 8, ["onClick"])]), t(e(Z), {
90
+ }, 8, ["onClick"])]), t(e(le), {
90
91
  value: d.value,
91
- "onUpdate:value": o[0] || (o[0] = (i) => d.value = i)
92
+ "onUpdate:value": o[0] || (o[0] = (l) => d.value = l)
92
93
  }, {
93
94
  default: u(() => [t(e(T), {
94
95
  value: "small"
95
96
  }, {
96
- default: u(() => [v(m(e(n)("ap.apTable.setting.sizeSmall")), 1)]),
97
+ default: u(() => [S(c(e(a)("ap.apTable.setting.sizeSmall")), 1)]),
97
98
  _: 1
98
99
  }), t(e(T), {
99
100
  value: "middle"
100
101
  }, {
101
- default: u(() => [v(m(e(n)("ap.apTable.setting.sizeNormal")), 1)]),
102
+ default: u(() => [S(c(e(a)("ap.apTable.setting.sizeNormal")), 1)]),
102
103
  _: 1
103
104
  })]),
104
105
  _: 1
@@ -107,26 +108,26 @@ const Te = /* @__PURE__ */ G({
107
108
  style: {
108
109
  margin: "0px"
109
110
  }
110
- }), t(se, {
111
- class: s(e(g)("left", "content")),
112
- value: e(l)
111
+ }), t(re, {
112
+ class: i(e(g)("left", "content")),
113
+ value: e(n)
113
114
  }, null, 8, ["class", "value"])], 2), t(e(x), {
114
115
  type: "vertical",
115
116
  style: {
116
117
  height: "100%",
117
118
  margin: "0px"
118
119
  }
119
- }), a("div", {
120
- class: s(e(f)("right"))
121
- }, [t(ie, {
122
- value: e(l),
123
- "onUpdate:value": o[1] || (o[1] = (i) => X(l) ? l.value = i : null),
124
- onReset: j
125
- }, null, 8, ["value"])], 2)], 2)]),
120
+ }), s("div", {
121
+ class: i(e(f)("right"))
122
+ }, [t(pe, {
123
+ value: e(n),
124
+ "onUpdate:value": o[1] || (o[1] = (l) => Z(n) ? n.value = l : null),
125
+ onReset: F
126
+ }, null, 8, ["value"])], 2)], 2), [[ee, C.value]])]),
126
127
  _: 1
127
- }, 8, ["open", "title"])], 64));
128
+ }, 8, ["open", "title", "after-open-change"])], 64));
128
129
  }
129
130
  });
130
131
  export {
131
- Te as default
132
+ Be as default
132
133
  };
@@ -352,6 +352,12 @@ export type ApTableExpose<SearchParamsType = Recordable, RecordType = any> = {
352
352
  * 查询表单提交
353
353
  */
354
354
  submit: () => void;
355
+ /**
356
+ * 表格查询提交(重制页码但查询参数不会重置)
357
+ * @param resetCurrent 是否重置当前页码,默认为`false`
358
+ * @returns
359
+ */
360
+ submitWith: (resetCurrent?: boolean) => void;
355
361
  /**
356
362
  * 查询表单重置
357
363
  */
@@ -0,0 +1,4 @@
1
+ /** 非字符串增加key值字段 */
2
+ export declare const ROW_KEY = "__ag-grid-modal-row-key";
3
+ export declare const SMALL_HEIGHT = "480px";
4
+ export declare const LARGER_HEIGHT = "calc(100vh - 200px)";
@@ -0,0 +1,6 @@
1
+ const o = "__ag-grid-modal-row-key", c = "480px", _ = "calc(100vh - 200px)";
2
+ export {
3
+ _ as LARGER_HEIGHT,
4
+ o as ROW_KEY,
5
+ c as SMALL_HEIGHT
6
+ };
@@ -0,0 +1,33 @@
1
+ import { ComputedRef } from 'vue';
2
+ import { AgGridExpose } from '../../../ag-grid';
3
+ import { RefreshType } from '../interface';
4
+ interface Options {
5
+ onMounted?: () => void;
6
+ onSelectedRows?: (rows?: any[]) => void;
7
+ }
8
+ export interface GridApi {
9
+ /** 设置 AgGrid 实例 */
10
+ setInstance: (node: any) => void;
11
+ /** 刷新表格 */
12
+ refresh: (type?: RefreshType) => void;
13
+ /** 获取 AgGrid 实例 */
14
+ getInstance: () => AgGridExpose | undefined;
15
+ /** 设置 AgGrid 选中行 */
16
+ setSelectedRowKeys: (keys: (string | number)[]) => void;
17
+ /** 获取 AgGrid 选中行 */
18
+ getSelectedRows: () => any[] | undefined;
19
+ /** 清空所有选中行 */
20
+ clearAllSelected: () => void;
21
+ /** 清除某一行数据 */
22
+ removeSelected: (record: any) => void;
23
+ /** 设置表格数据length */
24
+ setDataSourceLength: (len: number) => void;
25
+ }
26
+ interface GridApiProvider extends GridApi {
27
+ selectedRows?: ComputedRef<any[]>;
28
+ dataSourceLength?: ComputedRef<number>;
29
+ }
30
+ export declare function useAgGridInstance(options?: Options): [GridApi, any];
31
+ /** 获取上下文中grid的api */
32
+ export declare function useAgGridModalInject(): GridApiProvider | undefined;
33
+ export {};
@@ -0,0 +1,50 @@
1
+ import { ref as o, watch as r, defineComponent as A, provide as h, toRef as a, inject as I } from "vue";
2
+ import { cloneDeep as y } from "lodash-unified";
3
+ const u = Symbol("ag-grid-provider-key");
4
+ function L(n) {
5
+ const t = o(), c = o(), l = o(0), d = (e) => {
6
+ t.value = e;
7
+ }, i = (e) => {
8
+ l.value = e;
9
+ }, v = () => t.value, S = (e = "reset") => {
10
+ t.value && e in t.value && t.value[e]();
11
+ }, w = (e) => {
12
+ t.value?.rowSelection.setSelectedRowKeys(e);
13
+ }, g = () => y(t.value?.rowSelection.selectedRows.value), f = () => t.value?.rowSelection.clearAll(), R = (e) => t.value?.rowSelection.unSelectRows([e]);
14
+ r(t, (e) => {
15
+ e && n?.onMounted?.();
16
+ }), r(
17
+ () => t.value?.rowSelection.selectedRows.value,
18
+ (e) => {
19
+ c.value = e, n?.onSelectedRows?.(e);
20
+ }
21
+ );
22
+ const s = {
23
+ setInstance: d,
24
+ refresh: S,
25
+ getInstance: v,
26
+ setSelectedRowKeys: w,
27
+ getSelectedRows: g,
28
+ clearAllSelected: f,
29
+ removeSelected: R,
30
+ setDataSourceLength: i
31
+ }, p = A({
32
+ setup(e, { slots: m }) {
33
+ return h(u, {
34
+ ...s,
35
+ selectedRows: a(() => c.value),
36
+ dataSourceLength: a(
37
+ () => l.value
38
+ )
39
+ }), m.default;
40
+ }
41
+ });
42
+ return [s, p];
43
+ }
44
+ function _() {
45
+ return I(u);
46
+ }
47
+ export {
48
+ L as useAgGridInstance,
49
+ _ as useAgGridModalInject
50
+ };
@@ -0,0 +1,3 @@
1
+ import { AgGridPreviewModalProps, PreviewModalReturnType } from '../interface';
2
+ /** ag-grid弹框 */
3
+ export declare function useAgGridModal<T = any>(props: AgGridPreviewModalProps<T>): PreviewModalReturnType<T>;
@@ -0,0 +1,95 @@
1
+ import { defineComponent as v, ref as w, createVNode as n } from "vue";
2
+ import { ApModal as P } from "../../../ap-modal/index.mjs";
3
+ import "../../../ag-grid/index.mjs";
4
+ import { genRequest as y } from "../utils.mjs";
5
+ import { useAgGridInstance as I } from "./use-ag-grid-instance.mjs";
6
+ import { isFunction as A, isEmpty as f, omitBy as M, isUndefined as _, omit as q } from "lodash-unified";
7
+ import "../wrapper/index.vue.mjs";
8
+ import G from "../wrapper/index.vue2.mjs";
9
+ import H from "../../../ag-grid/index.vue.mjs";
10
+ function L(o) {
11
+ let a = null, s = null;
12
+ const [r, c] = I(), l = y(o.api, o.getRowKey, r.setDataSourceLength), u = (t) => {
13
+ const {
14
+ title: e,
15
+ width: i,
16
+ modalProps: C,
17
+ ...d
18
+ } = A(t) ? t(o) : t;
19
+ f(d) || s?.(d);
20
+ const m = M({
21
+ title: e,
22
+ width: i,
23
+ modalProps: C
24
+ }, _);
25
+ f(m) || a?.update(m);
26
+ }, g = /* @__PURE__ */ v({
27
+ name: "AgGridModalPreviewContent",
28
+ props: {
29
+ modalConfig: {
30
+ type: Object,
31
+ required: !0
32
+ }
33
+ },
34
+ setup(t) {
35
+ const e = w(t.modalConfig);
36
+ return s = (i) => {
37
+ e.value = {
38
+ ...e.value,
39
+ ...i
40
+ };
41
+ }, () => n(c, null, {
42
+ default: () => [n(G, {
43
+ rowHeight: e.value.rowHeight
44
+ }, {
45
+ default: () => [e.value.renderHeader?.(q(r, "setInstance"), {
46
+ updateProps: u
47
+ }), n(H, {
48
+ ref: r.setInstance,
49
+ searchForm: {
50
+ sortable: !1,
51
+ resize: {
52
+ target: "form"
53
+ }
54
+ },
55
+ rowKey: e.value.getRowKey,
56
+ request: l.request,
57
+ style: {
58
+ padding: "0px"
59
+ },
60
+ rowHeight: e.value.rowHeight,
61
+ columns: e.value.columns
62
+ }, e.value.gridSlots)]
63
+ })]
64
+ });
65
+ }
66
+ });
67
+ function p() {
68
+ a = P.createModal({
69
+ title: o.title,
70
+ width: o.width,
71
+ destroyOnClose: !0,
72
+ maskClosable: !1,
73
+ footer: null,
74
+ afterOpenChange(t) {
75
+ t === !1 && (r.setInstance(void 0), r.setDataSourceLength(0), a = null);
76
+ },
77
+ content: n(g, {
78
+ modalConfig: o
79
+ }, null),
80
+ ...o.modalProps || {}
81
+ });
82
+ }
83
+ function h(t) {
84
+ l.setExtraParams(t?.extraParams), p();
85
+ }
86
+ return {
87
+ open: h,
88
+ refresh: r.refresh,
89
+ getAgGridInstance: r.getInstance,
90
+ updateProps: u
91
+ };
92
+ }
93
+ export {
94
+ L as useAgGridModal
95
+ };
@@ -0,0 +1,2 @@
1
+ import { AgGridSelectModalProps, SelectModalReturnType } from '../interface';
2
+ export declare function useAgGridSelectModal<T = any>(props: AgGridSelectModalProps<T>): SelectModalReturnType<T>;