@aplus-frontend/ui 0.6.4 → 0.6.6

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 (70) hide show
  1. package/es/src/ap-form/interface.d.ts +23 -3
  2. package/es/src/ap-form/item-group/index.vue.mjs +33 -27
  3. package/es/src/ap-form/items/text/index.vue.d.ts +2 -2
  4. package/es/src/ap-form/items/text/password.vue.d.ts +2 -2
  5. package/es/src/ap-form/search-form/components/popover-sorter/index.vue.d.ts +4 -2
  6. package/es/src/ap-form/search-form/components/popover-sorter/index.vue2.mjs +70 -72
  7. package/es/src/ap-form/search-form/components/popover-sorter/sortable-item.vue.d.ts +3 -2
  8. package/es/src/ap-form/search-form/components/popover-sorter/sortable-item.vue2.mjs +16 -24
  9. package/es/src/ap-form/search-form/hooks/use-sorter.d.ts +7 -0
  10. package/es/src/ap-form/search-form/hooks/use-sorter.mjs +45 -0
  11. package/es/src/ap-form/search-form/index.vue.d.ts +6 -3
  12. package/es/src/ap-form/search-form/index.vue.mjs +101 -91
  13. package/es/src/ap-grid/index.vue.mjs +219 -201
  14. package/es/src/ap-grid/interface.d.ts +17 -1
  15. package/es/src/ap-table/ap-table.vue.d.ts +4 -0
  16. package/es/src/ap-table/ap-table.vue2.mjs +223 -205
  17. package/es/src/ap-table/constants.d.ts +2 -2
  18. package/es/src/ap-table/context.d.ts +4 -0
  19. package/es/src/ap-table/context.mjs +21 -21
  20. package/es/src/ap-table/interface.d.ts +17 -1
  21. package/es/src/ap-table/utils.d.ts +2 -2
  22. package/es/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +4 -0
  23. package/es/src/business/ap-table-modal/hooks/use-table-modal.d.ts +4 -0
  24. package/es/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +4 -0
  25. package/es/src/business/ap-table-modal/index.d.ts +13 -0
  26. package/es/src/business/ap-table-modal/table-modal.vue.d.ts +7 -0
  27. package/es/src/business/ap-view/ap-view.vue2.mjs +107 -109
  28. package/es/src/business/ap-view/components/main-button-content.vue2.mjs +72 -71
  29. package/es/src/business/ap-view/interface.d.ts +4 -0
  30. package/es/src/business/batch-input-group/index.vue.d.ts +1 -1
  31. package/es/src/business/hooks/usePageListApTable.d.ts +4 -0
  32. package/es/src/version.d.ts +1 -1
  33. package/es/src/version.mjs +1 -1
  34. package/lib/src/ap-form/interface.d.ts +23 -3
  35. package/lib/src/ap-form/item-group/index.vue.js +1 -1
  36. package/lib/src/ap-form/items/text/index.vue.d.ts +2 -2
  37. package/lib/src/ap-form/items/text/password.vue.d.ts +2 -2
  38. package/lib/src/ap-form/search-form/components/popover-sorter/index.vue.d.ts +4 -2
  39. package/lib/src/ap-form/search-form/components/popover-sorter/index.vue2.js +1 -1
  40. package/lib/src/ap-form/search-form/components/popover-sorter/sortable-item.vue.d.ts +3 -2
  41. package/lib/src/ap-form/search-form/components/popover-sorter/sortable-item.vue2.js +1 -1
  42. package/lib/src/ap-form/search-form/hooks/use-sorter.d.ts +7 -0
  43. package/lib/src/ap-form/search-form/hooks/use-sorter.js +1 -0
  44. package/lib/src/ap-form/search-form/index.vue.d.ts +6 -3
  45. package/lib/src/ap-form/search-form/index.vue.js +1 -1
  46. package/lib/src/ap-grid/index.vue.js +1 -1
  47. package/lib/src/ap-grid/interface.d.ts +17 -1
  48. package/lib/src/ap-table/ap-table.vue.d.ts +4 -0
  49. package/lib/src/ap-table/ap-table.vue2.js +1 -1
  50. package/lib/src/ap-table/constants.d.ts +2 -2
  51. package/lib/src/ap-table/context.d.ts +4 -0
  52. package/lib/src/ap-table/context.js +1 -1
  53. package/lib/src/ap-table/interface.d.ts +17 -1
  54. package/lib/src/ap-table/utils.d.ts +2 -2
  55. package/lib/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +4 -0
  56. package/lib/src/business/ap-table-modal/hooks/use-table-modal.d.ts +4 -0
  57. package/lib/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +4 -0
  58. package/lib/src/business/ap-table-modal/index.d.ts +13 -0
  59. package/lib/src/business/ap-table-modal/table-modal.vue.d.ts +7 -0
  60. package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
  61. package/lib/src/business/ap-view/components/main-button-content.vue2.js +1 -1
  62. package/lib/src/business/ap-view/interface.d.ts +4 -0
  63. package/lib/src/business/batch-input-group/index.vue.d.ts +1 -1
  64. package/lib/src/business/hooks/usePageListApTable.d.ts +4 -0
  65. package/lib/src/version.d.ts +1 -1
  66. package/lib/src/version.js +1 -1
  67. package/package.json +1 -1
  68. package/theme/ap-grid/index.css +15 -0
  69. package/theme/ap-grid/index.less +14 -0
  70. package/theme/index.css +15 -0
@@ -1,25 +1,26 @@
1
- import { isVNode as oe, defineComponent as ae, useSlots as ne, ref as L, shallowRef as U, computed as _, unref as a, watch as V, createVNode as t, Fragment as w, createBlock as y, openBlock as f, mergeProps as le, withCtx as A, resolveDynamicComponent as B, createElementBlock as re, renderList as se } from "vue";
2
- import { Col as R, Flex as N, Button as W, Row as ie } from "@aplus-frontend/antdv";
1
+ import { isVNode as le, defineComponent as re, useSlots as se, ref as U, shallowRef as W, computed as S, unref as n, watch as M, createVNode as t, Fragment as _, createBlock as g, openBlock as d, mergeProps as ie, withCtx as B, resolveDynamicComponent as I, createElementBlock as ue, renderList as ce } from "vue";
2
+ import { Col as w, Flex as N, Button as z, Row as pe } from "@aplus-frontend/antdv";
3
3
  import "../ap-form.vue.mjs";
4
4
  import "../item/index.vue2.mjs";
5
- import { genRealChildren as M } from "../item-group/helper.mjs";
5
+ import { genRealChildren as D } from "../item-group/helper.mjs";
6
6
  import "../../config-provider/index.mjs";
7
- import { isArray as ue, isBoolean as ce, omit as pe } from "lodash-unified";
8
- import { isDef as z } from "../../utils/index.mjs";
9
- import { execFunc as D, diffFormItem as de } from "./utils.mjs";
7
+ import { isArray as de, isBoolean as me, omit as fe } from "lodash-unified";
8
+ import { isDef as q } from "../../utils/index.mjs";
9
+ import { execFunc as H, diffFormItem as he } from "./utils.mjs";
10
10
  import "./components/popover-filter.vue.mjs";
11
- import { useCountPerRow as fe } from "./hooks/use-count-per-row.mjs";
11
+ import { useCountPerRow as xe } from "./hooks/use-count-per-row.mjs";
12
12
  import "./components/popover-sorter/index.vue.mjs";
13
- import { useNamespace as me } from "../../config-provider/hooks/use-namespace.mjs";
14
- import { useLocale as he } from "../../config-provider/hooks/use-locale.mjs";
15
- import q from "../item/index.vue.mjs";
16
- import xe from "./components/popover-filter.vue2.mjs";
17
- import ye from "./components/popover-sorter/index.vue2.mjs";
18
- import ge from "../ap-form.vue2.mjs";
19
- function ve(m) {
20
- return typeof m == "function" || Object.prototype.toString.call(m) === "[object Object]" && !oe(m);
13
+ import { useSorter as ge } from "./hooks/use-sorter.mjs";
14
+ import { useNamespace as ye } from "../../config-provider/hooks/use-namespace.mjs";
15
+ import { useLocale as ve } from "../../config-provider/hooks/use-locale.mjs";
16
+ import G from "../item/index.vue.mjs";
17
+ import Ce from "./components/popover-filter.vue2.mjs";
18
+ import Se from "./components/popover-sorter/index.vue2.mjs";
19
+ import _e from "../ap-form.vue2.mjs";
20
+ function we(m) {
21
+ return typeof m == "function" || Object.prototype.toString.call(m) === "[object Object]" && !le(m);
21
22
  }
22
- const s = 24, Ue = /* @__PURE__ */ ae({
23
+ const s = 24, De = /* @__PURE__ */ re({
23
24
  name: "ApFormSearchForm",
24
25
  __name: "index",
25
26
  props: {
@@ -112,140 +113,149 @@ const s = 24, Ue = /* @__PURE__ */ ae({
112
113
  resizeTarget: {}
113
114
  },
114
115
  setup(m, {
115
- expose: H
116
+ expose: J
116
117
  }) {
117
- var P;
118
- const i = ne(), o = m, {
119
- b: h
120
- } = me("ap-form-search-form"), {
118
+ var L;
119
+ const i = se(), o = m, {
120
+ b: f
121
+ } = ye("ap-form-search-form"), {
121
122
  t: k
122
- } = he(), G = fe(o), g = L();
123
+ } = ve(), K = xe(o), y = U(), Q = U();
123
124
  function T() {
124
- var n;
125
- const e = (n = g.value) == null ? void 0 : n.getFieldsValueTransformed(!0);
126
- D(o.onSubmit, e);
125
+ var a;
126
+ const e = (a = y.value) == null ? void 0 : a.getFieldsValueTransformed(!0);
127
+ H(o.onSubmit, e);
127
128
  }
128
- function J() {
129
- var e, n;
130
- o.customReset || (n = (e = g.value) == null ? void 0 : e.resetFields) == null || n.call(e), D(o.onReset);
129
+ function X() {
130
+ var e, a;
131
+ o.customReset || (a = (e = y.value) == null ? void 0 : e.resetFields) == null || a.call(e), H(o.onReset);
131
132
  }
132
- const K = (e) => z(e) ? (ue(e) ? e : [e]).join("") : Date.now();
133
- let I = [];
134
- const u = U(M(i.default())), b = L(!1), p = U((P = i.extra) == null ? void 0 : P.call(i)), E = _(() => Math.floor(s / a(G)));
135
- V(() => i.default(), (e) => {
136
- I = u.value, u.value = de(I, M(e)), b.value = !1;
137
- }), V(() => {
133
+ const Y = (e) => q(e) ? (de(e) ? e : [e]).join("") : Date.now();
134
+ let E = [];
135
+ const h = W(D(i.default())), c = W((L = i.extra) == null ? void 0 : L.call(i)), P = S(() => Math.floor(s / n(K))), {
136
+ items: R,
137
+ sorted: O,
138
+ handleClickConfirm: b
139
+ } = ge(h);
140
+ M(() => i.default(), (e) => {
141
+ E = h.value, h.value = he(E, D(e)), O.value = !1;
142
+ }), M(() => {
138
143
  var e;
139
144
  return (e = i.extra) == null ? void 0 : e.call(i);
140
145
  }, (e) => {
141
- p.value = e;
146
+ c.value = e;
142
147
  });
143
- const l = _(() => {
144
- const e = u.value, n = [], r = [], x = [], c = a(E);
145
- let v = 0, S = 0;
146
- const Y = s * o.maxRows - c * (a(p) && !o.extraInAction ? 2 : 1);
147
- e.forEach((F, te) => {
148
- const d = F.props;
149
- if (ce(d.hidden) ? !!d.hidden : z(d.hidden))
150
- n.push(F);
148
+ const l = S(() => {
149
+ const e = h.value, a = [], r = [], x = [], u = n(P);
150
+ let v = 0, F = 0;
151
+ const te = s * o.maxRows - u * (n(c) && !o.extraInAction ? 2 : 1);
152
+ e.forEach((A, ne) => {
153
+ const p = A.props;
154
+ if (me(p.hidden) ? !!p.hidden : q(p.hidden))
155
+ a.push(A);
151
156
  else {
152
- let C = d.span || c;
153
- const $ = {
154
- node: F,
157
+ let C = p.span || u;
158
+ const j = {
159
+ node: A,
155
160
  span: C,
156
- key: `ApFormSearchFormItem-${te}-${K(d.name)}-${d._signal}`
157
- }, j = s - v % s;
158
- j < C && (C += j), v += C, v > Y ? r.push($) : (S = v, x.push($));
161
+ key: `ApFormSearchFormItem-${ne}-${Y(p.name)}-${p._signal}`
162
+ }, V = s - v % s;
163
+ V < C && (C += V), v += C, v > te ? r.push(j) : (F = v, x.push(j));
159
164
  }
160
165
  });
161
- const O = s - (S + c) % s, Z = S % s < c, ee = O < c ? s : O;
166
+ const $ = s - (F + u) % s, oe = F % s < u, ae = $ < u ? s : $;
162
167
  return {
163
- hideNode: t(w, null, [n]),
168
+ hideNode: t(_, null, [a]),
164
169
  nodes: x,
165
170
  collapseNodes: r,
166
- extraSpan: ee,
167
- lastRowOnlyIncludeActionAndExtra: Z
171
+ extraSpan: ae,
172
+ lastRowOnlyIncludeActionAndExtra: oe
168
173
  };
169
- });
170
- function Q(e) {
171
- u.value = [...e], b.value = !0;
172
- }
173
- const X = _(() => {
174
+ }), Z = S(() => {
174
175
  let e;
175
- const n = l.value.collapseNodes.length || o.sortable && u.value.length, r = t(R, {
176
- span: a(E),
176
+ const a = l.value.collapseNodes.length || o.sortable && h.value.length, r = t(w, {
177
+ span: n(P),
177
178
  key: "actionWrapper"
178
179
  }, {
179
- default: () => [t(q, null, {
180
+ default: () => [t(G, null, {
180
181
  default: () => [t(N, {
181
182
  wrap: "wrap",
182
- justify: l.value.lastRowOnlyIncludeActionAndExtra && !(a(p) && o.extraInAction) ? "flex-end" : "space-between"
183
+ justify: l.value.lastRowOnlyIncludeActionAndExtra && !(n(c) && o.extraInAction) ? "flex-end" : "space-between"
183
184
  }, {
184
185
  default: () => [t(N, {
185
186
  gap: 8,
186
187
  wrap: "wrap"
187
188
  }, {
188
- default: () => [n ? t("div", {
189
- class: h("column-setting-trigger-wrapper")
190
- }, [l.value.collapseNodes.length ? t(xe, {
189
+ default: () => [a ? t("div", {
190
+ class: f("column-setting-trigger-wrapper")
191
+ }, [l.value.collapseNodes.length ? t(Ce, {
191
192
  onSubmit: T,
192
193
  config: l.value.collapseNodes,
193
194
  submitLoading: o.submitLoading
194
- }, null) : null, o.sortable && u.value.length ? t(ye, {
195
- children: u.value,
196
- onClickConfirm: Q,
197
- sorted: b.value
198
- }, null) : null]) : null, t(W, {
195
+ }, null) : null, o.sortable && R.value.length ? t(Se, {
196
+ ref: "sorterIns",
197
+ items: R.value,
198
+ onClickConfirm: b,
199
+ sorted: O.value
200
+ }, null) : null]) : null, t(z, {
199
201
  type: "primary",
200
202
  onClick: T,
201
203
  loading: o.submitLoading,
202
204
  htmlType: "submit",
203
- class: h("action-btn")
205
+ class: f("action-btn")
204
206
  }, {
205
207
  default: () => [o.searchText || k("ap.apForm.search.search")]
206
- }), t(W, {
207
- onClick: J,
208
+ }), t(z, {
209
+ onClick: X,
208
210
  type: "text",
209
- class: [h("action-btn"), h("action-btn-reset")]
211
+ class: [f("action-btn"), f("action-btn-reset")]
210
212
  }, {
211
213
  default: () => [o.resetText || k("ap.apForm.search.reset")]
212
214
  })]
213
- }), o.extraInAction ? a(p) : null]
215
+ }), o.extraInAction ? n(c) : null]
214
216
  })]
215
217
  })]
216
- }), x = !o.extraInAction && a(p) ? t(R, {
218
+ }), x = !o.extraInAction && n(c) ? t(w, {
217
219
  span: l.value.extraSpan,
218
220
  key: "extraNode"
219
221
  }, {
220
- default: () => [t(q, null, {
222
+ default: () => [t(G, null, {
221
223
  default: () => [t(N, {
222
224
  justify: l.value.extraSpan === s || l.value.lastRowOnlyIncludeActionAndExtra ? "start" : "flex-end"
223
- }, ve(e = a(p)) ? e : {
225
+ }, we(e = n(c)) ? e : {
224
226
  default: () => [e]
225
227
  })]
226
228
  })]
227
- }) : null, c = t(R, {
229
+ }) : null, u = t(w, {
228
230
  span: l.value.extraSpan
229
231
  }, null);
230
- return l.value.lastRowOnlyIncludeActionAndExtra ? t(w, null, [x || c, r]) : t(w, null, [r, x]);
232
+ return l.value.lastRowOnlyIncludeActionAndExtra ? t(_, null, [x || u, r]) : t(_, null, [r, x]);
231
233
  });
232
- return H({
233
- apForm: _(() => a(g))
234
- }), (e, n) => (f(), y(ge, le({
234
+ function ee() {
235
+ var a;
236
+ const e = (a = Q.value) == null ? void 0 : a.getCachedList();
237
+ b(e);
238
+ }
239
+ return J({
240
+ apForm: S(() => n(y)),
241
+ getSorterItems: () => R.value,
242
+ setSorterItems: b,
243
+ resetSorterItems: ee
244
+ }), (e, a) => (d(), g(_e, ie({
235
245
  ref_key: "apForm",
236
- ref: g,
237
- class: a(h)()
238
- }, a(pe)(o, ["collapse", "defaultCollapse", "onUpdate:collapse", "searchText", "resetText", "onSubmit", "onReset", "extraInAction", "forceExpand", "countPerRow"])), {
239
- default: A(() => [(f(), y(B(l.value.hideNode))), t(a(ie), {
246
+ ref: y,
247
+ class: n(f)()
248
+ }, n(fe)(o, ["collapse", "defaultCollapse", "onUpdate:collapse", "searchText", "resetText", "onSubmit", "onReset", "extraInAction", "forceExpand", "countPerRow"])), {
249
+ default: B(() => [(d(), g(I(l.value.hideNode))), t(n(pe), {
240
250
  gutter: 8
241
251
  }, {
242
- default: A(() => [(f(!0), re(w, null, se(l.value.nodes, (r) => (f(), y(a(R), {
252
+ default: B(() => [(d(!0), ue(_, null, ce(l.value.nodes, (r) => (d(), g(n(w), {
243
253
  key: r.key,
244
254
  span: r.span
245
255
  }, {
246
- default: A(() => [(f(), y(B(r.node)))]),
256
+ default: B(() => [(d(), g(I(r.node)))]),
247
257
  _: 2
248
- }, 1032, ["span"]))), 128)), (f(), y(B(X.value)))]),
258
+ }, 1032, ["span"]))), 128)), (d(), g(I(Z.value)))]),
249
259
  _: 1
250
260
  })]),
251
261
  _: 1
@@ -253,5 +263,5 @@ const s = 24, Ue = /* @__PURE__ */ ae({
253
263
  }
254
264
  });
255
265
  export {
256
- Ue as default
266
+ De as default
257
267
  };