@aplus-frontend/ui 0.2.10 → 0.2.12

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 (145) hide show
  1. package/es/index.mjs +41 -39
  2. package/es/src/ap-form/ap-form.vue.d.ts +4 -0
  3. package/es/src/ap-form/ap-form.vue2.mjs +131 -108
  4. package/es/src/ap-form/drawer-form/index.vue.d.ts +27 -2
  5. package/es/src/ap-form/drawer-form/index.vue.mjs +43 -37
  6. package/es/src/ap-form/interface.d.ts +8 -0
  7. package/es/src/ap-form/modal-form/index.vue.d.ts +27 -2
  8. package/es/src/ap-form/modal-form/index.vue.mjs +26 -20
  9. package/es/src/ap-form/search-form/index.vue.d.ts +27 -2
  10. package/es/src/ap-form/search-form/index.vue.mjs +37 -31
  11. package/es/src/ap-form/utils/params.d.ts +17 -0
  12. package/es/src/ap-form/utils/params.mjs +19 -0
  13. package/es/src/ap-list/index.vue.d.ts +1 -0
  14. package/es/src/ap-list/index.vue.mjs +85 -79
  15. package/es/src/ap-list/interface.d.ts +7 -0
  16. package/es/src/ap-table/hooks/use-table-column-state.mjs +84 -75
  17. package/es/src/ap-table/interface.d.ts +1 -0
  18. package/es/src/business/ap-group-search/ap-group-search.vue.d.ts +3 -1
  19. package/es/src/business/ap-group-search/ap-group-search.vue2.mjs +80 -70
  20. package/es/src/business/ap-group-search/extension-select/index.vue.d.ts +6 -2
  21. package/es/src/business/ap-group-search/extension-select/index.vue2.mjs +44 -34
  22. package/es/src/business/ap-group-search/extension-select/style/css.d.ts +0 -0
  23. package/es/src/business/ap-group-search/extension-select/style/css.js +1 -0
  24. package/es/src/business/ap-group-search/extension-select/style/index.d.ts +0 -0
  25. package/es/src/business/ap-group-search/extension-select/style/index.js +1 -0
  26. package/es/src/business/ap-group-search/images/icon-line-select.vue.mjs +9 -9
  27. package/es/src/business/ap-group-search/index.d.ts +28 -0
  28. package/es/src/business/ap-group-search/popover-select/index.vue.d.ts +6 -2
  29. package/es/src/business/ap-group-search/popover-select/index.vue2.mjs +50 -50
  30. package/es/src/business/ap-group-search/popover-select/style/css.js +1 -1
  31. package/es/src/business/ap-group-search/popover-select/style/index.js +1 -1
  32. package/es/src/business/ap-image/ApImage.vue2.mjs +16 -14
  33. package/es/src/business/ap-summary/ap-summary.vue2.mjs +58 -38
  34. package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.d.ts +50 -0
  35. package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.mjs +227 -0
  36. package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue2.mjs +4 -0
  37. package/es/src/business/ap-upload-file/ap-upload-single/style/css.d.ts +0 -0
  38. package/es/src/business/ap-upload-file/ap-upload-single/style/css.js +1 -0
  39. package/es/src/business/ap-upload-file/ap-upload-single/style/index.d.ts +0 -0
  40. package/es/src/business/ap-upload-file/ap-upload-single/style/index.js +1 -0
  41. package/es/src/business/ap-upload-file/hook/useInjectContext.d.ts +4 -0
  42. package/es/src/business/ap-upload-file/hook/useInjectContext.mjs +9 -0
  43. package/es/src/business/ap-upload-file/hook/useOss.d.ts +8 -0
  44. package/es/src/business/ap-upload-file/hook/useOss.mjs +30 -0
  45. package/es/src/business/ap-upload-file/hook/useProps.d.ts +12 -0
  46. package/es/src/business/ap-upload-file/hook/useProps.mjs +28 -0
  47. package/es/src/business/ap-upload-file/icon/delete-icon.vue.d.ts +3 -0
  48. package/es/src/business/ap-upload-file/icon/delete-icon.vue.mjs +27 -0
  49. package/es/src/business/ap-upload-file/icon/file-icon.vue.d.ts +3 -0
  50. package/es/src/business/ap-upload-file/icon/file-icon.vue.mjs +18 -0
  51. package/es/src/business/ap-upload-file/index.d.ts +3 -0
  52. package/es/src/business/ap-upload-file/index.mjs +2 -0
  53. package/es/src/business/ap-upload-file/interface.d.ts +29 -0
  54. package/es/src/business/ap-upload-file/interface.mjs +1 -0
  55. package/es/src/business/ap-upload-file/utils/accept.d.ts +16 -0
  56. package/es/src/business/ap-upload-file/utils/accept.mjs +55 -0
  57. package/es/src/business/ap-upload-file/utils/fileList.d.ts +5 -0
  58. package/es/src/business/ap-upload-file/utils/fileList.mjs +16 -0
  59. package/es/src/business/ap-upload-file/utils/upload.d.ts +10 -0
  60. package/es/src/business/ap-upload-file/utils/upload.mjs +62 -0
  61. package/es/src/business/index.d.ts +1 -0
  62. package/es/src/business/index.mjs +43 -42
  63. package/es/src/config-provider/config-provider.d.ts +8 -0
  64. package/es/src/config-provider/css-var.d.ts +8 -0
  65. package/es/src/config-provider/css-var.mjs +25 -9
  66. package/es/src/config-provider/index.d.ts +48 -0
  67. package/es/src/index.mjs +33 -31
  68. package/es/src/locale/lang/en.mjs +1 -1
  69. package/es/src/locale/lang/zh-cn.mjs +1 -1
  70. package/es/src/path-map.mjs +3 -1
  71. package/es/src/utils/index.d.ts +12 -0
  72. package/es/src/utils/index.mjs +27 -18
  73. package/lib/index.js +1 -1
  74. package/lib/src/ap-form/ap-form.vue.d.ts +4 -0
  75. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  76. package/lib/src/ap-form/drawer-form/index.vue.d.ts +27 -2
  77. package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
  78. package/lib/src/ap-form/interface.d.ts +8 -0
  79. package/lib/src/ap-form/modal-form/index.vue.d.ts +27 -2
  80. package/lib/src/ap-form/modal-form/index.vue.js +1 -1
  81. package/lib/src/ap-form/search-form/index.vue.d.ts +27 -2
  82. package/lib/src/ap-form/search-form/index.vue.js +1 -1
  83. package/lib/src/ap-form/utils/params.d.ts +17 -0
  84. package/lib/src/ap-form/utils/params.js +1 -0
  85. package/lib/src/ap-list/index.vue.d.ts +1 -0
  86. package/lib/src/ap-list/index.vue.js +1 -1
  87. package/lib/src/ap-list/interface.d.ts +7 -0
  88. package/lib/src/ap-table/hooks/use-table-column-state.js +1 -1
  89. package/lib/src/ap-table/interface.d.ts +1 -0
  90. package/lib/src/business/ap-group-search/ap-group-search.vue.d.ts +3 -1
  91. package/lib/src/business/ap-group-search/ap-group-search.vue2.js +1 -1
  92. package/lib/src/business/ap-group-search/extension-select/index.vue.d.ts +6 -2
  93. package/lib/src/business/ap-group-search/extension-select/index.vue2.js +1 -1
  94. package/lib/src/business/ap-group-search/extension-select/style/css.d.ts +0 -0
  95. package/lib/src/business/ap-group-search/extension-select/style/css.js +1 -0
  96. package/lib/src/business/ap-group-search/extension-select/style/index.d.ts +0 -0
  97. package/lib/src/business/ap-group-search/extension-select/style/index.js +1 -0
  98. package/lib/src/business/ap-group-search/images/icon-line-select.vue.js +1 -1
  99. package/lib/src/business/ap-group-search/index.d.ts +28 -0
  100. package/lib/src/business/ap-group-search/popover-select/index.vue.d.ts +6 -2
  101. package/lib/src/business/ap-group-search/popover-select/index.vue2.js +2 -2
  102. package/lib/src/business/ap-group-search/popover-select/style/css.js +1 -1
  103. package/lib/src/business/ap-group-search/popover-select/style/index.js +1 -1
  104. package/lib/src/business/ap-image/ApImage.vue2.js +1 -1
  105. package/lib/src/business/ap-summary/ap-summary.vue2.js +1 -1
  106. package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.d.ts +50 -0
  107. package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.js +1 -0
  108. package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue2.js +1 -0
  109. package/lib/src/business/ap-upload-file/ap-upload-single/style/css.d.ts +0 -0
  110. package/lib/src/business/ap-upload-file/ap-upload-single/style/css.js +1 -0
  111. package/lib/src/business/ap-upload-file/ap-upload-single/style/index.d.ts +0 -0
  112. package/lib/src/business/ap-upload-file/ap-upload-single/style/index.js +1 -0
  113. package/lib/src/business/ap-upload-file/hook/useInjectContext.d.ts +4 -0
  114. package/lib/src/business/ap-upload-file/hook/useInjectContext.js +1 -0
  115. package/lib/src/business/ap-upload-file/hook/useOss.d.ts +8 -0
  116. package/lib/src/business/ap-upload-file/hook/useOss.js +1 -0
  117. package/lib/src/business/ap-upload-file/hook/useProps.d.ts +12 -0
  118. package/lib/src/business/ap-upload-file/hook/useProps.js +1 -0
  119. package/lib/src/business/ap-upload-file/icon/delete-icon.vue.d.ts +3 -0
  120. package/lib/src/business/ap-upload-file/icon/delete-icon.vue.js +1 -0
  121. package/lib/src/business/ap-upload-file/icon/file-icon.vue.d.ts +3 -0
  122. package/lib/src/business/ap-upload-file/icon/file-icon.vue.js +1 -0
  123. package/lib/src/business/ap-upload-file/index.d.ts +3 -0
  124. package/lib/src/business/ap-upload-file/index.js +1 -0
  125. package/lib/src/business/ap-upload-file/interface.d.ts +29 -0
  126. package/lib/src/business/ap-upload-file/interface.js +1 -0
  127. package/lib/src/business/ap-upload-file/utils/accept.d.ts +16 -0
  128. package/lib/src/business/ap-upload-file/utils/accept.js +1 -0
  129. package/lib/src/business/ap-upload-file/utils/fileList.d.ts +5 -0
  130. package/lib/src/business/ap-upload-file/utils/fileList.js +1 -0
  131. package/lib/src/business/ap-upload-file/utils/upload.d.ts +10 -0
  132. package/lib/src/business/ap-upload-file/utils/upload.js +1 -0
  133. package/lib/src/business/index.d.ts +1 -0
  134. package/lib/src/business/index.js +1 -1
  135. package/lib/src/config-provider/config-provider.d.ts +8 -0
  136. package/lib/src/config-provider/css-var.d.ts +8 -0
  137. package/lib/src/config-provider/css-var.js +1 -1
  138. package/lib/src/config-provider/index.d.ts +48 -0
  139. package/lib/src/index.js +1 -1
  140. package/lib/src/locale/lang/en.js +1 -1
  141. package/lib/src/locale/lang/zh-cn.js +1 -1
  142. package/lib/src/path-map.js +1 -1
  143. package/lib/src/utils/index.d.ts +12 -0
  144. package/lib/src/utils/index.js +1 -1
  145. package/package.json +4 -4
@@ -1,5 +1,5 @@
1
- import { isVNode as ne, defineComponent as le, useSlots as re, ref as se, unref as o, shallowRef as V, computed as g, watch as j, cloneVNode as ie, createVNode as n, Fragment as _, openBlock as m, createBlock as y, mergeProps as ue, withCtx as B, resolveDynamicComponent as A, createElementBlock as ce, renderList as pe } from "vue";
2
- import { Col as R, Flex as M, Space as de, Button as E, Row as fe } from "@aplus-frontend/antdv";
1
+ import { isVNode as ne, defineComponent as le, useSlots as re, ref as se, unref as o, shallowRef as V, computed as g, watch as j, cloneVNode as ie, createVNode as n, Fragment as _, openBlock as m, createBlock as y, mergeProps as ue, withCtx as S, resolveDynamicComponent as A, createElementBlock as ce, renderList as pe } from "vue";
2
+ import { Col as B, Flex as M, Space as de, Button as E, Row as fe } from "@aplus-frontend/antdv";
3
3
  import "../ap-form.vue.mjs";
4
4
  import "../item/index.vue2.mjs";
5
5
  import "../../hooks/index.mjs";
@@ -11,14 +11,14 @@ import { isDef as $ } from "../../utils/index.mjs";
11
11
  import { diffFormItem as Ce } from "./utils.mjs";
12
12
  import { useControllableValue as ge } from "../../hooks/useControllableValue.mjs";
13
13
  import { useNamespace as _e } from "../../config-provider/hooks/use-namespace.mjs";
14
- import { useGlobalConfig as Re } from "../../config-provider/hooks/use-global-config.mjs";
15
- import { useLocale as Se } from "../../config-provider/hooks/use-locale.mjs";
14
+ import { useGlobalConfig as Be } from "../../config-provider/hooks/use-global-config.mjs";
15
+ import { useLocale as Fe } from "../../config-provider/hooks/use-locale.mjs";
16
16
  import L from "../item/index.vue.mjs";
17
- import Fe from "../ap-form.vue2.mjs";
18
- function Be(h) {
17
+ import Re from "../ap-form.vue2.mjs";
18
+ function Se(h) {
19
19
  return typeof h == "function" || Object.prototype.toString.call(h) === "[object Object]" && !ne(h);
20
20
  }
21
- const i = 24, qe = /* @__PURE__ */ le({
21
+ const i = 24, We = /* @__PURE__ */ le({
22
22
  name: "ApFormSearchForm",
23
23
  __name: "index",
24
24
  props: {
@@ -65,6 +65,12 @@ const i = 24, qe = /* @__PURE__ */ le({
65
65
  onFinishFailed: {},
66
66
  onValidate: {},
67
67
  initialValues: {},
68
+ syncToUrl: {
69
+ type: [Boolean, Function]
70
+ },
71
+ syncToUrlPriority: {
72
+ type: Boolean
73
+ },
68
74
  collapse: {
69
75
  type: Boolean,
70
76
  default: void 0
@@ -98,23 +104,23 @@ const i = 24, qe = /* @__PURE__ */ le({
98
104
  },
99
105
  emits: ["update:collapse"],
100
106
  setup(h, {
101
- expose: W,
102
- emit: q
107
+ expose: U,
108
+ emit: W
103
109
  }) {
104
110
  var N;
105
- const s = re(), a = h, z = q, {
111
+ const s = re(), a = h, q = W, {
106
112
  value: u,
107
- updateValue: H
108
- } = ge(a, z, {
113
+ updateValue: z
114
+ } = ge(a, q, {
109
115
  valuePropName: "collapse",
110
116
  defaultValuePropName: "defaultCollapse"
111
117
  }), {
112
- b: U
113
- } = _e("ap-form-search-form"), G = Re("uiMode"), {
118
+ b: H
119
+ } = _e("ap-form-search-form"), G = Be("uiMode"), {
114
120
  t: b
115
- } = Se(), C = se();
121
+ } = Fe(), C = se();
116
122
  function J() {
117
- H(!o(u));
123
+ z(!o(u));
118
124
  }
119
125
  function K() {
120
126
  var e, t;
@@ -125,17 +131,17 @@ const i = 24, qe = /* @__PURE__ */ le({
125
131
  a.customReset || (t = (e = C.value) == null ? void 0 : e.resetFields) == null || t.call(e), (l = a.onReset) == null || l.call(a);
126
132
  }
127
133
  let v = [];
128
- const S = V(D(s.default())), p = V((N = s.extra) == null ? void 0 : N.call(s)), w = g(() => Math.floor(i / a.countPerRow));
134
+ const F = V(D(s.default())), p = V((N = s.extra) == null ? void 0 : N.call(s)), w = g(() => Math.floor(i / a.countPerRow));
129
135
  j(() => s.default(), (e) => {
130
- v = S.value, S.value = Ce(v, D(e));
136
+ v = F.value, F.value = Ce(v, D(e));
131
137
  }), j(() => {
132
138
  var e;
133
139
  return (e = s.extra) == null ? void 0 : e.call(s);
134
140
  }, (e) => {
135
141
  p.value = e;
136
142
  });
137
- const X = (e) => $(e) ? (he(e) ? e : [e]).join("") : Date.now(), F = g(() => {
138
- const e = S.value, t = [], l = [], r = o(w);
143
+ const X = (e) => $(e) ? (he(e) ? e : [e]).join("") : Date.now(), R = g(() => {
144
+ const e = F.value, t = [], l = [], r = o(w);
139
145
  let d = 0;
140
146
  e.forEach((c) => {
141
147
  const f = c.props;
@@ -168,7 +174,7 @@ const i = 24, qe = /* @__PURE__ */ le({
168
174
  };
169
175
  }), Y = g(() => {
170
176
  let e;
171
- const t = o(F), l = n(R, {
177
+ const t = o(R), l = n(B, {
172
178
  span: o(w),
173
179
  key: "actionWrapper"
174
180
  }, {
@@ -198,37 +204,37 @@ const i = 24, qe = /* @__PURE__ */ le({
198
204
  }), a.extraInAction ? o(p) : null]
199
205
  })]
200
206
  })]
201
- }), r = !a.extraInAction && o(p) ? n(R, {
207
+ }), r = !a.extraInAction && o(p) ? n(B, {
202
208
  span: o(u) ? t.actualExtraSpan : t.defaultExtraSpan,
203
209
  key: "extraNode"
204
210
  }, {
205
211
  default: () => [n(L, null, {
206
212
  default: () => [n(M, {
207
213
  justify: !o(u) && (t.defaultExtraSpan === i || t.lastRowOnlyIncludeActionAndExtra) ? "start" : "flex-end"
208
- }, Be(e = o(p)) ? e : {
214
+ }, Se(e = o(p)) ? e : {
209
215
  default: () => [e]
210
216
  })]
211
217
  })]
212
- }) : null, d = n(R, {
218
+ }) : null, d = n(B, {
213
219
  span: t.defaultExtraSpan
214
220
  }, null);
215
221
  return !o(u) && t.lastRowOnlyIncludeActionAndExtra ? n(_, null, [r || d, l]) : n(_, null, [l, r]);
216
222
  });
217
- return W({
223
+ return U({
218
224
  apForm: g(() => o(C))
219
- }), (e, t) => (m(), y(Fe, ue({
220
- class: o(U)(),
225
+ }), (e, t) => (m(), y(Re, ue({
226
+ class: o(H)(),
221
227
  ref_key: "apForm",
222
228
  ref: C
223
229
  }, o(ye)(a, ["collapse", "defaultCollapse", "onUpdate:collapse", "searchText", "resetText", "onSubmit", "onReset", "extraInAction", "forceExpand", "countPerRow"])), {
224
- default: B(() => [(m(), y(A(F.value.hideNode))), n(o(fe), {
230
+ default: S(() => [(m(), y(A(R.value.hideNode))), n(o(fe), {
225
231
  gutter: 16
226
232
  }, {
227
- default: B(() => [(m(!0), ce(_, null, pe(F.value.nodes, (l) => (m(), y(o(R), {
233
+ default: S(() => [(m(!0), ce(_, null, pe(R.value.nodes, (l) => (m(), y(o(B), {
228
234
  key: l.key,
229
235
  span: l.span
230
236
  }, {
231
- default: B(() => [(m(), y(A(l.node)))]),
237
+ default: S(() => [(m(), y(A(l.node)))]),
232
238
  _: 2
233
239
  }, 1032, ["span"]))), 128)), (m(), y(A(Y.value)))]),
234
240
  _: 1
@@ -238,5 +244,5 @@ const i = 24, qe = /* @__PURE__ */ le({
238
244
  }
239
245
  });
240
246
  export {
241
- qe as default
247
+ We as default
242
248
  };
@@ -0,0 +1,17 @@
1
+ import { Recordable } from '../../type';
2
+ import { ApFormProps } from '../interface';
3
+ import { UrlParams } from '@vueuse/core';
4
+ /**
5
+ * 获取查询参数
6
+ * @param syncToUrl
7
+ * @param params
8
+ * @param type
9
+ * @returns
10
+ */
11
+ export declare function genParams(syncToUrl: ApFormProps['syncToUrl'], params: Recordable, type: 'get' | 'set'): any;
12
+ /**
13
+ * 设置表单数据到url查询参数(覆盖模式)
14
+ * @param ins
15
+ * @param params
16
+ */
17
+ export declare function setToParams(ins: UrlParams, params: Recordable): void;
@@ -0,0 +1,19 @@
1
+ import { runFunction as r } from "../../utils/index.mjs";
2
+ function u(o, t, e) {
3
+ return o === !0 ? t : r(o, t, e);
4
+ }
5
+ function c(o) {
6
+ const t = Object.keys(o);
7
+ for (const e of t)
8
+ o[e] = null;
9
+ }
10
+ function i(o, t) {
11
+ c(o);
12
+ const e = Object.keys(t);
13
+ for (const n of e)
14
+ t[n] != null && (o[n] = t[n]);
15
+ }
16
+ export {
17
+ u as genParams,
18
+ i as setToParams
19
+ };
@@ -10,6 +10,7 @@ declare const _default: <RecordType extends Recordable>(__VLS_props: NonNullable
10
10
  refresh: () => void;
11
11
  refreshByDelete: (n: number) => void;
12
12
  scrollToFirstRow: (selector?: string) => void;
13
+ getSearchFormValuesIfSetted: (transform?: boolean) => Partial<any>;
13
14
  }>): void;
14
15
  attrs: any;
15
16
  slots: {
@@ -1,12 +1,12 @@
1
- import { defineComponent as F, ref as M, unref as e, computed as i, watch as W, openBlock as l, createBlock as j, normalizeClass as s, withCtx as A, createElementVNode as G, normalizeStyle as C, renderSlot as u, createVNode as P, createElementBlock as m, Fragment as U, renderList as H, mergeProps as J, createCommentVNode as K } from "vue";
2
- import { Empty as D, Spin as Q, Pagination as X } from "@aplus-frontend/antdv";
1
+ import { defineComponent as M, ref as W, unref as t, computed as l, watch as j, openBlock as s, createBlock as A, normalizeClass as u, withCtx as G, createElementVNode as U, normalizeStyle as D, renderSlot as f, createVNode as k, createElementBlock as g, Fragment as H, renderList as J, mergeProps as K, createCommentVNode as Q } from "vue";
2
+ import { Empty as B, Spin as X, Pagination as Y } from "@aplus-frontend/antdv";
3
3
  import "../ap-table/index.mjs";
4
4
  import "../config-provider/index.mjs";
5
- import { isUndefined as k, omit as Y } from "lodash-unified";
6
- import { useOfflineList as Z } from "./hooks/use-offline-list.mjs";
7
- import { useNamespace as x } from "../config-provider/hooks/use-namespace.mjs";
8
- import { useTablePaging as ee } from "../ap-table/hooks/use-table-paging.mjs";
9
- const ue = /* @__PURE__ */ F({
5
+ import { isUndefined as E, omit as Z } from "lodash-unified";
6
+ import { useOfflineList as x } from "./hooks/use-offline-list.mjs";
7
+ import { useNamespace as ee } from "../config-provider/hooks/use-namespace.mjs";
8
+ import { useTablePaging as te } from "../ap-table/hooks/use-table-paging.mjs";
9
+ const fe = /* @__PURE__ */ M({
10
10
  __name: "index",
11
11
  props: {
12
12
  dataSource: {},
@@ -22,111 +22,117 @@ const ue = /* @__PURE__ */ F({
22
22
  containerStyle: {},
23
23
  footerWarpperStyle: {}
24
24
  },
25
- setup(B, { expose: E }) {
26
- const w = D.PRESENTED_IMAGE_SIMPLE, t = B, { b: g, e: p } = x("ap-list"), S = M(), {
27
- formRef: I,
28
- submit: h,
29
- reset: y,
25
+ setup(w, { expose: V }) {
26
+ const F = B.PRESENTED_IMAGE_SIMPLE, n = w, { b: p, e: S } = ee("ap-list"), h = W(), {
27
+ formRef: y,
28
+ submit: v,
29
+ reset: b,
30
30
  handleTableChange: L,
31
- data: f,
32
- refresh: z,
33
- refreshByDelete: N,
34
- tableProps: v
35
- } = ee({
31
+ data: c,
32
+ refresh: T,
33
+ refreshByDelete: z,
34
+ tableProps: C
35
+ } = te({
36
36
  async request(a) {
37
37
  var o;
38
- const n = await ((o = t.request) == null ? void 0 : o.call(t, a));
38
+ const e = await ((o = n.request) == null ? void 0 : o.call(n, a));
39
39
  return {
40
- data: (n == null ? void 0 : n.data) || [],
41
- total: (n == null ? void 0 : n.total) || 0
40
+ data: (e == null ? void 0 : e.data) || [],
41
+ total: (e == null ? void 0 : e.total) || 0
42
42
  };
43
43
  },
44
- defaultParams: t.params,
45
- defaultData: t.defaultData,
46
- manual: t.manual,
47
- defaultCurrent: t.pagination ? t.pagination.defaultCurrent : void 0,
48
- defaultPageSize: t.pagination ? t.pagination.defaultPageSize : void 0,
49
- formatParams: t.beforeSearchSubmit
50
- }), R = { form: I }, {
51
- pagination: b,
52
- dataSource: T,
53
- onChange: q
54
- } = Z(t);
55
- function O(a, n) {
56
- if (e(r)) {
57
- q(a, n);
44
+ defaultParams: n.params,
45
+ defaultData: n.defaultData,
46
+ manual: n.manual,
47
+ defaultCurrent: n.pagination ? n.pagination.defaultCurrent : void 0,
48
+ defaultPageSize: n.pagination ? n.pagination.defaultPageSize : void 0,
49
+ formatParams: n.beforeSearchSubmit
50
+ }), I = { form: y }, {
51
+ pagination: P,
52
+ dataSource: N,
53
+ onChange: R
54
+ } = x(n);
55
+ function q(a, e) {
56
+ if (t(r)) {
57
+ R(a, e);
58
58
  return;
59
59
  }
60
60
  L(
61
- { current: a, pageSize: n },
61
+ { current: a, pageSize: e },
62
62
  {},
63
63
  {},
64
64
  { currentDataSource: [], action: "paginate" }
65
65
  );
66
66
  }
67
- const c = i(() => e(r) ? e(T) : e(f).records), d = i(() => k(t.loading) ? e(f).loading : t.loading), V = i(() => {
68
- var a, n;
69
- return t.pagination === !1 ? !1 : ((a = t.pagination) == null ? void 0 : a.hideOnSinglePage) !== !0 ? !0 : e(r) ? (((n = t.dataSource) == null ? void 0 : n.length) || 0) > e(b).pageSize : e(f).total > e(v).pagination.pageSize;
70
- }), r = i(() => !k(t.dataSource));
71
- W(
72
- () => e(d),
67
+ const d = l(() => t(r) ? t(N) : t(c).records), m = l(() => E(n.loading) ? t(c).loading : n.loading), O = l(() => {
68
+ var a, e;
69
+ return n.pagination === !1 ? !1 : ((a = n.pagination) == null ? void 0 : a.hideOnSinglePage) !== !0 ? !0 : t(r) ? (((e = n.dataSource) == null ? void 0 : e.length) || 0) > t(P).pageSize : t(c).total > t(C).pagination.pageSize;
70
+ }), r = l(() => !E(n.dataSource));
71
+ j(
72
+ () => t(m),
73
73
  (a) => {
74
- var n;
75
- (n = t.onLoadingChange) == null || n.call(t, a);
74
+ var e;
75
+ (e = n.onLoadingChange) == null || e.call(n, a);
76
76
  }
77
77
  );
78
78
  function _(a) {
79
- var n, o;
80
- (o = (n = S.value) == null ? void 0 : n.querySelector(a || ":first-child")) == null || o.scrollIntoView({ behavior: "smooth", block: "center" });
79
+ var e, o;
80
+ (o = (e = h.value) == null ? void 0 : e.querySelector(a || ":first-child")) == null || o.scrollIntoView({ behavior: "smooth", block: "center" });
81
81
  }
82
- return E({
83
- submit: () => h(),
84
- reset: () => y(),
85
- refresh: () => z(),
86
- refreshByDelete: (a) => N(a),
87
- scrollToFirstRow: _
88
- }), (a, n) => (l(), j(e(Q), {
89
- spinning: d.value,
90
- class: s(e(g)("spin"))
82
+ function $(a = !1) {
83
+ var i;
84
+ const e = (i = y.value) == null ? void 0 : i.apForm, o = a ? e == null ? void 0 : e.getFieldsValueTransformed : e == null ? void 0 : e.getFieldsValue;
85
+ return (o == null ? void 0 : o()) || {};
86
+ }
87
+ return V({
88
+ submit: () => v(),
89
+ reset: () => b(),
90
+ refresh: () => T(),
91
+ refreshByDelete: (a) => z(a),
92
+ scrollToFirstRow: _,
93
+ getSearchFormValuesIfSetted: $
94
+ }), (a, e) => (s(), A(t(X), {
95
+ spinning: m.value,
96
+ class: u(t(p)("spin"))
91
97
  }, {
92
- default: A(() => [
93
- G("div", {
94
- class: s(e(g)()),
95
- style: C(a.containerStyle)
98
+ default: G(() => [
99
+ U("div", {
100
+ class: u(t(p)()),
101
+ style: D(a.containerStyle)
96
102
  }, [
97
- u(a.$slots, "header", {
98
- formIns: R,
99
- submit: e(h),
100
- reset: e(y)
103
+ f(a.$slots, "header", {
104
+ formIns: I,
105
+ submit: t(v),
106
+ reset: t(b)
101
107
  }),
102
- c.value.length === 0 ? u(a.$slots, "empty", {
108
+ d.value.length === 0 ? f(a.$slots, "empty", {
103
109
  key: 0,
104
- loading: d.value
110
+ loading: m.value
105
111
  }, () => [
106
- P(e(D), { image: e(w) }, null, 8, ["image"])
107
- ]) : (l(), m("div", {
112
+ k(t(B), { image: t(F) }, null, 8, ["image"])
113
+ ]) : (s(), g("div", {
108
114
  key: 1,
109
115
  ref_key: "contentRef",
110
- ref: S,
111
- class: s(e(p)("content"))
116
+ ref: h,
117
+ class: u(t(S)("content"))
112
118
  }, [
113
- u(a.$slots, "renderContent", { dataSource: c.value }, () => [
114
- (l(!0), m(U, null, H(c.value, (o, $) => u(a.$slots, "renderItem", {
119
+ f(a.$slots, "renderContent", { dataSource: d.value }, () => [
120
+ (s(!0), g(H, null, J(d.value, (o, i) => f(a.$slots, "renderItem", {
115
121
  item: o,
116
- index: $
122
+ index: i
117
123
  })), 256))
118
124
  ])
119
125
  ], 2)),
120
- V.value ? (l(), m("div", {
126
+ O.value ? (s(), g("div", {
121
127
  key: 2,
122
- class: s(e(p)("footer")),
123
- style: C(a.footerWarpperStyle)
128
+ class: u(t(S)("footer")),
129
+ style: D(a.footerWarpperStyle)
124
130
  }, [
125
- P(e(X), J(
126
- r.value ? e(b) : e(Y)(e(v).pagination, ["showTotal"]),
127
- { onChange: O }
131
+ k(t(Y), K(
132
+ r.value ? t(P) : t(Z)(t(C).pagination, ["showTotal"]),
133
+ { onChange: q }
128
134
  ), null, 16)
129
- ], 6)) : K("", !0)
135
+ ], 6)) : Q("", !0)
130
136
  ], 6)
131
137
  ]),
132
138
  _: 3
@@ -134,5 +140,5 @@ const ue = /* @__PURE__ */ F({
134
140
  }
135
141
  });
136
142
  export {
137
- ue as default
143
+ fe as default
138
144
  };
@@ -96,4 +96,11 @@ export type ApListExpose = {
96
96
  * @returns
97
97
  */
98
98
  scrollToFirstRow: (selector?: string) => void;
99
+ /**
100
+ * 获取查询表单的值
101
+ * @description 只有在自定义查询表单并且绑定了formRef才能获取到查询表单的值
102
+ * @param transform 是否获取转换后的值,默认为`false`
103
+ * @returns
104
+ */
105
+ getSearchFormValuesIfSetted: (transform?: boolean) => Recordable;
99
106
  };
@@ -1,118 +1,127 @@
1
- import { ref as _, shallowRef as j, unref as f, computed as z, watchEffect as D } from "vue";
2
- import { isDef as G } from "../../utils/index.mjs";
3
- import W, { customCloneColumnStates as k, getColumnStateString as X } from "../components/setting/utils.mjs";
4
- import { useInjectApTable as q } from "../context.mjs";
5
- import { isObject as B, mergeWith as E, isBoolean as H, omit as L, isNumber as N } from "lodash-unified";
6
- function a(r, n) {
7
- r.forEach((o) => {
8
- var c;
9
- n(o), (c = o.children) != null && c.length && a(o.children, n);
1
+ import { ref as j, shallowRef as z, unref as d, computed as D, watchEffect as G } from "vue";
2
+ import { isDef as W } from "../../utils/index.mjs";
3
+ import X, { customCloneColumnStates as A, getColumnStateString as q } from "../components/setting/utils.mjs";
4
+ import { useInjectApTable as H } from "../context.mjs";
5
+ import { isObject as B, mergeWith as E, isBoolean as L, omit as P, isNumber as N } from "lodash-unified";
6
+ function a(t, n) {
7
+ t.forEach((o) => {
8
+ var i;
9
+ n(o), (i = o.children) != null && i.length && a(o.children, n);
10
10
  });
11
11
  }
12
- function P(r, n) {
12
+ function Q(t, n) {
13
13
  if (!n)
14
14
  return {};
15
- const o = r.getItem(n);
15
+ const o = t.getItem(n);
16
16
  return o ? JSON.parse(o) : {};
17
17
  }
18
- function I(r, n) {
19
- if (B(r) && B(n))
20
- return E({}, r, n, I);
18
+ function F(t, n) {
19
+ if (B(t) && B(n))
20
+ return E({}, t, n, F);
21
21
  }
22
- const b = Number.MAX_SAFE_INTEGER, V = (r, n) => {
23
- const o = _(n), c = j(
24
- k(n)
25
- ), { columnsBackup: m, updateColumns: d } = q(), T = r.persistenceType || "localStorage", p = window[T];
26
- function F() {
27
- const e = P(
28
- p,
29
- r.persistenceKey
30
- ), t = E(
22
+ const b = Number.MAX_SAFE_INTEGER;
23
+ function U(t, n, o, i) {
24
+ return i ? i.fixed : n ? n.fixed : o && "fixed" in o ? o.fixed : L(t.fixed) ? t.fixed ? "left" : void 0 : t.fixed;
25
+ }
26
+ const te = (t, n) => {
27
+ const o = j(n), i = z(
28
+ A(n)
29
+ ), { columnsBackup: p, updateColumns: l } = H(), I = t.persistenceType || "localStorage", x = window[I];
30
+ function T() {
31
+ const e = Q(
32
+ x,
33
+ t.persistenceKey
34
+ ), r = E(
31
35
  {},
32
- r.defaultValue || {},
36
+ t.defaultValue || {},
33
37
  e,
34
- I
35
- ), s = f(m);
36
- function l(R, u, y) {
37
- return R.map((i) => {
38
- var A;
39
- const v = (u == null ? void 0 : u[i.key]) || {}, h = {
40
- key: i.key,
41
- label: i.title,
38
+ F
39
+ ), s = d(p);
40
+ function c(R, u, _) {
41
+ return R.map((f) => {
42
+ var k, v;
43
+ const w = (u == null ? void 0 : u[f.key]) || {}, h = {
44
+ key: f.key,
45
+ label: f.title,
42
46
  show: !0,
43
- fixed: y ? y.fixed : H(i.fixed) ? i.fixed ? "left" : void 0 : i.fixed,
47
+ fixed: U(
48
+ f,
49
+ e[f.key],
50
+ (k = t.defaultValue) == null ? void 0 : k[f.key],
51
+ _
52
+ ),
44
53
  disabled: !1,
45
- ...L(v, "children")
54
+ ...P(w, ["children", "fixed"])
46
55
  };
47
- return h.children = (A = i.children) != null && A.length ? l(
48
- i.children,
49
- v.children,
56
+ return h.children = (v = f.children) != null && v.length ? c(
57
+ f.children,
58
+ w.children,
50
59
  h
51
60
  ) : void 0, h;
52
61
  }).sort(O);
53
62
  }
54
- return l(s || [], t);
63
+ return c(s || [], r);
55
64
  }
56
- function O(e, t) {
65
+ function O(e, r) {
57
66
  const s = N(e.order) ? e.order : b;
58
- let l = N(t.order) ? t.order : b;
59
- return e.fixed === "right" && t.fixed !== "right" && (l = s - 1), t.fixed === "left" && e.fixed !== "left" && (l = s - 1), s - l;
67
+ let c = N(r.order) ? r.order : b;
68
+ return e.fixed === "right" && r.fixed !== "right" && (c = s - 1), r.fixed === "left" && e.fixed !== "left" && (c = s - 1), s - c;
60
69
  }
61
- const C = z(() => f(o).every((e) => e.show));
62
- function S() {
63
- const e = f(o);
64
- a(e, (t) => {
65
- !t.disabled && (t.show = !0);
70
+ const g = D(() => d(o).every((e) => e.show));
71
+ function C() {
72
+ const e = d(o);
73
+ a(e, (r) => {
74
+ !r.disabled && (r.show = !0);
66
75
  });
67
76
  }
68
- function g() {
69
- const e = f(o);
70
- a(e, (t) => {
71
- !t.disabled && (t.show = !1);
77
+ function y() {
78
+ const e = d(o);
79
+ a(e, (r) => {
80
+ !r.disabled && (r.show = !1);
72
81
  });
73
82
  }
74
83
  function K() {
75
- f(C) ? g() : S();
84
+ d(g) ? y() : C();
76
85
  }
77
- function J(e, t) {
78
- a(f(o), (s) => {
79
- s.key === e && (s.show = G(t) ? t : !s.show);
86
+ function J(e, r) {
87
+ a(d(o), (s) => {
88
+ s.key === e && (s.show = W(r) ? r : !s.show);
80
89
  });
81
90
  }
82
- function w(e) {
91
+ function S(e) {
83
92
  o.value = e;
84
93
  }
85
94
  function M(e) {
86
- c.value = e;
95
+ i.value = e;
87
96
  }
88
- function x(e) {
89
- if (r.persistenceKey) {
90
- const t = X(e);
91
- p.setItem(r.persistenceKey, JSON.stringify(t));
97
+ function m(e) {
98
+ if (t.persistenceKey) {
99
+ const r = q(e);
100
+ x.setItem(t.persistenceKey, JSON.stringify(r));
92
101
  }
93
102
  }
94
- return D(() => {
95
- var t;
96
- const e = F();
97
- w(e), (t = r.onChange) == null || t.call(r, e), d == null || d(
98
- W(
99
- f(m),
100
- f(e)
103
+ return G(() => {
104
+ var r;
105
+ const e = T();
106
+ S(e), (r = t.onChange) == null || r.call(t, e), l == null || l(
107
+ X(
108
+ d(p),
109
+ d(e)
101
110
  )
102
- ), c.value = k(e), x(e);
111
+ ), i.value = A(e), m(e);
103
112
  }), {
104
113
  columnState: o,
105
- selectAll: S,
106
- unSelectAll: g,
114
+ selectAll: C,
115
+ unSelectAll: y,
107
116
  toggleSelect: J,
108
- setColumnState: w,
109
- isAllSelected: C,
117
+ setColumnState: S,
118
+ isAllSelected: g,
110
119
  toggleSelectAll: K,
111
- columnStateBackup: c,
120
+ columnStateBackup: i,
112
121
  setColumnStateBackup: M,
113
- cacheColumnStateIfNeeded: x
122
+ cacheColumnStateIfNeeded: m
114
123
  };
115
124
  };
116
125
  export {
117
- V as useTableColumnState
126
+ te as useTableColumnState
118
127
  };
@@ -336,6 +336,7 @@ export type ApTableExpose<SearchParamsType = Recordable, RecordType = any> = {
336
336
  reset: () => void;
337
337
  /**
338
338
  * 刷新表格数据
339
+ * @description 请注意,此方法会缓存查询参数,也就意味着表单项异步初始值可能不会生效
339
340
  * @returns
340
341
  */
341
342
  refresh: () => void;