@aplus-frontend/ui 7.1.1 → 7.2.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 (57) hide show
  1. package/es/index.mjs +143 -147
  2. package/es/src/ap-pro-card/components/title/index.vue.d.ts +3 -0
  3. package/es/src/ap-pro-card/components/title/index.vue2.mjs +18 -13
  4. package/es/src/ap-upload/apUpload.vue.d.ts +1 -1
  5. package/es/src/business/ap-image/ApImage.vue2.mjs +45 -42
  6. package/es/src/business/ap-image/interface.d.ts +2 -0
  7. package/es/src/business/ap-title/ApTitle.vue2.mjs +24 -21
  8. package/es/src/business/ap-title/interface.d.ts +2 -0
  9. package/es/src/business/hooks/index.d.ts +0 -2
  10. package/es/src/business/hooks/index.mjs +5 -9
  11. package/es/src/business/hooks/usePageListApGrid.d.ts +1 -2
  12. package/es/src/business/hooks/usePageListApGrid.mjs +35 -44
  13. package/es/src/business/hooks/usePageListApTable.d.ts +1 -2
  14. package/es/src/business/hooks/usePageListApTable.mjs +46 -48
  15. package/es/src/config-provider/config-provider-props.d.ts +20 -3
  16. package/es/src/config-provider/config-provider-props.mjs +12 -0
  17. package/es/src/config-provider/config-provider.d.ts +33 -3
  18. package/es/src/config-provider/config-provider.mjs +35 -35
  19. package/es/src/config-provider/constants.d.ts +1 -0
  20. package/es/src/config-provider/hooks/use-global-config.d.ts +17 -2
  21. package/es/src/config-provider/index.d.ts +49 -4
  22. package/es/src/index.mjs +147 -151
  23. package/es/src/version.d.ts +1 -1
  24. package/es/src/version.mjs +1 -1
  25. package/lib/index.js +1 -1
  26. package/lib/src/ap-pro-card/components/title/index.vue.d.ts +3 -0
  27. package/lib/src/ap-pro-card/components/title/index.vue2.js +1 -1
  28. package/lib/src/ap-upload/apUpload.vue.d.ts +1 -1
  29. package/lib/src/business/ap-image/ApImage.vue2.js +1 -1
  30. package/lib/src/business/ap-image/interface.d.ts +2 -0
  31. package/lib/src/business/ap-title/ApTitle.vue2.js +1 -1
  32. package/lib/src/business/ap-title/interface.d.ts +2 -0
  33. package/lib/src/business/hooks/index.d.ts +0 -2
  34. package/lib/src/business/hooks/index.js +1 -1
  35. package/lib/src/business/hooks/usePageListApGrid.d.ts +1 -2
  36. package/lib/src/business/hooks/usePageListApGrid.js +1 -1
  37. package/lib/src/business/hooks/usePageListApTable.d.ts +1 -2
  38. package/lib/src/business/hooks/usePageListApTable.js +1 -1
  39. package/lib/src/config-provider/config-provider-props.d.ts +20 -3
  40. package/lib/src/config-provider/config-provider-props.js +1 -1
  41. package/lib/src/config-provider/config-provider.d.ts +33 -3
  42. package/lib/src/config-provider/config-provider.js +1 -1
  43. package/lib/src/config-provider/constants.d.ts +1 -0
  44. package/lib/src/config-provider/hooks/use-global-config.d.ts +17 -2
  45. package/lib/src/config-provider/index.d.ts +49 -4
  46. package/lib/src/index.js +1 -1
  47. package/lib/src/version.d.ts +1 -1
  48. package/lib/src/version.js +1 -1
  49. package/package.json +3 -3
  50. package/es/src/business/hooks/useGridRefresh.d.ts +0 -17
  51. package/es/src/business/hooks/useGridRefresh.mjs +0 -16
  52. package/es/src/business/hooks/useTableRefresh.d.ts +0 -20
  53. package/es/src/business/hooks/useTableRefresh.mjs +0 -57
  54. package/lib/src/business/hooks/useGridRefresh.d.ts +0 -17
  55. package/lib/src/business/hooks/useGridRefresh.js +0 -1
  56. package/lib/src/business/hooks/useTableRefresh.d.ts +0 -20
  57. package/lib/src/business/hooks/useTableRefresh.js +0 -1
@@ -1,16 +1,16 @@
1
- import { defineComponent as S, computed as n, ref as I, watchEffect as U, createBlock as p, openBlock as l, unref as a, mergeProps as f, withCtx as j, renderSlot as B, normalizeProps as E, guardReactiveProps as L, createElementVNode as g, normalizeClass as D, createElementBlock as M, Fragment as P, renderList as R, resolveDynamicComponent as T, createVNode as x } from "vue";
2
- import { Image as z } from "@aplus-frontend/antdv";
3
- import { DownloadOutlined as V } from "@ant-design/icons-vue";
4
- import { injectLocaleToOss as W, getOssInstance as G, getSignatureUrl as $ } from "./hooks/useOss.mjs";
1
+ import { defineComponent as M, computed as n, ref as S, watchEffect as U, createBlock as p, openBlock as l, unref as a, mergeProps as f, withCtx as j, renderSlot as B, normalizeProps as E, guardReactiveProps as L, createElementVNode as g, normalizeClass as x, createElementBlock as D, Fragment as P, renderList as R, resolveDynamicComponent as T, createVNode as z } from "vue";
2
+ import { Image as V } from "@aplus-frontend/antdv";
3
+ import { DownloadOutlined as W } from "@ant-design/icons-vue";
4
+ import { injectLocaleToOss as G, getOssInstance as $, getSignatureUrl as q } from "./hooks/useOss.mjs";
5
5
  import "../../config-provider/index.mjs";
6
- import q from "./style/index.mjs";
7
- import H from "./imgs/admin-fallback.jpg.mjs";
8
- import J from "./imgs/aplus-fallback.jpg.mjs";
9
- import { omit as K } from "lodash-unified";
10
- import { useNamespace as Q } from "../../config-provider/hooks/use-namespace.mjs";
6
+ import H from "./style/index.mjs";
7
+ import J from "./imgs/admin-fallback.jpg.mjs";
8
+ import K from "./imgs/aplus-fallback.jpg.mjs";
9
+ import { omit as Q } from "lodash-unified";
10
+ import { useNamespace as X } from "../../config-provider/hooks/use-namespace.mjs";
11
11
  import { useGlobalConfig as c } from "../../config-provider/hooks/use-global-config.mjs";
12
- import { useLocale as X } from "../../config-provider/hooks/use-locale.mjs";
13
- const me = /* @__PURE__ */ S({
12
+ import { useLocale as Y } from "../../config-provider/hooks/use-locale.mjs";
13
+ const ue = /* @__PURE__ */ M({
14
14
  __name: "ApImage",
15
15
  props: {
16
16
  getOssAccess: {},
@@ -20,20 +20,23 @@ const me = /* @__PURE__ */ S({
20
20
  fallback: {},
21
21
  src: {},
22
22
  fileName: {},
23
+ uiMode: {},
23
24
  preview: { type: [Boolean, Object], default: !0 }
24
25
  },
25
- setup(b) {
26
- const { b: i } = Q("ap-image"), m = q("ap-image"), e = b, u = {
27
- aplus: J,
28
- admin: H
29
- }, v = c("uiMode"), h = c("apUpload"), d = c(
26
+ setup(v) {
27
+ const { b: i } = X("ap-image"), m = H("ap-image"), e = v, u = {
28
+ aplus: K,
29
+ admin: J
30
+ }, b = c("apImage", { uiMode: "aplus" }), h = c("apUpload"), d = c(
30
31
  "downloadCenterTriggerConfig"
31
- ), { t: k, lang: w } = X(), C = n(
32
+ ), k = n(
33
+ () => e.uiMode || b.value?.uiMode
34
+ ), { t: w, lang: C } = Y(), O = n(
32
35
  () => e.getOssAccess || h.value?.getOssAccess
33
- ), O = n(
34
- () => u[v.value] || u.aplus
35
- ), y = n(() => e?.fallback || O.value), s = I("");
36
- W(k, w), U(async () => {
36
+ ), y = n(
37
+ () => u[k.value] || u.aplus
38
+ ), A = n(() => e?.fallback || y.value), s = S("");
39
+ G(w, C), U(async () => {
37
40
  if (!e?.src) {
38
41
  s.value = "";
39
42
  return;
@@ -43,55 +46,55 @@ const me = /* @__PURE__ */ S({
43
46
  return;
44
47
  }
45
48
  try {
46
- const t = await G(C.value), o = await $({
49
+ const t = await $(O.value), r = await q({
47
50
  oss: t,
48
51
  fileName: e.src
49
52
  });
50
- o && (s.value = o);
53
+ r && (s.value = r);
51
54
  } catch {
52
55
  s.value = "";
53
56
  }
54
57
  });
55
- async function A() {
58
+ async function N() {
56
59
  if (!e?.src)
57
60
  return;
58
- const t = e.src, o = e.fileName ?? e.src;
61
+ const t = e.src, r = e.fileName ?? e.src;
59
62
  if (!e.src?.startsWith("Frontend-Upload")) {
60
- N(t, o);
63
+ I(t, r);
61
64
  return;
62
65
  }
63
66
  if (d.value?.trigger) {
64
- let r = [
67
+ let o = [
65
68
  {
66
69
  objectName: t,
67
- fileName: o
70
+ fileName: r
68
71
  }
69
72
  ];
70
- await d.value?.trigger(r);
73
+ await d.value?.trigger(o);
71
74
  }
72
75
  }
73
- const N = (t, o) => {
74
- const r = document.createElement("a");
75
- r.href = t, r.rel = "noopener noreferrer", r.setAttribute("download", o), document.body.appendChild(r), r.click(), document.body.removeChild(r);
76
+ const I = (t, r) => {
77
+ const o = document.createElement("a");
78
+ o.href = t, o.rel = "noopener noreferrer", o.setAttribute("download", r), document.body.appendChild(o), o.click(), document.body.removeChild(o);
76
79
  };
77
- return (t, o) => (l(), p(a(z), f({
80
+ return (t, r) => (l(), p(a(V), f({
78
81
  class: [a(i)(), a(m)]
79
82
  }, {
80
- ...a(K)(e, ["src", "getOssAccess"]),
81
- fallback: y.value,
83
+ ...a(Q)(e, ["src", "getOssAccess"]),
84
+ fallback: A.value,
82
85
  src: s.value
83
86
  }), {
84
- toolbarRender: j((r) => [
85
- B(t.$slots, "toolbarRender", E(L({ ...r })), () => [
87
+ toolbarRender: j((o) => [
88
+ B(t.$slots, "toolbarRender", E(L({ ...o })), () => [
86
89
  g("div", {
87
- class: D([a(i)("toolbar"), a(m)])
90
+ class: x([a(i)("toolbar"), a(m)])
88
91
  }, [
89
- (l(!0), M(P, null, R(r.originalNodes, (_, F) => (l(), p(T(_), f({ ref_for: !0 }, e, { key: F }), null, 16))), 128)),
92
+ (l(!0), D(P, null, R(o.originalNodes, (_, F) => (l(), p(T(_), f({ ref_for: !0 }, e, { key: F }), null, 16))), 128)),
90
93
  g("div", {
91
94
  class: "ant-image-preview-operations-operation",
92
- onClick: A
95
+ onClick: N
93
96
  }, [
94
- x(a(V))
97
+ z(a(W))
95
98
  ])
96
99
  ], 2)
97
100
  ])
@@ -101,5 +104,5 @@ const me = /* @__PURE__ */ S({
101
104
  }
102
105
  });
103
106
  export {
104
- me as default
107
+ ue as default
105
108
  };
@@ -1,4 +1,5 @@
1
1
  import { accessCreate } from '@aplus-frontend/oss';
2
+ import { UiModeType } from '../../config-provider';
2
3
  export interface ApImageProps {
3
4
  getOssAccess?: () => Promise<accessCreate>;
4
5
  width?: number | string;
@@ -7,6 +8,7 @@ export interface ApImageProps {
7
8
  fallback?: string;
8
9
  src?: string;
9
10
  fileName?: string;
11
+ uiMode?: UiModeType;
10
12
  preview?: boolean | {
11
13
  visible?: boolean;
12
14
  onVisibleChange?: (visible: boolean, prevVisible: boolean) => void;
@@ -1,11 +1,11 @@
1
- import { defineComponent as g, computed as h, createElementBlock as a, openBlock as o, normalizeClass as l, unref as t, createElementVNode as r, renderSlot as n, Fragment as y, createBlock as C, createCommentVNode as k, toDisplayString as v, withCtx as I, createVNode as M, normalizeStyle as S } from "vue";
1
+ import { defineComponent as y, computed as a, createElementBlock as n, openBlock as l, normalizeClass as r, unref as t, createElementVNode as i, renderSlot as p, Fragment as C, createBlock as M, createCommentVNode as v, toDisplayString as k, withCtx as I, createVNode as S, normalizeStyle as T } from "vue";
2
2
  import { Tooltip as $ } from "@aplus-frontend/antdv";
3
3
  import { QuestionCircleOutlined as N } from "@ant-design/icons-vue";
4
4
  import "../../config-provider/index.mjs";
5
- import B from "./style/index.mjs";
6
- import { useNamespace as T } from "../../config-provider/hooks/use-namespace.mjs";
5
+ import A from "./style/index.mjs";
6
+ import { useNamespace as B } from "../../config-provider/hooks/use-namespace.mjs";
7
7
  import { useGlobalConfig as V } from "../../config-provider/hooks/use-global-config.mjs";
8
- const O = /* @__PURE__ */ g({
8
+ const O = /* @__PURE__ */ y({
9
9
  name: "ApTitle",
10
10
  __name: "ApTitle",
11
11
  props: {
@@ -13,39 +13,42 @@ const O = /* @__PURE__ */ g({
13
13
  helpMessage: { default: "" },
14
14
  helpIconColor: { default: "" },
15
15
  placement: { default: "top" },
16
- trigger: { default: "hover" }
16
+ trigger: { default: "hover" },
17
+ uiMode: {}
17
18
  },
18
- setup(p) {
19
- const s = p, { b: m, e: i, m: u } = T("ap-title"), c = B("ap-title"), f = V("uiMode", "aplus"), d = h(() => s.helpIconColor ? {
20
- color: `${s.helpIconColor}`
19
+ setup(m) {
20
+ const o = m, { b: u, e: s, m: c } = B("ap-title"), d = A("ap-title"), f = V("apTitle", { uiMode: "aplus" }), g = a(
21
+ () => o.uiMode || f.value?.uiMode
22
+ ), h = a(() => o.helpIconColor ? {
23
+ color: `${o.helpIconColor}`
21
24
  } : {});
22
- return (e, b) => (o(), a("div", {
23
- class: l([t(m)(), `${t(u)(t(f))}`, t(c)])
25
+ return (e, b) => (l(), n("div", {
26
+ class: r([t(u)(), `${t(c)(g.value)}`, t(d)])
24
27
  }, [
25
- r("div", {
26
- class: l(t(i)("prefix"))
28
+ i("div", {
29
+ class: r(t(s)("prefix"))
27
30
  }, [
28
- e.$slots.prefix ? n(e.$slots, "prefix", { key: 0 }) : (o(), a(y, { key: 1 }, [
29
- r("span", null, v(e.title), 1),
30
- e.helpMessage ? (o(), C(t($), {
31
+ e.$slots.prefix ? p(e.$slots, "prefix", { key: 0 }) : (l(), n(C, { key: 1 }, [
32
+ i("span", null, k(e.title), 1),
33
+ e.helpMessage ? (l(), M(t($), {
31
34
  key: 0,
32
35
  title: e.helpMessage,
33
36
  placement: e.placement,
34
37
  trigger: e.trigger
35
38
  }, {
36
39
  default: I(() => [
37
- M(t(N), {
38
- style: S(d.value)
40
+ S(t(N), {
41
+ style: T(h.value)
39
42
  }, null, 8, ["style"])
40
43
  ]),
41
44
  _: 1
42
- }, 8, ["title", "placement", "trigger"])) : k("", !0)
45
+ }, 8, ["title", "placement", "trigger"])) : v("", !0)
43
46
  ], 64))
44
47
  ], 2),
45
- r("div", {
46
- class: l(t(i)("suffix"))
48
+ i("div", {
49
+ class: r(t(s)("suffix"))
47
50
  }, [
48
- n(e.$slots, "suffix")
51
+ p(e.$slots, "suffix")
49
52
  ], 2)
50
53
  ], 2));
51
54
  }
@@ -1,3 +1,4 @@
1
+ import { UiModeType } from '../../config-provider';
1
2
  /**
2
3
  * ApTitle Props 属性类型声明
3
4
  */
@@ -22,4 +23,5 @@ export interface ApTitleProps {
22
23
  * 气泡触发行为 默认hover
23
24
  */
24
25
  trigger?: 'hover' | 'focus' | 'click' | 'contextmenu';
26
+ uiMode?: UiModeType;
25
27
  }
@@ -1,5 +1,3 @@
1
1
  export * from './usePageListApTable';
2
- export * from './useTableRefresh';
3
2
  export * from './usePageListApGrid';
4
- export * from './useGridRefresh';
5
3
  export * from './usePageListAgGrid';
@@ -1,12 +1,8 @@
1
1
  import { usePageListApTable as o } from "./usePageListApTable.mjs";
2
- import { useTableRefresh as t } from "./useTableRefresh.mjs";
3
- import { usePageListApGrid as p } from "./usePageListApGrid.mjs";
4
- import { useGridRefresh as a } from "./useGridRefresh.mjs";
5
- import { usePageListAgGrid as u } from "./usePageListAgGrid.mjs";
2
+ import { usePageListApGrid as t } from "./usePageListApGrid.mjs";
3
+ import { usePageListAgGrid as p } from "./usePageListAgGrid.mjs";
6
4
  export {
7
- a as useGridRefresh,
8
- u as usePageListAgGrid,
9
- p as usePageListApGrid,
10
- o as usePageListApTable,
11
- t as useTableRefresh
5
+ p as usePageListAgGrid,
6
+ t as usePageListApGrid,
7
+ o as usePageListApTable
12
8
  };
@@ -1,4 +1,3 @@
1
- import { UseTableRefreshOption } from '..';
2
1
  import { ApGridExpose, ApGridProps } from '../../ap-grid';
3
2
  export interface UsePageListApGrid extends ApGridProps {
4
3
  /** 是否显示默认的行选择配置
@@ -18,7 +17,7 @@ export interface UsePageListApGrid extends ApGridProps {
18
17
  /**
19
18
  * 表格刷新相关
20
19
  */
21
- tableRefresh?: boolean | Omit<UseTableRefreshOption, 'apTableRef'>;
20
+ tableRefresh?: boolean | (() => boolean);
22
21
  /** 是否需要在deactivated的时候清空数据
23
22
  * @default true
24
23
  */
@@ -1,75 +1,71 @@
1
- import "../index.mjs";
2
- import { merge as i, cloneDeep as F } from "lodash-unified";
1
+ import { isFunction as F, merge as l, cloneDeep as w } from "lodash-unified";
3
2
  import { ref as R } from "vue";
4
- import { useKeepAliveFlag as w } from "./useKeepAliveFlag.mjs";
5
- import { useTableRefresh as V } from "./useTableRefresh.mjs";
6
- function W(a) {
3
+ import { useKeepAliveFlag as V } from "./useKeepAliveFlag.mjs";
4
+ function B(u) {
7
5
  const r = R(null), {
8
- isShowRowSelection: c = !0,
6
+ isShowRowSelection: d = !0,
9
7
  clearSelectionOnRequest: f = !0,
10
8
  transformSearchFormValues: o,
11
- api: s,
12
- tableRefresh: d = !0,
13
- virtual: m,
14
- clearDataOnDeactivated: p = !0,
15
- ...h
16
- } = a || {};
17
- let l = null;
18
- const n = () => {
9
+ api: a,
10
+ tableRefresh: s = !0,
11
+ virtual: p,
12
+ clearDataOnDeactivated: m = !0,
13
+ ...v
14
+ } = u || {};
15
+ let n = null;
16
+ const c = () => {
19
17
  r.value?.rowSelection?.clearAll();
20
- };
21
- V({
22
- ...b(d),
23
- apTableRef: r
24
- });
25
- const u = () => {
18
+ }, i = () => {
26
19
  r.value?.submitWith(!0);
27
- }, v = () => {
20
+ }, S = () => {
28
21
  r.value?.reset();
29
- }, { isDeactivated: S } = w({
30
- afterDeactivated: u
22
+ }, { isDeactivated: h } = V({
23
+ afterActivated() {
24
+ (F(s) ? s() : s) && i();
25
+ },
26
+ afterDeactivated: i
31
27
  });
32
- return [i(
28
+ return [l(
33
29
  {
34
30
  // scroll,tableLayout,columnResizable设置表格可拖动
35
31
  scroll: { x: "100%", y: "100%" },
36
32
  columnResizable: !0,
37
- request: s ? async (e) => {
38
- if (S() && p)
33
+ request: a ? async (e) => {
34
+ if (h() && m)
39
35
  return {
40
36
  data: [],
41
37
  total: 0
42
38
  };
43
- l = e.sort;
39
+ n = e.sort;
44
40
  const t = o ? o(e) : e;
45
- if (!s) throw new Error("api is not defined");
46
- const { records: g, total: A } = await s(t);
47
- return f && n(), {
41
+ if (!a) throw new Error("api is not defined");
42
+ const { records: g, total: A } = await a(t);
43
+ return f && c(), {
48
44
  data: g,
49
45
  total: A
50
46
  };
51
47
  } : void 0,
52
- rowSelection: c ? {
48
+ rowSelection: d ? {
53
49
  fixed: "left",
54
50
  columnWidth: 38
55
51
  } : void 0,
56
52
  ref(e) {
57
53
  r.value = e;
58
54
  },
59
- virtual: i(
55
+ virtual: l(
60
56
  {
61
57
  oSize: 20,
62
58
  y: 20
63
59
  },
64
- m
60
+ p
65
61
  ),
66
62
  // 新UI规范,需要都添加分割线
67
63
  card: !0
68
64
  },
69
- h
65
+ v
70
66
  ), {
71
- reload: u,
72
- reset: v,
67
+ reload: i,
68
+ reset: S,
73
69
  getSearchFormValues: (e = !0) => {
74
70
  const t = r.value?.getSearchFormValues(!!e) || {};
75
71
  return o ? o(t) : t;
@@ -77,16 +73,11 @@ function W(a) {
77
73
  getApGridInstance: () => r.value,
78
74
  getSearchFormValuesAndSorted: (e = !0) => {
79
75
  const t = r.value?.getSearchFormValues(!!e) || {};
80
- return t.sort = l && F(l), o ? o(t) : t;
76
+ return t.sort = n && w(n), o ? o(t) : t;
81
77
  },
82
- clearSelection: n
78
+ clearSelection: c
83
79
  }];
84
80
  }
85
- function b(a) {
86
- return a === !0 ? {} : a === !1 ? {
87
- refreshBefore: () => !1
88
- } : a;
89
- }
90
81
  export {
91
- W as usePageListApGrid
82
+ B as usePageListApGrid
92
83
  };
@@ -1,5 +1,4 @@
1
1
  import { ApTableProps } from '../../';
2
- import { UseTableRefreshOption } from './useTableRefresh';
3
2
  import { Recordable } from '../../type';
4
3
  import { TableColumnsType } from '@aplus-frontend/antdv';
5
4
  import { InternalPagingType } from '../../ap-table/hooks/use-table-paging-ng';
@@ -22,7 +21,7 @@ export interface UsePageListApTable extends ApTableProps {
22
21
  /**
23
22
  * 表格刷新相关
24
23
  */
25
- tableRefresh?: boolean | Omit<UseTableRefreshOption, 'apTableRef'>;
24
+ tableRefresh?: boolean | (() => boolean);
26
25
  }
27
26
  /**
28
27
  * 集成了列表页面的ApTable的默认配置
@@ -1,29 +1,42 @@
1
- import { merge as d, cloneDeep as h } from "lodash-unified";
2
- import { ref as S } from "vue";
3
- import { useTableRefresh as b } from "./useTableRefresh.mjs";
4
- import { warning as g } from "../../utils/warning.mjs";
5
- function v(o) {
6
- return o === !0 ? {} : o === !1 ? {
7
- refreshBefore: () => !1
8
- } : o;
9
- }
10
- function O(o) {
11
- const r = S(null), {
12
- isShowRowSelection: u = !0,
13
- clearSelectionOnRequest: i = !0,
14
- transformSearchFormValues: a,
15
- api: s,
16
- tableRefresh: f = !1,
17
- ...m
18
- } = o || {};
1
+ import { isFunction as g, merge as v, cloneDeep as b } from "lodash-unified";
2
+ import { ref as A } from "vue";
3
+ import { warning as F } from "../../utils/warning.mjs";
4
+ import { useKeepAliveFlag as w } from "./useKeepAliveFlag.mjs";
5
+ function k(u) {
6
+ const r = A(null), {
7
+ isShowRowSelection: f = !0,
8
+ clearSelectionOnRequest: m = !0,
9
+ transformSearchFormValues: o,
10
+ api: a,
11
+ tableRefresh: s = !1,
12
+ ...p
13
+ } = u || {};
19
14
  let l = null;
20
15
  const c = () => {
21
16
  r.value?.rowSelection?.clearAll();
17
+ }, d = async (e) => {
18
+ l = e.sort;
19
+ const t = o ? o(e) : e;
20
+ try {
21
+ if (!a) throw new Error("api is not defined");
22
+ const { records: n, total: S } = await a(t);
23
+ return m && c(), {
24
+ data: n,
25
+ total: S
26
+ };
27
+ } catch (n) {
28
+ return F(!1, n), {
29
+ data: [],
30
+ total: 0
31
+ };
32
+ }
22
33
  };
23
- return b({
24
- ...v(f),
25
- apTableRef: r
26
- }), [d(
34
+ w({
35
+ afterActivated() {
36
+ (g(s) ? s() : s) && i();
37
+ }
38
+ });
39
+ const h = v(
27
40
  {
28
41
  // scroll,tableLayout,columnResizable设置表格可拖动
29
42
  scroll: { x: "100%", y: "100%" },
@@ -31,24 +44,8 @@ function O(o) {
31
44
  columnResizable: !0,
32
45
  // 表格header吸顶效果
33
46
  class: "ap-table--sticky",
34
- request: s ? async (e) => {
35
- l = e.sort;
36
- const t = a ? a(e) : e;
37
- try {
38
- if (!s) throw new Error("api is not defined");
39
- const { records: n, total: p } = await s(t);
40
- return i && c(), {
41
- data: n,
42
- total: p
43
- };
44
- } catch (n) {
45
- return g(!1, n), {
46
- data: [],
47
- total: 0
48
- };
49
- }
50
- } : void 0,
51
- rowSelection: u ? {
47
+ request: a ? d : void 0,
48
+ rowSelection: f ? {
52
49
  mode: "internal",
53
50
  fixed: "left",
54
51
  columnWidth: 50
@@ -59,26 +56,27 @@ function O(o) {
59
56
  // 新UI规范,需要都添加分割线
60
57
  card: !0
61
58
  },
62
- m
63
- ), {
64
- reload: () => {
65
- r.value?.submit();
66
- },
59
+ p
60
+ ), i = () => {
61
+ r.value?.submit();
62
+ };
63
+ return [h, {
64
+ reload: i,
67
65
  reset: () => {
68
66
  r.value?.reset();
69
67
  },
70
68
  getSearchFormValues: (e) => {
71
69
  const t = r.value?.getSearchFormValues(e) || {};
72
- return a ? a(t) : t;
70
+ return o ? o(t) : t;
73
71
  },
74
72
  getApTableInstance: () => r.value,
75
73
  getSearchFormValuesAndSorted: (e) => {
76
74
  const t = r.value?.getSearchFormValues(e) || {};
77
- return t.sort = l && h(l), a ? a(t) : t;
75
+ return t.sort = l && b(l), o ? o(t) : t;
78
76
  },
79
77
  clearSelection: c
80
78
  }];
81
79
  }
82
80
  export {
83
- O as usePageListApTable
81
+ k as usePageListApTable
84
82
  };
@@ -1,9 +1,9 @@
1
1
  import { ExtractPropTypes, PropType } from 'vue';
2
2
  import { LocaleType } from '../locale/interface';
3
- import { ApiType, ApUploadConfig, ApDescriptionsConfig, ValueTypeRenderConfig, downloadCenterTriggerConfig, ExportField, SearchFormGlobalConfig } from './constants';
3
+ import { ApiType, ApUploadConfig, ApDescriptionsConfig, ValueTypeRenderConfig, downloadCenterTriggerConfig, ExportField, SearchFormGlobalConfig, UiModeType } from './constants';
4
4
  import { ApGridProps } from '../ap-grid';
5
5
  import { AgGridProps } from '../ag-grid';
6
- import { ViewCacheOption } from '../business';
6
+ import { ApImageProps, ApTitleProps, ViewCacheOption } from '../business';
7
7
  import { FullToken } from '../design-token/interface';
8
8
  import { RecursivePartial } from '../type';
9
9
  import { default as __DTS_DEFAULT_0__ } from '@aplus-frontend/antdv/es/config-provider/renderEmpty';
@@ -14,6 +14,11 @@ import { ButtonSize } from '@aplus-frontend/antdv/es/button';
14
14
  import { ThemeConfig, InputConfig, PaginationConfig, FormConfig, SelectConfig, CascaderConfig, DatePickerConfig, RangePickerConfig, TreeSelectConfig, TextAreaConfig, InputNumberConfig, MentionsConfig, TimePickerConfig, CardConfig } from '@aplus-frontend/antdv/es/config-provider/context';
15
15
  type ApGridConfig = Pick<ApGridProps, 'rowSelection'>;
16
16
  type AgGridConfig = Pick<AgGridProps, 'rowSelection'>;
17
+ type ApProCardConfig = {
18
+ uiMode?: UiModeType;
19
+ };
20
+ type ApImageConfig = Pick<ApImageProps, 'uiMode'>;
21
+ type ApTitleConfig = Pick<ApTitleProps, 'uiMode'>;
17
22
  export declare const configProviderProps: () => {
18
23
  iconPrefixCls: StringConstructor;
19
24
  getTargetContainer: {
@@ -152,6 +157,15 @@ export declare const configProviderProps: () => {
152
157
  agGrid: {
153
158
  type: PropType<AgGridConfig>;
154
159
  };
160
+ apProCard: {
161
+ type: PropType<ApProCardConfig>;
162
+ };
163
+ apImage: {
164
+ type: PropType<ApImageConfig>;
165
+ };
166
+ apTitle: {
167
+ type: PropType<ApTitleConfig>;
168
+ };
155
169
  /**
156
170
  * @description aplus-ui的locale
157
171
  */
@@ -171,8 +185,11 @@ export declare const configProviderProps: () => {
171
185
  type: PropType<ApiType>;
172
186
  default: () => {};
173
187
  };
188
+ /**
189
+ * @deprecated 已废弃,请使用各自组件的uiMode属性
190
+ */
174
191
  uiMode: {
175
- type: PropType<"aplus" | "admin">;
192
+ type: PropType<UiModeType>;
176
193
  };
177
194
  apUpload: {
178
195
  type: PropType<ApUploadConfig>;
@@ -5,6 +5,15 @@ const t = () => ({
5
5
  },
6
6
  agGrid: {
7
7
  type: Object
8
+ },
9
+ apProCard: {
10
+ type: Object
11
+ },
12
+ apImage: {
13
+ type: Object
14
+ },
15
+ apTitle: {
16
+ type: Object
8
17
  }
9
18
  }), o = () => ({
10
19
  /**
@@ -26,6 +35,9 @@ const t = () => ({
26
35
  type: Object,
27
36
  default: () => ({})
28
37
  },
38
+ /**
39
+ * @deprecated 已废弃,请使用各自组件的uiMode属性
40
+ */
29
41
  uiMode: {
30
42
  type: String
31
43
  },