@aplus-frontend/ui 0.6.0-beta.1 → 0.6.0-beta.3

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 (116) hide show
  1. package/es/src/ap-button/ap-button.vue.mjs +1 -1
  2. package/es/src/ap-form/search-form/components/popover-sorter/index.vue2.mjs +39 -34
  3. package/es/src/ap-form/search-form/index.vue.mjs +1 -1
  4. package/es/src/ap-grid/editable/form-item.vue.mjs +23 -20
  5. package/es/src/ap-grid/editable/index.vue.mjs +3 -0
  6. package/es/src/ap-grid/index.vue.mjs +146 -136
  7. package/es/src/ap-grid/interface.d.ts +1 -1
  8. package/es/src/ap-grid/utils/table.mjs +32 -32
  9. package/es/src/ap-table/ap-table.vue2.mjs +206 -199
  10. package/es/src/ap-table/components/setting/tree-select/index.vue2.mjs +1 -1
  11. package/es/src/ap-tag/ap-tag.vue.d.ts +1 -0
  12. package/es/src/ap-tag/ap-tag.vue.mjs +18 -12
  13. package/es/src/ap-tag/interface.d.ts +4 -0
  14. package/es/src/business/ap-expand-alert/ApExpandAlert.vue2.mjs +11 -12
  15. package/es/src/business/ap-export-group/ApExportGroup.vue.d.ts +1 -0
  16. package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +108 -99
  17. package/es/src/business/ap-export-group/index.d.ts +3 -0
  18. package/es/src/business/ap-export-group/interface.d.ts +7 -2
  19. package/es/src/business/ap-table-modal/modal-title.vue2.mjs +2 -2
  20. package/es/src/business/ap-view/ap-view.vue2.mjs +72 -69
  21. package/es/src/business/ap-view/components/main-button-content.vue2.mjs +49 -43
  22. package/es/src/business/ap-view/interface.d.ts +4 -0
  23. package/es/src/business/hooks/usePageListApGrid.mjs +2 -4
  24. package/es/src/config-provider/css-var.mjs +2 -2
  25. package/es/src/locale/lang/en.mjs +1 -1
  26. package/es/src/locale/lang/zh-cn.mjs +1 -1
  27. package/lib/src/ap-button/ap-button.vue.js +1 -1
  28. package/lib/src/ap-form/search-form/components/popover-sorter/index.vue2.js +1 -1
  29. package/lib/src/ap-form/search-form/index.vue.js +1 -1
  30. package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
  31. package/lib/src/ap-grid/editable/index.vue.js +1 -1
  32. package/lib/src/ap-grid/index.vue.js +1 -1
  33. package/lib/src/ap-grid/interface.d.ts +1 -1
  34. package/lib/src/ap-grid/utils/table.js +1 -1
  35. package/lib/src/ap-table/ap-table.vue2.js +1 -1
  36. package/lib/src/ap-table/components/setting/tree-select/index.vue2.js +1 -1
  37. package/lib/src/ap-tag/ap-tag.vue.d.ts +1 -0
  38. package/lib/src/ap-tag/ap-tag.vue.js +1 -1
  39. package/lib/src/ap-tag/interface.d.ts +4 -0
  40. package/lib/src/business/ap-expand-alert/ApExpandAlert.vue2.js +1 -1
  41. package/lib/src/business/ap-export-group/ApExportGroup.vue.d.ts +1 -0
  42. package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
  43. package/lib/src/business/ap-export-group/index.d.ts +3 -0
  44. package/lib/src/business/ap-export-group/interface.d.ts +7 -2
  45. package/lib/src/business/ap-table-modal/modal-title.vue2.js +1 -1
  46. package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
  47. package/lib/src/business/ap-view/components/main-button-content.vue2.js +1 -1
  48. package/lib/src/business/ap-view/interface.d.ts +4 -0
  49. package/lib/src/business/hooks/usePageListApGrid.js +1 -1
  50. package/lib/src/config-provider/css-var.js +1 -1
  51. package/lib/src/locale/lang/en.js +1 -1
  52. package/lib/src/locale/lang/zh-cn.js +1 -1
  53. package/package.json +4 -4
  54. package/theme/antd-global-overwrite/admin/index.css +9 -25
  55. package/theme/antd-global-overwrite/admin/modal.css +6 -22
  56. package/theme/antd-global-overwrite/admin/modal.less +7 -22
  57. package/theme/antd-global-overwrite/admin/table.css +3 -3
  58. package/theme/antd-global-overwrite/admin/table.less +3 -3
  59. package/theme/antd-global-overwrite/aplus/index.css +9 -19
  60. package/theme/antd-global-overwrite/aplus/modal.css +6 -16
  61. package/theme/antd-global-overwrite/aplus/modal.less +7 -17
  62. package/theme/antd-global-overwrite/aplus/table.css +3 -3
  63. package/theme/antd-global-overwrite/aplus/table.less +3 -3
  64. package/theme/ap-appendix/ap-appendix.css +4 -2
  65. package/theme/ap-appendix/ap-appendix.less +4 -2
  66. package/theme/ap-attachment/ap-attachment.css +4 -4
  67. package/theme/ap-attachment/ap-attachment.less +4 -4
  68. package/theme/ap-batch-action/ap-batch-action.css +6 -3
  69. package/theme/ap-batch-action/ap-batch-action.less +6 -3
  70. package/theme/ap-descriptions/ap-descriptions.css +3 -5
  71. package/theme/ap-descriptions/ap-descriptions.less +3 -5
  72. package/theme/ap-download/ap-download.css +7 -10
  73. package/theme/ap-download/ap-download.less +8 -11
  74. package/theme/ap-expand-alert/ap-expand-alert.css +1 -1
  75. package/theme/ap-expand-alert/ap-expand-alert.less +3 -4
  76. package/theme/ap-form/ap-form-item.css +2 -2
  77. package/theme/ap-form/ap-form-item.less +2 -2
  78. package/theme/ap-form/index.css +5 -2
  79. package/theme/ap-form/search-form.css +5 -2
  80. package/theme/ap-form/search-form.less +3 -0
  81. package/theme/ap-grid/editable.less +3 -2
  82. package/theme/ap-grid/index.css +6 -3
  83. package/theme/ap-grid/index.less +6 -4
  84. package/theme/ap-ladder/ap-ladder.css +3 -3
  85. package/theme/ap-ladder/ap-ladder.less +3 -3
  86. package/theme/ap-select-layout/ap-select-layout.css +8 -8
  87. package/theme/ap-select-layout/ap-select-layout.less +8 -8
  88. package/theme/ap-status/ap-status.css +2 -3
  89. package/theme/ap-status/ap-status.less +2 -4
  90. package/theme/ap-summary/index.css +3 -3
  91. package/theme/ap-summary/index.less +3 -3
  92. package/theme/ap-table/ap-table-index.css +5 -5
  93. package/theme/ap-table/ap-table-index.less +5 -5
  94. package/theme/ap-table/ap-table-paragraph-ellipsis.less +1 -1
  95. package/theme/ap-table/ap-table.css +15 -14
  96. package/theme/ap-table/ap-table.less +2 -5
  97. package/theme/ap-table/setting/index.css +3 -3
  98. package/theme/ap-table/setting/modal.css +1 -2
  99. package/theme/ap-table/setting/modal.less +1 -2
  100. package/theme/ap-table/setting/select-group.css +2 -1
  101. package/theme/ap-table/setting/select-group.less +2 -1
  102. package/theme/ap-table-modal/index.css +15 -14
  103. package/theme/ap-tag/ap-tag-group.less +2 -2
  104. package/theme/ap-tag/ap-tag.css +24 -15
  105. package/theme/ap-tag/ap-tag.less +37 -24
  106. package/theme/ap-title/ap-title.css +2 -2
  107. package/theme/ap-title/ap-title.less +2 -2
  108. package/theme/ap-upload/index.css +3 -3
  109. package/theme/ap-upload/multiple-file.css +1 -1
  110. package/theme/ap-upload/multiple-file.less +1 -1
  111. package/theme/ap-upload/picture.css +2 -2
  112. package/theme/ap-upload/picture.less +2 -2
  113. package/theme/ap-view/ap-view.css +4 -0
  114. package/theme/ap-view/ap-view.less +4 -0
  115. package/theme/editable-table/index.css +5 -2
  116. package/theme/index.css +90 -77
@@ -1,19 +1,20 @@
1
- import { defineComponent as Y, computed as N, ref as p, createVNode as g, watch as x, createBlock as $, openBlock as j, unref as w, normalizeClass as E, withCtx as z, createElementVNode as M } from "vue";
1
+ import { defineComponent as I, computed as _, ref as p, createVNode as g, watch as x, createBlock as S, openBlock as Y, unref as w, mergeProps as j, withCtx as z, createElementVNode as M, normalizeClass as W } from "vue";
2
2
  import "../../config-provider/index.mjs";
3
- import W from "./icons/line-down.vue.mjs";
4
- import { ApBatchActionGroup as q } from "../ap-batch-action-group/index.mjs";
3
+ import q from "./icons/line-down.vue.mjs";
4
+ import { ApBatchActionGroup as H } from "../ap-batch-action-group/index.mjs";
5
5
  import "./components/main-button-content.vue.mjs";
6
6
  import "./components/menu-list-content.vue.mjs";
7
- import { useViewProvide as H } from "./hooks/use-view-provide.mjs";
8
- import { useInjectApTable as J } from "../../ap-table/context.mjs";
7
+ import { useViewProvide as J } from "./hooks/use-view-provide.mjs";
8
+ import { useInjectApTable as Q } from "../../ap-table/context.mjs";
9
9
  import { SYSTEM_VIEW_KEY as y } from "./utils/enum.mjs";
10
- import { isValid as Q } from "@aplus-frontend/utils";
11
- import { useGlobalConfig as X } from "../../config-provider/hooks/use-global-config.mjs";
12
- import { useNamespace as Z } from "../../config-provider/hooks/use-namespace.mjs";
13
- import { useLocale as h } from "../../config-provider/hooks/use-locale.mjs";
14
- import U from "./components/main-button-content.vue2.mjs";
15
- import R from "./components/menu-list-content.vue2.mjs";
16
- const ve = /* @__PURE__ */ Y({
10
+ import { isValid as X } from "@aplus-frontend/utils";
11
+ import { useGlobalConfig as Z } from "../../config-provider/hooks/use-global-config.mjs";
12
+ import { useNamespace as h } from "../../config-provider/hooks/use-namespace.mjs";
13
+ import { useLocale as U } from "../../config-provider/hooks/use-locale.mjs";
14
+ import R from "./components/main-button-content.vue2.mjs";
15
+ import C from "./components/menu-list-content.vue2.mjs";
16
+ const pe = /* @__PURE__ */ I({
17
+ name: "ApView",
17
18
  __name: "ap-view",
18
19
  props: {
19
20
  tableKey: {},
@@ -23,56 +24,56 @@ const ve = /* @__PURE__ */ Y({
23
24
  default: 20
24
25
  }
25
26
  },
26
- setup(F) {
27
- const f = F, L = X("viewCacheOption"), {
28
- b: d
29
- } = Z("ap-view"), {
30
- t: T
31
- } = h(), V = N(() => ({
27
+ setup(A) {
28
+ const f = A, E = Z("viewCacheOption"), {
29
+ b: V
30
+ } = h("ap-view"), {
31
+ t: F
32
+ } = U(), d = _(() => ({
32
33
  viewKey: y,
33
- viewName: T("ap.apView.systemView")
34
+ viewName: F("ap.apView.systemView")
34
35
  })), {
35
- getSearchFormValues: k,
36
- setSearchFormValues: A,
37
- submit: B,
38
- reset: G
39
- } = J(), P = p(!1), K = p(!1), r = p("system"), D = {
36
+ getSearchFormValues: L,
37
+ setSearchFormValues: P,
38
+ submit: T,
39
+ reset: k
40
+ } = Q(), B = p(!1), K = p(!1), r = p("system"), G = {
40
41
  dropdownType: "dropdown",
41
- content: g(U, {
42
+ content: g(R, {
42
43
  maxViewNum: f.maxViewNum
43
44
  }, null)
44
- }, s = p([V.value]), I = N(() => s.value.map((t) => ({
45
- id: t.viewKey,
46
- content: g(R, {
47
- view: t
45
+ }, s = p([d.value]), $ = _(() => s.value.map((e) => ({
46
+ id: e.viewKey,
47
+ content: g(C, {
48
+ view: e
48
49
  }, null)
49
50
  }))), n = {
50
- getSearchFormValues: k,
51
- setSearchFormValues: A,
52
- submit: B,
53
- reset: G,
51
+ getSearchFormValues: L,
52
+ setSearchFormValues: P,
53
+ submit: T,
54
+ reset: k,
54
55
  ...f.saveDataSource
55
- }, e = {
56
- ...L.value,
56
+ }, t = {
57
+ ...E.value,
57
58
  ...f.viewCacheOption
58
- }, _ = () => {
59
- const t = s.value.find((a) => a.isDefault);
60
- return (t == null ? void 0 : t.viewKey) ?? y;
59
+ }, N = () => {
60
+ const e = s.value.find((a) => a.isDefault);
61
+ return (e == null ? void 0 : e.viewKey) ?? y;
61
62
  }, c = {
62
- getViewList: async (t) => {
63
+ getViewList: async (e) => {
63
64
  var a;
64
65
  try {
65
66
  const {
66
67
  tableKey: o
67
- } = t, i = await ((a = e == null ? void 0 : e.getViewList) == null ? void 0 : a.call(e, {
68
+ } = e, i = await ((a = t == null ? void 0 : t.getViewList) == null ? void 0 : a.call(t, {
68
69
  tableKey: o
69
70
  }));
70
- return s.value = [V.value, ...i ?? []], r.value = _(), s.value;
71
+ return s.value = [d.value, ...i ?? []], r.value = N(), s.value;
71
72
  } catch {
72
- return s.value = [V.value], r.value = y, s.value;
73
+ return s.value = [d.value], r.value = y, s.value;
73
74
  }
74
75
  },
75
- addView: async (t) => {
76
+ addView: async (e) => {
76
77
  var u;
77
78
  const {
78
79
  tableKey: a,
@@ -80,8 +81,8 @@ const ve = /* @__PURE__ */ Y({
80
81
  viewName: i,
81
82
  isDefault: l,
82
83
  viewConfig: m
83
- } = t;
84
- await ((u = e == null ? void 0 : e.addView) == null ? void 0 : u.call(e, {
84
+ } = e;
85
+ await ((u = t == null ? void 0 : t.addView) == null ? void 0 : u.call(t, {
85
86
  tableKey: a,
86
87
  viewKey: o,
87
88
  viewName: i,
@@ -97,7 +98,7 @@ const ve = /* @__PURE__ */ Y({
97
98
  viewConfig: m
98
99
  }], r.value = o;
99
100
  },
100
- changeView: async (t) => {
101
+ changeView: async (e) => {
101
102
  var v;
102
103
  const {
103
104
  tableKey: a,
@@ -105,8 +106,8 @@ const ve = /* @__PURE__ */ Y({
105
106
  viewName: i,
106
107
  isDefault: l,
107
108
  viewConfig: m
108
- } = t;
109
- await ((v = e == null ? void 0 : e.changeView) == null ? void 0 : v.call(e, {
109
+ } = e;
110
+ await ((v = t == null ? void 0 : t.changeView) == null ? void 0 : v.call(t, {
110
111
  tableKey: a,
111
112
  viewKey: o,
112
113
  viewName: i,
@@ -119,56 +120,58 @@ const ve = /* @__PURE__ */ Y({
119
120
  const u = s.value.find((b) => b.viewKey === o);
120
121
  u && (u.viewName = i, u.isDefault = l, u.viewConfig = m), r.value = o;
121
122
  },
122
- removeView: async (t) => {
123
+ removeView: async (e) => {
123
124
  var i;
124
125
  const {
125
126
  tableKey: a,
126
127
  viewKey: o
127
- } = t;
128
- await ((i = e == null ? void 0 : e.removeView) == null ? void 0 : i.call(e, {
128
+ } = e;
129
+ await ((i = t == null ? void 0 : t.removeView) == null ? void 0 : i.call(t, {
129
130
  tableKey: a,
130
131
  viewKey: o
131
- })), s.value = s.value.filter((l) => l.viewKey !== o), o === r.value && (r.value = _());
132
+ })), s.value = s.value.filter((l) => l.viewKey !== o), o === r.value && (r.value = N());
132
133
  }
133
- }, S = {
134
+ }, D = {
134
135
  tableKey: f.tableKey,
135
136
  currentViewKey: r,
136
- popoverOpen: P,
137
+ popoverOpen: B,
137
138
  menuOpen: K,
138
139
  viewList: s,
139
140
  viewListCRUD: c,
140
141
  saveDataSource: n
141
142
  };
142
- return x(r, (t) => {
143
- const a = s.value.find((o) => o.viewKey === t);
143
+ return x(r, (e) => {
144
+ const a = s.value.find((o) => o.viewKey === e);
144
145
  a && setTimeout(() => {
145
146
  var o, i, l, m;
146
147
  a.viewKey === y ? (o = n.reset) == null || o.call(n) : ((l = n.setSearchFormValues) == null || l.call(n, ((i = a.viewConfig) == null ? void 0 : i.searchForm) ?? {}), (m = n.submit) == null || m.call(n));
147
148
  });
148
- }), H(S), x(() => f.tableKey, (t) => {
149
+ }), J(D), x(() => f.tableKey, (e) => {
149
150
  var a;
150
- Q(t) && ((a = c == null ? void 0 : c.getViewList) == null || a.call(c, {
151
- tableKey: t
151
+ X(e) && ((a = c == null ? void 0 : c.getViewList) == null || a.call(c, {
152
+ tableKey: e
152
153
  }));
153
154
  }, {
154
155
  immediate: !0
155
- }), (t, a) => (j(), $(w(q), {
156
+ }), (e, a) => (Y(), S(w(H), j({
157
+ ...e.$attrs
158
+ }, {
156
159
  open: K.value,
157
160
  "onUpdate:open": a[0] || (a[0] = (o) => K.value = o),
158
- class: E([w(d)()]),
159
- "button-props": D,
160
- "menu-list": I.value,
161
- "overlay-class-name": [w(d)("overlay")],
161
+ class: [w(V)()],
162
+ "button-props": G,
163
+ "menu-list": $.value,
164
+ "overlay-class-name": [w(V)("overlay")],
162
165
  trigger: "click",
163
166
  placement: "bottom"
164
- }, {
167
+ }), {
165
168
  icon: z(() => [M("div", {
166
- class: E([w(d)("icon")])
167
- }, [g(W)], 2)]),
169
+ class: W([w(V)("icon")])
170
+ }, [g(q)], 2)]),
168
171
  _: 1
169
- }, 8, ["open", "class", "menu-list", "overlay-class-name"]));
172
+ }, 16, ["open", "class", "menu-list", "overlay-class-name"]));
170
173
  }
171
174
  });
172
175
  export {
173
- ve as default
176
+ pe as default
174
177
  };
@@ -1,49 +1,55 @@
1
- import { defineComponent as $, ref as I, computed as T, watch as Y, createBlock as D, openBlock as E, unref as e, withCtx as t, createElementVNode as c, normalizeClass as m, createVNode as a, createSlots as K, toDisplayString as p, createTextVNode as v } from "vue";
2
- import { Popover as j, Tooltip as q, Space as x, Checkbox as B } from "@aplus-frontend/antdv";
1
+ import { defineComponent as T, ref as $, computed as I, watch as Y, createBlock as E, openBlock as K, unref as e, withCtx as t, createElementVNode as c, normalizeClass as r, createVNode as a, createSlots as j, toDisplayString as p, createTextVNode as w } from "vue";
2
+ import { Popover as q, Tooltip as B, Space as x, Checkbox as D } from "@aplus-frontend/antdv";
3
3
  import "../../../config-provider/index.mjs";
4
4
  import L from "../icons/line-eye.vue.mjs";
5
5
  import "../../../ap-form/ap-form.vue.mjs";
6
6
  import { ApField as M } from "../../../ap-field/index.mjs";
7
7
  import "../../../ap-button/index.mjs";
8
8
  import O from "dayjs";
9
- import { useViewInject as S } from "../hooks/use-view-provide.mjs";
10
- import { generateUniqueKey as A } from "../utils/uuid.mjs";
11
- import { useLocale as P } from "../../../config-provider/hooks/use-locale.mjs";
12
- import { useNamespace as R } from "../../../config-provider/hooks/use-namespace.mjs";
13
- import w from "../../../ap-form/ap-form.vue2.mjs";
9
+ import { useViewInject as A } from "../hooks/use-view-provide.mjs";
10
+ import { generateUniqueKey as P } from "../utils/uuid.mjs";
11
+ import { cloneDeep as R } from "lodash-unified";
12
+ import { useLocale as U } from "../../../config-provider/hooks/use-locale.mjs";
13
+ import { useNamespace as G } from "../../../config-provider/hooks/use-namespace.mjs";
14
+ import v from "../../../ap-form/ap-form.vue2.mjs";
14
15
  import N from "../../../ap-button/ap-button.vue.mjs";
15
- const le = /* @__PURE__ */ $({
16
+ const pe = /* @__PURE__ */ T({
16
17
  __name: "main-button-content",
17
18
  props: {
18
19
  maxViewNum: {}
19
20
  },
20
21
  setup(b) {
21
- const u = b, { t: o } = P(), { b: n } = R("ap-view"), _ = I(), { tableKey: F, popoverOpen: r, viewList: f, saveDataSource: s, viewListCRUD: V } = S(), y = T({
22
- get: () => r.value && f.value.length < u.maxViewNum + 1,
23
- set: (l) => {
24
- f.value.length < u.maxViewNum + 1 && (r.value = l);
22
+ const u = b, { t: o } = U(), { b: l } = G("ap-view"), _ = $(), { tableKey: F, popoverOpen: s, viewList: f, saveDataSource: n, viewListCRUD: V } = A(), h = I({
23
+ get: () => s.value && f.value.length < u.maxViewNum + 1,
24
+ set: (m) => {
25
+ f.value.length < u.maxViewNum + 1 && (s.value = m);
25
26
  }
26
27
  });
27
- Y(r, (l) => {
28
+ Y(s, (m) => {
28
29
  var i;
29
- l && ((i = _.value) == null || i.resetFields());
30
+ m && ((i = _.value) == null || i.resetFields());
30
31
  });
31
- const k = async (l) => {
32
- var g, h;
33
- const { viewName: i, isDefault: d } = l, C = A(), z = {
34
- searchForm: ((g = s == null ? void 0 : s.getSearchFormValues) == null ? void 0 : g.call(s)) ?? {}
32
+ const k = async (m) => {
33
+ var y, g;
34
+ const { viewName: i, isDefault: d } = m, C = P(), z = {
35
+ searchForm: R(
36
+ (y = n == null ? void 0 : n.getSearchFormValues) == null ? void 0 : y.call(
37
+ n,
38
+ !!(n != null && n.searchFormTransform)
39
+ )
40
+ )
35
41
  };
36
- await ((h = V.addView) == null ? void 0 : h.call(V, {
42
+ await ((g = V.addView) == null ? void 0 : g.call(V, {
37
43
  tableKey: F,
38
44
  viewKey: C,
39
45
  viewName: i,
40
46
  isDefault: d,
41
47
  viewConfig: z
42
- })), r.value = !1;
48
+ })), s.value = !1;
43
49
  };
44
- return (l, i) => (E(), D(e(j), {
45
- open: y.value,
46
- "onUpdate:open": i[1] || (i[1] = (d) => y.value = d),
50
+ return (m, i) => (K(), E(e(q), {
51
+ open: h.value,
52
+ "onUpdate:open": i[1] || (i[1] = (d) => h.value = d),
47
53
  placement: "bottom",
48
54
  trigger: "click",
49
55
  arrow: !1,
@@ -53,9 +59,9 @@ const le = /* @__PURE__ */ $({
53
59
  }, {
54
60
  content: t(() => [
55
61
  c("div", {
56
- class: m([e(n)("main-content-popover")])
62
+ class: r([e(l)("main-content-popover")])
57
63
  }, [
58
- a(w, {
64
+ a(v, {
59
65
  ref_key: "formRef",
60
66
  ref: _,
61
67
  layout: "vertical",
@@ -67,19 +73,19 @@ const le = /* @__PURE__ */ $({
67
73
  }, {
68
74
  default: t(() => [
69
75
  c("div", {
70
- class: m([e(n)("main-content-popover-title-content")])
76
+ class: r([e(l)("main-content-popover-title-content")])
71
77
  }, [
72
78
  c("div", {
73
- class: m([e(n)("main-content-popover-title-content-title")])
79
+ class: r([e(l)("main-content-popover-title-content-title")])
74
80
  }, p(e(o)("ap.apView.saveNewView")), 3),
75
- a(w.FormItem, {
81
+ a(v.FormItem, {
76
82
  name: "isDefault",
77
83
  "value-prop-name": "checked"
78
84
  }, {
79
85
  default: t(() => [
80
- a(e(B), null, {
86
+ a(e(D), null, {
81
87
  default: t(() => [
82
- v(p(e(o)("ap.apView.setDefault")), 1)
88
+ w(p(e(o)("ap.apView.setDefault")), 1)
83
89
  ]),
84
90
  _: 1
85
91
  })
@@ -87,7 +93,7 @@ const le = /* @__PURE__ */ $({
87
93
  _: 1
88
94
  })
89
95
  ], 2),
90
- a(w.FormItem, {
96
+ a(v.FormItem, {
91
97
  label: e(o)("ap.apView.viewName"),
92
98
  name: "viewName",
93
99
  rules: [{ required: !0, message: e(o)("ap.apView.notEmpty") }]
@@ -101,18 +107,18 @@ const le = /* @__PURE__ */ $({
101
107
  ]),
102
108
  _: 1
103
109
  }, 8, ["label", "rules"]),
104
- a(w.FormItem, {
105
- class: m([e(n)("main-content-popover-btn")])
110
+ a(v.FormItem, {
111
+ class: r([e(l)("main-content-popover-btn")])
106
112
  }, {
107
113
  default: t(() => [
108
114
  a(e(x), { size: 8 }, {
109
115
  default: t(() => [
110
116
  a(e(N), {
111
117
  size: "small",
112
- onClick: i[0] || (i[0] = (d) => r.value = !1)
118
+ onClick: i[0] || (i[0] = (d) => s.value = !1)
113
119
  }, {
114
120
  default: t(() => [
115
- v(p(e(o)("ap.apView.cancel")), 1)
121
+ w(p(e(o)("ap.apView.cancel")), 1)
116
122
  ]),
117
123
  _: 1
118
124
  }),
@@ -122,7 +128,7 @@ const le = /* @__PURE__ */ $({
122
128
  "html-type": "submit"
123
129
  }, {
124
130
  default: t(() => [
125
- v(p(e(o)("ap.apView.save")), 1)
131
+ w(p(e(o)("ap.apView.save")), 1)
126
132
  ]),
127
133
  _: 1
128
134
  })
@@ -139,17 +145,17 @@ const le = /* @__PURE__ */ $({
139
145
  ]),
140
146
  default: t(() => [
141
147
  c("div", {
142
- class: m({
143
- [e(n)("main-content")]: !0,
144
- [e(n)("main-content-disabled")]: e(f).length >= u.maxViewNum + 1
148
+ class: r({
149
+ [e(l)("main-content")]: !0,
150
+ [e(l)("main-content-disabled")]: e(f).length >= u.maxViewNum + 1
145
151
  })
146
152
  }, [
147
- a(e(q), { placement: "bottom" }, K({
153
+ a(e(B), { placement: "bottom" }, j({
148
154
  default: t(() => [
149
155
  a(e(x), { size: 4 }, {
150
156
  default: t(() => [
151
157
  a(L, {
152
- class: m([e(n)("icon")])
158
+ class: r([e(l)("icon")])
153
159
  }, null, 8, ["class"]),
154
160
  c("div", null, p(e(o)("ap.apView.saveView")), 1)
155
161
  ]),
@@ -161,7 +167,7 @@ const le = /* @__PURE__ */ $({
161
167
  e(f).length >= u.maxViewNum + 1 ? {
162
168
  name: "title",
163
169
  fn: t(() => [
164
- v(p(e(o)("ap.apView.maxTip")), 1)
170
+ w(p(e(o)("ap.apView.maxTip")), 1)
165
171
  ]),
166
172
  key: "0"
167
173
  } : void 0
@@ -173,5 +179,5 @@ const le = /* @__PURE__ */ $({
173
179
  }
174
180
  });
175
181
  export {
176
- le as default
182
+ pe as default
177
183
  };
@@ -4,6 +4,10 @@ export interface SaveDataSource {
4
4
  setSearchFormValues?: (values: Partial<Recordable>) => void;
5
5
  submit?: () => void;
6
6
  reset?: () => void;
7
+ /**
8
+ * 是否转换搜索表单,默认为 false
9
+ */
10
+ searchFormTransform?: boolean;
7
11
  }
8
12
  export interface ViewCacheOption {
9
13
  getViewList?: (option: {
@@ -4,7 +4,7 @@ import { merge as h, cloneDeep as S } from "lodash-unified";
4
4
  import { ref as g } from "vue";
5
5
  import { useGlobalConfig as v } from "../../config-provider/hooks/use-global-config.mjs";
6
6
  import { useTableRefresh as b } from "./useTableRefresh.mjs";
7
- function k(s) {
7
+ function z(s) {
8
8
  const o = g(null), {
9
9
  isShowRowSelection: c = !0,
10
10
  clearSelectionOnRequest: i = !0,
@@ -26,8 +26,6 @@ function k(s) {
26
26
  // scroll,tableLayout,columnResizable设置表格可拖动
27
27
  scroll: { x: "100%", y: "100%" },
28
28
  columnResizable: !0,
29
- // 表格分页器吸底效果
30
- sticky: !0,
31
29
  request: n ? async (e) => {
32
30
  l = e.sort;
33
31
  const r = a ? a(e) : e;
@@ -86,5 +84,5 @@ function R(s) {
86
84
  } : s;
87
85
  }
88
86
  export {
89
- k as usePageListApGrid
87
+ z as usePageListApGrid
90
88
  };
@@ -68,7 +68,7 @@ const b = {
68
68
  },
69
69
  "ap-descriptions": {
70
70
  item: {
71
- "padding-bottom": "24px",
71
+ "padding-bottom": "16px",
72
72
  "label-width": "auto"
73
73
  },
74
74
  "last-row-item": {
@@ -195,7 +195,7 @@ const b = {
195
195
  },
196
196
  "ap-descriptions": {
197
197
  item: {
198
- "padding-bottom": "24px",
198
+ "padding-bottom": "16px",
199
199
  "label-width": "auto"
200
200
  },
201
201
  "last-row-item": {
@@ -94,7 +94,7 @@ const a = {
94
94
  exportError: "Export error",
95
95
  exportSelected: "Export selected",
96
96
  exportAll: "Export all",
97
- export: "Export Excel",
97
+ export: "Export",
98
98
  exportSuccess: "The task has been submitted,please go to the download center to check the progress"
99
99
  },
100
100
  apBatchAction: {
@@ -103,7 +103,7 @@ const a = {
103
103
  exportError: "导出失败",
104
104
  exportSelected: "导出所选",
105
105
  exportAll: "导出全部",
106
- export: "导出Excel",
106
+ export: "导出",
107
107
  exportSuccess: "任务已提交,前往下载中心查看进度"
108
108
  },
109
109
  apBatchAction: {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),W=require("@aplus-frontend/antdv"),z=require("@aplus-frontend/utils");require("../config-provider/index.js");const L=require("lodash-unified"),f=require("./utils/index.js"),q=require("../config-provider/hooks/use-namespace.js"),M=require("../config-provider/hooks/use-global-config.js"),_=88,w=300,T=e.defineComponent({__name:"ap-button",props:{prefixCls:{},htmlType:{},shape:{},size:{},loading:{type:[Boolean,Object],default:void 0},disabled:{type:Boolean},ghost:{type:Boolean},block:{type:Boolean},danger:{type:Boolean},icon:{},href:{},target:{},title:{},onMousedown:{},type:{default:"default"},borderLinkColor:{},minWidth:{type:[Boolean,Number,String],default:!1},lazy:{type:[Boolean,Number],default:!0},onClick:{}},setup(y){const m=e.useSlots(),t=y,l={aplus:"#0070FF",admin:"#34b77c"},{b:a}=q.useNamespace("ap-action-button"),b=M.useGlobalConfig("uiMode"),n=e.ref(!1),v=e.computed(()=>t.borderLinkColor||l[b.value]||l.aplus),i=e.computed(()=>t.type==="borderLink"?v.value:void 0),u=e.computed(()=>f.transferOpacityColor(i.value)),h=e.computed(()=>t.minWidth===!0?`${_}px`:typeof t.minWidth=="number"?`${t.minWidth}px`:typeof t.minWidth=="string"?t.minWidth:void 0),g=e.computed(()=>(t.type==="borderLink"?"default":t.type)||"default"),s=e.computed(()=>t.loading??n.value??!1),c=e.computed(()=>t.lazy===!0?w:typeof t.lazy=="number"&&t.lazy>=0?t.lazy:0);function C(){const o=L.omit(t,["type","borderLinkColor","minWidth","onClick","loading"]);return o?{...o,type:g.value,onclick:k}:{}}async function k(){if(s.value)return;const o=f.isAsynchronous(t.onClick),d=Date.now();try{o&&(n.value=!0,await o)}finally{if(o){const r=Date.now()-d;r<c.value&&await z.wait(c.value-r),n.value=!1}}}return(o,d)=>(e.openBlock(),e.createBlock(e.unref(W.Button),e.mergeProps({class:{[e.unref(a)()]:!0,[`${e.unref(a)()}-border-link`]:u.value}},{...o.$attrs,...C()},{style:{color:i.value,minWidth:h.value,"--button-border-color":u.value},loading:s.value}),e.createSlots({_:2},[e.renderList(m,(r,p)=>({name:p,fn:e.withCtx(B=>[e.renderSlot(o.$slots,p,e.normalizeProps(e.guardReactiveProps(B||{})))])}))]),1040,["class","style","loading"]))}});exports.default=T;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),W=require("@aplus-frontend/antdv"),z=require("@aplus-frontend/utils");require("../config-provider/index.js");const L=require("lodash-unified"),f=require("./utils/index.js"),q=require("../config-provider/hooks/use-namespace.js"),M=require("../config-provider/hooks/use-global-config.js"),_=72,w=300,T=e.defineComponent({__name:"ap-button",props:{prefixCls:{},htmlType:{},shape:{},size:{},loading:{type:[Boolean,Object],default:void 0},disabled:{type:Boolean},ghost:{type:Boolean},block:{type:Boolean},danger:{type:Boolean},icon:{},href:{},target:{},title:{},onMousedown:{},type:{default:"default"},borderLinkColor:{},minWidth:{type:[Boolean,Number,String],default:!1},lazy:{type:[Boolean,Number],default:!0},onClick:{}},setup(y){const m=e.useSlots(),t=y,l={aplus:"#0070FF",admin:"#34b77c"},{b:a}=q.useNamespace("ap-action-button"),b=M.useGlobalConfig("uiMode"),n=e.ref(!1),v=e.computed(()=>t.borderLinkColor||l[b.value]||l.aplus),i=e.computed(()=>t.type==="borderLink"?v.value:void 0),u=e.computed(()=>f.transferOpacityColor(i.value)),h=e.computed(()=>t.minWidth===!0?`${_}px`:typeof t.minWidth=="number"?`${t.minWidth}px`:typeof t.minWidth=="string"?t.minWidth:void 0),g=e.computed(()=>(t.type==="borderLink"?"default":t.type)||"default"),s=e.computed(()=>t.loading??n.value??!1),c=e.computed(()=>t.lazy===!0?w:typeof t.lazy=="number"&&t.lazy>=0?t.lazy:0);function C(){const o=L.omit(t,["type","borderLinkColor","minWidth","onClick","loading"]);return o?{...o,type:g.value,onclick:k}:{}}async function k(){if(s.value)return;const o=f.isAsynchronous(t.onClick),d=Date.now();try{o&&(n.value=!0,await o)}finally{if(o){const r=Date.now()-d;r<c.value&&await z.wait(c.value-r),n.value=!1}}}return(o,d)=>(e.openBlock(),e.createBlock(e.unref(W.Button),e.mergeProps({class:{[e.unref(a)()]:!0,[`${e.unref(a)()}-border-link`]:u.value}},{...o.$attrs,...C()},{style:{color:i.value,minWidth:h.value,"--button-border-color":u.value},loading:s.value}),e.createSlots({_:2},[e.renderList(m,(r,p)=>({name:p,fn:e.withCtx(B=>[e.renderSlot(o.$slots,p,e.normalizeProps(e.guardReactiveProps(B||{})))])}))]),1040,["class","style","loading"]))}});exports.default=T;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),t=require("@aplus-frontend/antdv"),h=require("@aplus-frontend/icon");require("../../../../config-provider/index.js");const N=require("vuedraggable");require("./sortable-item.vue.js");const p=require("../../../../config-provider/hooks/use-namespace.js"),V=require("../../../../config-provider/hooks/use-locale.js"),_=require("./sortable-item.vue2.js"),y=e.defineComponent({name:"ApFormSearchFormPopoverSorter",__name:"index",props:{children:{},onClickConfirm:{type:Function}},setup(f){const i=f,o=e.ref(i.children);let d=[...i.children];const{e:a}=p.useNamespace("ap-form-search-form"),{b:r}=p.useNamespace("search-form-sorter"),{t:n}=V.useLocale(),s=e.ref(!1);function m(u){return u.closest(".ant-form")||document.body}function C(){s.value=!1,console.log(e.unref(o)),i.onClickConfirm(e.unref(o))}function v(){o.value=[...d]}return(u,l)=>(e.openBlock(),e.createBlock(e.unref(t.Popover),{open:s.value,"onUpdate:open":l[1]||(l[1]=c=>s.value=c),"overlay-class-name":e.unref(a)("popover"),trigger:"click",placement:"bottom",mask:"","mask-style":{backgroundColor:"transparent"},"get-popup-container":m},{content:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(r)("header"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(r)("header-title"))},e.toDisplayString(e.unref(n)("ap.apForm.search.sorterTitle")),3),e.createVNode(e.unref(t.Flex),{justify:"space-between"},{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass(e.unref(r)("header-desc"))},e.toDisplayString(e.unref(n)("ap.apForm.search.sorterDesc")),3),e.createElementVNode("div",{class:e.normalizeClass(e.unref(r)("header-action-wrapper")),onClick:v},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(r)("header-reset-btn"))},e.toDisplayString(e.unref(n)("ap.apForm.search.sorterReset")),3)],2)]),_:1})],2),e.createElementVNode("div",{class:e.normalizeClass([e.unref(a)("popover-content"),e.unref(r)("content")])},[e.createVNode(e.unref(N),{list:o.value,class:e.normalizeClass(e.unref(r)("sorter-wrapper"))},{item:e.withCtx(({element:c})=>[e.createVNode(_.default,{item:c},null,8,["item"])]),_:1},8,["list","class"])],2),e.createVNode(e.unref(t.Divider),{style:{margin:"0"}}),e.createElementVNode("div",{class:e.normalizeClass(e.unref(a)("popover-footer"))},[e.createVNode(e.unref(t.Flex),{justify:"end"},{default:e.withCtx(()=>[e.createVNode(e.unref(t.Button),{onClick:l[0]||(l[0]=c=>s.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("ap.common.cancelText")),1)]),_:1}),e.createVNode(e.unref(t.Button),{class:e.normalizeClass(e.unref(a)("popover-footer-confirm-btn")),type:"primary",onClick:C},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("ap.apForm.search.sorterConfirmBtn")),1)]),_:1},8,["class"])]),_:1})],2)]),default:e.withCtx(()=>[e.createVNode(e.unref(t.Tooltip),{title:e.unref(n)("ap.apForm.search.sorterTitle"),placement:"top"},{default:e.withCtx(()=>[e.createVNode(e.unref(t.Button),null,{icon:e.withCtx(()=>[e.createVNode(e.unref(h.IconApLayoutOutlined))]),_:1})]),_:1},8,["title"])]),_:1},8,["open","overlay-class-name"]))}});exports.default=y;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),t=require("@aplus-frontend/antdv"),N=require("@aplus-frontend/icon");require("../../../../config-provider/index.js");const g=require("vuedraggable");require("./sortable-item.vue.js");const y=require("../../../item-group/helper.js"),p=require("../../../../config-provider/hooks/use-namespace.js"),V=require("../../../../config-provider/hooks/use-locale.js"),_=require("./sortable-item.vue2.js"),x=e.defineComponent({name:"ApFormSearchFormPopoverSorter",__name:"index",props:{children:{},onClickConfirm:{type:Function}},setup(f){const u=f,o=e.ref(u.children);let m=[...u.children];const{e:a}=p.useNamespace("ap-form-search-form"),{b:r}=p.useNamespace("search-form-sorter"),{t:n}=V.useLocale(),s=e.ref(!1);function d(l){return l.closest(".ant-form")||document.body}function C(){s.value=!1,console.log(e.unref(o)),u.onClickConfirm(e.unref(o))}function h(){o.value=[...m]}function v(l){return y.getStringName(l.props.name)}return(l,c)=>(e.openBlock(),e.createBlock(e.unref(t.Popover),{open:s.value,"onUpdate:open":c[1]||(c[1]=i=>s.value=i),"overlay-class-name":e.unref(a)("popover"),trigger:"click",placement:"bottom",mask:"","mask-style":{backgroundColor:"transparent"},"get-popup-container":d},{content:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(r)("header"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(r)("header-title"))},e.toDisplayString(e.unref(n)("ap.apForm.search.sorterTitle")),3),e.createVNode(e.unref(t.Flex),{justify:"space-between"},{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass(e.unref(r)("header-desc"))},e.toDisplayString(e.unref(n)("ap.apForm.search.sorterDesc")),3),e.createElementVNode("div",{class:e.normalizeClass(e.unref(r)("header-action-wrapper")),onClick:h},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(r)("header-reset-btn"))},e.toDisplayString(e.unref(n)("ap.apForm.search.sorterReset")),3)],2)]),_:1})],2),e.createElementVNode("div",{class:e.normalizeClass([e.unref(a)("popover-content"),e.unref(r)("content")])},[e.createVNode(e.unref(g),{list:o.value,class:e.normalizeClass(e.unref(r)("sorter-wrapper")),"item-key":v},{item:e.withCtx(({element:i})=>[e.createVNode(_.default,{item:i},null,8,["item"])]),_:1},8,["list","class"])],2),e.createVNode(e.unref(t.Divider),{style:{margin:"0"}}),e.createElementVNode("div",{class:e.normalizeClass(e.unref(a)("popover-footer"))},[e.createVNode(e.unref(t.Flex),{justify:"end"},{default:e.withCtx(()=>[e.createVNode(e.unref(t.Button),{onClick:c[0]||(c[0]=i=>s.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("ap.common.cancelText")),1)]),_:1}),e.createVNode(e.unref(t.Button),{class:e.normalizeClass(e.unref(a)("popover-footer-confirm-btn")),type:"primary",onClick:C},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("ap.apForm.search.sorterConfirmBtn")),1)]),_:1},8,["class"])]),_:1})],2)]),default:e.withCtx(()=>[e.createVNode(e.unref(t.Tooltip),{title:e.unref(n)("ap.apForm.search.sorterTitle"),placement:"top"},{default:e.withCtx(()=>[e.createVNode(e.unref(t.Button),null,{icon:e.withCtx(()=>[e.createVNode(e.unref(N.IconApLayoutOutlined))]),_:1})]),_:1},8,["title"])]),_:1},8,["open","overlay-class-name"]))}});exports.default=x;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("@aplus-frontend/antdv");require("../ap-form.vue.js");require("../item/index.vue2.js");const q=require("../item-group/helper.js");require("../../config-provider/index.js");const C=require("lodash-unified"),A=require("../../utils/index.js"),N=require("./utils.js");require("./components/popover-filter.vue.js");const $=require("./hooks/use-count-per-row.js");require("./components/popover-sorter/index.vue.js");const z=require("../../config-provider/hooks/use-namespace.js"),H=require("../../config-provider/hooks/use-locale.js"),P=require("../item/index.vue.js"),G=require("./components/popover-filter.vue2.js"),J=require("./components/popover-sorter/index.vue2.js"),K=require("../ap-form.vue2.js");function Q(p){return typeof p=="function"||Object.prototype.toString.call(p)==="[object Object]"&&!e.isVNode(p)}const u=24,X=e.defineComponent({name:"ApFormSearchForm",__name:"index",props:{layout:{default:"horizontal"},labelCol:{},wrapperCol:{},colon:{type:Boolean,default:!0},labelAlign:{default:"right"},labelWrap:{type:Boolean},prefixCls:{},requiredMark:{},hideRequiredMark:{type:Boolean,default:!1},rules:{},validateMessages:{},validateOnRuleChange:{type:Boolean,default:!0},scrollToFirstError:{},onSubmit:{},name:{},validateTrigger:{default:"change"},size:{},disabled:{type:Boolean},onFieldsChange:{},onFinish:{},onFinishFailed:{},onValidate:{},initialValues:{},onValuesChange:{},syncToUrl:{type:[Boolean,Function]},syncToUrlPriority:{type:Boolean},collapse:{type:Boolean,default:void 0},defaultCollapse:{type:Boolean,default:!0},"onUpdate:collapse":{},searchText:{},resetText:{},onReset:{},customReset:{type:Boolean,default:!1},extraInAction:{type:Boolean,default:!1},forceExpand:{type:Boolean,default:!1},countPerRow:{default:4},submitLoading:{type:Boolean},maxRows:{default:2},sortable:{type:Boolean,default:!0}},setup(p,{expose:T}){var b;const s=e.useSlots(),n=p,{b:f}=z.useNamespace("ap-form-search-form"),{t:w}=H.useLocale(),I=$.useCountPerRow(n),h=e.ref();function B(){var a;const t=(a=h.value)==null?void 0:a.getFieldsValueTransformed(!0);N.execFunc(n.onSubmit,t)}function E(){var t,a;n.customReset||(a=(t=h.value)==null?void 0:t.resetFields)==null||a.call(t),N.execFunc(n.onReset)}const O=t=>A.isDef(t)?(C.isArray(t)?t:[t]).join(""):Date.now();let F=[];const c=e.shallowRef(q.genRealChildren(s.default())),i=e.shallowRef((b=s.extra)==null?void 0:b.call(s)),R=e.computed(()=>Math.floor(u/e.unref(I)));e.watch(()=>s.default(),t=>{F=c.value,c.value=N.diffFormItem(F,q.genRealChildren(t))}),e.watch(()=>{var t;return(t=s.extra)==null?void 0:t.call(s)},t=>{i.value=t});const o=e.computed(()=>{const t=c.value,a=[],r=[],x=[],m=e.unref(R);let _=0,g=0;const U=u*n.maxRows-m*(e.unref(i)&&!n.extraInAction?2:1);t.forEach((v,W)=>{const d=v.props;if(C.isBoolean(d.hidden)?!!d.hidden:A.isDef(d.hidden))a.push(v);else{let y=d.span||m;const k={node:v,span:y,key:`ApFormSearchFormItem-${W}-${O(d.name)}-${d._signal}`},V=u-_%u;V<y&&(y+=V),_+=y,_>U?r.push(k):(g=_,x.push(k))}});const S=u-(g+m)%u,D=g%u<m,M=S<m?u:S;return{hideNode:e.createVNode(e.Fragment,null,[a]),nodes:x,collapseNodes:r,extraSpan:M,lastRowOnlyIncludeActionAndExtra:D}});function j(t){c.value=[...t]}const L=e.computed(()=>{let t;const a=e.createVNode(l.Col,{span:e.unref(R),key:"actionWrapper"},{default:()=>[e.createVNode(P.default,null,{default:()=>[e.createVNode(l.Flex,{wrap:"wrap",justify:o.value.lastRowOnlyIncludeActionAndExtra&&!(e.unref(i)&&n.extraInAction)?"flex-end":"space-between"},{default:()=>[e.createVNode(l.Flex,{gap:8,wrap:"wrap"},{default:()=>[e.createVNode("div",{class:f("column-setting-trigger-wrapper")},[o.value.collapseNodes.length?e.createVNode(G.default,{onSubmit:B,config:o.value.collapseNodes,submitLoading:n.submitLoading},null):null,n.sortable&&c.value.length?e.createVNode(J.default,{children:c.value,onClickConfirm:j},null):null]),e.createVNode(l.Button,{type:"primary",onClick:B,loading:n.submitLoading,htmlType:"submit",class:f("action-btn")},{default:()=>[n.searchText||w("ap.apForm.search.search")]}),e.createVNode(l.Button,{onClick:E,type:"text",class:[f("action-btn"),f("action-btn-reset")]},{default:()=>[n.resetText||w("ap.apForm.search.reset")]})]}),n.extraInAction?e.unref(i):null]})]})]}),r=!n.extraInAction&&e.unref(i)?e.createVNode(l.Col,{span:o.value.extraSpan,key:"extraNode"},{default:()=>[e.createVNode(P.default,null,{default:()=>[e.createVNode(l.Flex,{justify:o.value.extraSpan===u||o.value.lastRowOnlyIncludeActionAndExtra?"start":"flex-end"},Q(t=e.unref(i))?t:{default:()=>[t]})]})]}):null,x=e.createVNode(l.Col,{span:o.value.extraSpan},null);return o.value.lastRowOnlyIncludeActionAndExtra?e.createVNode(e.Fragment,null,[r||x,a]):e.createVNode(e.Fragment,null,[a,r])});return T({apForm:e.computed(()=>e.unref(h))}),(t,a)=>(e.openBlock(),e.createBlock(K.default,e.mergeProps({ref_key:"apForm",ref:h,class:e.unref(f)()},e.unref(C.omit)(n,["collapse","defaultCollapse","onUpdate:collapse","searchText","resetText","onSubmit","onReset","extraInAction","forceExpand","countPerRow"])),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value.hideNode))),e.createVNode(e.unref(l.Row),{gutter:16},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value.nodes,r=>(e.openBlock(),e.createBlock(e.unref(l.Col),{key:r.key,span:r.span},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.node)))]),_:2},1032,["span"]))),128)),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(L.value)))]),_:1})]),_:1},16,["class"]))}});exports.default=X;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("@aplus-frontend/antdv");require("../ap-form.vue.js");require("../item/index.vue2.js");const q=require("../item-group/helper.js");require("../../config-provider/index.js");const C=require("lodash-unified"),A=require("../../utils/index.js"),N=require("./utils.js");require("./components/popover-filter.vue.js");const $=require("./hooks/use-count-per-row.js");require("./components/popover-sorter/index.vue.js");const z=require("../../config-provider/hooks/use-namespace.js"),H=require("../../config-provider/hooks/use-locale.js"),P=require("../item/index.vue.js"),G=require("./components/popover-filter.vue2.js"),J=require("./components/popover-sorter/index.vue2.js"),K=require("../ap-form.vue2.js");function Q(p){return typeof p=="function"||Object.prototype.toString.call(p)==="[object Object]"&&!e.isVNode(p)}const u=24,X=e.defineComponent({name:"ApFormSearchForm",__name:"index",props:{layout:{default:"horizontal"},labelCol:{},wrapperCol:{},colon:{type:Boolean,default:!0},labelAlign:{default:"right"},labelWrap:{type:Boolean},prefixCls:{},requiredMark:{},hideRequiredMark:{type:Boolean,default:!1},rules:{},validateMessages:{},validateOnRuleChange:{type:Boolean,default:!0},scrollToFirstError:{},onSubmit:{},name:{},validateTrigger:{default:"change"},size:{},disabled:{type:Boolean},onFieldsChange:{},onFinish:{},onFinishFailed:{},onValidate:{},initialValues:{},onValuesChange:{},syncToUrl:{type:[Boolean,Function]},syncToUrlPriority:{type:Boolean},collapse:{type:Boolean,default:void 0},defaultCollapse:{type:Boolean,default:!0},"onUpdate:collapse":{},searchText:{},resetText:{},onReset:{},customReset:{type:Boolean,default:!1},extraInAction:{type:Boolean,default:!1},forceExpand:{type:Boolean,default:!1},countPerRow:{default:4},submitLoading:{type:Boolean},maxRows:{default:2},sortable:{type:Boolean,default:!0}},setup(p,{expose:T}){var b;const s=e.useSlots(),n=p,{b:f}=z.useNamespace("ap-form-search-form"),{t:w}=H.useLocale(),I=$.useCountPerRow(n),h=e.ref();function B(){var a;const t=(a=h.value)==null?void 0:a.getFieldsValueTransformed(!0);N.execFunc(n.onSubmit,t)}function E(){var t,a;n.customReset||(a=(t=h.value)==null?void 0:t.resetFields)==null||a.call(t),N.execFunc(n.onReset)}const O=t=>A.isDef(t)?(C.isArray(t)?t:[t]).join(""):Date.now();let F=[];const c=e.shallowRef(q.genRealChildren(s.default())),i=e.shallowRef((b=s.extra)==null?void 0:b.call(s)),R=e.computed(()=>Math.floor(u/e.unref(I)));e.watch(()=>s.default(),t=>{F=c.value,c.value=N.diffFormItem(F,q.genRealChildren(t))}),e.watch(()=>{var t;return(t=s.extra)==null?void 0:t.call(s)},t=>{i.value=t});const o=e.computed(()=>{const t=c.value,a=[],r=[],x=[],m=e.unref(R);let _=0,g=0;const U=u*n.maxRows-m*(e.unref(i)&&!n.extraInAction?2:1);t.forEach((v,W)=>{const d=v.props;if(C.isBoolean(d.hidden)?!!d.hidden:A.isDef(d.hidden))a.push(v);else{let y=d.span||m;const k={node:v,span:y,key:`ApFormSearchFormItem-${W}-${O(d.name)}-${d._signal}`},V=u-_%u;V<y&&(y+=V),_+=y,_>U?r.push(k):(g=_,x.push(k))}});const S=u-(g+m)%u,D=g%u<m,M=S<m?u:S;return{hideNode:e.createVNode(e.Fragment,null,[a]),nodes:x,collapseNodes:r,extraSpan:M,lastRowOnlyIncludeActionAndExtra:D}});function j(t){c.value=[...t]}const L=e.computed(()=>{let t;const a=e.createVNode(l.Col,{span:e.unref(R),key:"actionWrapper"},{default:()=>[e.createVNode(P.default,null,{default:()=>[e.createVNode(l.Flex,{wrap:"wrap",justify:o.value.lastRowOnlyIncludeActionAndExtra&&!(e.unref(i)&&n.extraInAction)?"flex-end":"space-between"},{default:()=>[e.createVNode(l.Flex,{gap:8,wrap:"wrap"},{default:()=>[e.createVNode("div",{class:f("column-setting-trigger-wrapper")},[o.value.collapseNodes.length?e.createVNode(G.default,{onSubmit:B,config:o.value.collapseNodes,submitLoading:n.submitLoading},null):null,n.sortable&&c.value.length?e.createVNode(J.default,{children:c.value,onClickConfirm:j},null):null]),e.createVNode(l.Button,{type:"primary",onClick:B,loading:n.submitLoading,htmlType:"submit",class:f("action-btn")},{default:()=>[n.searchText||w("ap.apForm.search.search")]}),e.createVNode(l.Button,{onClick:E,type:"text",class:[f("action-btn"),f("action-btn-reset")]},{default:()=>[n.resetText||w("ap.apForm.search.reset")]})]}),n.extraInAction?e.unref(i):null]})]})]}),r=!n.extraInAction&&e.unref(i)?e.createVNode(l.Col,{span:o.value.extraSpan,key:"extraNode"},{default:()=>[e.createVNode(P.default,null,{default:()=>[e.createVNode(l.Flex,{justify:o.value.extraSpan===u||o.value.lastRowOnlyIncludeActionAndExtra?"start":"flex-end"},Q(t=e.unref(i))?t:{default:()=>[t]})]})]}):null,x=e.createVNode(l.Col,{span:o.value.extraSpan},null);return o.value.lastRowOnlyIncludeActionAndExtra?e.createVNode(e.Fragment,null,[r||x,a]):e.createVNode(e.Fragment,null,[a,r])});return T({apForm:e.computed(()=>e.unref(h))}),(t,a)=>(e.openBlock(),e.createBlock(K.default,e.mergeProps({ref_key:"apForm",ref:h,class:e.unref(f)()},e.unref(C.omit)(n,["collapse","defaultCollapse","onUpdate:collapse","searchText","resetText","onSubmit","onReset","extraInAction","forceExpand","countPerRow"])),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value.hideNode))),e.createVNode(e.unref(l.Row),{gutter:8},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value.nodes,r=>(e.openBlock(),e.createBlock(e.unref(l.Col),{key:r.key,span:r.span},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.node)))]),_:2},1032,["span"]))),128)),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(L.value)))]),_:1})]),_:1},16,["class"]))}});exports.default=X;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),g=require("../../ap-form/index.js"),d=require("lodash-unified");require("../../config-provider/index.js");const h=require("../../utils/index.js"),j=require("../hooks/use-editable-columns.js");require("../index.vue2.js");const E=require("../../ap-form/context.js"),O=require("../../config-provider/hooks/use-namespace.js"),P=require("../../config-provider/hooks/use-global-config.js"),z=require("../index.vue.js"),A=o.defineComponent({name:"EditableGrid",__name:"form-item",props:{dropdownPrefixCls:{},bordered:{type:Boolean,default:!1},locale:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{default:()=>["ascend","descend"]},showSorterTooltip:{type:[Boolean,Object],default:!0},prefixCls:{},tableLayout:{default:"fixed"},title:{},id:{},showHeader:{type:Boolean,default:!0},components:{},customRow:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean],default:!1},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean,default:!1},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean,default:!1},indentSize:{default:15},expandIconColumnIndex:{},showExpandColumn:{type:Boolean,default:!0},expandedRowClassName:{},childrenColumnName:{default:"children"},rowExpandable:{},sticky:{type:[Boolean,Object],default:!1},transformCellText:{},rowClassName:{},stripe:{type:Boolean},headerRowClassName:{},footerRowClassName:{},cellClassName:{},headerCellClassName:{},footerCellClassName:{},rowStyle:{},headerRowStyle:{},footerRowStyle:{},cellStyle:{},headerCellStyle:{},footerCellStyle:{},height:{},minHeight:{},maxHeight:{},mergeCells:{},mergeFooterItems:{},cellConfig:{},loading:{type:Boolean,default:void 0},loadingConfig:{},headerCellConfig:{},footerCellConfig:{},rowSelection:{type:Boolean,default:void 0},onLoadingChange:{},onShownColumnsChange:{},pagination:{type:[Boolean,Object],default:!1},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},size:{default:"mini"},adaptive:{type:Boolean,default:!1},columnResizable:{type:[Boolean,Object],default:!1},rowKey:{default:"key"},footer:{},virtual:{type:[Boolean,Object],default:void 0},expandable:{},value:{},columns:{},defaultValue:{},"onUpdate:value":{},onChange:{},maxLength:{},onFieldChange:{},label:{},name:{},formItem:{default:()=>({})}},setup(C,{expose:y}){const b=o.useSlots(),n=C,{b:w}=O.useNamespace("editable-grid");function x(e,t){return d.isArray(t)?t.reduce((u,l)=>u==null?void 0:u[l],e):e==null?void 0:e[t]}const{internalInstance:a,model:R}=E.useInjectForm(),p=o.toRef(n.name),i=o.ref(x(o.unref(R),p.value)||[]),S=g.ApForm.useWatch(p);o.watch(()=>S.value,async e=>{var t;await o.nextTick(),i.value=e,(t=n.onChange)==null||t.call(n,e)},{deep:!0});const m=o.ref(),B=P.useGlobalConfig("valueTypeMap"),v=j.useGetEditableColumns(n,B);function N(e,t){var s;const u=((s=o.unref(i))==null?void 0:s.length)||0;if(h.isDef(n.maxLength)&&u>=n.maxLength)return;const l={...e||{}};a==null||a.setFieldValue(n.name,l,!0,(f,r)=>{if(!f[r]){f[r]=[l];return}d.isUndefined(t)?f[r].push(l):f[r].splice(t,0,l)})}function _(e,t="suffix"){var f;const u=((f=o.unref(i))==null?void 0:f.length)||0,l=d.isNumber(e)?e:e.length;if(h.isDef(n.maxLength)&&u+l>n.maxLength)return;const s=d.isNumber(e)?new Array(e).fill(0).map(()=>({})):d.cloneDeep(e);a==null||a.setFieldValue(n.name,s,!0,(r,c)=>{if(!r[c]){r[c]=[...s];return}t==="suffix"?r[c].push(...s):r[c].unshift(...s)})}function F(e){const t=new Set(d.isNumber(e)?[e]:e);a==null||a.setFieldValue(n.name,void 0,!0,(u,l)=>{u[l]=u[l].filter((s,f)=>!t.has(f))})}function q(){return o.unref(i)}function D(e){var t;return(t=o.unref(i))==null?void 0:t[e]}function k(e,t,u=!0){a==null||a.setFieldValue(n.name,void 0,!0,(l,s)=>{if(!(!l[s]||!l[s][e])){if(!u){const f=Object.keys(l[s][e]);for(const r of f)r!==n.rowKey&&delete l[s][e][r]}Object.assign(l[s][e],{...t})}})}function L(e){a==null||a.setFieldValue(n.name,e)}function T(e){var u;const t=e==="end"?i.value.length-1:e;(u=m.value)==null||u.scrollToRow(t)}function V(){var e;(e=a==null?void 0:a.setFieldValue)==null||e.call(a,n.name,[])}return y({add:N,remove:F,getRowData:D,getRowsData:q,setRowData:k,addMultiple:_,scrollTo:T,setTableData:L,clear:V}),(e,t)=>(o.openBlock(),o.createBlock(o.unref(g.ApForm).FormItem,o.mergeProps(e.formItem,{name:e.name,label:e.label}),{default:o.withCtx(()=>[o.createVNode(z.default,o.mergeProps(o.unref(d.omit)(n,["name","value","onUpdate:value","maxLength","onChange","defaultValue","formItem"]),{ref_key:"tableRef",ref:m,class:o.unref(w)(),columns:o.unref(v),"data-source":i.value,"search-form":!1}),o.createSlots({_:2},[o.renderList(b,(u,l)=>({name:l,fn:o.withCtx(s=>[o.renderSlot(e.$slots,l,o.normalizeProps(o.guardReactiveProps(s||{})))])}))]),1040,["class","columns","data-source"])]),_:3},16,["name","label"]))}});exports.default=A;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),g=require("../../ap-form/index.js"),i=require("lodash-unified");require("../../config-provider/index.js");const h=require("../../utils/index.js"),j=require("../hooks/use-editable-columns.js");require("../index.vue2.js");const E=require("../../ap-form/context.js"),O=require("../../config-provider/hooks/use-namespace.js"),P=require("../../config-provider/hooks/use-global-config.js"),z=require("../index.vue.js"),A=o.defineComponent({name:"EditableGrid",__name:"form-item",props:{dropdownPrefixCls:{},bordered:{type:Boolean,default:!1},locale:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{default:()=>["ascend","descend"]},showSorterTooltip:{type:[Boolean,Object],default:!0},prefixCls:{},tableLayout:{default:"fixed"},title:{},id:{},showHeader:{type:Boolean,default:!0},components:{},customRow:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean],default:!1},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean,default:!1},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean,default:!1},indentSize:{default:15},expandIconColumnIndex:{},showExpandColumn:{type:Boolean,default:!0},expandedRowClassName:{},childrenColumnName:{default:"children"},rowExpandable:{},sticky:{type:[Boolean,Object],default:!1},transformCellText:{},rowClassName:{},stripe:{type:Boolean},headerRowClassName:{},footerRowClassName:{},cellClassName:{},headerCellClassName:{},footerCellClassName:{},rowStyle:{},headerRowStyle:{},footerRowStyle:{},cellStyle:{},headerCellStyle:{},footerCellStyle:{},height:{},minHeight:{},maxHeight:{},mergeCells:{},mergeFooterItems:{},cellConfig:{},loading:{type:Boolean,default:void 0},loadingConfig:{},headerCellConfig:{},footerCellConfig:{},round:{type:Boolean},rowSelection:{type:Boolean,default:void 0},onLoadingChange:{},onShownColumnsChange:{},pagination:{type:[Boolean,Object],default:!1},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},size:{default:"mini"},adaptive:{type:Boolean,default:!1},columnResizable:{type:[Boolean,Object],default:!1},rowKey:{default:"key"},footer:{},virtual:{type:[Boolean,Object],default:void 0},expandable:{},value:{},columns:{},defaultValue:{},"onUpdate:value":{},onChange:{},maxLength:{},onFieldChange:{},label:{},name:{},formItem:{default:()=>({})}},setup(y,{expose:C}){const b=o.useSlots(),n=y,{b:w}=O.useNamespace("editable-grid");function x(e,t){return i.isArray(t)?t.reduce((u,l)=>u==null?void 0:u[l],e):e==null?void 0:e[t]}const{internalInstance:a,model:R}=E.useInjectForm(),p=o.toRef(n.name),d=o.ref(x(o.unref(R),p.value)||[]),S=g.ApForm.useWatch(p);o.watch(()=>S.value,async e=>{var t;await o.nextTick(),d.value=e,(t=n.onChange)==null||t.call(n,e)},{deep:!0});const m=o.ref(),B=P.useGlobalConfig("valueTypeMap"),v=j.useGetEditableColumns(n,B);function N(e,t){var s;const u=((s=o.unref(d))==null?void 0:s.length)||0;if(h.isDef(n.maxLength)&&u>=n.maxLength)return;const l={...e||{}};a==null||a.setFieldValue(n.name,l,!0,(f,r)=>{if(!f[r]){f[r]=[l];return}i.isUndefined(t)?f[r].push(l):f[r].splice(t,0,l)})}function _(e,t="suffix"){var f;const u=((f=o.unref(d))==null?void 0:f.length)||0,l=i.isNumber(e)?e:e.length;if(h.isDef(n.maxLength)&&u+l>n.maxLength)return;const s=i.isNumber(e)?new Array(e).fill(0).map(()=>({})):i.cloneDeep(e);a==null||a.setFieldValue(n.name,s,!0,(r,c)=>{if(!r[c]){r[c]=[...s];return}t==="suffix"?r[c].push(...s):r[c].unshift(...s)})}function F(e){const t=new Set(i.isNumber(e)?[e]:e);a==null||a.setFieldValue(n.name,void 0,!0,(u,l)=>{u[l]=u[l].filter((s,f)=>!t.has(f))})}function q(){return o.unref(d)}function D(e){var t;return(t=o.unref(d))==null?void 0:t[e]}function k(e,t,u=!0){a==null||a.setFieldValue(n.name,void 0,!0,(l,s)=>{if(!(!l[s]||!l[s][e])){if(!u){const f=Object.keys(l[s][e]);for(const r of f)r!==n.rowKey&&delete l[s][e][r]}Object.assign(l[s][e],{...t})}})}function L(e){a==null||a.setFieldValue(n.name,e)}function T(e){var u;const t=e==="end"?d.value.length-1:e;(u=m.value)==null||u.scrollToRow(t)}function V(){var e;(e=a==null?void 0:a.setFieldValue)==null||e.call(a,n.name,[])}return C({add:N,remove:F,getRowData:D,getRowsData:q,setRowData:k,addMultiple:_,scrollTo:T,setTableData:L,clear:V}),(e,t)=>(o.openBlock(),o.createBlock(o.unref(g.ApForm).FormItem,o.mergeProps(e.formItem,{name:e.name,label:e.label}),{default:o.withCtx(()=>[o.createVNode(z.default,o.mergeProps(o.unref(i.omit)(n,["name","value","onUpdate:value","maxLength","onChange","defaultValue","formItem"]),{ref_key:"tableRef",ref:m,class:o.unref(w)(),columns:o.unref(v),"data-source":d.value,"search-form":!1}),o.createSlots({_:2},[o.renderList(b,(u,l)=>({name:l,fn:o.withCtx(s=>[o.renderSlot(e.$slots,l,o.normalizeProps(o.guardReactiveProps(s||{})))])}))]),1040,["class","columns","data-source"])]),_:3},16,["name","label"]))}});exports.default=A;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),g=require("../../ap-form/index.js"),c=require("lodash-unified");require("../../config-provider/index.js");require("../../hooks/index.js");const C=require("../../utils/index.js"),z=require("../hooks/use-editable-columns.js");require("../index.vue2.js");const I=require("../../config-provider/hooks/use-namespace.js"),G=require("../../hooks/useControllableValue.js"),H=require("../../config-provider/hooks/use-global-config.js"),K=require("../index.vue.js"),U=t.defineComponent({name:"EditableGrid",__name:"index",props:{dropdownPrefixCls:{},bordered:{type:Boolean,default:!1},locale:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{default:()=>["ascend","descend"]},showSorterTooltip:{type:[Boolean,Object],default:!0},prefixCls:{},tableLayout:{default:"fixed"},title:{},id:{},showHeader:{type:Boolean,default:!0},components:{},customRow:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean],default:!1},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean,default:!1},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean,default:!1},indentSize:{default:15},expandIconColumnIndex:{},showExpandColumn:{type:Boolean,default:!0},expandedRowClassName:{},childrenColumnName:{default:"children"},rowExpandable:{},sticky:{type:[Boolean,Object],default:!1},transformCellText:{},rowClassName:{},stripe:{type:Boolean},headerRowClassName:{},footerRowClassName:{},cellClassName:{},headerCellClassName:{},footerCellClassName:{},rowStyle:{},headerRowStyle:{},footerRowStyle:{},cellStyle:{},headerCellStyle:{},footerCellStyle:{},height:{},minHeight:{},maxHeight:{},mergeCells:{},mergeFooterItems:{},cellConfig:{},loading:{type:Boolean,default:void 0},loadingConfig:{},headerCellConfig:{},footerCellConfig:{},rowSelection:{type:Boolean,default:void 0},onLoadingChange:{},onShownColumnsChange:{},pagination:{type:[Boolean,Object],default:!1},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},size:{default:"mini"},adaptive:{type:Boolean,default:!1},columnResizable:{type:[Boolean,Object],default:!1},rowKey:{default:"key"},footer:{},virtual:{type:[Boolean,Object],default:void 0},expandable:{},value:{},columns:{},defaultValue:{},"onUpdate:value":{},onChange:{},maxLength:{},name:{default:"ap-editable-table-inner-name"},onFieldChange:{}},emits:["update:value"],setup(w,{expose:v,emit:x}){const b=t.useSlots(),n=w,{b:R}=I.useNamespace("editable-grid"),S=x,y=t.ref(),{value:p,updateValue:F}=G.useControllableValue(n,S),f=t.ref(),B=H.useGlobalConfig("valueTypeMap"),h=g.ApForm.useWatch(n.name,f);t.watch(()=>h.value,e=>{var a;F(e),(a=n.onChange)==null||a.call(n,e)},{deep:!0,flush:"post"}),t.watch(p,e=>{var a;e!==t.unref(h)&&(c.isEqual(e,t.unref(h))||(a=f.value)==null||a.setFieldValue(n.name,e))},{deep:!0});const _=z.useGetEditableColumns(n,B);function N(){var e;(e=f.value)==null||e.resetFields()}function V(e){return e?(c.isArray(e)?e:[e]).map(l=>c.isArray(l)?[n.name,...l]:[n.name,l]):void 0}async function q(e,a){var o;const l=await((o=f.value)==null?void 0:o.validateFields(V(e),a));return l==null?void 0:l[n.name]}function k(e,a){var r,u,s;const l=((r=t.unref(p))==null?void 0:r.length)||0;if(C.isDef(n.maxLength)&&l>=n.maxLength)return;const o={...e||{}};(s=(u=f.value)==null?void 0:u.setFieldValue)==null||s.call(u,n.name,o,!0,(d,i)=>{if(!d[i]){d[i]=[o];return}c.isUndefined(a)?d[i].push(o):d[i].splice(a,0,o)})}function E(e,a="suffix"){var u,s,d;const l=((u=t.unref(p))==null?void 0:u.length)||0,o=c.isNumber(e)?e:e.length;if(C.isDef(n.maxLength)&&l+o>n.maxLength)return;const r=c.isNumber(e)?new Array(e).fill(0).map(()=>({})):c.cloneDeep(e);(d=(s=f.value)==null?void 0:s.setFieldValue)==null||d.call(s,n.name,r,!0,(i,m)=>{if(!i[m]){i[m]=[...r];return}a==="suffix"?i[m].push(...r):i[m].unshift(...r)})}function L(e){var l,o;const a=new Set(c.isNumber(e)?[e]:e);(o=(l=f.value)==null?void 0:l.setFieldValue)==null||o.call(l,n.name,void 0,!0,(r,u)=>{r[u]=r[u].filter((s,d)=>!a.has(d))})}function A(){return t.unref(p)}function D(e){var a;(a=f.value)==null||a.setFieldValue(n.name,e)}function T(e){var a;return(a=t.unref(p))==null?void 0:a[e]}function j(e,a,l=!0){var o,r;(r=(o=f.value)==null?void 0:o.setFieldValue)==null||r.call(o,n.name,void 0,!0,(u,s)=>{if(!(!u[s]||!u[s][e])){if(!l){const d=Object.keys(u[s][e]);for(const i of d)i!==n.rowKey&&delete u[s][e][i]}Object.assign(u[s][e],{...a})}})}function O(e){var l;const a=e==="end"?p.value.length-1:e;(l=y.value)==null||l.scrollToRow(a)}function P(){var e,a;(a=(e=f.value)==null?void 0:e.setFieldValue)==null||a.call(e,n.name,[])}return v({resetFields:N,validateFields:q,add:k,remove:L,getRowData:T,getRowsData:A,setRowData:j,addMultiple:E,scrollTo:O,clear:P,setTableData:D}),(e,a)=>(t.openBlock(),t.createBlock(t.unref(g.ApForm),{ref_key:"formRef",ref:f,"initial-values":{[n.name]:t.unref(p)},style:{height:"100%"}},{default:t.withCtx(()=>[t.createVNode(t.unref(g.ApForm).FormItem,{name:e.name,"no-style":""},{default:t.withCtx(()=>[t.createVNode(K.default,t.mergeProps(t.unref(c.omit)(n,["name","value","onUpdate:value","maxLength","onChange","defaultValue"]),{ref_key:"tableRef",ref:y,class:t.unref(R)(),columns:t.unref(_),"data-source":t.unref(p),"search-form":!1}),t.createSlots({_:2},[t.renderList(b,(l,o)=>({name:o,fn:t.withCtx(r=>[t.renderSlot(e.$slots,o,t.normalizeProps(t.guardReactiveProps(r||{})))])}))]),1040,["class","columns","data-source"])]),_:3},8,["name"])]),_:3},8,["initial-values"]))}});exports.default=U;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),y=require("../../ap-form/index.js"),c=require("lodash-unified");require("../../config-provider/index.js");require("../../hooks/index.js");const C=require("../../utils/index.js"),z=require("../hooks/use-editable-columns.js");require("../index.vue2.js");const I=require("../../config-provider/hooks/use-namespace.js"),G=require("../../hooks/useControllableValue.js"),H=require("../../config-provider/hooks/use-global-config.js"),K=require("../index.vue.js"),U=t.defineComponent({name:"EditableGrid",__name:"index",props:{dropdownPrefixCls:{},bordered:{type:Boolean,default:!1},locale:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{default:()=>["ascend","descend"]},showSorterTooltip:{type:[Boolean,Object],default:!0},prefixCls:{},tableLayout:{default:"fixed"},title:{},id:{},showHeader:{type:Boolean,default:!0},components:{},customRow:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean],default:!1},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean,default:!1},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean,default:!1},indentSize:{default:15},expandIconColumnIndex:{},showExpandColumn:{type:Boolean,default:!0},expandedRowClassName:{},childrenColumnName:{default:"children"},rowExpandable:{},sticky:{type:[Boolean,Object],default:!1},transformCellText:{},rowClassName:{},stripe:{type:Boolean},headerRowClassName:{},footerRowClassName:{},cellClassName:{},headerCellClassName:{},footerCellClassName:{},rowStyle:{},headerRowStyle:{},footerRowStyle:{},cellStyle:{},headerCellStyle:{},footerCellStyle:{},height:{},minHeight:{},maxHeight:{},mergeCells:{},mergeFooterItems:{},cellConfig:{},loading:{type:Boolean,default:void 0},loadingConfig:{},headerCellConfig:{},footerCellConfig:{},round:{type:Boolean},rowSelection:{type:Boolean,default:void 0},onLoadingChange:{},onShownColumnsChange:{},pagination:{type:[Boolean,Object],default:!1},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},size:{default:"mini"},adaptive:{type:Boolean,default:!1},columnResizable:{type:[Boolean,Object],default:!1},rowKey:{default:"key"},footer:{},virtual:{type:[Boolean,Object],default:void 0},expandable:{},value:{},columns:{},defaultValue:{},"onUpdate:value":{},onChange:{},maxLength:{},name:{default:"ap-editable-table-inner-name"},onFieldChange:{}},emits:["update:value"],setup(w,{expose:v,emit:x}){const b=t.useSlots(),n=w,{b:R}=I.useNamespace("editable-grid"),S=x,g=t.ref(),{value:p,updateValue:B}=G.useControllableValue(n,S),f=t.ref(),F=H.useGlobalConfig("valueTypeMap"),h=y.ApForm.useWatch(n.name,f);t.watch(()=>h.value,e=>{var a;B(e),(a=n.onChange)==null||a.call(n,e)},{deep:!0,flush:"post"}),t.watch(p,e=>{var a;e!==t.unref(h)&&(c.isEqual(e,t.unref(h))||(a=f.value)==null||a.setFieldValue(n.name,e))},{deep:!0});const _=z.useGetEditableColumns(n,F);function N(){var e;(e=f.value)==null||e.resetFields()}function V(e){return e?(c.isArray(e)?e:[e]).map(l=>c.isArray(l)?[n.name,...l]:[n.name,l]):void 0}async function q(e,a){var o;const l=await((o=f.value)==null?void 0:o.validateFields(V(e),a));return l==null?void 0:l[n.name]}function k(e,a){var r,u,s;const l=((r=t.unref(p))==null?void 0:r.length)||0;if(C.isDef(n.maxLength)&&l>=n.maxLength)return;const o={...e||{}};(s=(u=f.value)==null?void 0:u.setFieldValue)==null||s.call(u,n.name,o,!0,(d,i)=>{if(!d[i]){d[i]=[o];return}c.isUndefined(a)?d[i].push(o):d[i].splice(a,0,o)})}function E(e,a="suffix"){var u,s,d;const l=((u=t.unref(p))==null?void 0:u.length)||0,o=c.isNumber(e)?e:e.length;if(C.isDef(n.maxLength)&&l+o>n.maxLength)return;const r=c.isNumber(e)?new Array(e).fill(0).map(()=>({})):c.cloneDeep(e);(d=(s=f.value)==null?void 0:s.setFieldValue)==null||d.call(s,n.name,r,!0,(i,m)=>{if(!i[m]){i[m]=[...r];return}a==="suffix"?i[m].push(...r):i[m].unshift(...r)})}function L(e){var l,o;const a=new Set(c.isNumber(e)?[e]:e);(o=(l=f.value)==null?void 0:l.setFieldValue)==null||o.call(l,n.name,void 0,!0,(r,u)=>{r[u]=r[u].filter((s,d)=>!a.has(d))})}function A(){return t.unref(p)}function D(e){var a;(a=f.value)==null||a.setFieldValue(n.name,e)}function T(e){var a;return(a=t.unref(p))==null?void 0:a[e]}function j(e,a,l=!0){var o,r;(r=(o=f.value)==null?void 0:o.setFieldValue)==null||r.call(o,n.name,void 0,!0,(u,s)=>{if(!(!u[s]||!u[s][e])){if(!l){const d=Object.keys(u[s][e]);for(const i of d)i!==n.rowKey&&delete u[s][e][i]}Object.assign(u[s][e],{...a})}})}function O(e){var l;const a=e==="end"?p.value.length-1:e;(l=g.value)==null||l.scrollToRow(a)}function P(){var e,a;(a=(e=f.value)==null?void 0:e.setFieldValue)==null||a.call(e,n.name,[])}return v({resetFields:N,validateFields:q,add:k,remove:L,getRowData:T,getRowsData:A,setRowData:j,addMultiple:E,scrollTo:O,clear:P,setTableData:D}),(e,a)=>(t.openBlock(),t.createBlock(t.unref(y.ApForm),{ref_key:"formRef",ref:f,"initial-values":{[n.name]:t.unref(p)},style:{height:"100%"}},{default:t.withCtx(()=>[t.createVNode(t.unref(y.ApForm).FormItem,{name:e.name,"no-style":""},{default:t.withCtx(()=>[t.createVNode(K.default,t.mergeProps(t.unref(c.omit)(n,["name","value","onUpdate:value","maxLength","onChange","defaultValue"]),{ref_key:"tableRef",ref:g,class:t.unref(R)(),columns:t.unref(_),"data-source":t.unref(p),"search-form":!1}),t.createSlots({_:2},[t.renderList(b,(l,o)=>({name:o,fn:t.withCtx(r=>[t.renderSlot(e.$slots,o,t.normalizeProps(t.guardReactiveProps(r||{})))])}))]),1040,["class","columns","data-source"])]),_:3},8,["name"])]),_:3},8,["initial-values"]))}});exports.default=U;