@aplus-frontend/ui 6.38.0 → 6.39.0

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 (103) hide show
  1. package/es/index.mjs +108 -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-table/components/setting/modal/index.vue2.mjs +72 -71
  6. package/es/src/ap-table/interface.d.ts +6 -0
  7. package/es/src/business/ag-grid-modal/constants.d.ts +4 -0
  8. package/es/src/business/ag-grid-modal/constants.mjs +6 -0
  9. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +33 -0
  10. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +50 -0
  11. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +3 -0
  12. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.mjs +58 -0
  13. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -0
  14. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.mjs +122 -0
  15. package/es/src/business/ag-grid-modal/hooks/use-modal-title.d.ts +24 -0
  16. package/es/src/business/ag-grid-modal/hooks/use-modal-title.mjs +49 -0
  17. package/es/src/business/ag-grid-modal/index.d.ts +2 -0
  18. package/es/src/business/ag-grid-modal/index.mjs +6 -0
  19. package/es/src/business/ag-grid-modal/interface.d.ts +130 -0
  20. package/es/src/business/ag-grid-modal/modal-layout/index.vue.d.ts +43 -0
  21. package/es/src/business/ag-grid-modal/modal-layout/index.vue.mjs +4 -0
  22. package/es/src/business/ag-grid-modal/modal-layout/index.vue2.mjs +102 -0
  23. package/es/src/business/ag-grid-modal/style/css.d.ts +0 -0
  24. package/es/src/business/ag-grid-modal/style/css.js +1 -0
  25. package/es/src/business/ag-grid-modal/style/index.d.ts +0 -0
  26. package/es/src/business/ag-grid-modal/style/index.js +1 -0
  27. package/es/src/business/ag-grid-modal/utils.d.ts +52 -0
  28. package/es/src/business/ag-grid-modal/utils.mjs +72 -0
  29. package/es/src/business/ag-grid-modal/wrapper/index.vue.d.ts +23 -0
  30. package/es/src/business/ag-grid-modal/wrapper/index.vue.mjs +4 -0
  31. package/es/src/business/ag-grid-modal/wrapper/index.vue2.mjs +25 -0
  32. package/es/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +1 -0
  33. package/es/src/business/ap-table-modal/hooks/use-table-modal.d.ts +1 -0
  34. package/es/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +1 -0
  35. package/es/src/business/ap-table-modal/index.d.ts +3 -0
  36. package/es/src/business/ap-table-modal/table-modal.vue.d.ts +1 -0
  37. package/es/src/business/hooks/usePageListApTable.d.ts +1 -0
  38. package/es/src/business/index.d.ts +1 -0
  39. package/es/src/business/index.mjs +55 -54
  40. package/es/src/index.mjs +78 -74
  41. package/es/src/path-map.mjs +3 -1
  42. package/es/src/version.d.ts +1 -1
  43. package/es/src/version.mjs +1 -1
  44. package/lib/index.js +1 -1
  45. package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
  46. package/lib/src/ag-grid/index.vue.js +1 -1
  47. package/lib/src/ag-grid/interface.d.ts +14 -0
  48. package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
  49. package/lib/src/ap-table/interface.d.ts +6 -0
  50. package/lib/src/business/ag-grid-modal/constants.d.ts +4 -0
  51. package/lib/src/business/ag-grid-modal/constants.js +1 -0
  52. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +33 -0
  53. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.js +1 -0
  54. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +3 -0
  55. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.js +1 -0
  56. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -0
  57. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.js +1 -0
  58. package/lib/src/business/ag-grid-modal/hooks/use-modal-title.d.ts +24 -0
  59. package/lib/src/business/ag-grid-modal/hooks/use-modal-title.js +1 -0
  60. package/lib/src/business/ag-grid-modal/index.d.ts +2 -0
  61. package/lib/src/business/ag-grid-modal/index.js +1 -0
  62. package/lib/src/business/ag-grid-modal/interface.d.ts +130 -0
  63. package/lib/src/business/ag-grid-modal/modal-layout/index.vue.d.ts +43 -0
  64. package/lib/src/business/ag-grid-modal/modal-layout/index.vue.js +1 -0
  65. package/lib/src/business/ag-grid-modal/modal-layout/index.vue2.js +1 -0
  66. package/lib/src/business/ag-grid-modal/style/css.cjs +1 -0
  67. package/lib/src/business/ag-grid-modal/style/css.d.ts +0 -0
  68. package/lib/src/business/ag-grid-modal/style/index.cjs +1 -0
  69. package/lib/src/business/ag-grid-modal/style/index.d.ts +0 -0
  70. package/lib/src/business/ag-grid-modal/utils.d.ts +52 -0
  71. package/lib/src/business/ag-grid-modal/utils.js +1 -0
  72. package/lib/src/business/ag-grid-modal/wrapper/index.vue.d.ts +23 -0
  73. package/lib/src/business/ag-grid-modal/wrapper/index.vue.js +1 -0
  74. package/lib/src/business/ag-grid-modal/wrapper/index.vue2.js +1 -0
  75. package/lib/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +1 -0
  76. package/lib/src/business/ap-table-modal/hooks/use-table-modal.d.ts +1 -0
  77. package/lib/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +1 -0
  78. package/lib/src/business/ap-table-modal/index.d.ts +3 -0
  79. package/lib/src/business/ap-table-modal/table-modal.vue.d.ts +1 -0
  80. package/lib/src/business/hooks/usePageListApTable.d.ts +1 -0
  81. package/lib/src/business/index.d.ts +1 -0
  82. package/lib/src/business/index.js +1 -1
  83. package/lib/src/index.js +1 -1
  84. package/lib/src/path-map.js +1 -1
  85. package/lib/src/version.d.ts +1 -1
  86. package/lib/src/version.js +1 -1
  87. package/package.json +1 -1
  88. package/theme/ag-grid/index.css +3 -0
  89. package/theme/ag-grid-modal/index.css +773 -0
  90. package/theme/ag-grid-modal/index.less +58 -0
  91. package/theme/ap-form/ap-form-item.css +3 -0
  92. package/theme/ap-form/ap-form-item.less +3 -0
  93. package/theme/ap-form/index.css +3 -0
  94. package/theme/ap-form/search-form.css +3 -0
  95. package/theme/ap-grid/index.css +3 -0
  96. package/theme/ap-table/ap-table.css +3 -0
  97. package/theme/ap-table-modal/index.css +3 -0
  98. package/theme/ap-upload/index.css +5 -0
  99. package/theme/ap-upload/multiple-file.css +5 -0
  100. package/theme/ap-upload/multiple-file.less +6 -0
  101. package/theme/editable-table/index.css +3 -0
  102. package/theme/index.css +54 -0
  103. package/theme/index.less +1 -0
@@ -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;
@@ -0,0 +1,58 @@
1
+ import { createVNode as r } from "vue";
2
+ import { ApModal as m } from "../../../ap-modal/index.mjs";
3
+ import "../../../ag-grid/index.mjs";
4
+ import { genRequest as d } from "../utils.mjs";
5
+ import { useAgGridInstance as l } from "./use-ag-grid-instance.mjs";
6
+ import { omit as c } from "lodash-unified";
7
+ import "../wrapper/index.vue.mjs";
8
+ import f from "../wrapper/index.vue2.mjs";
9
+ import u from "../../../ag-grid/index.vue.mjs";
10
+ function C(e) {
11
+ const [t, n] = l(), o = d(e.api, e.getRowKey, t.setDataSourceLength);
12
+ function a() {
13
+ m.createModal({
14
+ title: e.title,
15
+ width: e.width,
16
+ destroyOnClose: !0,
17
+ maskClosable: !1,
18
+ footer: null,
19
+ onCancel() {
20
+ t.setInstance(void 0), t.setDataSourceLength(0);
21
+ },
22
+ content: r(n, null, {
23
+ default: () => [r(f, {
24
+ rowHeight: e.rowHeight
25
+ }, {
26
+ default: () => [e.renderHeader?.(c(t, "setInstance")), r(u, {
27
+ ref: t.setInstance,
28
+ searchForm: {
29
+ sortable: !1,
30
+ resize: {
31
+ target: "form"
32
+ }
33
+ },
34
+ rowKey: e.getRowKey,
35
+ request: o.request,
36
+ style: {
37
+ padding: "0px"
38
+ },
39
+ rowHeight: e.rowHeight,
40
+ columns: e.columns
41
+ }, e.gridSlots)]
42
+ })]
43
+ }),
44
+ ...e.modalProps || {}
45
+ });
46
+ }
47
+ function i(s) {
48
+ o.setExtraParams(s?.extraParams), a();
49
+ }
50
+ return {
51
+ open: i,
52
+ refresh: t.refresh,
53
+ getAgGridInstance: t.getInstance
54
+ };
55
+ }
56
+ export {
57
+ C as useAgGridModal
58
+ };
@@ -0,0 +1,2 @@
1
+ import { AgGridSelectModalProps, SelectModalReturnType } from '../interface';
2
+ export declare function useAgGridSelectModal<T = any>(props: AgGridSelectModalProps<T>): SelectModalReturnType<T>;
@@ -0,0 +1,122 @@
1
+ import { createVNode as r, onUnmounted as O } from "vue";
2
+ import { ApModal as _ } from "../../../ap-modal/index.mjs";
3
+ import "../../../ag-grid/index.mjs";
4
+ import { AsyncCallback as L, genRequest as P, delRowKeyField as H, getModalLayoutConfig as T, addRowKeyField as j } from "../utils.mjs";
5
+ import { useAgGridInstance as q } from "./use-ag-grid-instance.mjs";
6
+ import { isFunction as u, omit as h } from "lodash-unified";
7
+ import { ROW_KEY as v } from "../constants.mjs";
8
+ import { useModalTitle as F } from "./use-modal-title.mjs";
9
+ import { message as G } from "@aplus-frontend/antdv";
10
+ import "../../../config-provider/index.mjs";
11
+ import "../modal-layout/index.vue.mjs";
12
+ import "../wrapper/index.vue.mjs";
13
+ import { useLocale as D } from "../../../config-provider/hooks/use-locale.mjs";
14
+ import E from "../wrapper/index.vue2.mjs";
15
+ import U from "../modal-layout/index.vue2.mjs";
16
+ import W from "../../../ag-grid/index.vue.mjs";
17
+ function le(e) {
18
+ let i;
19
+ const c = new L(), [C, b] = F(), {
20
+ t: K
21
+ } = D(), [n, k] = q({
22
+ onSelectedRows(t) {
23
+ b.setCount(t?.length || 0);
24
+ }
25
+ }), f = P(e.api, e.getRowKey, n.setDataSourceLength), d = u(e.getRowKey) ? e.getRowKey : (t) => t[e.getRowKey], x = () => {
26
+ const t = e.mergeRule || "old", o = n.getSelectedRows() || [];
27
+ return {
28
+ keys: M(o),
29
+ rows: o.map((l) => {
30
+ const s = d(l);
31
+ return t === "old" && i?.[s] ? i[s] : H(l);
32
+ })
33
+ };
34
+ }, g = async () => {
35
+ const t = x(), o = e.maxCount || 1 / 0;
36
+ return t.keys.length > o ? (G.warning(K("ap.apTableModal.messageMaxCount", {
37
+ maxCount: o
38
+ })), Promise.reject()) : (await e.beforeOk?.(t), e.finishCallback?.(t), c.resolve(t), t);
39
+ }, S = () => {
40
+ c.reject("modal is closed!"), n.setInstance(void 0), n.setDataSourceLength(0);
41
+ }, w = T(e.modalLayout);
42
+ function y(t) {
43
+ const o = t?.map((a) => j(a, e.getRowKey));
44
+ return r(k, null, {
45
+ default: () => [r(E, {
46
+ rowHeight: e.rowHeight
47
+ }, {
48
+ default: () => [e.renderHeader?.(h(n, "setInstance")), r(U, w.props, {
49
+ default: () => [r(W, {
50
+ ref: n.setInstance,
51
+ searchForm: {
52
+ sortable: !1,
53
+ resize: {
54
+ target: "form"
55
+ }
56
+ },
57
+ rowKey: u(e.getRowKey) ? v : e.getRowKey,
58
+ request: f.request,
59
+ style: {
60
+ padding: "0px"
61
+ },
62
+ rowHeight: e.rowHeight,
63
+ columns: e.columns,
64
+ rowSelection: {
65
+ defaultSelectedRows: o,
66
+ preserveSelectedRowKeys: !0,
67
+ type: e.mode || "checkbox",
68
+ fixed: "left",
69
+ columnWidth: 38,
70
+ disabled(a) {
71
+ return u(e.disabledCheckbox) ? e.disabledCheckbox(a, h(n, "setInstance")) : e.disabledCheckbox ?? !1;
72
+ }
73
+ }
74
+ }, e.gridSlots)],
75
+ ...w.slots
76
+ })]
77
+ })]
78
+ });
79
+ }
80
+ function I() {
81
+ const t = Object.values(i || {}), o = y(t);
82
+ _.createModal({
83
+ title: r(C, {
84
+ title: e.title,
85
+ maxCount: e.maxCount || 1 / 0
86
+ }, e.modalTitleSlots),
87
+ width: e.width,
88
+ destroyOnClose: !0,
89
+ maskClosable: !1,
90
+ onOk: g,
91
+ onCancel: S,
92
+ content: o,
93
+ ...e.modalProps || {}
94
+ });
95
+ }
96
+ function M(t) {
97
+ return t?.map(d) || [];
98
+ }
99
+ function R(t, o, a = !1) {
100
+ if (i = t?.reduce((m, l) => {
101
+ const s = d(l);
102
+ return m[s] = l, m;
103
+ }, {}), f.setExtraParams(o?.extraParams), I(), a)
104
+ return c.buildPromise();
105
+ }
106
+ function A(t, o) {
107
+ return R(t, o, !0);
108
+ }
109
+ return O(() => {
110
+ c.reject("component is Unmounted!");
111
+ }), {
112
+ open: R,
113
+ asyncOpen: A,
114
+ refresh: n.refresh,
115
+ getAgGridInstance: n.getInstance,
116
+ genContent: y,
117
+ validate: g
118
+ };
119
+ }
120
+ export {
121
+ le as useAgGridSelectModal
122
+ };
@@ -0,0 +1,24 @@
1
+ import { DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ export declare function useModalTitle(): readonly [ DefineComponent<ExtractPropTypes<{
3
+ title: {
4
+ type: any;
5
+ default: null;
6
+ };
7
+ maxCount: {
8
+ type: NumberConstructor;
9
+ required: true;
10
+ };
11
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
12
+ title: {
13
+ type: any;
14
+ default: null;
15
+ };
16
+ maxCount: {
17
+ type: NumberConstructor;
18
+ required: true;
19
+ };
20
+ }>> & Readonly<{}>, {
21
+ title: any;
22
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
23
+ readonly setCount: (data: number) => void;
24
+ }];
@@ -0,0 +1,49 @@
1
+ import { ref as n, defineComponent as u, createVNode as a } from "vue";
2
+ import "../../../config-provider/index.mjs";
3
+ import { useLocale as i } from "../../../config-provider/hooks/use-locale.mjs";
4
+ function d() {
5
+ const e = n(0);
6
+ return [/* @__PURE__ */ u({
7
+ props: {
8
+ title: {
9
+ type: null,
10
+ default: null
11
+ },
12
+ maxCount: {
13
+ type: Number,
14
+ required: !0
15
+ }
16
+ },
17
+ setup(t, {
18
+ slots: l
19
+ }) {
20
+ const {
21
+ t: o
22
+ } = i();
23
+ return () => a("div", null, [t.title, l.default ? l.default({
24
+ maxCount: t.maxCount,
25
+ count: e.value
26
+ }) : a("span", {
27
+ style: {
28
+ color: "var(--ap-text-color-3)",
29
+ fontSize: "12px",
30
+ fontWeight: "normal",
31
+ marginLeft: "12px"
32
+ }
33
+ }, [isFinite(t.maxCount) ? o("ap.apTableModal.titleSuffixOne", {
34
+ maxCount: t.maxCount
35
+ }) : "", o("ap.apTableModal.titleSuffixTwo"), a("span", {
36
+ style: {
37
+ color: "var(--ap-color-primary)"
38
+ }
39
+ }, [e.value]), o("ap.apTableModal.titleSuffixThree")])]);
40
+ }
41
+ }), {
42
+ setCount: (t) => {
43
+ e.value = t;
44
+ }
45
+ }];
46
+ }
47
+ export {
48
+ d as useModalTitle
49
+ };
@@ -0,0 +1,2 @@
1
+ export { useAgGridModal } from './hooks/use-ag-grid-modal';
2
+ export { useAgGridSelectModal } from './hooks/use-ag-grid-select-modal';
@@ -0,0 +1,6 @@
1
+ import { useAgGridModal as r } from "./hooks/use-ag-grid-modal.mjs";
2
+ import { useAgGridSelectModal as l } from "./hooks/use-ag-grid-select-modal.mjs";
3
+ export {
4
+ r as useAgGridModal,
5
+ l as useAgGridSelectModal
6
+ };