@aplus-frontend/ui 6.41.2 → 6.42.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 (31) hide show
  1. package/es/src/ag-grid/hooks/use-columns-def.mjs +47 -46
  2. package/es/src/ag-grid/index.vue.mjs +1 -0
  3. package/es/src/ag-grid/interface.d.ts +1 -0
  4. package/es/src/ap-download/ap-download.vue.d.ts +4 -4
  5. package/es/src/ap-download/ap-download.vue.mjs +29 -29
  6. package/es/src/ap-download/interface.d.ts +4 -0
  7. package/es/src/business/ap-attachment/ApAttachment.mjs +53 -49
  8. package/es/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +3 -2
  9. package/es/src/business/ap-expand-alert/ApExpandAlert.vue2.mjs +56 -48
  10. package/es/src/business/ap-expand-alert/index.d.ts +5 -2
  11. package/es/src/business/ap-expand-alert/interface.d.ts +1 -1
  12. package/es/src/business/hooks/usePageListAgGrid.d.ts +0 -2
  13. package/es/src/business/hooks/usePageListAgGrid.mjs +24 -24
  14. package/es/src/version.d.ts +1 -1
  15. package/es/src/version.mjs +1 -1
  16. package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
  17. package/lib/src/ag-grid/index.vue.js +1 -1
  18. package/lib/src/ag-grid/interface.d.ts +1 -0
  19. package/lib/src/ap-download/ap-download.vue.d.ts +4 -4
  20. package/lib/src/ap-download/ap-download.vue.js +1 -1
  21. package/lib/src/ap-download/interface.d.ts +4 -0
  22. package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
  23. package/lib/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +3 -2
  24. package/lib/src/business/ap-expand-alert/ApExpandAlert.vue2.js +1 -1
  25. package/lib/src/business/ap-expand-alert/index.d.ts +5 -2
  26. package/lib/src/business/ap-expand-alert/interface.d.ts +1 -1
  27. package/lib/src/business/hooks/usePageListAgGrid.d.ts +0 -2
  28. package/lib/src/business/hooks/usePageListAgGrid.js +1 -1
  29. package/lib/src/version.d.ts +1 -1
  30. package/lib/src/version.js +1 -1
  31. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
- import { getTableRenderProps as y, objectToString as P } from "../../ap-table/utils.mjs";
1
+ import { getTableRenderProps as y, objectToString as D } from "../../ap-table/utils.mjs";
2
2
  import { rendererMap as h } from "../renderer/index.mjs";
3
3
  import { isNumber as f, isFunction as m } from "lodash-unified";
4
- import { ref as R, unref as x, computed as T } from "vue";
4
+ import { ref as P, unref as x, computed as T } from "vue";
5
5
  import "../components/body-cell/index.vue.mjs";
6
6
  import "../components/header-cell/index.vue.mjs";
7
7
  import "../components/tooltip/index.vue.mjs";
@@ -16,20 +16,20 @@ import v from "../components/header-cell/index.vue2.mjs";
16
16
  function F(t) {
17
17
  return f(t) && t > 1;
18
18
  }
19
- function M(t, o) {
20
- if (o.bodyCellTooltip)
21
- return m(o.bodyCellTooltip) ? o.bodyCellTooltip(t.value, t.data) : o.bodyCellTooltip;
22
- if (o.renderText)
23
- return o.renderText({
19
+ function M(t, i) {
20
+ if (i.bodyCellTooltip)
21
+ return m(i.bodyCellTooltip) ? i.bodyCellTooltip(t.value, t.data) : i.bodyCellTooltip;
22
+ if (i.renderText)
23
+ return i.renderText({
24
24
  value: t.value,
25
25
  record: t.data,
26
- column: o,
26
+ column: i,
27
27
  text: t.value
28
28
  });
29
- const n = o.valueType || "text", d = h[n];
29
+ const n = i.valueType || "text", d = h[n];
30
30
  if (d) {
31
31
  const p = y(
32
- { ...o, valueType: n },
32
+ { ...i, valueType: n },
33
33
  {
34
34
  value: t.value,
35
35
  text: t.value,
@@ -41,59 +41,59 @@ function M(t, o) {
41
41
  );
42
42
  return d(p);
43
43
  }
44
- return P(t.value);
44
+ return D(t.value);
45
45
  }
46
- const X = (t, o, n) => {
47
- const d = _("valueTypeMap"), u = R(), { em: p } = G("ag-grid"), c = (r) => {
46
+ const X = (t, i, n) => {
47
+ const d = _("valueTypeMap"), u = P(), { em: p } = G("ag-grid"), c = (r) => {
48
48
  const a = {
49
49
  cellRenderer: W,
50
50
  cellRendererParams: {
51
51
  column: r,
52
52
  extraValueType: x(d),
53
- rowKey: o.rowKey
53
+ rowKey: i.rowKey
54
54
  }
55
55
  };
56
56
  if (r.customRender)
57
57
  return a;
58
58
  if (r.renderText)
59
59
  return {
60
- valueFormatter: (i) => r.renderText({
61
- value: i.value,
62
- record: i.data,
60
+ valueFormatter: (o) => r.renderText({
61
+ value: o.value,
62
+ record: o.data,
63
63
  column: r,
64
- text: i.value
64
+ text: o.value
65
65
  })
66
66
  };
67
- const l = r.valueType || "text", e = h[l];
67
+ const s = r.valueType || "text", e = h[s];
68
68
  return e ? {
69
- valueFormatter: (i) => {
70
- const s = y(
71
- { ...r, valueType: l },
69
+ valueFormatter: (o) => {
70
+ const l = y(
71
+ { ...r, valueType: s },
72
72
  {
73
- value: i.value,
74
- text: i.value,
75
- record: i.data,
76
- column: i.column,
77
- rowIndex: i.node?.rowIndex,
78
- pinned: i.node?.rowPinned
73
+ value: o.value,
74
+ text: o.value,
75
+ record: o.data,
76
+ column: o.column,
77
+ rowIndex: o.node?.rowIndex,
78
+ pinned: o.node?.rowPinned
79
79
  }
80
80
  );
81
- return e(s);
81
+ return e(l);
82
82
  }
83
83
  } : a;
84
84
  }, b = (r) => {
85
- const a = {}, l = r.bodyCellTooltip || !r.customRender && (r.ellipsis === !0 || r.ellipsis === "tooltip" || f(r.ellipsis)), e = f(r.ellipsis) && r.ellipsis > 1, i = f(r.ellipsis) ? r.ellipsis : 1;
86
- return a.tooltipValueGetter = l ? (s) => M(s, r) : void 0, a.wrapText = !r.ellipsis || e, a.cellStyle = {
87
- "--ag-grid-line-clamp": i
85
+ const a = {}, s = r.bodyCellTooltip || !r.customRender && (r.ellipsis === !0 || r.ellipsis === "tooltip" || f(r.ellipsis)), e = f(r.ellipsis) && r.ellipsis > 1, o = f(r.ellipsis) ? r.ellipsis : 1;
86
+ return a.tooltipValueGetter = s ? (l) => M(l, r) : void 0, a.wrapText = !r.ellipsis || e, a.cellStyle = {
87
+ "--ag-grid-line-clamp": o
88
88
  }, a.tooltipComponent = z, a.tooltipComponentParams = {
89
- lineClamp: i,
89
+ lineClamp: o,
90
90
  gridWrapperRef: u
91
91
  }, a;
92
- }, g = T(() => {
92
+ }, w = T(() => {
93
93
  const r = x(t);
94
- function a(l) {
95
- return l.map((e) => {
96
- const i = {
94
+ function a(s) {
95
+ return s.map((e) => {
96
+ const o = {
97
97
  field: S(e.dataIndex),
98
98
  colId: I(e.key) ? String(e.key) : void 0,
99
99
  sortable: !!e.sorter,
@@ -110,12 +110,13 @@ const X = (t, o, n) => {
110
110
  pinned: e.fixed || null,
111
111
  // undefined to null
112
112
  colSpan: e.colSpan,
113
- cellClass: n((s) => {
114
- const C = e.cellClass || "", D = m(C) ? C(s.data, s.node) : C;
113
+ spanRows: e.spanRows,
114
+ cellClass: n((l) => {
115
+ const C = e.cellClass || "", R = m(C) ? C(l.data, l.node) : C;
115
116
  return [
116
117
  `${p("cell", e.align || "left")}`,
117
118
  F(e.ellipsis) ? p("cell", "multiline") : null,
118
- D
119
+ R
119
120
  ].flat().filter(Boolean);
120
121
  }),
121
122
  headerStyle: e.headerStyle,
@@ -126,27 +127,27 @@ const X = (t, o, n) => {
126
127
  ...c(e)
127
128
  };
128
129
  return e.children?.length ? {
129
- ...i,
130
+ ...o,
130
131
  headerGroupComponent: v,
131
132
  headerGroupComponentParams: {
132
133
  column: e
133
134
  },
134
135
  children: a(e.children)
135
- } : i;
136
+ } : o;
136
137
  });
137
138
  }
138
139
  return a(r);
139
- }), w = T(
140
+ }), g = T(
140
141
  () => ({
141
142
  headerComponent: v,
142
- resizable: o.columnResizable,
143
+ resizable: i.columnResizable,
143
144
  suppressMovable: !0,
144
145
  cellDataType: !1
145
146
  })
146
147
  );
147
148
  return {
148
- columnDefs: g,
149
- defaultColDef: w,
149
+ columnDefs: w,
150
+ defaultColDef: g,
150
151
  gridWrapperRef: u
151
152
  };
152
153
  };
@@ -507,6 +507,7 @@ const vt = /* @__PURE__ */ io({
507
507
  "row-class-rules": e.rowClassRules,
508
508
  "no-rows-overlay-component": Uo,
509
509
  "suppress-cell-focus": "",
510
+ "enable-cell-span": "",
510
511
  "dom-layout": e.autoHeight ? "autoHeight" : "normal",
511
512
  onSortChanged: Fe,
512
513
  onGridReady: r[0] || (r[0] = (a) => s.value = a.api),
@@ -90,6 +90,7 @@ export type AgGridColumnType<RecordType = any, ExtraValueType = 'text', ValueTyp
90
90
  minWidth?: number;
91
91
  maxWidth?: number;
92
92
  colSpan?: ColDef<RecordType>['colSpan'];
93
+ spanRows?: ColDef<RecordType>['spanRows'];
93
94
  /**
94
95
  * 为当前单元格添加类名
95
96
  * @returns
@@ -1,4 +1,4 @@
1
- import { ApDownLoadProps } from './interface';
1
+ import { ApDownLoadProps, downloadCallbackResponse } from './interface';
2
2
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
3
  import { ButtonType } from '@aplus-frontend/antdv/es/button';
4
4
  type __VLS_Props = ApDownLoadProps;
@@ -11,10 +11,10 @@ declare function __VLS_template(): {
11
11
  rootEl: any;
12
12
  };
13
13
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
14
- declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
15
- downloadCallback: (...args: any[]) => void;
14
+ declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
15
+ downloadCallback: (res?: downloadCallbackResponse | undefined) => any;
16
16
  }, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
17
- onDownloadCallback?: ((...args: any[]) => any) | undefined;
17
+ onDownloadCallback?: ((res?: downloadCallbackResponse | undefined) => any) | undefined;
18
18
  }>, {
19
19
  size: "small" | "large" | "middle";
20
20
  type: ButtonType;
@@ -1,9 +1,9 @@
1
- import { defineComponent as F, ref as L, useSlots as S, computed as t, unref as a, createBlock as x, openBlock as i, mergeProps as A, withCtx as j, createElementVNode as m, normalizeClass as I, createElementBlock as u, createCommentVNode as f, createVNode as M, renderSlot as T, toDisplayString as U } from "vue";
1
+ import { defineComponent as F, ref as L, useSlots as S, computed as a, unref as l, createBlock as x, openBlock as i, mergeProps as A, withCtx as j, createElementVNode as u, normalizeClass as I, createElementBlock as f, createCommentVNode as g, createVNode as M, renderSlot as T, toDisplayString as U } from "vue";
2
2
  import { Button as V } from "@aplus-frontend/antdv";
3
3
  import { LoadingOutlined as D } from "@ant-design/icons-vue";
4
4
  import "../config-provider/index.mjs";
5
5
  import { useOssInit as E } from "./hooks/index.mjs";
6
- import { getFileInfo as g } from "./utils/getFileInfo.mjs";
6
+ import { getFileInfo as y } from "./utils/getFileInfo.mjs";
7
7
  import { useStyle as P } from "./hooks/useStyle.mjs";
8
8
  import { useLocale as G } from "../config-provider/hooks/use-locale.mjs";
9
9
  import { useGlobalConfig as r } from "../config-provider/hooks/use-global-config.mjs";
@@ -43,58 +43,58 @@ const R = {
43
43
  getOssAccess: {}
44
44
  },
45
45
  emits: ["downloadCallback"],
46
- setup(y, { emit: C }) {
47
- const N = C, n = L(!1), { lang: b } = G(), v = S(), h = t(() => b.value === "zh-cn" ? "zh_CN" : "en_US"), w = r("uiMode"), e = y, l = r("apUpload"), c = r(
46
+ setup(C, { emit: b }) {
47
+ const c = b, s = L(!1), { lang: N } = G(), v = S(), w = a(() => N.value === "zh-cn" ? "zh_CN" : "en_US"), h = r("uiMode"), e = C, n = r("apUpload"), d = r(
48
48
  "downloadCenterTriggerConfig"
49
- ), d = t(() => e.disabled), _ = t(() => e.color ? e.color : w.value === "aplus" ? "#0070FF" : "#1890FF"), k = t(() => e.size), { getInnerWrapperClass: B } = P(_, k, d), z = t(() => e.getOssAccess || l.value?.getOssAccess), O = async () => {
49
+ ), p = a(() => e.disabled), _ = a(() => e.color ? e.color : h.value === "aplus" ? "#0070FF" : "#1890FF"), k = a(() => e.size), { getInnerWrapperClass: B } = P(_, k, p), z = a(() => e.getOssAccess || n.value?.getOssAccess), O = async () => {
50
50
  if (!e.disabled) {
51
- n.value = !0;
51
+ s.value = !0;
52
52
  try {
53
- if (c.value?.trigger) {
54
- let s = g(
55
- e.needName ?? l?.value?.needName,
53
+ if (d.value?.trigger) {
54
+ let t = y(
55
+ e.needName ?? n?.value?.needName,
56
56
  e.fileName
57
- ).map((p) => ({
58
- objectName: p.path,
59
- fileName: p.fileName
57
+ ).map((m) => ({
58
+ objectName: m.path,
59
+ fileName: m.fileName
60
60
  }));
61
- await c.value?.trigger(s);
61
+ await d.value?.trigger(t), c("downloadCallback", t);
62
62
  } else {
63
- const s = await (await E(
63
+ const t = await (await E(
64
64
  z.value,
65
- a(h)
65
+ l(w)
66
66
  )).downloadFile(
67
- g(
68
- e.needName ?? l?.value?.needName,
67
+ y(
68
+ e.needName ?? n?.value?.needName,
69
69
  e.fileName
70
70
  )
71
71
  );
72
- N("downloadCallback", s);
72
+ c("downloadCallback", t);
73
73
  }
74
74
  } catch (o) {
75
75
  console.error(o);
76
76
  } finally {
77
- n.value = !1;
77
+ s.value = !1;
78
78
  }
79
79
  }
80
80
  };
81
- return (o, s) => (i(), x(a(V), A(e, {
81
+ return (o, t) => (i(), x(l(V), A(e, {
82
82
  type: e.type,
83
83
  size: e.size,
84
- disabled: d.value,
84
+ disabled: p.value,
85
85
  onClick: O
86
86
  }), {
87
87
  default: j(() => [
88
- m("div", {
89
- class: I(a(B))
88
+ u("div", {
89
+ class: I(l(B))
90
90
  }, [
91
- n.value ? (i(), u("span", R, [
92
- M(a(D), { spin: !0 })
93
- ])) : f("", !0),
94
- a(v).icon ? (i(), u("span", W, [
91
+ s.value ? (i(), f("span", R, [
92
+ M(l(D), { spin: !0 })
93
+ ])) : g("", !0),
94
+ l(v).icon ? (i(), f("span", W, [
95
95
  T(o.$slots, "icon")
96
- ])) : f("", !0),
97
- m("span", $, U(o.text), 1)
96
+ ])) : g("", !0),
97
+ u("span", $, U(o.text), 1)
98
98
  ], 2)
99
99
  ]),
100
100
  _: 3
@@ -38,4 +38,8 @@ export declare enum ApDownLoadNeedNameKeyDefault {
38
38
  pathKey = "path"
39
39
  }
40
40
  export type actionResponse = Awaited<ReturnType<typeof client.downloadFile>>;
41
+ export type downloadCallbackResponse = {
42
+ objectName: string;
43
+ fileName: string;
44
+ }[] | actionResponse;
41
45
  export {};
@@ -1,107 +1,111 @@
1
- import { defineComponent as M, ref as p, useSlots as S, computed as o, cloneVNode as U, toRaw as f, unref as W, createVNode as t, createTextVNode as _ } from "vue";
2
- import { Tooltip as j, Popover as K } from "@aplus-frontend/antdv";
1
+ import { defineComponent as S, ref as y, useSlots as U, computed as o, cloneVNode as W, toRaw as v, unref as _, createVNode as t, createTextVNode as j } from "vue";
2
+ import { Tooltip as K, Popover as R } from "@aplus-frontend/antdv";
3
3
  import "../../config-provider/index.mjs";
4
4
  import { ApAttachmentProps as B } from "./constans.mjs";
5
- import { getHexWithOpacity as G, getFileInfo as w } from "../../ap-download/utils/getFileInfo.mjs";
5
+ import { getHexWithOpacity as G, getFileInfo as F } from "../../ap-download/utils/getFileInfo.mjs";
6
6
  import { useOssInit as H } from "../../ap-download/hooks/index.mjs";
7
- import { debounce as R, isArray as q } from "lodash-unified";
8
- import { LoadingOutlined as v } from "@ant-design/icons-vue";
9
- import { warning as D } from "../../utils/warning.mjs";
10
- import { useNamespace as E } from "../../config-provider/hooks/use-namespace.mjs";
11
- import { useGlobalConfig as g } from "../../config-provider/hooks/use-global-config.mjs";
12
- import { useLocale as J } from "../../config-provider/hooks/use-locale.mjs";
13
- const ce = /* @__PURE__ */ M({
7
+ import { debounce as q, isArray as D } from "lodash-unified";
8
+ import { LoadingOutlined as g } from "@ant-design/icons-vue";
9
+ import { warning as E } from "../../utils/warning.mjs";
10
+ import { useNamespace as J } from "../../config-provider/hooks/use-namespace.mjs";
11
+ import { useGlobalConfig as h } from "../../config-provider/hooks/use-global-config.mjs";
12
+ import { useLocale as Q } from "../../config-provider/hooks/use-locale.mjs";
13
+ const se = /* @__PURE__ */ S({
14
14
  name: "ApAttachment",
15
15
  props: B(),
16
- setup(e) {
16
+ setup(e, {
17
+ emit: N
18
+ }) {
17
19
  const {
18
- b: y,
20
+ b,
19
21
  e: l
20
- } = E("ap-attachment"), F = g("uiMode"), b = g("apUpload"), h = g("downloadCenterTriggerConfig"), {
21
- lang: x,
22
+ } = J("ap-attachment"), x = h("uiMode"), O = h("apUpload"), C = h("downloadCenterTriggerConfig"), {
23
+ lang: T,
22
24
  t: m
23
- } = J(), i = p(!1), c = p(""), u = S(), O = o(() => x.value === "zh-cn" ? "zh_CN" : "en_US"), r = o(() => e.attachmentList.length === 1), N = o(() => e.needName ? e.attachmentList.length > 0 && e.needName && e.needName.nameKey ? e.attachmentList[0][e.needName.nameKey] : "" : e.attachmentList.length > 0 ? e.attachmentList[0].fileName : ""), T = o(() => r.value ? N.value : m("ap.apAttachment.downloadall")), L = o(() => e.color ? e.color : F.value === "aplus" ? "#0070FF" : "#1890FF"), A = o(() => ({
24
- "--download-main-color": L.value,
25
- "--download-main-color-opacity": G(L.value, 0.6)
26
- })), P = o(() => e.getOssAccess || b.value?.getOssAccess), k = o(() => {
27
- const a = u.default ? u.default()[0] : null;
28
- return a ? U(a, {
25
+ } = Q(), i = y(!1), c = y(""), r = U(), k = o(() => T.value === "zh-cn" ? "zh_CN" : "en_US"), d = o(() => e.attachmentList.length === 1), L = o(() => e.needName ? e.attachmentList.length > 0 && e.needName && e.needName.nameKey ? e.attachmentList[0][e.needName.nameKey] : "" : e.attachmentList.length > 0 ? e.attachmentList[0].fileName : ""), P = o(() => d.value ? L.value : m("ap.apAttachment.downloadall")), w = o(() => e.color ? e.color : x.value === "aplus" ? "#0070FF" : "#1890FF"), p = o(() => ({
26
+ "--download-main-color": w.value,
27
+ "--download-main-color-opacity": G(w.value, 0.6)
28
+ })), V = o(() => e.getOssAccess || O.value?.getOssAccess), z = o(() => {
29
+ const a = r.default ? r.default()[0] : null;
30
+ return a ? W(a, {
29
31
  style: {
30
32
  "font-size": "16px"
31
33
  }
32
34
  }) : null;
33
- }), d = R(async (a, s) => {
35
+ }), f = q(async (a, s) => {
34
36
  if (!e.disabled) {
35
37
  i.value = !0, s && (c.value = s);
36
38
  try {
37
- const n = q(f(a)) ? f(a) : [f(a)];
38
- if (h.value?.trigger) {
39
- const I = w(e.needName, n).map((C) => ({
40
- objectName: C.path,
41
- fileName: C.fileName
39
+ const n = D(v(a)) ? v(a) : [v(a)];
40
+ if (C.value?.trigger) {
41
+ const u = F(e.needName, n).map((A) => ({
42
+ objectName: A.path,
43
+ fileName: A.fileName
42
44
  }));
43
- h.value?.trigger(I);
44
- } else
45
- await (await H(P.value, W(O))).downloadFile(w(e.needName, n));
45
+ C.value?.trigger(u), N("downloadCallback", u);
46
+ } else {
47
+ const u = await (await H(V.value, _(k))).downloadFile(F(e.needName, n));
48
+ N("downloadCallback", u);
49
+ }
46
50
  } catch (n) {
47
- D(!1, n);
51
+ E(!1, n);
48
52
  } finally {
49
53
  i.value = !1, c.value = "";
50
54
  }
51
55
  }
52
- }, 500), V = (a) => a && a.length > 0 ? t("ul", {
56
+ }, 500), I = (a) => a && a.length > 0 ? t("ul", {
53
57
  class: [l("file-list")],
54
- style: A.value
58
+ style: p.value
55
59
  }, [a.map((s, n) => t("li", {
56
60
  key: n,
57
61
  class: [l("file-item")],
58
- onClick: () => d(s, n + 1)
62
+ onClick: () => f(s, n + 1)
59
63
  }, [i.value && c.value === n + 1 ? t("span", {
60
64
  class: [l("spin")]
61
- }, [t(v, {
65
+ }, [t(g, {
62
66
  spin: !0
63
67
  }, null)]) : null, s.fileName])), t("li", {
64
68
  class: [l("down-load-all")],
65
- onClick: () => d(e.attachmentList, "all")
69
+ onClick: () => f(e.attachmentList, "all")
66
70
  }, [i.value && c.value === "all" ? t("span", {
67
71
  class: [l("spin")]
68
- }, [t(v, {
72
+ }, [t(g, {
69
73
  spin: !0
70
74
  }, null)]) : null, m("ap.apAttachment.downloadall")])]) : null;
71
75
  return () => e.attachmentList?.length > 0 && t("div", {
72
- class: [y()],
73
- style: [A.value]
74
- }, [t(j, {
75
- title: T.value,
76
+ class: [b()],
77
+ style: [p.value]
78
+ }, [t(K, {
79
+ title: P.value,
76
80
  placement: e.textToolTipPlacement,
77
81
  color: e.toolTipBgColor
78
82
  }, {
79
83
  default: () => [t("div", {
80
84
  class: [l("content")],
81
- onClick: () => d(r.value ? e.attachmentList[0] : e.attachmentList, "global")
85
+ onClick: () => f(d.value ? e.attachmentList[0] : e.attachmentList, "global")
82
86
  }, [i.value && c.value === "global" ? t("div", {
83
87
  class: [l("spin")]
84
- }, [t(v, {
88
+ }, [t(g, {
85
89
  spin: !0
86
- }, null)]) : null, u.default ? t("div", {
90
+ }, null)]) : null, r.default ? t("div", {
87
91
  class: [l("text-render")]
88
- }, [k.value, _(" ")]) : null, t("div", {
92
+ }, [z.value, j(" ")]) : null, t("div", {
89
93
  class: [l("text-inner")],
90
94
  style: {
91
95
  "max-width": e.maxWidth ? e.maxWidth + "px" : "auto"
92
96
  }
93
- }, [N.value])])]
94
- }), t(K, {
95
- content: V(e.attachmentList),
97
+ }, [L.value])])]
98
+ }), t(R, {
99
+ content: I(e.attachmentList),
96
100
  placement: e.fileMorePopoverPlacement,
97
101
  color: "#fff"
98
102
  }, {
99
- default: () => [!r.value && t("div", {
103
+ default: () => [!d.value && t("div", {
100
104
  class: [l("more")]
101
105
  }, [m("ap.apAttachment.more")])]
102
106
  })]);
103
107
  }
104
108
  });
105
109
  export {
106
- ce as default
110
+ se as default
107
111
  };
@@ -2,9 +2,10 @@ import { ApExpandAlertProps } from './interface';
2
2
  import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } from 'vue';
3
3
  declare const _default: <T extends Record<string, any>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
4
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
5
+ readonly onClose?: ((args_0: MouseEvent) => any) | undefined;
5
6
  readonly onExpand?: ((args_0: "collapse" | "expand") => any) | undefined;
6
7
  readonly onChoose?: ((args_0: T) => any) | undefined;
7
- } & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, "onExpand" | "onChoose"> & ApExpandAlertProps<T> & Partial<{}>> & PublicProps;
8
+ } & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, "onClose" | "onExpand" | "onChoose"> & ApExpandAlertProps<T> & Partial<{}>> & PublicProps;
8
9
  expose(exposed: ShallowUnwrapRef<{
9
10
  setExpand: (state?: boolean) => void;
10
11
  }>): void;
@@ -22,7 +23,7 @@ declare const _default: <T extends Record<string, any>>(__VLS_props: NonNullable
22
23
  index: number;
23
24
  }): any;
24
25
  };
25
- emit: ((evt: "expand", args_0: "collapse" | "expand") => void) & ((evt: "choose", args_0: T) => void);
26
+ emit: ((evt: "close", args_0: MouseEvent) => void) & ((evt: "expand", args_0: "collapse" | "expand") => void) & ((evt: "choose", args_0: T) => void);
26
27
  }>) => VNode & {
27
28
  __ctx?: Awaited<typeof __VLS_setup>;
28
29
  };
@@ -1,13 +1,13 @@
1
- import { defineComponent as K, computed as c, ref as g, watch as x, nextTick as f, onMounted as W, createElementBlock as i, openBlock as a, normalizeClass as n, unref as t, createVNode as b, withCtx as m, createElementVNode as S, normalizeStyle as y, renderSlot as H, createBlock as $, toDisplayString as u, resolveDynamicComponent as I, Fragment as C, renderList as j, createCommentVNode as L, createTextVNode as J } from "vue";
2
- import { DownOutlined as P } from "@ant-design/icons-vue";
3
- import { Alert as Q, Tooltip as U } from "@aplus-frontend/antdv";
4
- import { ApActionItem as X } from "../../ap-action/index.mjs";
1
+ import { defineComponent as W, computed as c, ref as g, watch as x, nextTick as f, onMounted as j, createElementBlock as i, openBlock as l, normalizeClass as n, unref as t, createVNode as C, withCtx as m, createElementVNode as S, normalizeStyle as y, renderSlot as H, createBlock as $, toDisplayString as u, resolveDynamicComponent as I, Fragment as E, renderList as J, createCommentVNode as L, createTextVNode as P } from "vue";
2
+ import { DownOutlined as Q } from "@ant-design/icons-vue";
3
+ import { Alert as U, Tooltip as X } from "@aplus-frontend/antdv";
4
+ import { ApActionItem as Y } from "../../ap-action/index.mjs";
5
5
  import "../../config-provider/index.mjs";
6
- import { isNil as Y, isString as E } from "lodash-unified";
7
- import { useLocale as Z } from "../../config-provider/hooks/use-locale.mjs";
8
- import { useNamespace as _ } from "../../config-provider/hooks/use-namespace.mjs";
9
- import { useGlobalConfig as ee } from "../../config-provider/hooks/use-global-config.mjs";
10
- const te = ["onClick"], ce = /* @__PURE__ */ K({
6
+ import { isNil as Z, isString as A } from "lodash-unified";
7
+ import { useLocale as _ } from "../../config-provider/hooks/use-locale.mjs";
8
+ import { useNamespace as ee } from "../../config-provider/hooks/use-namespace.mjs";
9
+ import { useGlobalConfig as te } from "../../config-provider/hooks/use-global-config.mjs";
10
+ const le = ["onClick"], fe = /* @__PURE__ */ W({
11
11
  __name: "ApExpandAlert",
12
12
  props: {
13
13
  type: { default: "warning" },
@@ -21,38 +21,43 @@ const te = ["onClick"], ce = /* @__PURE__ */ K({
21
21
  prefixStyle: { default: () => ({}) },
22
22
  rows: { default: 2 },
23
23
  defaultExpand: { type: Boolean, default: !0 },
24
- showIcon: { type: Boolean, default: !0 }
24
+ showIcon: { type: Boolean, default: !0 },
25
+ closable: { type: Boolean },
26
+ afterClose: {}
25
27
  },
26
- emits: ["choose", "expand"],
28
+ emits: ["choose", "expand", "close"],
27
29
  setup(z, { expose: D, emit: M }) {
28
- const A = M, p = z, { t: B } = Z(), V = c(() => {
30
+ const h = M, p = z, { t: B } = _(), V = c(() => {
29
31
  if (p.type != "card")
30
32
  return p.type;
31
- }), l = g(""), d = g(null), R = c(() => ({
33
+ }), a = g(""), d = g(null), R = c(() => ({
32
34
  fontWeight: "400",
33
35
  wordBreak: "break-all",
34
36
  overflow: "hidden",
35
37
  display: "-webkit-box",
36
- webkitLineClamp: l.value,
38
+ webkitLineClamp: a.value,
37
39
  webkitBoxOrient: "vertical",
38
40
  lineHeight: "18px"
39
41
  }));
40
42
  function q() {
41
- l.value === "1" ? (l.value = "", A("expand", "expand")) : (l.value = "1", A("expand", "collapse"));
43
+ a.value === "1" ? (a.value = "", h("expand", "expand")) : (a.value = "1", h("expand", "collapse"));
42
44
  }
43
- const F = c(() => l.value === "1" ? B("ap.apExpandAlert.expand") : B("ap.apExpandAlert.collapse")), h = g(!0), N = c(() => l.value !== "1");
44
- function v(e) {
45
- e ? l.value = "" : l.value = "1";
45
+ const F = c(() => a.value === "1" ? B("ap.apExpandAlert.expand") : B("ap.apExpandAlert.collapse")), v = g(!0), N = c(() => a.value !== "1");
46
+ function k(e) {
47
+ e ? a.value = "" : a.value = "1";
48
+ }
49
+ function O(e) {
50
+ h("close", e);
46
51
  }
47
52
  x(
48
53
  () => p.data,
49
54
  () => {
50
- l.value = "", f(() => {
55
+ a.value = "", f(() => {
51
56
  if (d.value) {
52
57
  const e = Number(d.value.clientHeight), r = Number(
53
58
  parseInt(d.value.style.lineHeight)
54
59
  );
55
- e < r * Number(p.rows) && N.value ? h.value = !1 : h.value = !0;
60
+ e < r * Number(p.rows) && N.value ? v.value = !1 : v.value = !0;
56
61
  }
57
62
  });
58
63
  },
@@ -63,21 +68,21 @@ const te = ["onClick"], ce = /* @__PURE__ */ K({
63
68
  () => p.defaultExpand,
64
69
  (e) => {
65
70
  e ? f(() => {
66
- v(e);
71
+ k(e);
67
72
  }) : f(() => {
68
- v(e);
73
+ k(e);
69
74
  });
70
75
  },
71
76
  { immediate: !0 }
72
- ), W(() => {
77
+ ), j(() => {
73
78
  x(
74
79
  () => p.contentStyle,
75
80
  (e) => {
76
- Y(e.lineHeight) || f(() => {
81
+ Z(e.lineHeight) || f(() => {
77
82
  const r = document.querySelector(
78
- `#${k} .ant-alert-action`
83
+ `#${w} .ant-alert-action`
79
84
  ), s = document.querySelector(
80
- `#${k} .ant-alert-icon`
85
+ `#${w} .ant-alert-icon`
81
86
  );
82
87
  r && r.setAttribute("style", `line-height: ${e.lineHeight}`), s && s.setAttribute("style", `line-height: ${e.lineHeight}`);
83
88
  });
@@ -89,20 +94,23 @@ const te = ["onClick"], ce = /* @__PURE__ */ K({
89
94
  }
90
95
  );
91
96
  });
92
- const { b: T, e: o, m: O } = _("ap-expand-alert"), k = `${T()}-key-${Date.now()}-${(Math.random() * 1e6).toFixed(0)}`, G = ee("uiMode", "aplus");
97
+ const { b: T, e: o, m: G } = ee("ap-expand-alert"), w = `${T()}-key-${Date.now()}-${(Math.random() * 1e6).toFixed(0)}`, K = te("uiMode", "aplus");
93
98
  return D({
94
- setExpand: v
95
- }), (e, r) => (a(), i("div", {
96
- id: k,
97
- class: n([t(T)(), `${t(O)(t(G))}`])
99
+ setExpand: k
100
+ }), (e, r) => (l(), i("div", {
101
+ id: w,
102
+ class: n([t(T)(), `${t(G)(t(K))}`])
98
103
  }, [
99
- b(t(Q), {
104
+ C(t(U), {
100
105
  type: V.value,
101
106
  "show-icon": e.showIcon,
102
- class: n([t(o)("antAlert"), e.type == "card" ? "card-alert" : ""])
107
+ closable: e.closable,
108
+ class: n([t(o)("antAlert"), e.type == "card" ? "card-alert" : ""]),
109
+ "after-close": e.afterClose,
110
+ onClose: O
103
111
  }, {
104
112
  action: m(() => [
105
- h.value ? (a(), $(t(X), {
113
+ v.value ? (l(), $(t(Y), {
106
114
  key: 0,
107
115
  size: "small",
108
116
  style: { "font-size": "12px", "padding-left": "16px" },
@@ -112,7 +120,7 @@ const te = ["onClick"], ce = /* @__PURE__ */ K({
112
120
  S("span", {
113
121
  class: n(t(o)("expandText"))
114
122
  }, u(F.value), 3),
115
- b(t(P), {
123
+ C(t(Q), {
116
124
  class: n(N.value ? t(o)("expandIcon") : t(o)("collapseIcon"))
117
125
  }, null, 8, ["class"])
118
126
  ]),
@@ -127,52 +135,52 @@ const te = ["onClick"], ce = /* @__PURE__ */ K({
127
135
  class: n(t(o)("alertContent"))
128
136
  }, [
129
137
  H(e.$slots, "default", {}, () => [
130
- t(E)(e.prefix) ? (a(), i("span", {
138
+ t(A)(e.prefix) ? (l(), i("span", {
131
139
  key: 0,
132
140
  class: n(t(o)("prefix")),
133
141
  style: y(e.prefixStyle)
134
- }, u(e.prefix), 7)) : (a(), $(I(e.prefix), {
142
+ }, u(e.prefix), 7)) : (l(), $(I(e.prefix), {
135
143
  key: 1,
136
144
  style: y(e.prefixStyle)
137
145
  }, null, 8, ["style"])),
138
- t(E)(e.data) ? (a(), i("span", {
146
+ t(A)(e.data) ? (l(), i("span", {
139
147
  key: 2,
140
148
  class: n(t(o)("text"))
141
- }, u(e.data), 3)) : (a(!0), i(C, { key: 3 }, j(e.data, (s, w) => (a(), i(C, { key: w }, [
142
- b(t(U), {
149
+ }, u(e.data), 3)) : (l(!0), i(E, { key: 3 }, J(e.data, (s, b) => (l(), i(E, { key: b }, [
150
+ C(t(X), {
143
151
  title: e.tipTitle ? e.tipTitle : null
144
152
  }, {
145
153
  default: m(() => [
146
154
  H(e.$slots, "item", {
147
155
  record: s,
148
- index: w
156
+ index: b
149
157
  }, () => [
150
158
  S("span", {
151
159
  class: n(t(o)("showItem")),
152
160
  onClick: (ae) => e.$emit("choose", s)
153
- }, u(e.mapLabel ? s[e.mapLabel] : s), 11, te)
161
+ }, u(e.mapLabel ? s[e.mapLabel] : s), 11, le)
154
162
  ])
155
163
  ]),
156
164
  _: 2
157
165
  }, 1032, ["title"]),
158
- w !== e.data.length - 1 ? (a(), i("span", {
166
+ b !== e.data.length - 1 ? (l(), i("span", {
159
167
  key: 0,
160
168
  class: n(t(o)("spliter")),
161
169
  style: y(e.separatorStyle)
162
170
  }, [
163
- t(E)(e.separator) ? (a(), i(C, { key: 0 }, [
164
- J(u(e.separator), 1)
165
- ], 64)) : (a(), $(I(e.separator), { key: 1 }))
171
+ t(A)(e.separator) ? (l(), i(E, { key: 0 }, [
172
+ P(u(e.separator), 1)
173
+ ], 64)) : (l(), $(I(e.separator), { key: 1 }))
166
174
  ], 6)) : L("", !0)
167
175
  ], 64))), 128))
168
176
  ])
169
177
  ], 6)
170
178
  ]),
171
179
  _: 3
172
- }, 8, ["type", "show-icon", "class"])
180
+ }, 8, ["type", "show-icon", "closable", "class", "after-close"])
173
181
  ], 2));
174
182
  }
175
183
  });
176
184
  export {
177
- ce as default
185
+ fe as default
178
186
  };
@@ -15,9 +15,10 @@ declare const ApExpandAlert: (<T extends Record<string, any>>(__VLS_props: NonNu
15
15
  index: number;
16
16
  }): any;
17
17
  };
18
- emit: ((evt: "expand", args_0: "collapse" | "expand") => void) & ((evt: "choose", args_0: T) => void);
18
+ emit: ((evt: "close", args_0: MouseEvent) => void) & ((evt: "expand", args_0: "collapse" | "expand") => void) & ((evt: "choose", args_0: T) => void);
19
19
  }, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
20
20
  props: {
21
+ readonly onClose?: ((args_0: MouseEvent) => any) | undefined;
21
22
  readonly onExpand?: ((args_0: "collapse" | "expand") => any) | undefined;
22
23
  readonly onChoose?: ((args_0: T) => any) | undefined;
23
24
  type?: "warning" | "error" | "success" | "info" | "card" | undefined | undefined;
@@ -31,6 +32,8 @@ declare const ApExpandAlert: (<T extends Record<string, any>>(__VLS_props: NonNu
31
32
  prefixStyle?: CSSProperties | undefined;
32
33
  rows?: string | number | undefined;
33
34
  defaultExpand?: boolean | undefined;
35
+ closable?: boolean | undefined;
36
+ afterClose?: (() => void) | undefined;
34
37
  showIcon?: boolean | undefined;
35
38
  } & PublicProps;
36
39
  expose(exposed: ShallowUnwrapRef<{
@@ -50,7 +53,7 @@ declare const ApExpandAlert: (<T extends Record<string, any>>(__VLS_props: NonNu
50
53
  index: number;
51
54
  }): any;
52
55
  };
53
- emit: ((evt: "expand", args_0: "collapse" | "expand") => void) & ((evt: "choose", args_0: T) => void);
56
+ emit: ((evt: "close", args_0: MouseEvent) => void) & ((evt: "expand", args_0: "collapse" | "expand") => void) & ((evt: "choose", args_0: T) => void);
54
57
  }>) => VNode & {
55
58
  __ctx?: Awaited<typeof __VLS_setup>;
56
59
  }) & ( Plugin & (new (...args: any[]) => {
@@ -45,4 +45,4 @@ export type ApExpandAlertProps<T> = {
45
45
  * 默认是否展开
46
46
  */
47
47
  defaultExpand?: boolean;
48
- } & Pick<AlertProps, 'showIcon'>;
48
+ } & Pick<AlertProps, 'showIcon' | 'closable' | 'afterClose'>;
@@ -22,8 +22,6 @@ export interface UsePageListAgGrid extends AgGridProps {
22
22
  * @default true
23
23
  */
24
24
  clearDataOnDeactivated?: boolean;
25
- /** 绑定ref */
26
- onRef?: (expose: AgGridExpose) => void;
27
25
  }
28
26
  /**
29
27
  * 集成了列表页面的AgGrid的默认配置
@@ -1,44 +1,43 @@
1
- import { isFunction as A, merge as F, cloneDeep as R } from "lodash-unified";
2
- import { ref as w } from "vue";
3
- import { useKeepAliveFlag as V } from "./useKeepAliveFlag.mjs";
4
- function W(l) {
5
- const r = w(null), {
1
+ import { isFunction as g, merge as A, cloneDeep as F } from "lodash-unified";
2
+ import { ref as V } from "vue";
3
+ import { useKeepAliveFlag as w } from "./useKeepAliveFlag.mjs";
4
+ function O(l) {
5
+ const r = V(null), {
6
6
  isShowRowSelection: u = !0,
7
7
  clearSelectionOnRequest: d = !0,
8
8
  transformSearchFormValues: o,
9
- api: s,
10
- tableRefresh: n = !0,
9
+ api: a,
10
+ tableRefresh: s = !0,
11
11
  clearDataOnDeactivated: f = !0,
12
- onRef: m,
13
- ...p
12
+ ...m
14
13
  } = l || {};
15
- let a = null;
14
+ let n = null;
16
15
  const i = () => {
17
16
  r.value?.rowSelection?.clearAll();
18
17
  }, c = (e) => {
19
18
  r.value?.submitWith(e);
20
- }, g = () => {
19
+ }, p = () => {
21
20
  r.value?.reset();
22
- }, { isDeactivated: h } = V({
21
+ }, { isDeactivated: h } = w({
23
22
  afterActivated() {
24
- (A(n) ? n() : n) && c();
23
+ (g(s) ? s() : s) && c();
25
24
  },
26
25
  afterDeactivated: c
27
26
  });
28
- return [F(
27
+ return [A(
29
28
  {
30
29
  // scroll,tableLayout,columnResizable设置表格可拖动
31
30
  columnResizable: !0,
32
- request: s ? async (e) => {
31
+ request: a ? async (e) => {
33
32
  if (h() && f)
34
33
  return {
35
34
  data: [],
36
35
  total: 0
37
36
  };
38
- a = e.sort, console.log("_sortedInfo", a);
37
+ n = e.sort;
39
38
  const t = o ? o(e) : e;
40
- if (!s) throw new Error("api is not defined");
41
- const { records: v, total: S } = await s(t);
39
+ if (!a) throw new Error("api is not defined");
40
+ const { records: v, total: S } = await a(t);
42
41
  return d && i(), {
43
42
  data: v,
44
43
  total: S
@@ -48,16 +47,17 @@ function W(l) {
48
47
  fixed: "left",
49
48
  columnWidth: 38
50
49
  } : void 0,
51
- ref(e) {
52
- r.value = e, m?.(e);
50
+ /** Jackie 推荐方法 */
51
+ onVnodeBeforeMount(e) {
52
+ r.value = e.component?.exposed;
53
53
  },
54
54
  // 新UI规范,需要都添加分割线
55
55
  card: !0
56
56
  },
57
- p
57
+ m
58
58
  ), {
59
59
  reload: c,
60
- reset: g,
60
+ reset: p,
61
61
  getSearchFormValues: (e = !0) => {
62
62
  const t = r.value?.getSearchFormValues(!!e) || {};
63
63
  return o ? o(t) : t;
@@ -65,11 +65,11 @@ function W(l) {
65
65
  getAgGridInstance: () => r.value,
66
66
  getSearchFormValuesAndSorted: (e = !0) => {
67
67
  const t = r.value?.getSearchFormValues(!!e) || {};
68
- return t.sort = a && R(a), o ? o(t) : t;
68
+ return t.sort = n && F(n), o ? o(t) : t;
69
69
  },
70
70
  clearSelection: i
71
71
  }];
72
72
  }
73
73
  export {
74
- W as usePageListAgGrid
74
+ O as usePageListAgGrid
75
75
  };
@@ -1,2 +1,2 @@
1
- declare const _default: "6.41.2";
1
+ declare const _default: "6.42.0";
2
2
  export default _default;
@@ -1,4 +1,4 @@
1
- const e = "6.41.2";
1
+ const e = "6.42.0";
2
2
  export {
3
3
  e as default
4
4
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("../../ap-table/utils.js"),T=require("../renderer/index.js"),o=require("lodash-unified"),d=require("vue");require("../components/body-cell/index.vue.js");require("../components/header-cell/index.vue.js");require("../components/tooltip/index.vue.js");require("../../config-provider/index.js");const q=require("../../ap-grid/utils/col.js"),w=require("../../utils/index.js"),P=require("../../config-provider/hooks/use-global-config.js"),S=require("../../config-provider/hooks/use-namespace.js"),D=require("../components/body-cell/index.vue2.js"),R=require("../components/tooltip/index.vue2.js"),C=require("../components/header-cell/index.vue2.js");function I(t){return o.isNumber(t)&&t>1}function G(t,i){if(i.bodyCellTooltip)return o.isFunction(i.bodyCellTooltip)?i.bodyCellTooltip(t.value,t.data):i.bodyCellTooltip;if(i.renderText)return i.renderText({value:t.value,record:t.data,column:i,text:t.value});const u=i.valueType||"text",p=T.rendererMap[u];if(p){const f=x.getTableRenderProps({...i,valueType:u},{value:t.value,text:t.value,record:t.data,column:t.column,rowIndex:t.node?.rowIndex,pinned:t.node?.rowPinned});return p(f)}return x.objectToString(t.value)}const M=(t,i,u)=>{const p=P.useGlobalConfig("valueTypeMap"),c=d.ref(),{em:f}=S.useNamespace("ag-grid"),y=r=>{const l={cellRenderer:D.default,cellRendererParams:{column:r,extraValueType:d.unref(p),rowKey:i.rowKey}};if(r.customRender)return l;if(r.renderText)return{valueFormatter:s=>r.renderText({value:s.value,record:s.data,column:r,text:s.value})};const a=r.valueType||"text",e=T.rendererMap[a];return e?{valueFormatter:s=>{const n=x.getTableRenderProps({...r,valueType:a},{value:s.value,text:s.value,record:s.data,column:s.column,rowIndex:s.node?.rowIndex,pinned:s.node?.rowPinned});return e(n)}}:l},b=r=>{const l={},a=r.bodyCellTooltip||!r.customRender&&(r.ellipsis===!0||r.ellipsis==="tooltip"||o.isNumber(r.ellipsis)),e=o.isNumber(r.ellipsis)&&r.ellipsis>1,s=o.isNumber(r.ellipsis)?r.ellipsis:1;return l.tooltipValueGetter=a?n=>G(n,r):void 0,l.wrapText=!r.ellipsis||e,l.cellStyle={"--ag-grid-line-clamp":s},l.tooltipComponent=R.default,l.tooltipComponentParams={lineClamp:s,gridWrapperRef:c},l},h=d.computed(()=>{const r=d.unref(t);function l(a){return a.map(e=>{const s={field:q.dataIndexToField(e.dataIndex),colId:w.isDef(e.key)?String(e.key):void 0,sortable:!!e.sorter,comparator:e.sorter===!0?()=>0:e.sorter,headerComponentParams:{column:e},resizable:e.resizable,width:e.width,minWidth:e.minWidth,maxWidth:e.maxWidth,flex:e.width?void 0:1,pinned:e.fixed||null,colSpan:e.colSpan,cellClass:u(n=>{const v=e.cellClass||"",g=o.isFunction(v)?v(n.data,n.node):v;return[`${f("cell",e.align||"left")}`,I(e.ellipsis)?f("cell","multiline"):null,g].flat().filter(Boolean)}),headerStyle:e.headerStyle,headerClass:e.headerClass,autoHeight:!0,...b(e),...y(e)};return e.children?.length?{...s,headerGroupComponent:C.default,headerGroupComponentParams:{column:e},children:l(e.children)}:s})}return l(r)}),_=d.computed(()=>({headerComponent:C.default,resizable:i.columnResizable,suppressMovable:!0,cellDataType:!1}));return{columnDefs:h,defaultColDef:_,gridWrapperRef:c}};exports.useColumnsDef=M;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("../../ap-table/utils.js"),T=require("../renderer/index.js"),o=require("lodash-unified"),d=require("vue");require("../components/body-cell/index.vue.js");require("../components/header-cell/index.vue.js");require("../components/tooltip/index.vue.js");require("../../config-provider/index.js");const q=require("../../ap-grid/utils/col.js"),w=require("../../utils/index.js"),R=require("../../config-provider/hooks/use-global-config.js"),P=require("../../config-provider/hooks/use-namespace.js"),S=require("../components/body-cell/index.vue2.js"),D=require("../components/tooltip/index.vue2.js"),C=require("../components/header-cell/index.vue2.js");function I(t){return o.isNumber(t)&&t>1}function G(t,i){if(i.bodyCellTooltip)return o.isFunction(i.bodyCellTooltip)?i.bodyCellTooltip(t.value,t.data):i.bodyCellTooltip;if(i.renderText)return i.renderText({value:t.value,record:t.data,column:i,text:t.value});const u=i.valueType||"text",p=T.rendererMap[u];if(p){const f=x.getTableRenderProps({...i,valueType:u},{value:t.value,text:t.value,record:t.data,column:t.column,rowIndex:t.node?.rowIndex,pinned:t.node?.rowPinned});return p(f)}return x.objectToString(t.value)}const M=(t,i,u)=>{const p=R.useGlobalConfig("valueTypeMap"),c=d.ref(),{em:f}=P.useNamespace("ag-grid"),y=r=>{const a={cellRenderer:S.default,cellRendererParams:{column:r,extraValueType:d.unref(p),rowKey:i.rowKey}};if(r.customRender)return a;if(r.renderText)return{valueFormatter:s=>r.renderText({value:s.value,record:s.data,column:r,text:s.value})};const l=r.valueType||"text",e=T.rendererMap[l];return e?{valueFormatter:s=>{const n=x.getTableRenderProps({...r,valueType:l},{value:s.value,text:s.value,record:s.data,column:s.column,rowIndex:s.node?.rowIndex,pinned:s.node?.rowPinned});return e(n)}}:a},b=r=>{const a={},l=r.bodyCellTooltip||!r.customRender&&(r.ellipsis===!0||r.ellipsis==="tooltip"||o.isNumber(r.ellipsis)),e=o.isNumber(r.ellipsis)&&r.ellipsis>1,s=o.isNumber(r.ellipsis)?r.ellipsis:1;return a.tooltipValueGetter=l?n=>G(n,r):void 0,a.wrapText=!r.ellipsis||e,a.cellStyle={"--ag-grid-line-clamp":s},a.tooltipComponent=D.default,a.tooltipComponentParams={lineClamp:s,gridWrapperRef:c},a},h=d.computed(()=>{const r=d.unref(t);function a(l){return l.map(e=>{const s={field:q.dataIndexToField(e.dataIndex),colId:w.isDef(e.key)?String(e.key):void 0,sortable:!!e.sorter,comparator:e.sorter===!0?()=>0:e.sorter,headerComponentParams:{column:e},resizable:e.resizable,width:e.width,minWidth:e.minWidth,maxWidth:e.maxWidth,flex:e.width?void 0:1,pinned:e.fixed||null,colSpan:e.colSpan,spanRows:e.spanRows,cellClass:u(n=>{const v=e.cellClass||"",g=o.isFunction(v)?v(n.data,n.node):v;return[`${f("cell",e.align||"left")}`,I(e.ellipsis)?f("cell","multiline"):null,g].flat().filter(Boolean)}),headerStyle:e.headerStyle,headerClass:e.headerClass,autoHeight:!0,...b(e),...y(e)};return e.children?.length?{...s,headerGroupComponent:C.default,headerGroupComponentParams:{column:e},children:a(e.children)}:s})}return a(r)}),_=d.computed(()=>({headerComponent:C.default,resizable:i.columnResizable,suppressMovable:!0,cellDataType:!1}));return{columnDefs:h,defaultColDef:_,gridWrapperRef:c}};exports.useColumnsDef=M;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),$e=require("ag-grid-vue3"),$=require("ag-grid-community"),je=require("./utils.js"),j=require("@aplus-frontend/antdv"),i=require("lodash-unified");require("../config-provider/index.js");const Je=require("../ap-form/index.js"),Qe=require("../ap-table/utils.js"),Xe=require("../ap-table/hooks/use-table-paging-ng.js"),Ye=require("./hooks/use-row-selection.js"),Ze=require("./context.js"),eo=require("../ap-table/context.js"),B=require("../ap-grid/constants.js"),oo=require("@aplus-frontend/antdv/es/theme/internal"),to=require("./theme.js"),ro=require("./hooks/use-columns.js"),no=require("./hooks/use-columns-def.js"),ao=require("../utils/index.js"),lo=require("../utils/slot.js"),so=require("./hooks/use-search-form.js");require("./components/empty/index.vue.js");const uo=require("./hooks/use-virtual-config.js"),io=require("./hooks/use-pinned-row.js"),co=require("./hooks/use-selection-col-def.js");require("./components/row/index.vue.js");const fo=require("../config-provider/hooks/use-namespace.js"),mo=require("../config-provider/hooks/use-global-config.js"),po=require("./components/row/index.vue2.js"),go=require("./components/empty/index.vue2.js"),wo=e.defineComponent({name:"AgGrid",__name:"index",props:{dropdownPrefixCls:{},bordered:{type:Boolean},locale:{},onChange:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{},showSorterTooltip:{type:[Boolean,Object]},prefixCls:{},rowKey:{type:[String,Function],default:"key"},tableLayout:{},title:{},id:{},showHeader:{type:Boolean},components:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean]},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean},indentSize:{},expandIconColumnIndex:{},showExpandColumn:{type:Boolean},expandedRowClassName:{},childrenColumnName:{},rowExpandable:{},transformCellText:{},columns:{},rowSelection:{type:Boolean},card:{type:Boolean},params:{},request:{},defaultData:{},dataSource:{},onLoadingChange:{},onShownColumnsChange:{},searchForm:{type:[Boolean,Object],default:void 0},beforeSearchSubmit:{},pagination:{type:[Boolean,Object],default:void 0},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},tableStyle:{},manual:{type:Boolean,default:void 0},size:{default:"mini"},adaptive:{type:Boolean},columnResizable:{type:Boolean,default:!1},loading:{type:Boolean,default:void 0},summary:{},rowHeight:{},getRowHeight:{},advanceRenderer:{type:Boolean},browserTooltips:{type:Boolean},virtual:{type:[Boolean,Object],default:void 0},onRowClicked:{},onScrollEnd:{},rowClassName:{},rowClassRules:{},autoHeight:{type:Boolean},onUpdate:{},customRow:{},theme:{}},setup(J,{expose:Q}){$.ModuleRegistry.registerModules([$.AllCommunityModule]);const t=J,T=e.useSlots(),{e:R,b:c,be:X}=fo.useNamespace("ag-grid"),C=e.ref(t.size),Y=to.useTheme(C,e.toRef(t,"rowHeight"),e.toRef(t,"theme")),Z=uo.default(e.toRef(t,"virtual")),{rowPinnedGridConfig:E,getRowPinnedCellClass:ee}=io.usePinnedRow(e.toRef(t,"summary")),oe=mo.useGlobalConfig("apGrid"),l=e.ref(),[,te]=oo.useToken();let y=!!t.dataSource;const D=so.useSearchForm(t),{shownColumns:p,columns:V,columnKeys:re,getTargetColumnByKey:ne}=ro.useColumns(t),{defaultColDef:ae,columnDefs:le,gridWrapperRef:se}=no.useColumnsDef(V,t,ee),b=e.ref({});Ze.useProvideSorter({sorter:b,setSorter(o){b.value=o}});const ue={asc:"ascend",desc:"descend"};function ie(){const o=l.value.getColumns()?.filter(d=>d.getSort()!==void 0),r=e.unref(b)||{};let n=o?.[0];const s=Object.keys(r);if(s.length&&s.every(d=>r[d]===null)){const d=Object.keys(r)[0];d&&(n=l.value?.getColumn(d))}if(!n)return;const u=n.getColDef(),f=n.getSort(),m=ne(u.colId);P(void 0,void 0,{column:u,field:m?.field??u.field??u.colId,order:f?ue[f]:null})}const ce=e.computed(()=>Qe.recursionApColumns(e.unref(p),o=>{if(o.sorter===!0)return o.field??o.dataIndex??o.key}).filter(Boolean)),de=()=>{b.value={};const o=l.value;if(!o)return;const r=o.getColumnState()?.map(n=>({...n,sort:null}));o.applyColumnState({state:r})},fe=e.computed(()=>ao.isDef(t.manual)?t.manual:lo.getValidVNodeList(T.searchFormExtra?.()||[]).some(r=>r.type?.name==="ApView")),{formRef:g,submit:F,reset:x,data:w,tableProps:z,handleTableChangeOptional:P,submitWith:A,refresh:K,getPaging:me,setPaging:pe,setDataSource:ge}=Xe.useTablePaging({async request(o){if(y=!1,S.value&&!S.value.preserveSelectedRowKeys&&i.isUndefined(t.dataSource)&&I(),!i.isUndefined(t.dataSource)){const n=o.pageSize*(o.current-1);return{data:(t.pagination===!1?t.dataSource:t.dataSource.slice(n,n+o.pageSize))||[],total:t.dataSource.length||0}}const r=await t.request?.(o);return{data:r?.data||[],total:r?.total||0}},namespace:"ap-grid",filterFields:e.ref([]),params:e.toRef(t,"params"),defaultData:t.defaultData,manual:e.unref(fe),formatParams:t.beforeSearchSubmit,pagination:t.pagination,sortFields:ce,onClickReset:de}),S=e.computed(()=>{const o=t.rowSelection||oe.value?.rowSelection;if(o)return o===!0?B.DEFAULT_ROW_SELECTION_CONFIG:{...B.DEFAULT_ROW_SELECTION_CONFIG,...o}}),we=co.default(t,p),Se=e.computed(()=>i.isUndefined(t.dataSource)?w.records:t.dataSource),{select:Ce,unSelect:ye,selectedRows:N,selectedRowKeys:he,clearAll:ve,selectMultiByKeys:Re,selectMulti:be,unSelectMulti:ke}=Ye.default({...S.value,dataSource:Se,rowKey:t.rowKey}),Be={checkbox:"multiRow",radio:"singleRow"},Fe=e.computed(()=>{const o=S.value;if(!o)return;const{type:r="checkbox",disabled:n}=o;return{mode:Be[r],isRowSelectable:s=>n?!n(s.data):!0,hideDisabledCheckboxes:o.hideDisabled??!1}});function q(o){return i.isFunction(t.rowKey)?t.rowKey(o):o[t.rowKey]}const k=({api:o=l.value})=>{if(t.onUpdate?.(),!S.value)return;const r=N.value||[];y=!1;const n=[];o.forEachNode(s=>{const h=s.data,u=q(h),f=s.isSelected();r.find(m=>q(m)===u)?!f&&n.push(s):f&&s.setSelected(!1)}),o.setNodesSelected({nodes:n,newValue:!0}),setTimeout(()=>{y=!0},0)},xe=o=>{y&&(o.node.isSelected()?Ce(o.data):ye(o.data),i.isFunction(S.value?.tooltip)&&o.api.refreshCells({rowNodes:[o.node],columns:["ag-Grid-SelectionColumn"],force:!0}))},Ne=()=>{y=!0},I=()=>{ve(),l.value?.deselectAll()};function qe(o){Re(o),e.nextTick(()=>{k({})})}const Ie=e.computed(()=>{const o=t.customRow;return o?{isFullWidthRow:o.isCustomRow,fullWidthCellRenderer:po.default,fullWidthCellRendererParams:{render:o.render}}:{}});function Te(o){be(o),e.nextTick(()=>{k({})})}function Ee(o){ke(o),e.nextTick(()=>{k({})})}function M(o=!1){const r=o?"getFieldsValueTransformed":"getFieldsValue";return g.value?.apForm?.[r]?.(!0)}function _(o){g.value?.apForm?.setFieldsValue?.(o)}function O(){return g.value?.getSorterItems()||[]}function W(o){g.value?.setSorterItems(o)}function U(){g.value?.resetSorterItems()}function G(o){return o&&String(o)}function De(o){const r=l.value;if(!r)return;const n=r.getColumnState()||[],s=o.map(a=>a.key?String(a.key):a.key).filter(Boolean),h=n.map(a=>{if(!re.value.includes(a.colId))return a;const v=!s.includes(a.colId),H={...a,hide:v},L=o.find(Le=>G(Le.key)===a.colId);return L&&(H.pinned=L.fixed||null),H}),u=new Map(o.map((a,v)=>[G(a.key),v])),f=h.filter(a=>u.has(a.colId)).sort((a,v)=>u.get(a.colId)-u.get(v.colId)),m=[];let d=0;for(const a of h)u.has(a.colId)?m.push(f[d++]):m.push(a);r.applyColumnState({state:m,applyOrder:!0})}eo.useProvideApTable({columns:e.computed(()=>p.value),columnsBackup:e.computed(()=>V.value),size:e.computed(()=>B.sizeMap[C.value]),updateColumns(o){p.value=o,t.onShownColumnsChange?.(o),De(o)},updateSize(o){C.value=B.sizeReverseMap[o]},renderConfig:e.computed(()=>({className:X("table-header","title"),color:te.value.colorTextTertiary})),dataSource:e.computed(()=>e.unref(w).records),getSearchFormValues:M,setSearchFormValues:_,submit:F,submitWith:A,reset:x,refresh:K,getSearchFormSorterItems:O,setSearchFormSorterItems:W,resetSearchFormSorterItems:U});const Ve=e.computed(()=>i.isUndefined(t.loading)?w.loading:t.loading),ze=e.computed(()=>[c(),t.card?null:c("wrapper"),c("adaptive"),c(`size-${C.value}`)].filter(Boolean)),Pe=e.computed(()=>({height:"100%",...t.tableStyle||{}})),Ae=(o,r)=>{P({current:o,pageSize:r})};function Ke(o){const r=o.data;return q(r)}function Me(o,r){(i.isFunction(o)?l.value?.ensureNodeVisible:l.value?.ensureIndexVisible)?.(o,r)}function _e(o,r){l.value?.ensureColumnVisible(o,r)}function Oe(o){t.onRowClicked?.(o.data,o.event)}function We(o){t.onScrollEnd?.(o.direction)}function Ue(o){return l.value?.refreshCells(o)}function Ge(o){return l.value?.redrawRows(o)}const He=o=>{const r=[E.value.getRowClass?.(o)];if(!o.node.rowPinned){const n=i.isFunction(t.rowClassName)?t.rowClassName(o.data,o.rowIndex):t.rowClassName;r.push(n)}return r.flat().filter(Boolean)};return e.watch(()=>t.dataSource,o=>{ge(o)},{immediate:!0,deep:!0}),e.watch(()=>t.size,o=>{C.value=o}),e.watch(()=>e.unref(w).loading,o=>{t.onLoadingChange?.(o)}),Q({submit:F,reset:x,refresh:K,submitWith:A,setSearchFormValues:_,getSearchFormValues:M,getShowColumns:()=>e.unref(p),rowSelection:{selectedRows:e.computed(()=>N.value),setSelectedRowKeys:qe,setSelectedRows:Te,clearAll:I,unSelectRows:Ee},scrollToRow:Me,scrollToColumn:_e,getDataSource:()=>e.unref(w.records),getPaging:me,setPaging:pe,getSearchFormSorterItems:O,setSearchFormSorterItems:W,resetSearchFormSorterItems:U,refreshCells:Ue,redrawRows:Ge,_internalGridApi:e.computed(()=>l.value)}),(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(ze.value),style:e.normalizeStyle(o.wrapperStyle)},[e.unref(i.isUndefined)(o.dataSource)&&o.searchForm!==!1&&e.unref(D).length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(o.card?e.unref(R)("search-wrapper"):null),style:e.normalizeStyle(o.searchFormWrapperStyle)},[e.createVNode(e.unref(Je.ApForm).SearchForm,e.mergeProps(o.searchForm||{},{ref_key:"formRef",ref:g,"custom-reset":"","submit-loading":e.unref(z).loading,onSubmit:e.unref(F),onReset:e.unref(x)}),e.createSlots({default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(D),n=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.renderNode),{key:n.dataIndex}))),128))]),_:2},[T.searchFormExtra?{name:"extra",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"searchFormExtra")]),key:"0"}:void 0]),1040,["submit-loading","onSubmit","onReset"])],6)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([e.unref(R)("table-wrapper"),o.card?e.unref(R)("table-wrapper-card"):null]),style:e.normalizeStyle(o.tableWrapperStyle)},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(c)("header-wrapper"))},[e.renderSlot(o.$slots,"title",{selectedRows:e.unref(N),selectedRowKeys:e.unref(he),shownColumns:e.unref(p),clearAll:I})],2),e.createElementVNode("div",{ref_key:"gridWrapperRef",ref:se,class:e.normalizeClass(e.unref(c)("grid-wrapper"))},[e.createVNode(e.unref($e.AgGridVue),e.mergeProps(e.unref(je.mergeProps)(e.unref(Z),e.unref(E),Ie.value),{"get-row-class":He,style:Pe.value,"row-data":e.unref(w).records,"column-defs":e.unref(le),"default-col-def":e.unref(ae),"suppress-loading-overlay":"","row-selection":Fe.value,"selection-column-def":e.unref(we),"get-row-id":Ke,"get-row-height":t.getRowHeight,theme:e.unref(Y),"tooltip-show-delay":500,"enable-browser-tooltips":o.browserTooltips,"tooltip-interaction":"","row-class-rules":o.rowClassRules,"no-rows-overlay-component":go.default,"suppress-cell-focus":"","dom-layout":o.autoHeight?"autoHeight":"normal",onSortChanged:ie,onGridReady:r[0]||(r[0]=n=>l.value=n.api),onRowDataUpdated:k,onRowSelected:xe,onFirstDataRendered:Ne,onRowClicked:Oe,onBodyScrollEnd:We}),null,16,["style","row-data","column-defs","default-col-def","row-selection","selection-column-def","get-row-height","theme","enable-browser-tooltips","row-class-rules","dom-layout"]),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(e.unref(R)("table-loading-wrapper"))},[e.createVNode(e.unref(j.Spin),{delay:300})],2),[[e.vShow,Ve.value]])],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(c)("pagination-wrapper"))},[o.pagination!==!1?(e.openBlock(),e.createBlock(e.unref(j.Pagination),e.mergeProps({key:0,class:e.unref(c)("pagination")},e.unref(z).pagination,{onChange:Ae}),null,16,["class"])):e.createCommentVNode("",!0)],2)],6)],6))}});exports.default=wo;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),$e=require("ag-grid-vue3"),$=require("ag-grid-community"),je=require("./utils.js"),j=require("@aplus-frontend/antdv"),i=require("lodash-unified");require("../config-provider/index.js");const Je=require("../ap-form/index.js"),Qe=require("../ap-table/utils.js"),Xe=require("../ap-table/hooks/use-table-paging-ng.js"),Ye=require("./hooks/use-row-selection.js"),Ze=require("./context.js"),eo=require("../ap-table/context.js"),B=require("../ap-grid/constants.js"),oo=require("@aplus-frontend/antdv/es/theme/internal"),to=require("./theme.js"),ro=require("./hooks/use-columns.js"),no=require("./hooks/use-columns-def.js"),ao=require("../utils/index.js"),lo=require("../utils/slot.js"),so=require("./hooks/use-search-form.js");require("./components/empty/index.vue.js");const uo=require("./hooks/use-virtual-config.js"),io=require("./hooks/use-pinned-row.js"),co=require("./hooks/use-selection-col-def.js");require("./components/row/index.vue.js");const fo=require("../config-provider/hooks/use-namespace.js"),po=require("../config-provider/hooks/use-global-config.js"),mo=require("./components/row/index.vue2.js"),go=require("./components/empty/index.vue2.js"),wo=e.defineComponent({name:"AgGrid",__name:"index",props:{dropdownPrefixCls:{},bordered:{type:Boolean},locale:{},onChange:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{},showSorterTooltip:{type:[Boolean,Object]},prefixCls:{},rowKey:{type:[String,Function],default:"key"},tableLayout:{},title:{},id:{},showHeader:{type:Boolean},components:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean]},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean},indentSize:{},expandIconColumnIndex:{},showExpandColumn:{type:Boolean},expandedRowClassName:{},childrenColumnName:{},rowExpandable:{},transformCellText:{},columns:{},rowSelection:{type:Boolean},card:{type:Boolean},params:{},request:{},defaultData:{},dataSource:{},onLoadingChange:{},onShownColumnsChange:{},searchForm:{type:[Boolean,Object],default:void 0},beforeSearchSubmit:{},pagination:{type:[Boolean,Object],default:void 0},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},tableStyle:{},manual:{type:Boolean,default:void 0},size:{default:"mini"},adaptive:{type:Boolean},columnResizable:{type:Boolean,default:!1},loading:{type:Boolean,default:void 0},summary:{},rowHeight:{},getRowHeight:{},advanceRenderer:{type:Boolean},browserTooltips:{type:Boolean},virtual:{type:[Boolean,Object],default:void 0},onRowClicked:{},onScrollEnd:{},rowClassName:{},rowClassRules:{},autoHeight:{type:Boolean},onUpdate:{},customRow:{},theme:{}},setup(J,{expose:Q}){$.ModuleRegistry.registerModules([$.AllCommunityModule]);const t=J,T=e.useSlots(),{e:R,b:c,be:X}=fo.useNamespace("ag-grid"),C=e.ref(t.size),Y=to.useTheme(C,e.toRef(t,"rowHeight"),e.toRef(t,"theme")),Z=uo.default(e.toRef(t,"virtual")),{rowPinnedGridConfig:E,getRowPinnedCellClass:ee}=io.usePinnedRow(e.toRef(t,"summary")),oe=po.useGlobalConfig("apGrid"),l=e.ref(),[,te]=oo.useToken();let y=!!t.dataSource;const D=so.useSearchForm(t),{shownColumns:m,columns:V,columnKeys:re,getTargetColumnByKey:ne}=ro.useColumns(t),{defaultColDef:ae,columnDefs:le,gridWrapperRef:se}=no.useColumnsDef(V,t,ee),b=e.ref({});Ze.useProvideSorter({sorter:b,setSorter(o){b.value=o}});const ue={asc:"ascend",desc:"descend"};function ie(){const o=l.value.getColumns()?.filter(d=>d.getSort()!==void 0),r=e.unref(b)||{};let n=o?.[0];const s=Object.keys(r);if(s.length&&s.every(d=>r[d]===null)){const d=Object.keys(r)[0];d&&(n=l.value?.getColumn(d))}if(!n)return;const u=n.getColDef(),f=n.getSort(),p=ne(u.colId);P(void 0,void 0,{column:u,field:p?.field??u.field??u.colId,order:f?ue[f]:null})}const ce=e.computed(()=>Qe.recursionApColumns(e.unref(m),o=>{if(o.sorter===!0)return o.field??o.dataIndex??o.key}).filter(Boolean)),de=()=>{b.value={};const o=l.value;if(!o)return;const r=o.getColumnState()?.map(n=>({...n,sort:null}));o.applyColumnState({state:r})},fe=e.computed(()=>ao.isDef(t.manual)?t.manual:lo.getValidVNodeList(T.searchFormExtra?.()||[]).some(r=>r.type?.name==="ApView")),{formRef:g,submit:F,reset:x,data:w,tableProps:z,handleTableChangeOptional:P,submitWith:A,refresh:K,getPaging:pe,setPaging:me,setDataSource:ge}=Xe.useTablePaging({async request(o){if(y=!1,S.value&&!S.value.preserveSelectedRowKeys&&i.isUndefined(t.dataSource)&&I(),!i.isUndefined(t.dataSource)){const n=o.pageSize*(o.current-1);return{data:(t.pagination===!1?t.dataSource:t.dataSource.slice(n,n+o.pageSize))||[],total:t.dataSource.length||0}}const r=await t.request?.(o);return{data:r?.data||[],total:r?.total||0}},namespace:"ap-grid",filterFields:e.ref([]),params:e.toRef(t,"params"),defaultData:t.defaultData,manual:e.unref(fe),formatParams:t.beforeSearchSubmit,pagination:t.pagination,sortFields:ce,onClickReset:de}),S=e.computed(()=>{const o=t.rowSelection||oe.value?.rowSelection;if(o)return o===!0?B.DEFAULT_ROW_SELECTION_CONFIG:{...B.DEFAULT_ROW_SELECTION_CONFIG,...o}}),we=co.default(t,m),Se=e.computed(()=>i.isUndefined(t.dataSource)?w.records:t.dataSource),{select:Ce,unSelect:ye,selectedRows:N,selectedRowKeys:he,clearAll:ve,selectMultiByKeys:Re,selectMulti:be,unSelectMulti:ke}=Ye.default({...S.value,dataSource:Se,rowKey:t.rowKey}),Be={checkbox:"multiRow",radio:"singleRow"},Fe=e.computed(()=>{const o=S.value;if(!o)return;const{type:r="checkbox",disabled:n}=o;return{mode:Be[r],isRowSelectable:s=>n?!n(s.data):!0,hideDisabledCheckboxes:o.hideDisabled??!1}});function q(o){return i.isFunction(t.rowKey)?t.rowKey(o):o[t.rowKey]}const k=({api:o=l.value})=>{if(t.onUpdate?.(),!S.value)return;const r=N.value||[];y=!1;const n=[];o.forEachNode(s=>{const h=s.data,u=q(h),f=s.isSelected();r.find(p=>q(p)===u)?!f&&n.push(s):f&&s.setSelected(!1)}),o.setNodesSelected({nodes:n,newValue:!0}),setTimeout(()=>{y=!0},0)},xe=o=>{y&&(o.node.isSelected()?Ce(o.data):ye(o.data),i.isFunction(S.value?.tooltip)&&o.api.refreshCells({rowNodes:[o.node],columns:["ag-Grid-SelectionColumn"],force:!0}))},Ne=()=>{y=!0},I=()=>{ve(),l.value?.deselectAll()};function qe(o){Re(o),e.nextTick(()=>{k({})})}const Ie=e.computed(()=>{const o=t.customRow;return o?{isFullWidthRow:o.isCustomRow,fullWidthCellRenderer:mo.default,fullWidthCellRendererParams:{render:o.render}}:{}});function Te(o){be(o),e.nextTick(()=>{k({})})}function Ee(o){ke(o),e.nextTick(()=>{k({})})}function M(o=!1){const r=o?"getFieldsValueTransformed":"getFieldsValue";return g.value?.apForm?.[r]?.(!0)}function _(o){g.value?.apForm?.setFieldsValue?.(o)}function O(){return g.value?.getSorterItems()||[]}function W(o){g.value?.setSorterItems(o)}function U(){g.value?.resetSorterItems()}function G(o){return o&&String(o)}function De(o){const r=l.value;if(!r)return;const n=r.getColumnState()||[],s=o.map(a=>a.key?String(a.key):a.key).filter(Boolean),h=n.map(a=>{if(!re.value.includes(a.colId))return a;const v=!s.includes(a.colId),H={...a,hide:v},L=o.find(Le=>G(Le.key)===a.colId);return L&&(H.pinned=L.fixed||null),H}),u=new Map(o.map((a,v)=>[G(a.key),v])),f=h.filter(a=>u.has(a.colId)).sort((a,v)=>u.get(a.colId)-u.get(v.colId)),p=[];let d=0;for(const a of h)u.has(a.colId)?p.push(f[d++]):p.push(a);r.applyColumnState({state:p,applyOrder:!0})}eo.useProvideApTable({columns:e.computed(()=>m.value),columnsBackup:e.computed(()=>V.value),size:e.computed(()=>B.sizeMap[C.value]),updateColumns(o){m.value=o,t.onShownColumnsChange?.(o),De(o)},updateSize(o){C.value=B.sizeReverseMap[o]},renderConfig:e.computed(()=>({className:X("table-header","title"),color:te.value.colorTextTertiary})),dataSource:e.computed(()=>e.unref(w).records),getSearchFormValues:M,setSearchFormValues:_,submit:F,submitWith:A,reset:x,refresh:K,getSearchFormSorterItems:O,setSearchFormSorterItems:W,resetSearchFormSorterItems:U});const Ve=e.computed(()=>i.isUndefined(t.loading)?w.loading:t.loading),ze=e.computed(()=>[c(),t.card?null:c("wrapper"),c("adaptive"),c(`size-${C.value}`)].filter(Boolean)),Pe=e.computed(()=>({height:"100%",...t.tableStyle||{}})),Ae=(o,r)=>{P({current:o,pageSize:r})};function Ke(o){const r=o.data;return q(r)}function Me(o,r){(i.isFunction(o)?l.value?.ensureNodeVisible:l.value?.ensureIndexVisible)?.(o,r)}function _e(o,r){l.value?.ensureColumnVisible(o,r)}function Oe(o){t.onRowClicked?.(o.data,o.event)}function We(o){t.onScrollEnd?.(o.direction)}function Ue(o){return l.value?.refreshCells(o)}function Ge(o){return l.value?.redrawRows(o)}const He=o=>{const r=[E.value.getRowClass?.(o)];if(!o.node.rowPinned){const n=i.isFunction(t.rowClassName)?t.rowClassName(o.data,o.rowIndex):t.rowClassName;r.push(n)}return r.flat().filter(Boolean)};return e.watch(()=>t.dataSource,o=>{ge(o)},{immediate:!0,deep:!0}),e.watch(()=>t.size,o=>{C.value=o}),e.watch(()=>e.unref(w).loading,o=>{t.onLoadingChange?.(o)}),Q({submit:F,reset:x,refresh:K,submitWith:A,setSearchFormValues:_,getSearchFormValues:M,getShowColumns:()=>e.unref(m),rowSelection:{selectedRows:e.computed(()=>N.value),setSelectedRowKeys:qe,setSelectedRows:Te,clearAll:I,unSelectRows:Ee},scrollToRow:Me,scrollToColumn:_e,getDataSource:()=>e.unref(w.records),getPaging:pe,setPaging:me,getSearchFormSorterItems:O,setSearchFormSorterItems:W,resetSearchFormSorterItems:U,refreshCells:Ue,redrawRows:Ge,_internalGridApi:e.computed(()=>l.value)}),(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(ze.value),style:e.normalizeStyle(o.wrapperStyle)},[e.unref(i.isUndefined)(o.dataSource)&&o.searchForm!==!1&&e.unref(D).length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(o.card?e.unref(R)("search-wrapper"):null),style:e.normalizeStyle(o.searchFormWrapperStyle)},[e.createVNode(e.unref(Je.ApForm).SearchForm,e.mergeProps(o.searchForm||{},{ref_key:"formRef",ref:g,"custom-reset":"","submit-loading":e.unref(z).loading,onSubmit:e.unref(F),onReset:e.unref(x)}),e.createSlots({default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(D),n=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.renderNode),{key:n.dataIndex}))),128))]),_:2},[T.searchFormExtra?{name:"extra",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"searchFormExtra")]),key:"0"}:void 0]),1040,["submit-loading","onSubmit","onReset"])],6)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([e.unref(R)("table-wrapper"),o.card?e.unref(R)("table-wrapper-card"):null]),style:e.normalizeStyle(o.tableWrapperStyle)},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(c)("header-wrapper"))},[e.renderSlot(o.$slots,"title",{selectedRows:e.unref(N),selectedRowKeys:e.unref(he),shownColumns:e.unref(m),clearAll:I})],2),e.createElementVNode("div",{ref_key:"gridWrapperRef",ref:se,class:e.normalizeClass(e.unref(c)("grid-wrapper"))},[e.createVNode(e.unref($e.AgGridVue),e.mergeProps(e.unref(je.mergeProps)(e.unref(Z),e.unref(E),Ie.value),{"get-row-class":He,style:Pe.value,"row-data":e.unref(w).records,"column-defs":e.unref(le),"default-col-def":e.unref(ae),"suppress-loading-overlay":"","row-selection":Fe.value,"selection-column-def":e.unref(we),"get-row-id":Ke,"get-row-height":t.getRowHeight,theme:e.unref(Y),"tooltip-show-delay":500,"enable-browser-tooltips":o.browserTooltips,"tooltip-interaction":"","row-class-rules":o.rowClassRules,"no-rows-overlay-component":go.default,"suppress-cell-focus":"","enable-cell-span":"","dom-layout":o.autoHeight?"autoHeight":"normal",onSortChanged:ie,onGridReady:r[0]||(r[0]=n=>l.value=n.api),onRowDataUpdated:k,onRowSelected:xe,onFirstDataRendered:Ne,onRowClicked:Oe,onBodyScrollEnd:We}),null,16,["style","row-data","column-defs","default-col-def","row-selection","selection-column-def","get-row-height","theme","enable-browser-tooltips","row-class-rules","dom-layout"]),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(e.unref(R)("table-loading-wrapper"))},[e.createVNode(e.unref(j.Spin),{delay:300})],2),[[e.vShow,Ve.value]])],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(c)("pagination-wrapper"))},[o.pagination!==!1?(e.openBlock(),e.createBlock(e.unref(j.Pagination),e.mergeProps({key:0,class:e.unref(c)("pagination")},e.unref(z).pagination,{onChange:Ae}),null,16,["class"])):e.createCommentVNode("",!0)],2)],6)],6))}});exports.default=wo;
@@ -90,6 +90,7 @@ export type AgGridColumnType<RecordType = any, ExtraValueType = 'text', ValueTyp
90
90
  minWidth?: number;
91
91
  maxWidth?: number;
92
92
  colSpan?: ColDef<RecordType>['colSpan'];
93
+ spanRows?: ColDef<RecordType>['spanRows'];
93
94
  /**
94
95
  * 为当前单元格添加类名
95
96
  * @returns
@@ -1,4 +1,4 @@
1
- import { ApDownLoadProps } from './interface';
1
+ import { ApDownLoadProps, downloadCallbackResponse } from './interface';
2
2
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
3
  import { ButtonType } from '@aplus-frontend/antdv/es/button';
4
4
  type __VLS_Props = ApDownLoadProps;
@@ -11,10 +11,10 @@ declare function __VLS_template(): {
11
11
  rootEl: any;
12
12
  };
13
13
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
14
- declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
15
- downloadCallback: (...args: any[]) => void;
14
+ declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
15
+ downloadCallback: (res?: downloadCallbackResponse | undefined) => any;
16
16
  }, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
17
- onDownloadCallback?: ((...args: any[]) => any) | undefined;
17
+ onDownloadCallback?: ((res?: downloadCallbackResponse | undefined) => any) | undefined;
18
18
  }>, {
19
19
  size: "small" | "large" | "middle";
20
20
  type: ButtonType;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),B=require("@aplus-frontend/antdv"),h=require("@ant-design/icons-vue");require("../config-provider/index.js");const w=require("./hooks/index.js"),u=require("./utils/getFileInfo.js"),O=require("./hooks/useStyle.js"),q=require("../config-provider/hooks/use-locale.js"),a=require("../config-provider/hooks/use-global-config.js"),z={key:0,class:"spin"},F={key:1,class:"icon"},S={class:"text"},I=e.defineComponent({name:"ApDownload",__name:"ap-download",props:{prefixCls:{},type:{default:"link"},htmlType:{},shape:{},size:{default:"middle"},loading:{type:[Boolean,Object]},disabled:{type:Boolean,default:!1},ghost:{type:Boolean},block:{type:Boolean},danger:{type:Boolean},icon:{},href:{},target:{},title:{},onClick:{},onMousedown:{},autoInsertSpace:{type:Boolean},iconPosition:{},color:{},variant:{},text:{},fileName:{},needName:{type:[Boolean,Object]},getOssAccess:{}},emits:["downloadCallback"],setup(d,{emit:p}){const f=p,l=e.ref(!1),{lang:m}=q.useLocale(),g=e.useSlots(),C=e.computed(()=>m.value==="zh-cn"?"zh_CN":"en_US"),y=a.useGlobalConfig("uiMode"),o=d,s=a.useGlobalConfig("apUpload"),i=a.useGlobalConfig("downloadCenterTriggerConfig"),c=e.computed(()=>o.disabled),b=e.computed(()=>o.color?o.color:y.value==="aplus"?"#0070FF":"#1890FF"),v=e.computed(()=>o.size),{getInnerWrapperClass:N}=O.useStyle(b,v,c),_=e.computed(()=>o.getOssAccess||s.value?.getOssAccess),k=async()=>{if(!o.disabled){l.value=!0;try{if(i.value?.trigger){let n=u.getFileInfo(o.needName??s?.value?.needName,o.fileName).map(r=>({objectName:r.path,fileName:r.fileName}));await i.value?.trigger(n)}else{const n=await(await w.useOssInit(_.value,e.unref(C))).downloadFile(u.getFileInfo(o.needName??s?.value?.needName,o.fileName));f("downloadCallback",n)}}catch(t){console.error(t)}finally{l.value=!1}}};return(t,n)=>(e.openBlock(),e.createBlock(e.unref(B.Button),e.mergeProps(o,{type:o.type,size:o.size,disabled:c.value,onClick:k}),{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(N))},[l.value?(e.openBlock(),e.createElementBlock("span",z,[e.createVNode(e.unref(h.LoadingOutlined),{spin:!0})])):e.createCommentVNode("",!0),e.unref(g).icon?(e.openBlock(),e.createElementBlock("span",F,[e.renderSlot(t.$slots,"icon")])):e.createCommentVNode("",!0),e.createElementVNode("span",S,e.toDisplayString(t.text),1)],2)]),_:3},16,["type","size","disabled"]))}});exports.default=I;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),w=require("@aplus-frontend/antdv"),B=require("@ant-design/icons-vue");require("../config-provider/index.js");const h=require("./hooks/index.js"),u=require("./utils/getFileInfo.js"),O=require("./hooks/useStyle.js"),q=require("../config-provider/hooks/use-locale.js"),a=require("../config-provider/hooks/use-global-config.js"),z={key:0,class:"spin"},F={key:1,class:"icon"},S={class:"text"},I=e.defineComponent({name:"ApDownload",__name:"ap-download",props:{prefixCls:{},type:{default:"link"},htmlType:{},shape:{},size:{default:"middle"},loading:{type:[Boolean,Object]},disabled:{type:Boolean,default:!1},ghost:{type:Boolean},block:{type:Boolean},danger:{type:Boolean},icon:{},href:{},target:{},title:{},onClick:{},onMousedown:{},autoInsertSpace:{type:Boolean},iconPosition:{},color:{},variant:{},text:{},fileName:{},needName:{type:[Boolean,Object]},getOssAccess:{}},emits:["downloadCallback"],setup(p,{emit:f}){const i=f,l=e.ref(!1),{lang:m}=q.useLocale(),g=e.useSlots(),C=e.computed(()=>m.value==="zh-cn"?"zh_CN":"en_US"),y=a.useGlobalConfig("uiMode"),o=p,s=a.useGlobalConfig("apUpload"),c=a.useGlobalConfig("downloadCenterTriggerConfig"),r=e.computed(()=>o.disabled),b=e.computed(()=>o.color?o.color:y.value==="aplus"?"#0070FF":"#1890FF"),v=e.computed(()=>o.size),{getInnerWrapperClass:N}=O.useStyle(b,v,r),k=e.computed(()=>o.getOssAccess||s.value?.getOssAccess),_=async()=>{if(!o.disabled){l.value=!0;try{if(c.value?.trigger){let n=u.getFileInfo(o.needName??s?.value?.needName,o.fileName).map(d=>({objectName:d.path,fileName:d.fileName}));await c.value?.trigger(n),i("downloadCallback",n)}else{const n=await(await h.useOssInit(k.value,e.unref(C))).downloadFile(u.getFileInfo(o.needName??s?.value?.needName,o.fileName));i("downloadCallback",n)}}catch(t){console.error(t)}finally{l.value=!1}}};return(t,n)=>(e.openBlock(),e.createBlock(e.unref(w.Button),e.mergeProps(o,{type:o.type,size:o.size,disabled:r.value,onClick:_}),{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(N))},[l.value?(e.openBlock(),e.createElementBlock("span",z,[e.createVNode(e.unref(B.LoadingOutlined),{spin:!0})])):e.createCommentVNode("",!0),e.unref(g).icon?(e.openBlock(),e.createElementBlock("span",F,[e.renderSlot(t.$slots,"icon")])):e.createCommentVNode("",!0),e.createElementVNode("span",S,e.toDisplayString(t.text),1)],2)]),_:3},16,["type","size","disabled"]))}});exports.default=I;
@@ -38,4 +38,8 @@ export declare enum ApDownLoadNeedNameKeyDefault {
38
38
  pathKey = "path"
39
39
  }
40
40
  export type actionResponse = Awaited<ReturnType<typeof client.downloadFile>>;
41
+ export type downloadCallbackResponse = {
42
+ objectName: string;
43
+ fileName: string;
44
+ }[] | actionResponse;
41
45
  export {};
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),C=require("@aplus-frontend/antdv");require("../../config-provider/index.js");const M=require("./constans.js"),m=require("../../ap-download/utils/getFileInfo.js"),S=require("../../ap-download/hooks/index.js"),w=require("lodash-unified"),f=require("@ant-design/icons-vue"),_=require("../../utils/warning.js"),k=require("../../config-provider/hooks/use-namespace.js"),g=require("../../config-provider/hooks/use-global-config.js"),G=require("../../config-provider/hooks/use-locale.js"),U=e.defineComponent({name:"ApAttachment",props:M.ApAttachmentProps(),setup(t){const{b:F,e:a}=k.useNamespace("ap-attachment"),y=g.useGlobalConfig("uiMode"),A=g.useGlobalConfig("apUpload"),v=g.useGlobalConfig("downloadCenterTriggerConfig"),{lang:b,t:s}=G.useLocale(),o=e.ref(!1),c=e.ref(""),u=e.useSlots(),q=e.computed(()=>b.value==="zh-cn"?"zh_CN":"en_US"),r=e.computed(()=>t.attachmentList.length===1),N=e.computed(()=>t.needName?t.attachmentList.length>0&&t.needName&&t.needName.nameKey?t.attachmentList[0][t.needName.nameKey]:"":t.attachmentList.length>0?t.attachmentList[0].fileName:""),O=e.computed(()=>r.value?N.value:s("ap.apAttachment.downloadall")),h=e.computed(()=>t.color?t.color:y.value==="aplus"?"#0070FF":"#1890FF"),L=e.computed(()=>({"--download-main-color":h.value,"--download-main-color-opacity":m.getHexWithOpacity(h.value,.6)})),p=e.computed(()=>t.getOssAccess||A.value?.getOssAccess),T=e.computed(()=>{const l=u.default?u.default()[0]:null;return l?e.cloneVNode(l,{style:{"font-size":"16px"}}):null}),d=w.debounce(async(l,i)=>{if(!t.disabled){o.value=!0,i&&(c.value=i);try{const n=w.isArray(e.toRaw(l))?e.toRaw(l):[e.toRaw(l)];if(v.value?.trigger){const P=m.getFileInfo(t.needName,n).map(V=>({objectName:V.path,fileName:V.fileName}));v.value?.trigger(P)}else await(await S.useOssInit(p.value,e.unref(q))).downloadFile(m.getFileInfo(t.needName,n))}catch(n){_.warning(!1,n)}finally{o.value=!1,c.value=""}}},500),x=l=>l&&l.length>0?e.createVNode("ul",{class:[a("file-list")],style:L.value},[l.map((i,n)=>e.createVNode("li",{key:n,class:[a("file-item")],onClick:()=>d(i,n+1)},[o.value&&c.value===n+1?e.createVNode("span",{class:[a("spin")]},[e.createVNode(f.LoadingOutlined,{spin:!0},null)]):null,i.fileName])),e.createVNode("li",{class:[a("down-load-all")],onClick:()=>d(t.attachmentList,"all")},[o.value&&c.value==="all"?e.createVNode("span",{class:[a("spin")]},[e.createVNode(f.LoadingOutlined,{spin:!0},null)]):null,s("ap.apAttachment.downloadall")])]):null;return()=>t.attachmentList?.length>0&&e.createVNode("div",{class:[F()],style:[L.value]},[e.createVNode(C.Tooltip,{title:O.value,placement:t.textToolTipPlacement,color:t.toolTipBgColor},{default:()=>[e.createVNode("div",{class:[a("content")],onClick:()=>d(r.value?t.attachmentList[0]:t.attachmentList,"global")},[o.value&&c.value==="global"?e.createVNode("div",{class:[a("spin")]},[e.createVNode(f.LoadingOutlined,{spin:!0},null)]):null,u.default?e.createVNode("div",{class:[a("text-render")]},[T.value,e.createTextVNode(" ")]):null,e.createVNode("div",{class:[a("text-inner")],style:{"max-width":t.maxWidth?t.maxWidth+"px":"auto"}},[N.value])])]}),e.createVNode(C.Popover,{content:x(t.attachmentList),placement:t.fileMorePopoverPlacement,color:"#fff"},{default:()=>[!r.value&&e.createVNode("div",{class:[a("more")]},[s("ap.apAttachment.more")])]})])}});exports.default=U;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),b=require("@aplus-frontend/antdv");require("../../config-provider/index.js");const M=require("./constans.js"),f=require("../../ap-download/utils/getFileInfo.js"),S=require("../../ap-download/hooks/index.js"),F=require("lodash-unified"),g=require("@ant-design/icons-vue"),_=require("../../utils/warning.js"),G=require("../../config-provider/hooks/use-namespace.js"),v=require("../../config-provider/hooks/use-global-config.js"),R=require("../../config-provider/hooks/use-locale.js"),U=e.defineComponent({name:"ApAttachment",props:M.ApAttachmentProps(),setup(t,{emit:N}){const{b:y,e:a}=G.useNamespace("ap-attachment"),A=v.useGlobalConfig("uiMode"),q=v.useGlobalConfig("apUpload"),h=v.useGlobalConfig("downloadCenterTriggerConfig"),{lang:O,t:u}=R.useLocale(),o=e.ref(!1),c=e.ref(""),d=e.useSlots(),p=e.computed(()=>O.value==="zh-cn"?"zh_CN":"en_US"),r=e.computed(()=>t.attachmentList.length===1),C=e.computed(()=>t.needName?t.attachmentList.length>0&&t.needName&&t.needName.nameKey?t.attachmentList[0][t.needName.nameKey]:"":t.attachmentList.length>0?t.attachmentList[0].fileName:""),T=e.computed(()=>r.value?C.value:u("ap.apAttachment.downloadall")),L=e.computed(()=>t.color?t.color:A.value==="aplus"?"#0070FF":"#1890FF"),w=e.computed(()=>({"--download-main-color":L.value,"--download-main-color-opacity":f.getHexWithOpacity(L.value,.6)})),x=e.computed(()=>t.getOssAccess||q.value?.getOssAccess),k=e.computed(()=>{const l=d.default?d.default()[0]:null;return l?e.cloneVNode(l,{style:{"font-size":"16px"}}):null}),m=F.debounce(async(l,i)=>{if(!t.disabled){o.value=!0,i&&(c.value=i);try{const n=F.isArray(e.toRaw(l))?e.toRaw(l):[e.toRaw(l)];if(h.value?.trigger){const s=f.getFileInfo(t.needName,n).map(V=>({objectName:V.path,fileName:V.fileName}));h.value?.trigger(s),N("downloadCallback",s)}else{const s=await(await S.useOssInit(x.value,e.unref(p))).downloadFile(f.getFileInfo(t.needName,n));N("downloadCallback",s)}}catch(n){_.warning(!1,n)}finally{o.value=!1,c.value=""}}},500),I=l=>l&&l.length>0?e.createVNode("ul",{class:[a("file-list")],style:w.value},[l.map((i,n)=>e.createVNode("li",{key:n,class:[a("file-item")],onClick:()=>m(i,n+1)},[o.value&&c.value===n+1?e.createVNode("span",{class:[a("spin")]},[e.createVNode(g.LoadingOutlined,{spin:!0},null)]):null,i.fileName])),e.createVNode("li",{class:[a("down-load-all")],onClick:()=>m(t.attachmentList,"all")},[o.value&&c.value==="all"?e.createVNode("span",{class:[a("spin")]},[e.createVNode(g.LoadingOutlined,{spin:!0},null)]):null,u("ap.apAttachment.downloadall")])]):null;return()=>t.attachmentList?.length>0&&e.createVNode("div",{class:[y()],style:[w.value]},[e.createVNode(b.Tooltip,{title:T.value,placement:t.textToolTipPlacement,color:t.toolTipBgColor},{default:()=>[e.createVNode("div",{class:[a("content")],onClick:()=>m(r.value?t.attachmentList[0]:t.attachmentList,"global")},[o.value&&c.value==="global"?e.createVNode("div",{class:[a("spin")]},[e.createVNode(g.LoadingOutlined,{spin:!0},null)]):null,d.default?e.createVNode("div",{class:[a("text-render")]},[k.value,e.createTextVNode(" ")]):null,e.createVNode("div",{class:[a("text-inner")],style:{"max-width":t.maxWidth?t.maxWidth+"px":"auto"}},[C.value])])]}),e.createVNode(b.Popover,{content:I(t.attachmentList),placement:t.fileMorePopoverPlacement,color:"#fff"},{default:()=>[!r.value&&e.createVNode("div",{class:[a("more")]},[u("ap.apAttachment.more")])]})])}});exports.default=U;
@@ -2,9 +2,10 @@ import { ApExpandAlertProps } from './interface';
2
2
  import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } from 'vue';
3
3
  declare const _default: <T extends Record<string, any>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
4
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
5
+ readonly onClose?: ((args_0: MouseEvent) => any) | undefined;
5
6
  readonly onExpand?: ((args_0: "collapse" | "expand") => any) | undefined;
6
7
  readonly onChoose?: ((args_0: T) => any) | undefined;
7
- } & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, "onExpand" | "onChoose"> & ApExpandAlertProps<T> & Partial<{}>> & PublicProps;
8
+ } & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, "onClose" | "onExpand" | "onChoose"> & ApExpandAlertProps<T> & Partial<{}>> & PublicProps;
8
9
  expose(exposed: ShallowUnwrapRef<{
9
10
  setExpand: (state?: boolean) => void;
10
11
  }>): void;
@@ -22,7 +23,7 @@ declare const _default: <T extends Record<string, any>>(__VLS_props: NonNullable
22
23
  index: number;
23
24
  }): any;
24
25
  };
25
- emit: ((evt: "expand", args_0: "collapse" | "expand") => void) & ((evt: "choose", args_0: T) => void);
26
+ emit: ((evt: "close", args_0: MouseEvent) => void) & ((evt: "expand", args_0: "collapse" | "expand") => void) & ((evt: "choose", args_0: T) => void);
26
27
  }>) => VNode & {
27
28
  __ctx?: Awaited<typeof __VLS_setup>;
28
29
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),z=require("@ant-design/icons-vue"),h=require("@aplus-frontend/antdv"),N=require("../../ap-action/index.js");require("../../config-provider/index.js");const i=require("lodash-unified"),T=require("../../config-provider/hooks/use-locale.js"),$=require("../../config-provider/hooks/use-namespace.js"),q=require("../../config-provider/hooks/use-global-config.js"),A=["onClick"],D=e.defineComponent({__name:"ApExpandAlert",props:{type:{default:"warning"},data:{default:()=>[]},prefix:{default:""},tipTitle:{default:""},mapLabel:{},separator:{default:"|"},separatorStyle:{default:()=>({})},contentStyle:{default:()=>({})},prefixStyle:{default:()=>({})},rows:{default:2},defaultExpand:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0}},emits:["choose","expand"],setup(g,{expose:v,emit:B}){const f=B,r=g,{t:m}=T.useLocale(),S=e.computed(()=>{if(r.type!="card")return r.type}),l=e.ref(""),s=e.ref(null),w=e.computed(()=>({fontWeight:"400",wordBreak:"break-all",overflow:"hidden",display:"-webkit-box",webkitLineClamp:l.value,webkitBoxOrient:"vertical",lineHeight:"18px"}));function C(){l.value==="1"?(l.value="",f("expand","expand")):(l.value="1",f("expand","collapse"))}const x=e.computed(()=>l.value==="1"?m("ap.apExpandAlert.expand"):m("ap.apExpandAlert.collapse")),u=e.ref(!0),y=e.computed(()=>l.value!=="1");function c(t){t?l.value="":l.value="1"}e.watch(()=>r.data,()=>{l.value="",e.nextTick(()=>{if(s.value){const t=Number(s.value.clientHeight),o=Number(parseInt(s.value.style.lineHeight));t<o*Number(r.rows)&&y.value?u.value=!1:u.value=!0}})},{immediate:!0}),e.watch(()=>r.defaultExpand,t=>{t?e.nextTick(()=>{c(t)}):e.nextTick(()=>{c(t)})},{immediate:!0}),e.onMounted(()=>{e.watch(()=>r.contentStyle,t=>{i.isNil(t.lineHeight)||e.nextTick(()=>{const o=document.querySelector(`#${p} .ant-alert-action`),a=document.querySelector(`#${p} .ant-alert-icon`);o&&o.setAttribute("style",`line-height: ${t.lineHeight}`),a&&a.setAttribute("style",`line-height: ${t.lineHeight}`)})},{deep:!0,immediate:!0,flush:"post"})});const{b:k,e:n,m:E}=$.useNamespace("ap-expand-alert"),p=`${k()}-key-${Date.now()}-${(Math.random()*1e6).toFixed(0)}`,b=q.useGlobalConfig("uiMode","aplus");return v({setExpand:c}),(t,o)=>(e.openBlock(),e.createElementBlock("div",{id:p,class:e.normalizeClass([e.unref(k)(),`${e.unref(E)(e.unref(b))}`])},[e.createVNode(e.unref(h.Alert),{type:S.value,"show-icon":t.showIcon,class:e.normalizeClass([e.unref(n)("antAlert"),t.type=="card"?"card-alert":""])},{action:e.withCtx(()=>[u.value?(e.openBlock(),e.createBlock(e.unref(N.ApActionItem),{key:0,size:"small",style:{"font-size":"12px","padding-left":"16px"},onClick:o[0]||(o[0]=a=>C())},{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass(e.unref(n)("expandText"))},e.toDisplayString(x.value),3),e.createVNode(e.unref(z.DownOutlined),{class:e.normalizeClass(y.value?e.unref(n)("expandIcon"):e.unref(n)("collapseIcon"))},null,8,["class"])]),_:1})):e.createCommentVNode("",!0)]),message:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"ellipsisBoxRef",ref:s,style:e.normalizeStyle({...w.value,...t.contentStyle}),class:e.normalizeClass(e.unref(n)("alertContent"))},[e.renderSlot(t.$slots,"default",{},()=>[e.unref(i.isString)(t.prefix)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(n)("prefix")),style:e.normalizeStyle(t.prefixStyle)},e.toDisplayString(t.prefix),7)):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.prefix),{key:1,style:e.normalizeStyle(t.prefixStyle)},null,8,["style"])),e.unref(i.isString)(t.data)?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(e.unref(n)("text"))},e.toDisplayString(t.data),3)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(t.data,(a,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:d},[e.createVNode(e.unref(h.Tooltip),{title:t.tipTitle?t.tipTitle:null},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"item",{record:a,index:d},()=>[e.createElementVNode("span",{class:e.normalizeClass(e.unref(n)("showItem")),onClick:V=>t.$emit("choose",a)},e.toDisplayString(t.mapLabel?a[t.mapLabel]:a),11,A)])]),_:2},1032,["title"]),d!==t.data.length-1?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(n)("spliter")),style:e.normalizeStyle(t.separatorStyle)},[e.unref(i.isString)(t.separator)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(t.separator),1)],64)):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.separator),{key:1}))],6)):e.createCommentVNode("",!0)],64))),128))])],6)]),_:3},8,["type","show-icon","class"])],2))}});exports.default=D;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),N=require("@ant-design/icons-vue"),h=require("@aplus-frontend/antdv"),T=require("../../ap-action/index.js");require("../../config-provider/index.js");const i=require("lodash-unified"),$=require("../../config-provider/hooks/use-locale.js"),q=require("../../config-provider/hooks/use-namespace.js"),A=require("../../config-provider/hooks/use-global-config.js"),D=["onClick"],V=e.defineComponent({__name:"ApExpandAlert",props:{type:{default:"warning"},data:{default:()=>[]},prefix:{default:""},tipTitle:{default:""},mapLabel:{},separator:{default:"|"},separatorStyle:{default:()=>({})},contentStyle:{default:()=>({})},prefixStyle:{default:()=>({})},rows:{default:2},defaultExpand:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},closable:{type:Boolean},afterClose:{}},emits:["choose","expand","close"],setup(g,{expose:v,emit:C}){const u=C,r=g,{t:m}=$.useLocale(),B=e.computed(()=>{if(r.type!="card")return r.type}),l=e.ref(""),s=e.ref(null),S=e.computed(()=>({fontWeight:"400",wordBreak:"break-all",overflow:"hidden",display:"-webkit-box",webkitLineClamp:l.value,webkitBoxOrient:"vertical",lineHeight:"18px"}));function w(){l.value==="1"?(l.value="",u("expand","expand")):(l.value="1",u("expand","collapse"))}const b=e.computed(()=>l.value==="1"?m("ap.apExpandAlert.expand"):m("ap.apExpandAlert.collapse")),c=e.ref(!0),y=e.computed(()=>l.value!=="1");function p(t){t?l.value="":l.value="1"}function x(t){u("close",t)}e.watch(()=>r.data,()=>{l.value="",e.nextTick(()=>{if(s.value){const t=Number(s.value.clientHeight),o=Number(parseInt(s.value.style.lineHeight));t<o*Number(r.rows)&&y.value?c.value=!1:c.value=!0}})},{immediate:!0}),e.watch(()=>r.defaultExpand,t=>{t?e.nextTick(()=>{p(t)}):e.nextTick(()=>{p(t)})},{immediate:!0}),e.onMounted(()=>{e.watch(()=>r.contentStyle,t=>{i.isNil(t.lineHeight)||e.nextTick(()=>{const o=document.querySelector(`#${d} .ant-alert-action`),a=document.querySelector(`#${d} .ant-alert-icon`);o&&o.setAttribute("style",`line-height: ${t.lineHeight}`),a&&a.setAttribute("style",`line-height: ${t.lineHeight}`)})},{deep:!0,immediate:!0,flush:"post"})});const{b:k,e:n,m:E}=q.useNamespace("ap-expand-alert"),d=`${k()}-key-${Date.now()}-${(Math.random()*1e6).toFixed(0)}`,z=A.useGlobalConfig("uiMode","aplus");return v({setExpand:p}),(t,o)=>(e.openBlock(),e.createElementBlock("div",{id:d,class:e.normalizeClass([e.unref(k)(),`${e.unref(E)(e.unref(z))}`])},[e.createVNode(e.unref(h.Alert),{type:B.value,"show-icon":t.showIcon,closable:t.closable,class:e.normalizeClass([e.unref(n)("antAlert"),t.type=="card"?"card-alert":""]),"after-close":t.afterClose,onClose:x},{action:e.withCtx(()=>[c.value?(e.openBlock(),e.createBlock(e.unref(T.ApActionItem),{key:0,size:"small",style:{"font-size":"12px","padding-left":"16px"},onClick:o[0]||(o[0]=a=>w())},{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass(e.unref(n)("expandText"))},e.toDisplayString(b.value),3),e.createVNode(e.unref(N.DownOutlined),{class:e.normalizeClass(y.value?e.unref(n)("expandIcon"):e.unref(n)("collapseIcon"))},null,8,["class"])]),_:1})):e.createCommentVNode("",!0)]),message:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"ellipsisBoxRef",ref:s,style:e.normalizeStyle({...S.value,...t.contentStyle}),class:e.normalizeClass(e.unref(n)("alertContent"))},[e.renderSlot(t.$slots,"default",{},()=>[e.unref(i.isString)(t.prefix)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(n)("prefix")),style:e.normalizeStyle(t.prefixStyle)},e.toDisplayString(t.prefix),7)):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.prefix),{key:1,style:e.normalizeStyle(t.prefixStyle)},null,8,["style"])),e.unref(i.isString)(t.data)?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(e.unref(n)("text"))},e.toDisplayString(t.data),3)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(t.data,(a,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:f},[e.createVNode(e.unref(h.Tooltip),{title:t.tipTitle?t.tipTitle:null},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"item",{record:a,index:f},()=>[e.createElementVNode("span",{class:e.normalizeClass(e.unref(n)("showItem")),onClick:H=>t.$emit("choose",a)},e.toDisplayString(t.mapLabel?a[t.mapLabel]:a),11,D)])]),_:2},1032,["title"]),f!==t.data.length-1?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(n)("spliter")),style:e.normalizeStyle(t.separatorStyle)},[e.unref(i.isString)(t.separator)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(t.separator),1)],64)):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.separator),{key:1}))],6)):e.createCommentVNode("",!0)],64))),128))])],6)]),_:3},8,["type","show-icon","closable","class","after-close"])],2))}});exports.default=V;
@@ -15,9 +15,10 @@ declare const ApExpandAlert: (<T extends Record<string, any>>(__VLS_props: NonNu
15
15
  index: number;
16
16
  }): any;
17
17
  };
18
- emit: ((evt: "expand", args_0: "collapse" | "expand") => void) & ((evt: "choose", args_0: T) => void);
18
+ emit: ((evt: "close", args_0: MouseEvent) => void) & ((evt: "expand", args_0: "collapse" | "expand") => void) & ((evt: "choose", args_0: T) => void);
19
19
  }, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
20
20
  props: {
21
+ readonly onClose?: ((args_0: MouseEvent) => any) | undefined;
21
22
  readonly onExpand?: ((args_0: "collapse" | "expand") => any) | undefined;
22
23
  readonly onChoose?: ((args_0: T) => any) | undefined;
23
24
  type?: "warning" | "error" | "success" | "info" | "card" | undefined | undefined;
@@ -31,6 +32,8 @@ declare const ApExpandAlert: (<T extends Record<string, any>>(__VLS_props: NonNu
31
32
  prefixStyle?: CSSProperties | undefined;
32
33
  rows?: string | number | undefined;
33
34
  defaultExpand?: boolean | undefined;
35
+ closable?: boolean | undefined;
36
+ afterClose?: (() => void) | undefined;
34
37
  showIcon?: boolean | undefined;
35
38
  } & PublicProps;
36
39
  expose(exposed: ShallowUnwrapRef<{
@@ -50,7 +53,7 @@ declare const ApExpandAlert: (<T extends Record<string, any>>(__VLS_props: NonNu
50
53
  index: number;
51
54
  }): any;
52
55
  };
53
- emit: ((evt: "expand", args_0: "collapse" | "expand") => void) & ((evt: "choose", args_0: T) => void);
56
+ emit: ((evt: "close", args_0: MouseEvent) => void) & ((evt: "expand", args_0: "collapse" | "expand") => void) & ((evt: "choose", args_0: T) => void);
54
57
  }>) => VNode & {
55
58
  __ctx?: Awaited<typeof __VLS_setup>;
56
59
  }) & ( Plugin & (new (...args: any[]) => {
@@ -45,4 +45,4 @@ export type ApExpandAlertProps<T> = {
45
45
  * 默认是否展开
46
46
  */
47
47
  defaultExpand?: boolean;
48
- } & Pick<AlertProps, 'showIcon'>;
48
+ } & Pick<AlertProps, 'showIcon' | 'closable' | 'afterClose'>;
@@ -22,8 +22,6 @@ export interface UsePageListAgGrid extends AgGridProps {
22
22
  * @default true
23
23
  */
24
24
  clearDataOnDeactivated?: boolean;
25
- /** 绑定ref */
26
- onRef?: (expose: AgGridExpose) => void;
27
25
  }
28
26
  /**
29
27
  * 集成了列表页面的AgGrid的默认配置
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("lodash-unified"),R=require("vue"),q=require("./useKeepAliveFlag.js");function w(u){const r=R.ref(null),{isShowRowSelection:d=!0,clearSelectionOnRequest:f=!0,transformSearchFormValues:o,api:s,tableRefresh:n=!0,clearDataOnDeactivated:g=!0,onRef:v,...S}=u||{};let a=null;const l=()=>{r.value?.rowSelection?.clearAll()},i=e=>{r.value?.submitWith(e)},h=()=>{r.value?.reset()},{isDeactivated:p}=q.useKeepAliveFlag({afterActivated(){(c.isFunction(n)?n():n)&&i()},afterDeactivated:i}),m=async e=>{if(p()&&g)return{data:[],total:0};a=e.sort,console.log("_sortedInfo",a);const t=o?o(e):e;if(!s)throw new Error("api is not defined");const{records:A,total:F}=await s(t);return f&&l(),{data:A,total:F}};return[c.merge({columnResizable:!0,request:s?m:void 0,rowSelection:d?{fixed:"left",columnWidth:38}:void 0,ref(e){r.value=e,v?.(e)},card:!0},S),{reload:i,reset:h,getSearchFormValues:(e=!0)=>{const t=r.value?.getSearchFormValues(!!e)||{};return o?o(t):t},getAgGridInstance:()=>r.value,getSearchFormValuesAndSorted:(e=!0)=>{const t=r.value?.getSearchFormValues(!!e)||{};return t.sort=a&&c.cloneDeep(a),o?o(t):t},clearSelection:l}]}exports.usePageListAgGrid=w;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("lodash-unified"),F=require("vue"),V=require("./useKeepAliveFlag.js");function q(l){const r=F.ref(null),{isShowRowSelection:d=!0,clearSelectionOnRequest:f=!0,transformSearchFormValues:o,api:a,tableRefresh:s=!0,clearDataOnDeactivated:g=!0,...v}=l||{};let n=null;const u=()=>{r.value?.rowSelection?.clearAll()},i=e=>{r.value?.submitWith(e)},p=()=>{r.value?.reset()},{isDeactivated:S}=V.useKeepAliveFlag({afterActivated(){(c.isFunction(s)?s():s)&&i()},afterDeactivated:i}),h=async e=>{if(S()&&g)return{data:[],total:0};n=e.sort;const t=o?o(e):e;if(!a)throw new Error("api is not defined");const{records:m,total:A}=await a(t);return f&&u(),{data:m,total:A}};return[c.merge({columnResizable:!0,request:a?h:void 0,rowSelection:d?{fixed:"left",columnWidth:38}:void 0,onVnodeBeforeMount(e){r.value=e.component?.exposed},card:!0},v),{reload:i,reset:p,getSearchFormValues:(e=!0)=>{const t=r.value?.getSearchFormValues(!!e)||{};return o?o(t):t},getAgGridInstance:()=>r.value,getSearchFormValuesAndSorted:(e=!0)=>{const t=r.value?.getSearchFormValues(!!e)||{};return t.sort=n&&c.cloneDeep(n),o?o(t):t},clearSelection:u}]}exports.usePageListAgGrid=q;
@@ -1,2 +1,2 @@
1
- declare const _default: "6.41.2";
1
+ declare const _default: "6.42.0";
2
2
  export default _default;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="6.41.2";exports.default=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="6.42.0";exports.default=e;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aplus-frontend/ui",
3
- "version": "6.41.2",
3
+ "version": "6.42.0",
4
4
  "main": "./lib/index.js",
5
5
  "type": "module",
6
6
  "files": [