@aplus-frontend/ui 6.14.0 → 6.16.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 (50) hide show
  1. package/es/src/ap-grid/utils/table.mjs +8 -8
  2. package/es/src/ap-list/hooks/use-offline-list.d.ts +3 -0
  3. package/es/src/ap-list/hooks/use-offline-list.mjs +25 -19
  4. package/es/src/ap-list/interface.d.ts +3 -5
  5. package/es/src/business/ap-batch-action/ApBatchAction.vue.d.ts +3 -1
  6. package/es/src/business/ap-batch-action/ApBatchAction.vue2.mjs +35 -31
  7. package/es/src/business/ap-batch-action/index.d.ts +9 -3
  8. package/es/src/business/ap-batch-action/interface.d.ts +4 -0
  9. package/es/src/business/ap-export-group/ApExportGroup.vue.d.ts +1 -1
  10. package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +153 -116
  11. package/es/src/business/ap-export-group/index.d.ts +3 -3
  12. package/es/src/business/ap-export-group/interface.d.ts +14 -2
  13. package/es/src/business/ap-table-modal/interface.d.ts +3 -1
  14. package/es/src/business/ap-table-modal/table-layout/index.vue2.mjs +32 -30
  15. package/es/src/design-token/index.mjs +1 -1
  16. package/es/src/editable-table/hooks/use-get-columns.mjs +18 -18
  17. package/es/src/text/index.vue.d.ts +1 -1
  18. package/es/src/text/index.vue.mjs +49 -43
  19. package/es/src/version.d.ts +1 -1
  20. package/es/src/version.mjs +1 -1
  21. package/es/test/setup.d.ts +1 -5
  22. package/lib/src/ap-grid/utils/table.js +1 -1
  23. package/lib/src/ap-list/hooks/use-offline-list.d.ts +3 -0
  24. package/lib/src/ap-list/hooks/use-offline-list.js +1 -1
  25. package/lib/src/ap-list/interface.d.ts +3 -5
  26. package/lib/src/business/ap-batch-action/ApBatchAction.vue.d.ts +3 -1
  27. package/lib/src/business/ap-batch-action/ApBatchAction.vue2.js +1 -1
  28. package/lib/src/business/ap-batch-action/index.d.ts +9 -3
  29. package/lib/src/business/ap-batch-action/interface.d.ts +4 -0
  30. package/lib/src/business/ap-export-group/ApExportGroup.vue.d.ts +1 -1
  31. package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
  32. package/lib/src/business/ap-export-group/index.d.ts +3 -3
  33. package/lib/src/business/ap-export-group/interface.d.ts +14 -2
  34. package/lib/src/business/ap-table-modal/interface.d.ts +3 -1
  35. package/lib/src/business/ap-table-modal/table-layout/index.vue2.js +1 -1
  36. package/lib/src/design-token/index.js +1 -1
  37. package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
  38. package/lib/src/text/index.vue.d.ts +1 -1
  39. package/lib/src/text/index.vue.js +1 -1
  40. package/lib/src/version.d.ts +1 -1
  41. package/lib/src/version.js +1 -1
  42. package/lib/test/setup.d.ts +1 -5
  43. package/package.json +1 -1
  44. package/theme/ap-grid/index.css +11 -4
  45. package/theme/ap-grid/index.less +11 -2
  46. package/theme/ap-table-modal/index.css +3 -2
  47. package/theme/ap-table-modal/index.less +3 -2
  48. package/theme/index.css +17 -6
  49. package/theme/text/index.css +3 -0
  50. package/theme/text/index.less +3 -0
@@ -5,7 +5,7 @@ import { ApExportGroupProps } from './interface';
5
5
  export * from './interface';
6
6
  declare const ApExportGroup: {
7
7
  new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly< ApExportGroupProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
8
- type: "button" | "dropdown";
8
+ type: "button" | "dropdown" | "group";
9
9
  exportField: boolean | {
10
10
  key?: string;
11
11
  convertField?: {
@@ -21,7 +21,7 @@ declare const ApExportGroup: {
21
21
  M: {};
22
22
  Defaults: {};
23
23
  }, Readonly< ApExportGroupProps> & Readonly<{}>, {}, {}, {}, {}, {
24
- type: "button" | "dropdown";
24
+ type: "button" | "dropdown" | "group";
25
25
  exportField: boolean | {
26
26
  key?: string;
27
27
  convertField?: {
@@ -34,7 +34,7 @@ declare const ApExportGroup: {
34
34
  __isTeleport?: never;
35
35
  __isSuspense?: never;
36
36
  } & ComponentOptionsBase<Readonly< ApExportGroupProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
37
- type: "button" | "dropdown";
37
+ type: "button" | "dropdown" | "group";
38
38
  exportField: boolean | {
39
39
  key?: string;
40
40
  convertField?: {
@@ -1,12 +1,23 @@
1
- export interface ApExportGroupProps {
1
+ import { ApBatchActionGroupButtonProps } from '../ap-batch-action-group';
2
+ export type ApExportGroupProps = {
2
3
  /**
3
4
  * 类型
4
5
  */
5
- type?: 'button' | 'dropdown';
6
+ type?: 'button' | 'dropdown' | 'group';
6
7
  /**
7
8
  * 选中行的Key列表
8
9
  */
9
10
  selectedRowKeys?: any[];
11
+ /**
12
+ * 类型为group时配置,适用于多导出
13
+ */
14
+ groupList?: ApExportGroupListItem[];
15
+ /**
16
+ * 类型为group时配置,和批量操作按钮组buttonProps一致
17
+ */
18
+ buttonProps?: ApBatchActionGroupButtonProps;
19
+ } & ApExportGroupListItem;
20
+ export interface ApExportGroupListItem {
10
21
  /**
11
22
  * 是否禁用
12
23
  */
@@ -57,5 +68,6 @@ export declare enum ApExportGroupActionType {
57
68
  }
58
69
  export type ApExportGroupAntMenuInfo = {
59
70
  key: string | number;
71
+ option?: ApExportGroupListItem;
60
72
  };
61
73
  export type ApExportGroupMixedParams<ParamsType> = Partial<ParamsType>;
@@ -1,4 +1,4 @@
1
- import { VNode, VNodeChild } from 'vue';
1
+ import { StyleValue, VNode, VNodeChild } from 'vue';
2
2
  import { ApTableProps } from '../../ap-table';
3
3
  import { ModalProps, TableProps } from '@aplus-frontend/antdv';
4
4
  /** table-modal的props类型 */
@@ -75,6 +75,8 @@ export interface TableLayoutConfig {
75
75
  leftTitle?: string | VNodeChild;
76
76
  /** 右侧标题 */
77
77
  rightTitle?: (selectedCount: number) => string | VNodeChild;
78
+ /** 右侧内容样式 */
79
+ rightContentStyle?: StyleValue;
78
80
  /** 已经选择item渲染, renderSelectedItem有值才为复杂布局 */
79
81
  renderSelectedItem?: (record: any, actions: {
80
82
  deleteItem: (record: any) => void;
@@ -1,38 +1,39 @@
1
- import { defineComponent as v, createElementBlock as o, openBlock as l, normalizeClass as a, unref as t, renderSlot as h, Fragment as i, createCommentVNode as b, createElementVNode as m, createVNode as p, withCtx as n, createBlock as s, resolveDynamicComponent as c, h as T, createTextVNode as $, toDisplayString as B, renderList as M } from "vue";
1
+ import { defineComponent as v, createElementBlock as o, openBlock as l, normalizeClass as a, unref as t, renderSlot as h, Fragment as n, createCommentVNode as b, createElementVNode as m, createVNode as p, withCtx as i, createBlock as s, resolveDynamicComponent as c, h as S, normalizeStyle as B, createTextVNode as $, toDisplayString as M, renderList as A } from "vue";
2
2
  import "../../../config-provider/index.mjs";
3
- import { ApTitle as k } from "../../ap-title/index.mjs";
4
- import { Button as V, Empty as I } from "@aplus-frontend/antdv";
5
- import { useLocale as A } from "../../../config-provider/hooks/use-locale.mjs";
6
- import { useNamespace as D } from "../../../config-provider/hooks/use-namespace.mjs";
7
- const O = /* @__PURE__ */ v({
3
+ import { ApTitle as T } from "../../ap-title/index.mjs";
4
+ import { Button as V, Empty as k } from "@aplus-frontend/antdv";
5
+ import { useLocale as D } from "../../../config-provider/hooks/use-locale.mjs";
6
+ import { useNamespace as j } from "../../../config-provider/hooks/use-namespace.mjs";
7
+ const q = /* @__PURE__ */ v({
8
8
  __name: "index",
9
9
  props: {
10
10
  leftTitle: { type: [String, Object, Number, Boolean, null, Array], default: "" },
11
11
  rightTitle: {},
12
+ rightContentStyle: { type: [Boolean, null, String, Object, Array] },
12
13
  renderSelectedItem: {},
13
14
  selectedList: { default: () => [] }
14
15
  },
15
16
  emits: ["clear", "deleteItem"],
16
- setup(S, { emit: E }) {
17
- const { t: d } = A(), u = S, f = E, L = () => {
18
- f("clear");
19
- }, C = (e) => {
20
- f("deleteItem", e);
21
- }, N = (e) => typeof u.rightTitle == "function" ? u.rightTitle(e) : `${d("ap.apTableModal.selected")} (${e})`, { m: r } = D("ap-table-modal");
17
+ setup(I, { emit: C }) {
18
+ const { t: d } = D(), u = I, y = C, E = () => {
19
+ y("clear");
20
+ }, L = (e) => {
21
+ y("deleteItem", e);
22
+ }, N = (e) => typeof u.rightTitle == "function" ? u.rightTitle(e) : `${d("ap.apTableModal.selected")} (${e})`, { m: r } = j("ap-table-modal");
22
23
  return (e, w) => (l(), o("div", {
23
24
  class: a([
24
25
  e.renderSelectedItem ? t(r)("table-layout") : "",
25
26
  { "complex-layout": !!e.renderSelectedItem }
26
27
  ])
27
28
  }, [
28
- e.renderSelectedItem ? (l(), o(i, { key: 0 }, [
29
+ e.renderSelectedItem ? (l(), o(n, { key: 0 }, [
29
30
  e.leftTitle ? (l(), o("div", {
30
31
  key: 0,
31
32
  class: a(t(r)("table-layout-left"))
32
33
  }, [
33
- p(t(k), { style: { "margin-bottom": "16px" } }, {
34
- prefix: n(() => [
35
- (l(), s(c(T(i, [e.leftTitle]))))
34
+ p(t(T), { style: { "margin-bottom": "16px" } }, {
35
+ prefix: i(() => [
36
+ (l(), s(c(S(n, [e.leftTitle]))))
36
37
  ]),
37
38
  _: 1
38
39
  }),
@@ -43,22 +44,23 @@ const O = /* @__PURE__ */ v({
43
44
  ], 2)
44
45
  ], 2)) : b("", !0),
45
46
  m("div", {
46
- class: a(t(r)("table-layout-right"))
47
+ class: a(t(r)("table-layout-right")),
48
+ style: B(e.rightContentStyle)
47
49
  }, [
48
- p(t(k), {
50
+ p(t(T), {
49
51
  title: `${t(d)("ap.apTableModal.selected")} (${e.selectedList.length})`
50
52
  }, {
51
- prefix: n(() => [
52
- (l(), s(c(T(i, [N(e.selectedList.length)]))))
53
+ prefix: i(() => [
54
+ (l(), s(c(S(n, [N(e.selectedList.length)]))))
53
55
  ]),
54
- suffix: n(() => [
56
+ suffix: i(() => [
55
57
  p(t(V), {
56
58
  type: "link",
57
59
  style: { padding: "0px", height: "22px", "border-width": "0px" },
58
- onClick: L
60
+ onClick: E
59
61
  }, {
60
- default: n(() => [
61
- $(B(t(d)("ap.apTableModal.clear")), 1)
62
+ default: i(() => [
63
+ $(M(t(d)("ap.apTableModal.clear")), 1)
62
64
  ]),
63
65
  _: 1
64
66
  })
@@ -68,21 +70,21 @@ const O = /* @__PURE__ */ v({
68
70
  m("div", {
69
71
  class: a(t(r)("table-layout-right-content"))
70
72
  }, [
71
- (l(!0), o(i, null, M(e.selectedList, (y) => {
73
+ (l(!0), o(n, null, A(e.selectedList, (f) => {
72
74
  var g;
73
- return l(), s(c((g = e.renderSelectedItem) == null ? void 0 : g.call(e, y, { deleteItem: C })), { key: y });
75
+ return l(), s(c((g = e.renderSelectedItem) == null ? void 0 : g.call(e, f, { deleteItem: L })), { key: f });
74
76
  }), 128)),
75
- e.selectedList.length === 0 ? (l(), s(t(I), {
77
+ e.selectedList.length === 0 ? (l(), s(t(k), {
76
78
  key: 0,
77
- image: t(I).PRESENTED_IMAGE_SIMPLE,
79
+ image: t(k).PRESENTED_IMAGE_SIMPLE,
78
80
  style: { "margin-top": "100px" }
79
81
  }, null, 8, ["image"])) : b("", !0)
80
82
  ], 2)
81
- ], 2)
83
+ ], 6)
82
84
  ], 64)) : h(e.$slots, "default", { key: 1 })
83
85
  ], 2));
84
86
  }
85
87
  });
86
88
  export {
87
- O as default
89
+ q as default
88
90
  };
@@ -61,7 +61,7 @@ const o = {
61
61
  // 信息色
62
62
  colorInfo: "#1890FF",
63
63
  // 成功色
64
- colorSuccess: "#52C41A",
64
+ colorSuccess: "#34b77c",
65
65
  // 错误色
66
66
  colorError: "#FF4D4F",
67
67
  // 警告色
@@ -1,26 +1,26 @@
1
- import { useSlots as N, computed as T, unref as m } from "vue";
1
+ import { useSlots as C, computed as N, unref as m } from "vue";
2
2
  import { omit as y, isFunction as k, isArray as f } from "lodash-unified";
3
3
  import { getEditableTableTitle as w, mergeClass as A, getFinalNode as q } from "../utils.mjs";
4
4
  import { updateFormProps as v, getFieldProps as E, getTableRenderProps as G } from "../../ap-table/utils.mjs";
5
5
  import "../../config-provider/index.mjs";
6
6
  import { useToken as S } from "@aplus-frontend/antdv/es/theme/internal";
7
7
  import { useNamespace as U } from "../../config-provider/hooks/use-namespace.mjs";
8
- const M = (a, b) => {
8
+ const M = (t, b) => {
9
9
  const {
10
10
  em: x,
11
11
  be: g
12
- } = U("editable-table"), F = N(), [, h] = S();
13
- return T(() => {
14
- const d = a.columns;
12
+ } = U("editable-table"), F = C(), [, h] = S();
13
+ return N(() => {
14
+ const d = t.columns;
15
15
  if (!d)
16
16
  return [];
17
17
  function c(I) {
18
18
  return I.map((e) => ({
19
19
  ...y(e, ["ellipsis"]),
20
20
  children: c(e.children || []),
21
- title: w(e, g("table-header", "title"), x("header-cell", "required"), F.headerCell, m(h).colorPrimary),
21
+ title: w(e, g("table-header", "title"), x("header-cell", "required"), F.headerCell, m(h).colorTextTertiary),
22
22
  customRender({
23
- value: t,
23
+ value: l,
24
24
  ...n
25
25
  }) {
26
26
  const o = k(e.editable) ? e.editable(n.text, n.record, n.index) : !!e.editable;
@@ -28,35 +28,35 @@ const M = (a, b) => {
28
28
  return console.warn("can not render table cell because no `valueType` / `customRender` / `customRenderFormItem`"), null;
29
29
  let r;
30
30
  if (o) {
31
- const l = v(e, E(e.fieldProps, {
32
- value: t,
31
+ const a = v(e, E(e.fieldProps, {
32
+ value: l,
33
33
  ...n
34
34
  })), i = {};
35
- a.onFieldChange && (i[`onUpdate:${l.valuePropName || "value"}`] = (C) => {
35
+ t.onFieldChange && (i[`onUpdate:${a.valuePropName || "value"}`] = (T) => {
36
36
  var s;
37
- return (s = a.onFieldChange) == null ? void 0 : s.call(a, n.index, e.dataIndex, C);
37
+ return (s = t.onFieldChange) == null ? void 0 : s.call(t, n.index, e.dataIndex, T);
38
38
  });
39
39
  const R = f(e.dataIndex) ? e.dataIndex : [e.dataIndex];
40
40
  r = {
41
- name: [...f(a.name) ? a.name : [a.name], n.index, ...R],
42
- ...l || {},
41
+ name: [...f(t.name) ? t.name : [t.name], n.index, ...R],
42
+ ...a || {},
43
43
  field: {
44
44
  style: "width: 100%",
45
- ...(l == null ? void 0 : l.field) || {},
45
+ ...(a == null ? void 0 : a.field) || {},
46
46
  ...i,
47
- class: A("is-editable", l.class)
47
+ class: A("is-editable", a.class)
48
48
  }
49
49
  };
50
50
  } else
51
51
  r = {
52
52
  field: G(e, {
53
- value: t,
53
+ value: l,
54
54
  ...n
55
55
  })
56
56
  };
57
- const u = q(e, o, r, t, n.record, m(b));
57
+ const u = q(e, o, r, l, n.record, m(b));
58
58
  return e.customRender ? e.customRender({
59
- value: t,
59
+ value: l,
60
60
  ...n,
61
61
  editable: o,
62
62
  originalNode: u
@@ -1,6 +1,6 @@
1
1
  import { ApTextProps } from './interface';
2
- import { DefineComponent, ComponentOptionsMixin, PublicProps, CSSProperties, ComponentProvideOptions } from 'vue';
3
2
  import { LinkProps } from '@aplus-frontend/antdv/es/typography/Link';
3
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, CSSProperties, ComponentProvideOptions } from 'vue';
4
4
  type ApTextSlots = {
5
5
  default: any;
6
6
  ellipsisSymbol: any;
@@ -1,10 +1,11 @@
1
- import { defineComponent as A, useSlots as L, computed as r, unref as l, createVNode as O, isVNode as $, Fragment as z, createElementBlock as c, openBlock as o, normalizeClass as s, createCommentVNode as b, createElementVNode as D, normalizeStyle as E, createBlock as u, resolveDynamicComponent as U, mergeProps as v, withCtx as m, renderSlot as i, createSlots as w, createTextVNode as F, toDisplayString as G, renderList as I, normalizeProps as R, guardReactiveProps as q } from "vue";
2
- import { TypographyLink as H, TypographyText as J } from "@aplus-frontend/antdv";
3
- import { isUndefined as d, isString as K, omit as C } from "lodash-unified";
1
+ import { defineComponent as L, useSlots as O, computed as n, unref as o, createVNode as $, isVNode as z, Fragment as D, createElementBlock as d, openBlock as t, normalizeClass as s, createCommentVNode as v, createElementVNode as x, normalizeStyle as E, createBlock as u, resolveDynamicComponent as U, mergeProps as C, withCtx as m, renderSlot as i, createSlots as w, createTextVNode as F, toDisplayString as G, renderList as I, normalizeProps as R, guardReactiveProps as _ } from "vue";
2
+ import { TypographyLink as q, TypographyText as H } from "@aplus-frontend/antdv";
3
+ import { isUndefined as p, omit as f, isString as J } from "lodash-unified";
4
4
  import "../config-provider/index.mjs";
5
- import { useInjectApTextGroup as M } from "./context.mjs";
5
+ import { useInjectApTextGroup as K } from "./context.mjs";
6
+ import { isDef as M } from "../utils/index.mjs";
6
7
  import { useNamespace as Q } from "../config-provider/hooks/use-namespace.mjs";
7
- const te = /* @__PURE__ */ A({
8
+ const ae = /* @__PURE__ */ L({
8
9
  name: "ApText",
9
10
  __name: "index",
10
11
  props: {
@@ -65,60 +66,65 @@ const te = /* @__PURE__ */ A({
65
66
  style: {}
66
67
  },
67
68
  setup(B) {
68
- const f = L(), t = B, {
69
+ const y = O(), e = B, {
69
70
  b: g,
70
- e: p,
71
+ e: c,
71
72
  em: S,
72
- m: N
73
+ m: P
73
74
  } = Q("ap-text"), {
74
- colon: n,
75
- vertical: a,
76
- labelStyle: P
77
- } = M(), T = r(() => d(t.colon) ? d(n == null ? void 0 : n.value) ? !0 : n.value : t.colon), V = r(() => d(t.vertical) ? d(a == null ? void 0 : a.value) ? !1 : a.value : t.vertical), h = r(() => {
78
- const e = l(P) || {};
79
- return Object.assign(e, t.labelStyle || {}), e;
80
- }), y = r(() => {
81
- if (t.label)
82
- return $(t.label) ? t.label : O(z, null, [t.label]);
75
+ colon: a,
76
+ vertical: r,
77
+ labelStyle: N
78
+ } = K(), T = n(() => p(e.colon) ? p(a == null ? void 0 : a.value) ? !0 : a.value : e.colon), V = n(() => p(e.vertical) ? p(r == null ? void 0 : r.value) ? !1 : r.value : e.vertical), h = n(() => {
79
+ const l = o(N) || {};
80
+ return Object.assign(l, e.labelStyle || {}), l;
81
+ }), k = n(() => {
82
+ if (e.label)
83
+ return z(e.label) ? e.label : $(D, null, [e.label]);
84
+ }), j = n(() => {
85
+ const l = M(e.linkProps.ellipsis) ? e.linkProps.ellipsis : !!e.ellipsis;
86
+ return {
87
+ href: J(e.link) ? e.link : void 0,
88
+ ...f(e, ["linkProps"]),
89
+ ...e.linkProps,
90
+ ellipsis: l
91
+ };
83
92
  });
84
- return (e, W) => (o(), c("div", {
85
- class: s([l(g)(), {
86
- [l(N)("vertical")]: V.value
93
+ return (l, W) => (t(), d("div", {
94
+ class: s([o(g)(), {
95
+ [o(P)("vertical")]: V.value
87
96
  }])
88
- }, [y.value ? (o(), c("span", {
97
+ }, [k.value ? (t(), d("span", {
89
98
  key: 0,
90
- class: s([l(p)("label"), {
91
- [l(S)("label", "no-colon")]: !T.value
99
+ class: s([o(c)("label"), {
100
+ [o(S)("label", "no-colon")]: !T.value
92
101
  }]),
93
102
  style: E(h.value)
94
- }, [(o(), u(U(y.value)))], 6)) : b("", !0), D("div", {
95
- class: s(l(p)("content"))
96
- }, [e.link ? (o(), u(l(H), v({
103
+ }, [(t(), u(U(k.value)))], 6)) : v("", !0), x("div", {
104
+ class: s(o(c)("content"))
105
+ }, [l.link ? (t(), u(o(q), C({
97
106
  key: 0
98
- }, {
99
- href: l(K)(e.link) ? e.link : void 0,
100
- ...e.linkProps
101
- }, {
102
- onClick: e.onClickContent
107
+ }, j.value, {
108
+ onClick: l.onClickContent
103
109
  }), {
104
- default: m(() => [i(e.$slots, "default")]),
110
+ default: m(() => [i(l.$slots, "default")]),
105
111
  _: 3
106
- }, 16, ["onClick"])) : (o(), u(l(J), v({
112
+ }, 16, ["onClick"])) : (t(), u(o(H), C({
107
113
  key: 1
108
- }, l(C)(t, ["label", "colon", "link", "linkProps", "vertical", "labelStyle"]), {
109
- onClick: e.onClickContent
114
+ }, o(f)(e, ["label", "colon", "link", "linkProps", "vertical", "labelStyle"]), {
115
+ onClick: l.onClickContent
110
116
  }), w({
111
- default: m(() => [i(e.$slots, "default", {}, () => [F(G(e.content || "--"), 1)])]),
117
+ default: m(() => [i(l.$slots, "default", {}, () => [F(G(l.content || "--"), 1)])]),
112
118
  _: 2
113
- }, [I(l(C)(f, ["default", "addonAfter"]), (X, k) => ({
114
- name: k,
115
- fn: m((j) => [i(e.$slots, k, R(q(j || {})))])
116
- }))]), 1040, ["onClick"])), f.addonAfter ? (o(), c("div", {
119
+ }, [I(o(f)(y, ["default", "addonAfter"]), (X, b) => ({
120
+ name: b,
121
+ fn: m((A) => [i(l.$slots, b, R(_(A || {})))])
122
+ }))]), 1040, ["onClick"])), y.addonAfter ? (t(), d("div", {
117
123
  key: 2,
118
- class: s(l(p)("content-addon-after"))
119
- }, [i(e.$slots, "addonAfter")], 2)) : b("", !0)], 2)], 2));
124
+ class: s(o(c)("content-addon-after"))
125
+ }, [i(l.$slots, "addonAfter")], 2)) : v("", !0)], 2)], 2));
120
126
  }
121
127
  });
122
128
  export {
123
- te as default
129
+ ae as default
124
130
  };
@@ -1,2 +1,2 @@
1
- declare const _default: "6.14.0";
1
+ declare const _default: "6.16.0";
2
2
  export default _default;
@@ -1,4 +1,4 @@
1
- const e = "6.14.0";
1
+ const e = "6.16.0";
2
2
  export {
3
3
  e as default
4
4
  };
@@ -1,5 +1 @@
1
- declare class MockResizeObserver {
2
- observe(): void;
3
- unobserve(): void;
4
- disconnect(): void;
5
- }
1
+ export declare function triggerResize(target: Element, width?: number, height?: number): void;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("lodash-unified"),c=require("../../utils/index.js"),h=20,C=50,g=e=>e.some(t=>!!t.html);function m(e){var n;const t={...l.omit(e,["columns","request","searchForm","dataSource","rowKey","value","round"])};if(t.rowConfig={isHover:!0,keyField:e.rowKey,isCurrent:!!e.rowHighlightable},t.columnConfig={},g(e.columns||[])&&(t.rowConfig.useKey=!0,t.columnConfig.useKey=!0),e.adaptive&&(t.autoResize=!0,t.height="100%"),e.columnResizable&&(t.columnConfig.resizable=!0),e.rowSelection){const o=e.rowSelection===!0?{}:e.rowSelection;o.type==="radio"?t.radioConfig={highlight:!0,checkMethod({row:i}){return o.disabled?!o.disabled(i):!0},visibleMethod({row:i}){return o.shown?o.shown(i):!0},checkRowKey:(n=o.defaultSelectedRowKeys)==null?void 0:n[0],reserve:l.isUndefined(o.preserveSelectedRowKeys)?!0:o.preserveSelectedRowKeys}:t.checkboxConfig={highlight:!0,checkMethod({row:i}){return o.disabled?!o.disabled(i):!0},visibleMethod({row:i}){return o.shown?o.shown(i):!0},reserve:l.isUndefined(o.preserveSelectedRowKeys)?!0:o.preserveSelectedRowKeys,range:o.range||!1}}return t.border=e.bordered===!1?"inner":!0,e.expandable&&(t.expandConfig=l.omit(e.expandable,["renderContent","width","title"])),e.footer&&(t.showFooter=!0,l.isFunction(e.footer)?t.footerMethod=e.footer:t.footerData=e.footer),e.virtual===!1?(t.virtualXConfig={enabled:!1},t.virtualYConfig={enabled:!1}):(u(t,"X",e.virtual),u(t,"Y",e.virtual)),t.round=c.isDef(e.round)?e.round:!e.card,e.virtual!==!1&&(t.headerCellConfig={height:36,...t.headerCellConfig||{}}),t.treeConfig&&(t.treeConfig={...t.treeConfig||{},transform:!0}),t}function u(e,t,r){const n=t==="X",o=n?"x":"y",i=n?"virtualXConfig":"virtualYConfig",d=r==null?void 0:r[o],f=d!==!1,s=n?h:C,a=l.isNumber(d)&&d>=0?d:s;e[i]={enabled:f,gt:a,oSize:(r==null?void 0:r.oSize)||0}}function w(e){return e===!0?"left":e}function b(e,t){const r=e===!0||!e.type?"checkbox":e.type,n=e===!0?60:e.columnWidth||60;let o=e===!0?void 0:w(e.fixed);return o||(o===!1?o=void 0:o=t.some(i=>i.fixed==="left"||i.fixed===!0)?"left":void 0),{type:r,width:n,fixed:o}}function y(e){const t=(e==null?void 0:e.width)||"auto";return{type:"expand",title:e==null?void 0:e.title,width:t}}exports.getRowExpandProps=y;exports.getRowSelectionProps=b;exports.toVxeProps=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("lodash-unified"),c=require("../../utils/index.js"),h=20,C=50,g=e=>e.some(t=>!!t.html);function m(e){var n;const t={...d.omit(e,["columns","request","searchForm","dataSource","rowKey","value","round"])};if(t.rowConfig={isHover:!0,keyField:e.rowKey,isCurrent:!!e.rowHighlightable},t.columnConfig={},g(e.columns||[])&&(t.rowConfig.useKey=!0,t.columnConfig.useKey=!0),e.adaptive&&(t.autoResize=!0,t.height="100%"),e.columnResizable&&(t.columnConfig.resizable=!0),e.rowSelection){const o=e.rowSelection===!0?{}:e.rowSelection;o.type==="radio"?t.radioConfig={highlight:!0,checkMethod({row:r}){return o.disabled?!o.disabled(r):!0},visibleMethod({row:r}){return o.shown?o.shown(r):!0},checkRowKey:(n=o.defaultSelectedRowKeys)==null?void 0:n[0],reserve:d.isUndefined(o.preserveSelectedRowKeys)?!0:o.preserveSelectedRowKeys}:t.checkboxConfig={highlight:!0,checkMethod({row:r}){return o.disabled?!o.disabled(r):!0},visibleMethod({row:r}){return o.shown?o.shown(r):!0},reserve:d.isUndefined(o.preserveSelectedRowKeys)?!0:o.preserveSelectedRowKeys,range:o.range||!1}}return t.border=e.bordered===!1?"inner":!0,e.expandable&&(t.expandConfig=d.omit(e.expandable,["renderContent","width","title"])),e.footer&&(t.showFooter=!0,d.isFunction(e.footer)?t.footerMethod=e.footer:t.footerData=e.footer),e.virtual===!1?(t.virtualXConfig={enabled:!1},t.virtualYConfig={enabled:!1}):(u(t,"X",e.virtual),u(t,"Y",e.virtual)),t.round=c.isDef(e.round)?e.round:!e.card,t.headerCellConfig={height:36,...t.headerCellConfig||{}},t.treeConfig&&(t.treeConfig={...t.treeConfig||{},transform:!0}),t}function u(e,t,i){const n=t==="X",o=n?"x":"y",r=n?"virtualXConfig":"virtualYConfig",s=i==null?void 0:i[o],f=s!==!1,l=n?h:C,a=d.isNumber(s)&&s>=0?s:l;e[r]={enabled:f,gt:a,oSize:(i==null?void 0:i.oSize)||0}}function w(e){return e===!0?"left":e}function b(e,t){const i=e===!0||!e.type?"checkbox":e.type,n=e===!0?60:e.columnWidth||60;let o=e===!0?void 0:w(e.fixed);return o||(o===!1?o=void 0:o=t.some(r=>r.fixed==="left"||r.fixed===!0)?"left":void 0),{type:i,width:n,fixed:o}}function y(e){const t=(e==null?void 0:e.width)||"auto";return{type:"expand",title:e==null?void 0:e.title,width:t}}exports.getRowExpandProps=y;exports.getRowSelectionProps=b;exports.toVxeProps=m;
@@ -14,6 +14,9 @@ export declare const useOfflineList: <DataType = Recordable>(params: ApListProps
14
14
  total: number;
15
15
  showSizeChanger: boolean;
16
16
  showQuickJumper: boolean;
17
+ showLessItems: boolean | undefined;
18
+ size: "default" | "small";
19
+ pageSizeOptions: (string | number)[];
17
20
  }>;
18
21
  dataSource: ComputedRef<DataType[]>;
19
22
  onChange: (page: number, size: number) => void;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=n=>{const t=e.ref(n.pagination&&n.pagination.defaultCurrent||1),u=e.ref(n.pagination&&n.pagination.defaultPageSize||10);function i(r,a){t.value=r,u.value=a}const o=e.computed(()=>n.dataSource?n.pagination===!1?[...n.dataSource]:n.dataSource.slice((e.unref(t)-1)*e.unref(u),e.unref(t)*e.unref(u)):[]);return{pagination:e.computed(()=>{var r;return{current:e.unref(t),pageSize:e.unref(u),total:((r=n.dataSource)==null?void 0:r.length)||0,showSizeChanger:!0,showQuickJumper:!0}}),dataSource:o,onChange:i}};exports.useOfflineList=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),f=require("../../utils/index.js"),d=require("lodash-unified"),l=e=>{const i=n.ref(e.pagination&&e.pagination.defaultCurrent||1),u=n.ref(e.pagination&&e.pagination.defaultPageSize||10);function s(t,o){i.value=t,u.value=o}const g=n.computed(()=>e.dataSource?e.pagination===!1?[...e.dataSource]:e.dataSource.slice((n.unref(i)-1)*n.unref(u),n.unref(i)*n.unref(u)):[]);return{pagination:n.computed(()=>{var c;const{showLessItems:t,showSizeChanger:o,showQuickJumper:r,pageSizeOptions:a}=e.pagination||{};return{current:n.unref(i),pageSize:n.unref(u),total:((c=e.dataSource)==null?void 0:c.length)||0,showSizeChanger:f.isDef(o)?o:!t,showQuickJumper:f.isDef(r)?r:!t,showLessItems:t,size:"default",pageSizeOptions:d.isUndefined(a)?["10","20","50","100"]:a}}),dataSource:g,onChange:s}};exports.useOfflineList=l;
@@ -1,5 +1,5 @@
1
1
  import { StyleValue } from 'vue';
2
- import { RequestData } from '../ap-table';
2
+ import { ApTablePaginationConfig, RequestData } from '../ap-table';
3
3
  import { Recordable } from '../type';
4
4
  import { InternalPagingType } from '../ap-table/hooks/use-table-paging-ng';
5
5
  export type ApListProps<RecordType = any, ParamsType = Recordable> = {
@@ -49,14 +49,12 @@ export type ApListProps<RecordType = any, ParamsType = Recordable> = {
49
49
  /**
50
50
  * 是否显示分页器(特定的分页器)或者指定默认的当前页和pageSize
51
51
  */
52
- pagination?: false | {
53
- defaultCurrent?: number;
54
- defaultPageSize?: number;
52
+ pagination?: false | (Omit<ApTablePaginationConfig, 'showTotal'> & {
55
53
  /**
56
54
  * 只有一页时隐藏分页
57
55
  */
58
56
  hideOnSinglePage?: boolean;
59
- };
57
+ });
60
58
  /**
61
59
  * 是否手动发起第一次网络请求
62
60
  */
@@ -17,7 +17,9 @@ declare function __VLS_template(): {
17
17
  rootEl: HTMLDivElement;
18
18
  };
19
19
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
20
- declare const __VLS_component: DefineComponent<ApBatchActionProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ApBatchActionProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
20
+ declare const __VLS_component: DefineComponent<ApBatchActionProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ApBatchActionProps> & Readonly<{}>, {
21
+ showSelected: boolean;
22
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {
21
23
  headerRef: HTMLDivElement;
22
24
  }, HTMLDivElement>;
23
25
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),V=require("@aplus-frontend/antdv");require("../../config-provider/index.js");const B=require("../../config-provider/hooks/use-namespace.js"),C=require("../../config-provider/hooks/use-locale.js"),E={class:"selected-desc"},w={class:"selected-desc-conut"},D={class:"selected-desc-clean"},b=e.defineComponent({__name:"ApBatchAction",props:{selectedRowKeys:{},clearAll:{type:Function}},setup(_){const{b:c}=B.useNamespace("ap-batch-action"),{t:r}=C.useLocale(),s=_,n=e.useSlots(),A=e.computed(()=>{var t;return((t=s.selectedRowKeys)==null?void 0:t.length)||0}),o=e.ref(!1),i=e.ref();return e.watch(()=>n.header,()=>{setTimeout(()=>{var l,d,p,h,f,v,a,m,y,S,N;const t=(l=n.header)==null?void 0:l.call(n);(t==null?void 0:t.length)===1&&((p=(d=t==null?void 0:t[0])==null?void 0:d.type)==null?void 0:p.name)==="ASpace"?o.value=!!((y=(m=(a=Array.prototype.slice.call((v=(f=(h=i.value)==null?void 0:h.children)==null?void 0:f[0])==null?void 0:v.children))==null?void 0:a.filter)==null?void 0:m.call(a,u=>{var g;return(g=u==null?void 0:u.children)==null?void 0:g.length}))!=null&&y.length):o.value=!!((N=(S=i.value)==null?void 0:S.children)!=null&&N.length)})},{immediate:!0}),(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(c)()])},[e.withDirectives(e.createElementVNode("div",{ref_key:"headerRef",ref:i,class:e.normalizeClass(e.unref(c)("header"))},[e.renderSlot(t.$slots,"header")],2),[[e.vShow,o.value]]),e.createElementVNode("div",{class:e.normalizeClass(e.unref(c)("body"))},[e.renderSlot(t.$slots,"prefix"),e.createElementVNode("div",E,[e.createElementVNode("div",w,[e.createTextVNode(e.toDisplayString(e.unref(r)("ap.apBatchAction.selected"))+" ",1),e.createElementVNode("span",null,e.toDisplayString(A.value),1),e.createTextVNode(" "+e.toDisplayString(e.unref(r)("ap.apBatchAction.piecesOfData")),1)]),e.createElementVNode("div",D,[e.createVNode(e.unref(V.Button),{type:"link",onClick:l[0]||(l[0]=d=>s.clearAll&&s.clearAll())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("ap.apBatchAction.empty")),1)]),_:1})])]),e.renderSlot(t.$slots,"suffix")],2)],2))}});exports.default=b;
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 V=require("../../config-provider/hooks/use-namespace.js"),k=require("../../config-provider/hooks/use-locale.js"),w={key:0,class:"selected-desc"},C={class:"selected-desc-conut"},E={class:"selected-desc-clean"},D=e.defineComponent({__name:"ApBatchAction",props:{selectedRowKeys:{},clearAll:{},showSelected:{type:Boolean,default:!0}},setup(_){const{b:o}=V.useNamespace("ap-batch-action"),{t:r}=k.useLocale(),a=_,c=e.useSlots(),A=e.computed(()=>{var t;return((t=a.selectedRowKeys)==null?void 0:t.length)||0}),s=e.ref(!1),d=e.ref();return e.watch(()=>c.header,()=>{setTimeout(()=>{var l,i,p,h,f,m,n,v,y,S,N;const t=(l=c.header)==null?void 0:l.call(c);(t==null?void 0:t.length)===1&&((p=(i=t==null?void 0:t[0])==null?void 0:i.type)==null?void 0:p.name)==="ASpace"?s.value=!!((y=(v=(n=Array.prototype.slice.call((m=(f=(h=d.value)==null?void 0:h.children)==null?void 0:f[0])==null?void 0:m.children))==null?void 0:n.filter)==null?void 0:v.call(n,u=>{var g;return(g=u==null?void 0:u.children)==null?void 0:g.length}))!=null&&y.length):s.value=!!((N=(S=d.value)==null?void 0:S.children)!=null&&N.length)})},{immediate:!0}),(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(o)()])},[e.withDirectives(e.createElementVNode("div",{ref_key:"headerRef",ref:d,class:e.normalizeClass(e.unref(o)("header"))},[e.renderSlot(t.$slots,"header")],2),[[e.vShow,s.value]]),e.createElementVNode("div",{class:e.normalizeClass(e.unref(o)("body"))},[e.renderSlot(t.$slots,"prefix"),a.showSelected?(e.openBlock(),e.createElementBlock("div",w,[e.createElementVNode("div",C,[e.createTextVNode(e.toDisplayString(e.unref(r)("ap.apBatchAction.selected"))+" ",1),e.createElementVNode("span",null,e.toDisplayString(A.value),1),e.createTextVNode(" "+e.toDisplayString(e.unref(r)("ap.apBatchAction.piecesOfData")),1)]),e.createElementVNode("div",E,[e.createVNode(e.unref(B.Button),{type:"link",onClick:l[0]||(l[0]=i=>a.clearAll&&a.clearAll())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("ap.apBatchAction.empty")),1)]),_:1})])])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"suffix")],2)],2))}});exports.default=D;
@@ -2,7 +2,9 @@ import { CreateComponentPublicInstanceWithMixins, ComponentOptionsMixin, PublicP
2
2
  import { ApBatchActionProps } from './interface';
3
3
  export * from './interface';
4
4
  declare const ApBatchAction: {
5
- new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly< ApBatchActionProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {
5
+ new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly< ApBatchActionProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
6
+ showSelected: boolean;
7
+ }, false, {}, {}, GlobalComponents, GlobalDirectives, string, {
6
8
  headerRef: HTMLDivElement;
7
9
  }, HTMLDivElement, ComponentProvideOptions, {
8
10
  P: {};
@@ -11,11 +13,15 @@ declare const ApBatchAction: {
11
13
  C: {};
12
14
  M: {};
13
15
  Defaults: {};
14
- }, Readonly< ApBatchActionProps> & Readonly<{}>, {}, {}, {}, {}, {}>;
16
+ }, Readonly< ApBatchActionProps> & Readonly<{}>, {}, {}, {}, {}, {
17
+ showSelected: boolean;
18
+ }>;
15
19
  __isFragment?: never;
16
20
  __isTeleport?: never;
17
21
  __isSuspense?: never;
18
- } & ComponentOptionsBase<Readonly< ApBatchActionProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
22
+ } & ComponentOptionsBase<Readonly< ApBatchActionProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
23
+ showSelected: boolean;
24
+ }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
19
25
  $slots: Readonly<{
20
26
  header: () => any[];
21
27
  prefix: () => void;
@@ -7,4 +7,8 @@ export interface ApBatchActionProps {
7
7
  * 清空
8
8
  */
9
9
  clearAll?: () => void;
10
+ /**
11
+ * 是否显示主体
12
+ */
13
+ showSelected?: boolean;
10
14
  }
@@ -1,7 +1,7 @@
1
1
  import { ApExportGroupProps } from './interface';
2
2
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
3
  declare const _default: DefineComponent<ApExportGroupProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ApExportGroupProps> & Readonly<{}>, {
4
- type: "button" | "dropdown";
4
+ type: "button" | "dropdown" | "group";
5
5
  exportField: boolean | {
6
6
  key?: string;
7
7
  convertField?: {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),G=require("@ant-design/icons-vue"),i=require("@aplus-frontend/antdv");require("../../config-provider/index.js");const u=require("./interface.js"),L=require("@aplus-frontend/hooks"),F=require("./handleExportDownload.js"),M=require("../../ap-table/context.js"),N=require("./convertExportField.js");require("../../ap-button/index.js");const D=require("../../config-provider/hooks/use-namespace.js"),P=require("../../config-provider/hooks/use-locale.js"),V=require("../../config-provider/hooks/use-global-config.js"),E=require("../../ap-button/ap-button.vue.js"),I=e.defineComponent({__name:"ApExportGroup",props:{type:{default:"button"},selectedRowKeys:{},disabled:{type:Boolean},auth:{},ifShow:{},text:{},idKey:{},request:{},getRequestParams:{},getInitialParams:{},beforeRequest:{},successMessage:{type:[Boolean,String],default:!1},exportField:{type:[Boolean,Object],default:void 0}},setup(C){const{hasPermission:A}=L.usePermission(),t=C,{columns:s,dataSource:c}=M.useInjectApTable(),{b:_}=D.useNamespace("ap-export-group"),{t:l}=P.useLocale(),m=V.useGlobalConfig("exportField"),r=e.ref(!1),p=e.ref(!1),d=e.computed(()=>{var o;return!!(t!=null&&t.disabled)||(c!==void 0?!((o=c==null?void 0:c.value)!=null&&o.length):!1)||r.value});e.watch(()=>d.value,()=>{d.value&&(p.value=!1)},{immediate:!0});const q=e.computed(()=>(t==null?void 0:t.successMessage)===!0?l("ap.apExportGroup.exportSuccess"):t!=null&&t.successMessage?t.successMessage:""),x=e.computed(()=>{const o="exportFieldList",a=(t==null?void 0:t.exportField)??(m.value===""?!0:m.value)??!1;return a===!0?{key:o}:typeof a=="object"?{...a,key:a.key??o}:a}),B={textAlign:"center"},y=e.computed(()=>(t==null?void 0:t.selectedRowKeys)||[]),k=e.computed(()=>{let o=t==null?void 0:t.ifShow;return!(t!=null&&t.ifShow)&&(t!=null&&t.auth)&&(o=()=>A(t.auth)),(o==null?void 0:o())??!0});async function S(){y.value.length>0?v({key:u.ApExportGroupActionType.SELECT}):v({key:u.ApExportGroupActionType.ALL})}async function v({key:o}){var b,w,h;const{getRequestParams:a,request:n}=t||{};let g={};o===u.ApExportGroupActionType.SELECT?g={[(t==null?void 0:t.idKey)||"ids"]:y.value}:o===u.ApExportGroupActionType.ALL&&(g=(a==null?void 0:a())||{});const T=((b=t==null?void 0:t.getInitialParams)==null?void 0:b.call(t))||{};try{r.value=!0;let f=Object.assign({...g,...T},x.value&&(s!=null&&s.value)?{[x.value.key]:N.convertExportField(s.value,(w=x.value)==null?void 0:w.convertField)}:{});f=((h=t==null?void 0:t.beforeRequest)==null?void 0:h.call(t,f))||f,await F.handleExportDownload(async()=>await(n==null?void 0:n(f))),t!=null&&t.successMessage&&i.message.success(q.value)}finally{r.value=!1}}return(o,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[k.value&&t.type==="button"?(e.openBlock(),e.createBlock(e.unref(E.default),e.mergeProps({key:0},{...o.$attrs},{disabled:d.value,loading:r.value,"min-width":"",onClick:S}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString((t==null?void 0:t.text)??e.unref(l)("ap.apExportGroup.export")),1)]),_:1},16,["disabled","loading"])):e.createCommentVNode("",!0),k.value&&t.type==="dropdown"?(e.openBlock(),e.createBlock(e.unref(i.Dropdown),{key:1,open:p.value,"onUpdate:open":a[0]||(a[0]=n=>p.value=n),class:e.normalizeClass([e.unref(_)()]),"overlay-style":B,disabled:d.value},{overlay:e.withCtx(()=>[e.createVNode(e.unref(i.Menu),{onClick:v},{default:e.withCtx(()=>{var n;return[(e.openBlock(),e.createBlock(e.unref(i.MenuItem),{key:e.unref(u.ApExportGroupActionType).SELECT,disabled:((n=y.value)==null?void 0:n.length)===0},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("ap.apExportGroup.exportSelected")),1)]),_:1},8,["disabled"])),(e.openBlock(),e.createBlock(e.unref(i.MenuItem),{key:e.unref(u.ApExportGroupActionType).ALL},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("ap.apExportGroup.exportAll")),1)]),_:1}))]}),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(E.default),e.mergeProps({...o.$attrs},{loading:r.value}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString((t==null?void 0:t.text)??e.unref(l)("ap.apExportGroup.export"))+" ",1),e.createVNode(e.unref(G.DownOutlined))]),_:1},16,["loading"])]),_:1},8,["open","class","disabled"])):e.createCommentVNode("",!0)],64))}});exports.default=I;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),M=require("@ant-design/icons-vue"),f=require("@aplus-frontend/antdv");require("../../config-provider/index.js");const n=require("./interface.js"),N=require("@aplus-frontend/hooks"),V=require("./handleExportDownload.js"),D=require("../../ap-table/context.js"),I=require("./convertExportField.js");require("../../ap-button/index.js");const K=require("../ap-batch-action-group/index.js"),j=require("../../config-provider/hooks/use-namespace.js"),R=require("../../config-provider/hooks/use-locale.js"),O=require("../../config-provider/hooks/use-global-config.js"),C=require("../../ap-button/ap-button.vue.js"),_=e.defineComponent({__name:"ApExportGroup",props:{type:{default:"button"},selectedRowKeys:{},groupList:{},buttonProps:{},disabled:{type:Boolean},auth:{},ifShow:{},text:{},idKey:{},request:{},getRequestParams:{},getInitialParams:{},beforeRequest:{},successMessage:{type:[Boolean,String],default:!1},exportField:{type:[Boolean,Object],default:void 0}},setup(B){const{hasPermission:L}=N.usePermission(),t=B,{columns:y,dataSource:x}=D.useInjectApTable(),{b:G}=j.useNamespace("ap-export-group"),{t:l}=R.useLocale(),E=O.useGlobalConfig("exportField"),s=e.ref(!1),b=e.ref(!1),i=e.computed(()=>{var a;return!!(t!=null&&t.disabled)||(x!==void 0?!((a=x==null?void 0:x.value)!=null&&a.length):!1)||s.value});e.watch(()=>i.value,()=>{i.value&&(b.value=!1)},{immediate:!0});const S=e.computed(()=>(t==null?void 0:t.successMessage)===!0?l("ap.apExportGroup.exportSuccess"):t!=null&&t.successMessage?t.successMessage:""),T=(a=t==null?void 0:t.exportField)=>{const r="exportFieldList",o=a??(E.value===""?!0:E.value)??!1;return o===!0?{key:r}:typeof o=="object"?{...o,key:o.key??r}:o},m={textAlign:"center"},v=e.computed(()=>(t==null?void 0:t.selectedRowKeys)||[]),k=e.computed(()=>{let a=t==null?void 0:t.ifShow;return!(t!=null&&t.ifShow)&&(t!=null&&t.auth)&&(a=()=>L(t.auth)),(a==null?void 0:a())??!0});async function q(){v.value.length>0?d({key:n.ApExportGroupActionType.SELECT}):d({key:n.ApExportGroupActionType.ALL})}async function d({key:a,option:r}){var w,A;const o=r||t,{getRequestParams:c,request:u}=o||{},p=T(o==null?void 0:o.exportField);let h={};a===n.ApExportGroupActionType.SELECT?h={[(o==null?void 0:o.idKey)||"ids"]:v.value}:a===n.ApExportGroupActionType.ALL&&(h=(c==null?void 0:c())||{});const F=((w=o==null?void 0:o.getInitialParams)==null?void 0:w.call(o))||{};try{s.value=!0;let g=Object.assign({...h,...F},p&&(y!=null&&y.value)?{[p.key]:I.convertExportField(y.value,p==null?void 0:p.convertField)}:{});g=((A=o==null?void 0:o.beforeRequest)==null?void 0:A.call(o,g))||g,await V.handleExportDownload(async()=>await(u==null?void 0:u(g))),o!=null&&o.successMessage&&f.message.success(S.value)}finally{s.value=!1}}const P=e.computed(()=>{var a;return((a=t==null?void 0:t.groupList)==null?void 0:a.map((r,o)=>({key:o,content:r==null?void 0:r.text,auth:r==null?void 0:r.auth,ifShow:r==null?void 0:r.ifShow,disabled:r==null?void 0:r.disabled,onClick:()=>{v.value.length>0?d({key:n.ApExportGroupActionType.SELECT,option:r}):d({key:n.ApExportGroupActionType.ALL,option:r})}})))||[]});return(a,r)=>{var o,c;return e.openBlock(),e.createElementBlock(e.Fragment,null,[k.value&&t.type==="button"?(e.openBlock(),e.createBlock(e.unref(C.default),e.mergeProps({key:0},{...a.$attrs},{disabled:i.value,loading:s.value,"min-width":"",onClick:q}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString((t==null?void 0:t.text)??e.unref(l)("ap.apExportGroup.export")),1)]),_:1},16,["disabled","loading"])):e.createCommentVNode("",!0),k.value&&t.type==="dropdown"?(e.openBlock(),e.createBlock(e.unref(f.Dropdown),{key:1,open:b.value,"onUpdate:open":r[0]||(r[0]=u=>b.value=u),class:e.normalizeClass([e.unref(G)()]),"overlay-style":m,disabled:i.value},{overlay:e.withCtx(()=>[e.createVNode(e.unref(f.Menu),{onClick:d},{default:e.withCtx(()=>{var u;return[(e.openBlock(),e.createBlock(e.unref(f.MenuItem),{key:e.unref(n.ApExportGroupActionType).SELECT,disabled:((u=v.value)==null?void 0:u.length)===0},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("ap.apExportGroup.exportSelected")),1)]),_:1},8,["disabled"])),(e.openBlock(),e.createBlock(e.unref(f.MenuItem),{key:e.unref(n.ApExportGroupActionType).ALL},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("ap.apExportGroup.exportAll")),1)]),_:1}))]}),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(C.default),e.mergeProps({...a.$attrs},{loading:s.value}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString((t==null?void 0:t.text)??e.unref(l)("ap.apExportGroup.export"))+" ",1),e.createVNode(e.unref(M.DownOutlined))]),_:1},16,["loading"])]),_:1},8,["open","class","disabled"])):e.createCommentVNode("",!0),k.value&&t.type==="group"?(e.openBlock(),e.createBlock(e.unref(K.ApBatchActionGroup),e.mergeProps({key:2},{...a.$attrs},{disabled:i.value,loading:s.value,"button-props":{...t.buttonProps,content:((o=t==null?void 0:t.buttonProps)==null?void 0:o.content)??e.unref(l)("ap.apExportGroup.export"),type:((c=t==null?void 0:t.buttonProps)==null?void 0:c.type)??"default"},"menu-list":P.value}),null,16,["disabled","loading","button-props","menu-list"])):e.createCommentVNode("",!0)],64)}}});exports.default=_;