@aplus-frontend/ui 0.5.36 → 0.5.37

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.
@@ -1,5 +1,5 @@
1
- import { defineComponent as P, useSlots as A, toRef as H, ref as h, unref as f, watch as W, nextTick as G, createBlock as K, openBlock as U, mergeProps as C, withCtx as g, createVNode as $, createSlots as q, renderList as J, renderSlot as Q, normalizeProps as X, guardReactiveProps as Y } from "vue";
2
- import { ApForm as y } from "../../ap-form/index.mjs";
1
+ import { defineComponent as P, useSlots as A, toRef as H, ref as h, unref as u, watch as K, nextTick as W, createBlock as G, openBlock as U, mergeProps as g, withCtx as y, createVNode as $, createSlots as q, renderList as J, renderSlot as Q, normalizeProps as X, guardReactiveProps as Y } from "vue";
2
+ import { ApForm as C } from "../../ap-form/index.mjs";
3
3
  import { isArray as Z, isUndefined as I, isNumber as m, cloneDeep as M, omit as ee } from "lodash-unified";
4
4
  import "../../config-provider/index.mjs";
5
5
  import { isDef as w } from "../../utils/index.mjs";
@@ -9,7 +9,7 @@ import { useInjectForm as te } from "../../ap-form/context.mjs";
9
9
  import { useNamespace as ae } from "../../config-provider/hooks/use-namespace.mjs";
10
10
  import { useGlobalConfig as le } from "../../config-provider/hooks/use-global-config.mjs";
11
11
  import ne from "../index.vue.mjs";
12
- const ge = /* @__PURE__ */ P({
12
+ const ye = /* @__PURE__ */ P({
13
13
  name: "EditableGrid",
14
14
  __name: "form-item",
15
15
  props: {
@@ -154,10 +154,10 @@ const ge = /* @__PURE__ */ P({
154
154
  default: () => ({})
155
155
  }
156
156
  },
157
- setup(x, {
158
- expose: b
157
+ setup(b, {
158
+ expose: x
159
159
  }) {
160
- const R = A(), l = x, {
160
+ const R = A(), l = b, {
161
161
  b: B
162
162
  } = ae("editable-grid");
163
163
  function S(e, o) {
@@ -166,108 +166,114 @@ const ge = /* @__PURE__ */ P({
166
166
  const {
167
167
  internalInstance: t,
168
168
  model: F
169
- } = te(), p = H(l.name), d = h(S(f(F), p.value) || []), N = y.useWatch(p);
170
- W(() => N.value, async (e) => {
169
+ } = te(), p = H(l.name), d = h(S(u(F), p.value) || []), N = C.useWatch(p);
170
+ K(() => N.value, async (e) => {
171
171
  var o;
172
- await G(), d.value = e, (o = l.onChange) == null || o.call(l, e);
172
+ await W(), d.value = e, (o = l.onChange) == null || o.call(l, e);
173
173
  }, {
174
174
  deep: !0
175
175
  });
176
- const c = h(), v = le("valueTypeMap"), D = oe(l, v);
177
- function L(e, o) {
178
- var r;
179
- const n = ((r = f(d)) == null ? void 0 : r.length) || 0;
176
+ const c = h(), v = le("valueTypeMap"), k = oe(l, v);
177
+ function D(e, o) {
178
+ var s;
179
+ const n = ((s = u(d)) == null ? void 0 : s.length) || 0;
180
180
  if (w(l.maxLength) && n >= l.maxLength)
181
181
  return;
182
182
  const a = {
183
183
  ...e || {}
184
184
  };
185
- t == null || t.setFieldValue(l.name, a, !0, (u, s) => {
186
- if (!u[s]) {
187
- u[s] = [a];
185
+ t == null || t.setFieldValue(l.name, a, !0, (r, f) => {
186
+ if (!r[f]) {
187
+ r[f] = [a];
188
188
  return;
189
189
  }
190
- I(o) ? u[s].push(a) : u[s].splice(o, 0, a);
190
+ I(o) ? r[f].push(a) : r[f].splice(o, 0, a);
191
191
  });
192
192
  }
193
- function V(e, o = "suffix") {
194
- var u;
195
- const n = ((u = f(d)) == null ? void 0 : u.length) || 0, a = m(e) ? e : e.length;
193
+ function L(e, o = "suffix") {
194
+ var r;
195
+ const n = ((r = u(d)) == null ? void 0 : r.length) || 0, a = m(e) ? e : e.length;
196
196
  if (w(l.maxLength) && n + a > l.maxLength)
197
197
  return;
198
- const r = m(e) ? new Array(e).fill(0).map(() => ({})) : M(e);
199
- t == null || t.setFieldValue(l.name, r, !0, (s, i) => {
200
- if (!s[i]) {
201
- s[i] = [...r];
198
+ const s = m(e) ? new Array(e).fill(0).map(() => ({})) : M(e);
199
+ t == null || t.setFieldValue(l.name, s, !0, (f, i) => {
200
+ if (!f[i]) {
201
+ f[i] = [...s];
202
202
  return;
203
203
  }
204
- o === "suffix" ? s[i].push(...r) : s[i].unshift(...r);
204
+ o === "suffix" ? f[i].push(...s) : f[i].unshift(...s);
205
205
  });
206
206
  }
207
- function T(e) {
207
+ function V(e) {
208
208
  const o = new Set(m(e) ? [e] : e);
209
209
  t == null || t.setFieldValue(l.name, void 0, !0, (n, a) => {
210
- n[a] = n[a].filter((r, u) => !o.has(u));
210
+ n[a] = n[a].filter((s, r) => !o.has(r));
211
211
  });
212
212
  }
213
- function _() {
214
- return f(d);
213
+ function T() {
214
+ return u(d);
215
215
  }
216
- function E(e) {
216
+ function _(e) {
217
217
  var o;
218
- return (o = f(d)) == null ? void 0 : o[e];
218
+ return (o = u(d)) == null ? void 0 : o[e];
219
219
  }
220
- function k(e, o, n = !0) {
221
- t == null || t.setFieldValue(l.name, void 0, !0, (a, r) => {
222
- !a[r] || !a[r][e] || (a[r][e] = {
223
- ...n ? a[r][e] : {},
224
- ...o
225
- });
220
+ function j(e, o, n = !0) {
221
+ t == null || t.setFieldValue(l.name, void 0, !0, (a, s) => {
222
+ if (!(!a[s] || !a[s][e])) {
223
+ if (!n) {
224
+ const r = Object.keys(a[s][e]);
225
+ for (const f of r)
226
+ f !== l.rowKey && delete a[s][e][f];
227
+ }
228
+ Object.assign(a[s][e], {
229
+ ...o
230
+ });
231
+ }
226
232
  });
227
233
  }
228
- function j(e) {
234
+ function E(e) {
229
235
  t == null || t.setFieldValue(l.name, e);
230
236
  }
231
- function z(e) {
237
+ function O(e) {
232
238
  var n;
233
239
  const o = e === "end" ? d.value.length - 1 : e;
234
240
  (n = c.value) == null || n.scrollToRow(o);
235
241
  }
236
- function O() {
242
+ function z() {
237
243
  var e;
238
244
  (e = t == null ? void 0 : t.setFieldValue) == null || e.call(t, l.name, []);
239
245
  }
240
- return b({
241
- add: L,
242
- remove: T,
243
- getRowData: E,
244
- getRowsData: _,
245
- setRowData: k,
246
- addMultiple: V,
247
- scrollTo: z,
248
- setTableData: j,
249
- clear: O
250
- }), (e, o) => (U(), K(f(y).FormItem, C(e.formItem, {
246
+ return x({
247
+ add: D,
248
+ remove: V,
249
+ getRowData: _,
250
+ getRowsData: T,
251
+ setRowData: j,
252
+ addMultiple: L,
253
+ scrollTo: O,
254
+ setTableData: E,
255
+ clear: z
256
+ }), (e, o) => (U(), G(u(C).FormItem, g(e.formItem, {
251
257
  name: e.name,
252
258
  label: e.label
253
259
  }), {
254
- default: g(() => [$(ne, C(f(ee)(l, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue", "formItem"]), {
260
+ default: y(() => [$(ne, g(u(ee)(l, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue", "formItem"]), {
255
261
  ref_key: "tableRef",
256
262
  ref: c,
257
- class: f(B)(),
258
- columns: f(D),
263
+ class: u(B)(),
264
+ columns: u(k),
259
265
  "data-source": d.value,
260
266
  "search-form": !1
261
267
  }), q({
262
268
  _: 2
263
269
  }, [J(R, (n, a) => ({
264
270
  name: a,
265
- fn: g((r) => [Q(e.$slots, a, X(Y(r || {})))])
271
+ fn: y((s) => [Q(e.$slots, a, X(Y(s || {})))])
266
272
  }))]), 1040, ["class", "columns", "data-source"])]),
267
273
  _: 3
268
274
  }, 16, ["name", "label"]));
269
275
  }
270
276
  });
271
277
  export {
272
- ge as default
278
+ ye as default
273
279
  };
@@ -1,16 +1,16 @@
1
1
  import { defineComponent as U, useSlots as $, ref as w, watch as x, unref as u, createBlock as q, openBlock as J, withCtx as h, createVNode as v, mergeProps as Q, createSlots as X, renderList as Y, renderSlot as Z, normalizeProps as M, guardReactiveProps as ee } from "vue";
2
- import { ApForm as g } from "../../ap-form/index.mjs";
3
- import { isEqual as ae, isArray as R, isUndefined as te, isNumber as C, cloneDeep as le, omit as oe } from "lodash-unified";
2
+ import { ApForm as y } from "../../ap-form/index.mjs";
3
+ import { isEqual as ae, isArray as b, isUndefined as te, isNumber as g, cloneDeep as oe, omit as le } from "lodash-unified";
4
4
  import "../../config-provider/index.mjs";
5
5
  import "../../hooks/index.mjs";
6
- import { isDef as b } from "../../utils/index.mjs";
6
+ import { isDef as R } from "../../utils/index.mjs";
7
7
  import { useGetEditableColumns as ne } from "../hooks/use-editable-columns.mjs";
8
8
  import "../index.vue2.mjs";
9
- import { useNamespace as re } from "../../config-provider/hooks/use-namespace.mjs";
10
- import { useControllableValue as se } from "../../hooks/useControllableValue.mjs";
9
+ import { useNamespace as se } from "../../config-provider/hooks/use-namespace.mjs";
10
+ import { useControllableValue as re } from "../../hooks/useControllableValue.mjs";
11
11
  import { useGlobalConfig as ue } from "../../config-provider/hooks/use-global-config.mjs";
12
12
  import ie from "../index.vue.mjs";
13
- const Re = /* @__PURE__ */ U({
13
+ const be = /* @__PURE__ */ U({
14
14
  name: "EditableGrid",
15
15
  __name: "index",
16
16
  props: {
@@ -160,116 +160,122 @@ const Re = /* @__PURE__ */ U({
160
160
  }) {
161
161
  const N = $(), t = B, {
162
162
  b: V
163
- } = re("editable-grid"), _ = F, y = w(), {
163
+ } = se("editable-grid"), _ = F, C = w(), {
164
164
  value: m,
165
- updateValue: L
166
- } = se(t, _), i = w(), E = ue("valueTypeMap"), c = g.useWatch(t.name, i);
165
+ updateValue: k
166
+ } = re(t, _), f = w(), L = ue("valueTypeMap"), c = y.useWatch(t.name, f);
167
167
  x(() => c.value, (e) => {
168
168
  var a;
169
- L(e), (a = t.onChange) == null || a.call(t, e);
169
+ k(e), (a = t.onChange) == null || a.call(t, e);
170
170
  }, {
171
171
  deep: !0,
172
172
  flush: "post"
173
173
  }), x(m, (e) => {
174
174
  var a;
175
- e !== u(c) && (ae(e, u(c)) || (a = i.value) == null || a.setFieldValue(t.name, e));
175
+ e !== u(c) && (ae(e, u(c)) || (a = f.value) == null || a.setFieldValue(t.name, e));
176
176
  }, {
177
177
  deep: !0
178
178
  });
179
- const D = ne(t, E);
180
- function T() {
179
+ const E = ne(t, L);
180
+ function D() {
181
181
  var e;
182
- (e = i.value) == null || e.resetFields();
182
+ (e = f.value) == null || e.resetFields();
183
183
  }
184
- function k(e) {
185
- return e ? (R(e) ? e : [e]).map((l) => R(l) ? [t.name, ...l] : [t.name, l]) : void 0;
184
+ function T(e) {
185
+ return e ? (b(e) ? e : [e]).map((o) => b(o) ? [t.name, ...o] : [t.name, o]) : void 0;
186
186
  }
187
- async function A(e, a) {
188
- var o;
189
- const l = await ((o = i.value) == null ? void 0 : o.validateFields(k(e), a));
190
- return l == null ? void 0 : l[t.name];
187
+ async function j(e, a) {
188
+ var l;
189
+ const o = await ((l = f.value) == null ? void 0 : l.validateFields(T(e), a));
190
+ return o == null ? void 0 : o[t.name];
191
191
  }
192
- function j(e, a) {
193
- var n, r, s;
194
- const l = ((n = u(m)) == null ? void 0 : n.length) || 0;
195
- if (b(t.maxLength) && l >= t.maxLength)
192
+ function O(e, a) {
193
+ var s, n, r;
194
+ const o = ((s = u(m)) == null ? void 0 : s.length) || 0;
195
+ if (R(t.maxLength) && o >= t.maxLength)
196
196
  return;
197
- const o = {
197
+ const l = {
198
198
  ...e || {}
199
199
  };
200
- (s = (r = i.value) == null ? void 0 : r.setFieldValue) == null || s.call(r, t.name, o, !0, (d, f) => {
201
- if (!d[f]) {
202
- d[f] = [o];
200
+ (r = (n = f.value) == null ? void 0 : n.setFieldValue) == null || r.call(n, t.name, l, !0, (d, i) => {
201
+ if (!d[i]) {
202
+ d[i] = [l];
203
203
  return;
204
204
  }
205
- te(a) ? d[f].push(o) : d[f].splice(a, 0, o);
205
+ te(a) ? d[i].push(l) : d[i].splice(a, 0, l);
206
206
  });
207
207
  }
208
- function z(e, a = "suffix") {
209
- var r, s, d;
210
- const l = ((r = u(m)) == null ? void 0 : r.length) || 0, o = C(e) ? e : e.length;
211
- if (b(t.maxLength) && l + o > t.maxLength)
208
+ function A(e, a = "suffix") {
209
+ var n, r, d;
210
+ const o = ((n = u(m)) == null ? void 0 : n.length) || 0, l = g(e) ? e : e.length;
211
+ if (R(t.maxLength) && o + l > t.maxLength)
212
212
  return;
213
- const n = C(e) ? new Array(e).fill(0).map(() => ({})) : le(e);
214
- (d = (s = i.value) == null ? void 0 : s.setFieldValue) == null || d.call(s, t.name, n, !0, (f, p) => {
215
- if (!f[p]) {
216
- f[p] = [...n];
213
+ const s = g(e) ? new Array(e).fill(0).map(() => ({})) : oe(e);
214
+ (d = (r = f.value) == null ? void 0 : r.setFieldValue) == null || d.call(r, t.name, s, !0, (i, p) => {
215
+ if (!i[p]) {
216
+ i[p] = [...s];
217
217
  return;
218
218
  }
219
- a === "suffix" ? f[p].push(...n) : f[p].unshift(...n);
219
+ a === "suffix" ? i[p].push(...s) : i[p].unshift(...s);
220
220
  });
221
221
  }
222
- function I(e) {
223
- var l, o;
224
- const a = new Set(C(e) ? [e] : e);
225
- (o = (l = i.value) == null ? void 0 : l.setFieldValue) == null || o.call(l, t.name, void 0, !0, (n, r) => {
226
- n[r] = n[r].filter((s, d) => !a.has(d));
222
+ function z(e) {
223
+ var o, l;
224
+ const a = new Set(g(e) ? [e] : e);
225
+ (l = (o = f.value) == null ? void 0 : o.setFieldValue) == null || l.call(o, t.name, void 0, !0, (s, n) => {
226
+ s[n] = s[n].filter((r, d) => !a.has(d));
227
227
  });
228
228
  }
229
- function O() {
229
+ function I() {
230
230
  return u(m);
231
231
  }
232
232
  function P(e) {
233
233
  var a;
234
- (a = i.value) == null || a.setFieldValue(t.name, e);
234
+ (a = f.value) == null || a.setFieldValue(t.name, e);
235
235
  }
236
236
  function H(e) {
237
237
  var a;
238
238
  return (a = u(m)) == null ? void 0 : a[e];
239
239
  }
240
- function W(e, a, l = !0) {
241
- var o, n;
242
- (n = (o = i.value) == null ? void 0 : o.setFieldValue) == null || n.call(o, t.name, void 0, !0, (r, s) => {
243
- !r[s] || !r[s][e] || (r[s][e] = {
244
- ...l ? r[s][e] : {},
245
- ...a
246
- });
240
+ function K(e, a, o = !0) {
241
+ var l, s;
242
+ (s = (l = f.value) == null ? void 0 : l.setFieldValue) == null || s.call(l, t.name, void 0, !0, (n, r) => {
243
+ if (!(!n[r] || !n[r][e])) {
244
+ if (!o) {
245
+ const d = Object.keys(n[r][e]);
246
+ for (const i of d)
247
+ i !== t.rowKey && delete n[r][e][i];
248
+ }
249
+ Object.assign(n[r][e], {
250
+ ...a
251
+ });
252
+ }
247
253
  });
248
254
  }
249
- function G(e) {
250
- var l;
255
+ function W(e) {
256
+ var o;
251
257
  const a = e === "end" ? m.value.length - 1 : e;
252
- (l = y.value) == null || l.scrollToRow(a);
258
+ (o = C.value) == null || o.scrollToRow(a);
253
259
  }
254
- function K() {
260
+ function G() {
255
261
  var e, a;
256
- (a = (e = i.value) == null ? void 0 : e.setFieldValue) == null || a.call(e, t.name, []);
262
+ (a = (e = f.value) == null ? void 0 : e.setFieldValue) == null || a.call(e, t.name, []);
257
263
  }
258
264
  return S({
259
- resetFields: T,
260
- validateFields: A,
261
- add: j,
262
- remove: I,
265
+ resetFields: D,
266
+ validateFields: j,
267
+ add: O,
268
+ remove: z,
263
269
  getRowData: H,
264
- getRowsData: O,
265
- setRowData: W,
266
- addMultiple: z,
267
- scrollTo: G,
268
- clear: K,
270
+ getRowsData: I,
271
+ setRowData: K,
272
+ addMultiple: A,
273
+ scrollTo: W,
274
+ clear: G,
269
275
  setTableData: P
270
- }), (e, a) => (J(), q(u(g), {
276
+ }), (e, a) => (J(), q(u(y), {
271
277
  ref_key: "formRef",
272
- ref: i,
278
+ ref: f,
273
279
  "initial-values": {
274
280
  [t.name]: u(m)
275
281
  },
@@ -277,22 +283,22 @@ const Re = /* @__PURE__ */ U({
277
283
  height: "100%"
278
284
  }
279
285
  }, {
280
- default: h(() => [v(u(g).FormItem, {
286
+ default: h(() => [v(u(y).FormItem, {
281
287
  name: e.name,
282
288
  "no-style": ""
283
289
  }, {
284
- default: h(() => [v(ie, Q(u(oe)(t, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue"]), {
290
+ default: h(() => [v(ie, Q(u(le)(t, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue"]), {
285
291
  ref_key: "tableRef",
286
- ref: y,
292
+ ref: C,
287
293
  class: u(V)(),
288
- columns: u(D),
294
+ columns: u(E),
289
295
  "data-source": u(m),
290
296
  "search-form": !1
291
297
  }), X({
292
298
  _: 2
293
- }, [Y(N, (l, o) => ({
294
- name: o,
295
- fn: h((n) => [Z(e.$slots, o, M(ee(n || {})))])
299
+ }, [Y(N, (o, l) => ({
300
+ name: l,
301
+ fn: h((s) => [Z(e.$slots, l, M(ee(s || {})))])
296
302
  }))]), 1040, ["class", "columns", "data-source"])]),
297
303
  _: 3
298
304
  }, 8, ["name"])]),
@@ -301,5 +307,5 @@ const Re = /* @__PURE__ */ U({
301
307
  }
302
308
  });
303
309
  export {
304
- Re as default
310
+ be as default
305
311
  };
@@ -1,13 +1,13 @@
1
- import { defineComponent as H, ref as J, unref as t, computed as c, watch as Q, createBlock as S, openBlock as i, withCtx as d, createElementVNode as X, normalizeStyle as h, normalizeClass as f, renderSlot as l, createElementBlock as p, createCommentVNode as Y, createVNode as v, Fragment as I, renderList as Z, mergeProps as _ } from "vue";
2
- import { Empty as E, Spin as x, Pagination as ee } from "@aplus-frontend/antdv";
3
- import { useTablePaging as te } from "../ap-table/hooks/use-table-paging-ng.mjs";
1
+ import { defineComponent as X, ref as Y, unref as e, computed as p, watch as Z, createElementBlock as s, openBlock as i, normalizeStyle as v, normalizeClass as l, renderSlot as u, createElementVNode as _, createCommentVNode as I, createVNode as g, Fragment as E, createBlock as O, withCtx as h, renderList as x, mergeProps as ee } from "vue";
2
+ import { Empty as V, Spin as te, Pagination as ae } from "@aplus-frontend/antdv";
3
+ import { useTablePaging as ne } from "../ap-table/hooks/use-table-paging-ng.mjs";
4
4
  import "../config-provider/index.mjs";
5
- import { isUndefined as O, isNumber as ae, omit as ne } from "lodash-unified";
6
- import { useOfflineList as re } from "./hooks/use-offline-list.mjs";
5
+ import { isUndefined as F, isNumber as re, omit as oe } from "lodash-unified";
6
+ import { useOfflineList as ie } from "./hooks/use-offline-list.mjs";
7
7
  import "vue-virtual-scroller/dist/vue-virtual-scroller.css";
8
- import { RecycleScroller as oe, DynamicScroller as ie, DynamicScrollerItem as le } from "vue-virtual-scroller";
9
- import { useNamespace as se } from "../config-provider/hooks/use-namespace.mjs";
10
- const he = /* @__PURE__ */ H({
8
+ import { RecycleScroller as le, DynamicScroller as se, DynamicScrollerItem as ue } from "vue-virtual-scroller";
9
+ import { useNamespace as ce } from "../config-provider/hooks/use-namespace.mjs";
10
+ const be = /* @__PURE__ */ X({
11
11
  __name: "index",
12
12
  props: {
13
13
  dataSource: {},
@@ -24,22 +24,23 @@ const he = /* @__PURE__ */ H({
24
24
  contentStyle: { type: [Boolean, null, String, Object, Array] },
25
25
  footerWarpperStyle: { type: [Boolean, null, String, Object, Array] },
26
26
  virtual: { default: void 0 },
27
- rowKey: {}
27
+ rowKey: {},
28
+ adaptive: { type: Boolean, default: !1 }
28
29
  },
29
- setup(V, { expose: F }) {
30
- const L = E.PRESENTED_IMAGE_SIMPLE, n = V, { b: u, e: N } = se("ap-list"), b = J(), {
30
+ setup(L, { expose: N }) {
31
+ const R = V.PRESENTED_IMAGE_SIMPLE, n = L, { b: m, e: y, bm: T, m: $ } = ce("ap-list"), b = Y(), {
31
32
  formRef: k,
32
33
  submit: w,
33
- reset: D,
34
- handleTableChange: R,
35
- data: g,
36
- refresh: T,
37
- refreshByDelete: $,
38
- tableProps: z
39
- } = te({
40
- async request(e) {
34
+ reset: B,
35
+ handleTableChange: j,
36
+ data: S,
37
+ refresh: q,
38
+ refreshByDelete: A,
39
+ tableProps: D
40
+ } = ne({
41
+ async request(t) {
41
42
  var r;
42
- const a = await ((r = n.request) == null ? void 0 : r.call(n, e));
43
+ const a = await ((r = n.request) == null ? void 0 : r.call(n, t));
43
44
  return {
44
45
  data: (a == null ? void 0 : a.data) || [],
45
46
  total: (a == null ? void 0 : a.total) || 0
@@ -50,143 +51,149 @@ const he = /* @__PURE__ */ H({
50
51
  manual: n.manual,
51
52
  pagination: n.pagination,
52
53
  formatParams: n.beforeSearchSubmit
53
- }), j = { form: k }, {
54
- pagination: B,
55
- dataSource: q,
56
- onChange: A
57
- } = re(n);
58
- function K(e, a) {
59
- if (t(m)) {
60
- A(e, a);
54
+ }), K = { form: k }, {
55
+ pagination: z,
56
+ dataSource: M,
57
+ onChange: W
58
+ } = ie(n);
59
+ function G(t, a) {
60
+ if (e(f)) {
61
+ W(t, a);
61
62
  return;
62
63
  }
63
- R(
64
- { current: e, pageSize: a },
64
+ j(
65
+ { current: t, pageSize: a },
65
66
  {},
66
67
  {},
67
68
  { currentDataSource: [], action: "paginate" }
68
69
  );
69
70
  }
70
- const s = c(() => t(m) ? t(q) : t(g).records), y = c(() => O(n.loading) ? t(g).loading : n.loading), M = c(() => {
71
- var e, a;
72
- return n.pagination === !1 || n.virtual ? !1 : ((e = n.pagination) == null ? void 0 : e.hideOnSinglePage) !== !0 ? !0 : t(m) ? (((a = n.dataSource) == null ? void 0 : a.length) || 0) > t(B).pageSize : t(g).total > t(z).pagination.pageSize;
73
- }), m = c(() => !O(n.dataSource));
74
- Q(
75
- () => t(y),
76
- (e) => {
71
+ const c = p(() => e(f) ? e(M) : e(S).records), d = p(() => F(n.loading) ? e(S).loading : n.loading), U = p(() => {
72
+ var t, a;
73
+ return n.pagination === !1 || n.virtual ? !1 : ((t = n.pagination) == null ? void 0 : t.hideOnSinglePage) !== !0 ? !0 : e(f) ? (((a = n.dataSource) == null ? void 0 : a.length) || 0) > e(z).pageSize : e(S).total > e(D).pagination.pageSize;
74
+ }), f = p(() => !F(n.dataSource));
75
+ Z(
76
+ () => e(d),
77
+ (t) => {
77
78
  var a;
78
- (a = n.onLoadingChange) == null || a.call(n, e);
79
+ (a = n.onLoadingChange) == null || a.call(n, t);
79
80
  }
80
81
  );
81
- function W(e) {
82
+ function H(t) {
82
83
  var a, r;
83
- (r = (a = b.value) == null ? void 0 : a.querySelector(e || ":first-child")) == null || r.scrollIntoView({ behavior: "smooth", block: "center" });
84
+ (r = (a = b.value) == null ? void 0 : a.querySelector(t || ":first-child")) == null || r.scrollIntoView({ behavior: "smooth", block: "center" });
84
85
  }
85
- function G(e = !1) {
86
+ function J(t = !1) {
86
87
  var o;
87
- const a = (o = k.value) == null ? void 0 : o.apForm, r = e ? a == null ? void 0 : a.getFieldsValueTransformed : a == null ? void 0 : a.getFieldsValue;
88
+ const a = (o = k.value) == null ? void 0 : o.apForm, r = t ? a == null ? void 0 : a.getFieldsValueTransformed : a == null ? void 0 : a.getFieldsValue;
88
89
  return (r == null ? void 0 : r()) || {};
89
90
  }
90
- return F({
91
+ return N({
91
92
  submit: () => w(),
92
- reset: () => D(),
93
- refresh: () => T(),
94
- refreshByDelete: (e) => $(e),
95
- scrollToFirstRow: W,
96
- getSearchFormValuesIfSetted: G
97
- }), (e, a) => (i(), S(t(x), {
98
- spinning: y.value,
99
- "wrapper-class-name": t(u)("spin")
100
- }, {
101
- default: d(() => [
102
- X("div", {
103
- class: f(t(u)()),
104
- style: h(e.containerStyle)
93
+ reset: () => B(),
94
+ refresh: () => q(),
95
+ refreshByDelete: (t) => A(t),
96
+ scrollToFirstRow: H,
97
+ getSearchFormValuesIfSetted: J
98
+ }), (t, a) => (i(), s("div", {
99
+ class: l([e(m)(), { [e($)("adaptive")]: t.adaptive }]),
100
+ style: v(t.containerStyle)
101
+ }, [
102
+ u(t.$slots, "header", {
103
+ formIns: K,
104
+ submit: e(w),
105
+ reset: e(B)
106
+ }),
107
+ _("div", {
108
+ class: l([
109
+ e(m)("content-container"),
110
+ { [e(T)("content-container", "spinning")]: d.value }
111
+ ])
112
+ }, [
113
+ d.value ? (i(), s("div", {
114
+ key: 0,
115
+ class: l(e(y)("spin-wrapper"))
105
116
  }, [
106
- l(e.$slots, "header", {
107
- formIns: j,
108
- submit: t(w),
109
- reset: t(D)
110
- }),
111
- s.value.length === 0 ? l(e.$slots, "empty", {
112
- key: 0,
113
- loading: y.value
114
- }, () => [
115
- v(t(E), { image: t(L) }, null, 8, ["image"])
116
- ]) : (i(), p("div", {
117
- key: 1,
118
- ref_key: "contentRef",
119
- ref: b,
120
- style: h(e.contentStyle)
121
- }, [
122
- e.virtual ? (i(), p(I, { key: 0 }, [
123
- t(ae)(e.virtual) ? (i(), S(t(oe), {
124
- key: 0,
125
- class: f(t(u)("scroll-wrapper")),
126
- items: s.value,
127
- "item-size": e.virtual,
128
- "key-field": n.rowKey || "id"
129
- }, {
130
- default: d(({ item: r, index: o }) => [
131
- l(e.$slots, "renderItem", {
132
- item: r,
133
- index: o
134
- })
135
- ]),
136
- _: 3
137
- }, 8, ["class", "items", "item-size", "key-field"])) : (i(), S(t(ie), {
138
- key: 1,
139
- items: s.value,
140
- "min-item-size": e.virtual.minItemSize,
141
- class: f(t(u)("scroll-wrapper"))
142
- }, {
143
- default: d(({ item: r, index: o, active: U }) => {
144
- var C, P;
145
- return [
146
- v(t(le), {
147
- item: r,
148
- active: U,
149
- "data-index": o,
150
- "size-dependencies": (P = (C = e.virtual).sizeDependencies) == null ? void 0 : P.call(C, r)
151
- }, {
152
- default: d(() => [
153
- l(e.$slots, "renderItem", {
154
- item: r,
155
- index: o
156
- })
157
- ]),
158
- _: 2
159
- }, 1032, ["item", "active", "data-index", "size-dependencies"])
160
- ];
161
- }),
162
- _: 3
163
- }, 8, ["items", "min-item-size", "class"]))
164
- ], 64)) : l(e.$slots, "renderContent", {
117
+ g(e(te), { spinning: d.value }, null, 8, ["spinning"])
118
+ ], 2)) : I("", !0),
119
+ c.value.length === 0 ? u(t.$slots, "empty", {
120
+ key: 1,
121
+ loading: d.value
122
+ }, () => [
123
+ g(e(V), { image: e(R) }, null, 8, ["image"])
124
+ ]) : (i(), s("div", {
125
+ key: 2,
126
+ ref_key: "contentRef",
127
+ ref: b,
128
+ style: v(t.contentStyle),
129
+ class: l(e(y)("content"))
130
+ }, [
131
+ t.virtual ? (i(), s(E, { key: 0 }, [
132
+ e(re)(t.virtual) ? (i(), O(e(le), {
133
+ key: 0,
134
+ class: l(e(m)("scroll-wrapper")),
135
+ items: c.value,
136
+ "item-size": t.virtual,
137
+ "key-field": n.rowKey || "id"
138
+ }, {
139
+ default: h(({ item: r, index: o }) => [
140
+ u(t.$slots, "renderItem", {
141
+ item: r,
142
+ index: o
143
+ })
144
+ ]),
145
+ _: 3
146
+ }, 8, ["class", "items", "item-size", "key-field"])) : (i(), O(e(se), {
165
147
  key: 1,
166
- dataSource: s.value
167
- }, () => [
168
- (i(!0), p(I, null, Z(s.value, (r, o) => l(e.$slots, "renderItem", {
169
- item: r,
170
- index: o
171
- })), 256))
172
- ])
173
- ], 4)),
174
- M.value ? (i(), p("div", {
175
- key: 2,
176
- class: f(t(N)("footer")),
177
- style: h(e.footerWarpperStyle)
178
- }, [
179
- v(t(ee), _(
180
- m.value ? t(B) : t(ne)(t(z).pagination, ["showTotal"]),
181
- { onChange: K }
182
- ), null, 16)
183
- ], 6)) : Y("", !0)
184
- ], 6)
185
- ]),
186
- _: 3
187
- }, 8, ["spinning", "wrapper-class-name"]));
148
+ items: c.value,
149
+ "min-item-size": t.virtual.minItemSize,
150
+ class: l(e(m)("scroll-wrapper"))
151
+ }, {
152
+ default: h(({ item: r, index: o, active: Q }) => {
153
+ var C, P;
154
+ return [
155
+ g(e(ue), {
156
+ item: r,
157
+ active: Q,
158
+ "data-index": o,
159
+ "size-dependencies": (P = (C = t.virtual).sizeDependencies) == null ? void 0 : P.call(C, r)
160
+ }, {
161
+ default: h(() => [
162
+ u(t.$slots, "renderItem", {
163
+ item: r,
164
+ index: o
165
+ })
166
+ ]),
167
+ _: 2
168
+ }, 1032, ["item", "active", "data-index", "size-dependencies"])
169
+ ];
170
+ }),
171
+ _: 3
172
+ }, 8, ["items", "min-item-size", "class"]))
173
+ ], 64)) : u(t.$slots, "renderContent", {
174
+ key: 1,
175
+ dataSource: c.value
176
+ }, () => [
177
+ (i(!0), s(E, null, x(c.value, (r, o) => u(t.$slots, "renderItem", {
178
+ item: r,
179
+ index: o
180
+ })), 256))
181
+ ])
182
+ ], 6))
183
+ ], 2),
184
+ U.value ? (i(), s("div", {
185
+ key: 0,
186
+ class: l(e(y)("footer")),
187
+ style: v(t.footerWarpperStyle)
188
+ }, [
189
+ g(e(ae), ee(
190
+ f.value ? e(z) : e(oe)(e(D).pagination, ["showTotal"]),
191
+ { onChange: G }
192
+ ), null, 16)
193
+ ], 6)) : I("", !0)
194
+ ], 6));
188
195
  }
189
196
  });
190
197
  export {
191
- he as default
198
+ be as default
192
199
  };
@@ -86,6 +86,10 @@ export type ApListProps<RecordType = any, ParamsType = Recordable> = {
86
86
  * @default "id"
87
87
  */
88
88
  rowKey?: string;
89
+ /**
90
+ * 是否自适应外部容器高度(无数据时充满容器、数据超出时内部滚动)
91
+ */
92
+ adaptive?: boolean;
89
93
  };
90
94
  export type ApListExpose = {
91
95
  /**
@@ -27,16 +27,16 @@ const Ae = ({
27
27
  request: f,
28
28
  defaultParams: L = {},
29
29
  defaultData: v = [],
30
- formatParams: y,
31
- paramsValueTypeMap: O,
32
- resetFieldsIgnores: R,
30
+ formatParams: O,
31
+ paramsValueTypeMap: R,
32
+ resetFieldsIgnores: y,
33
33
  filterFields: J,
34
34
  sortFields: K,
35
35
  namespace: M = "ap-table",
36
36
  pagination: S
37
37
  }) => {
38
38
  let b = 0, i = {};
39
- const Q = Se(S), $ = (e) => y ? y(e) : e, z = ae(), c = j(ze(S)), {
39
+ const Q = Se(S), $ = (e) => O ? O(e) : e, z = ae(), c = j(ze(S)), {
40
40
  getColumnSFConfig: G,
41
41
  setSF: W,
42
42
  clearAll: Z,
@@ -46,7 +46,7 @@ const Ae = ({
46
46
  t: T
47
47
  } = me(), {
48
48
  b: P
49
- } = he(M), a = j({
49
+ } = he(M), o = j({
50
50
  total: v.length,
51
51
  records: v,
52
52
  loading: !1
@@ -56,32 +56,30 @@ const Ae = ({
56
56
  }, I = async (e) => {
57
57
  var r;
58
58
  const t = $(e), n = Date.now();
59
- b = n, a.loading = !0;
59
+ b = n, o.loading = !0;
60
60
  try {
61
- const o = await f({
61
+ const a = await f({
62
62
  ...m(L),
63
63
  ...t
64
64
  });
65
- b === n && (a.total = o.total || ((r = o.data) == null ? void 0 : r.length) || 0, a.records = [...o.data || []]);
65
+ b === n && (o.total = a.total || ((r = a.data) == null ? void 0 : r.length) || 0, o.records = [...a.data || []], o.loading = !1);
66
66
  } catch {
67
- b === n && (a.records = [], a.total = 0);
68
- } finally {
69
- a.loading = !1;
67
+ b === n && (o.records = [], o.total = 0, o.loading = !1);
70
68
  }
71
69
  }, V = (e) => {
72
70
  const t = {};
73
71
  return Object.entries(e).forEach(([n, r]) => {
74
- if (t[n] = r, O && r) {
75
- const o = O[n];
76
- o && (t[n] = le(o, r));
72
+ if (t[n] = r, R && r) {
73
+ const a = R[n];
74
+ a && (t[n] = le(a, r));
77
75
  }
78
76
  }), t;
79
77
  }, Y = async (e) => {
80
- var r, o, l, g, d;
78
+ var r, a, l, g, d;
81
79
  const t = w(), n = {};
82
80
  Object.entries(t).forEach(([p, F]) => {
83
- R && R.indexOf(p) > -1 && (n[p] = F);
84
- }), await ((o = (r = z.value) == null ? void 0 : r.apForm) == null ? void 0 : o.resetFields()), (d = (g = (l = z.value) == null ? void 0 : l.apForm) == null ? void 0 : g.setFieldsValue) == null || d.call(g, n), se(() => {
81
+ y && y.indexOf(p) > -1 && (n[p] = F);
82
+ }), await ((a = (r = z.value) == null ? void 0 : r.apForm) == null ? void 0 : a.resetFields()), (d = (g = (l = z.value) == null ? void 0 : l.apForm) == null ? void 0 : g.setFieldsValue) == null || d.call(g, n), se(() => {
85
83
  e == null || e();
86
84
  });
87
85
  }, C = (e) => {
@@ -113,7 +111,7 @@ const Ae = ({
113
111
  const {
114
112
  current: t,
115
113
  pageSize: n
116
- } = c, r = a.total - e, o = Math.ceil(r / n), l = t > o ? o : t;
114
+ } = c, r = o.total - e, a = Math.ceil(r / n), l = t > a ? a : t;
117
115
  k({
118
116
  current: l > 0 ? l : 1
119
117
  });
@@ -122,8 +120,8 @@ const Ae = ({
122
120
  var p, F;
123
121
  const r = w();
124
122
  c.current = e.current, c.pageSize = e.pageSize, W(t, n);
125
- const o = q(n) ? [...n] : [n], l = {};
126
- for (const u of o)
123
+ const a = q(n) ? [...n] : [n], l = {};
124
+ for (const u of a)
127
125
  (p = m(K)) != null && p.includes(u.columnKey || u.field) && u.order && (l[fe(u.columnKey || u.field)] = u.order);
128
126
  const g = {};
129
127
  for (const u of Object.keys(t))
@@ -158,16 +156,16 @@ const Ae = ({
158
156
  deep: !0
159
157
  });
160
158
  const ne = A(() => {
161
- if (a.total === 0)
159
+ if (o.total === 0)
162
160
  return "-";
163
161
  const {
164
162
  current: e,
165
163
  pageSize: t
166
164
  } = c;
167
- return `${e}/${Math.ceil(a.total / t)}`;
165
+ return `${e}/${Math.ceil(o.total / t)}`;
168
166
  });
169
167
  function re(e) {
170
- q(e) && (a.records = e, a.total = e.length);
168
+ q(e) && (o.records = e, o.total = e.length);
171
169
  }
172
170
  const oe = A(() => {
173
171
  const {
@@ -175,19 +173,19 @@ const Ae = ({
175
173
  showTotal: t,
176
174
  showQuickJumper: n,
177
175
  showSizeChanger: r,
178
- pageSizeOptions: o
176
+ pageSizeOptions: a
179
177
  } = Q;
180
178
  return {
181
- loading: a.loading,
179
+ loading: o.loading,
182
180
  pagination: {
183
181
  current: c.current,
184
182
  pageSize: c.pageSize,
185
- total: a.total,
183
+ total: o.total,
186
184
  showSizeChanger: N(r) ? r : !e,
187
185
  showQuickJumper: N(n) ? n : !e,
188
186
  showLessItems: e,
189
187
  size: "default",
190
- pageSizeOptions: pe(o) ? ["10", "20", "50", "100"] : o,
188
+ pageSizeOptions: pe(a) ? ["10", "20", "50", "100"] : a,
191
189
  showTotal: t ? (l) => x("span", {
192
190
  class: P("pagination-total-wrapper")
193
191
  }, [T("ap.apTable.pagination.totalLeftPrefix"), " ", x("span", {
@@ -199,7 +197,7 @@ const Ae = ({
199
197
  }, [m(ne)]), " ", T("ap.apTable.pagination.totalRightSuffix")])]) : void 0
200
198
  },
201
199
  onChange: _,
202
- dataSource: a.records
200
+ dataSource: o.records
203
201
  };
204
202
  });
205
203
  return {
@@ -208,12 +206,12 @@ const Ae = ({
208
206
  reset: ee,
209
207
  refresh: U,
210
208
  refreshByDelete: te,
211
- data: a,
209
+ data: o,
212
210
  current: c.current,
213
211
  pageSize: c.pageSize,
214
212
  handleTableChange: _,
215
213
  tableProps: oe,
216
- dataSource: A(() => a.records),
214
+ dataSource: A(() => o.records),
217
215
  setDataSource: re,
218
216
  getColumnSFConfig: G,
219
217
  sortedInfo: H,
@@ -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"),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 k=require("../../ap-form/context.js"),P=require("../../config-provider/hooks/use-namespace.js"),O=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:"medium"},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 w=o.useSlots(),n=C,{b}=P.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}=k.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=O.useGlobalConfig("valueTypeMap"),v=j.useGetEditableColumns(n,B);function N(e,t){var r;const u=((r=o.unref(d))==null?void 0:r.length)||0;if(h.isDef(n.maxLength)&&u>=n.maxLength)return;const l={...e||{}};a==null||a.setFieldValue(n.name,l,!0,(s,f)=>{if(!s[f]){s[f]=[l];return}i.isUndefined(t)?s[f].push(l):s[f].splice(t,0,l)})}function _(e,t="suffix"){var s;const u=((s=o.unref(d))==null?void 0:s.length)||0,l=i.isNumber(e)?e:e.length;if(h.isDef(n.maxLength)&&u+l>n.maxLength)return;const r=i.isNumber(e)?new Array(e).fill(0).map(()=>({})):i.cloneDeep(e);a==null||a.setFieldValue(n.name,r,!0,(f,c)=>{if(!f[c]){f[c]=[...r];return}t==="suffix"?f[c].push(...r):f[c].unshift(...r)})}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((r,s)=>!t.has(s))})}function q(){return o.unref(d)}function D(e){var t;return(t=o.unref(d))==null?void 0:t[e]}function L(e,t,u=!0){a==null||a.setFieldValue(n.name,void 0,!0,(l,r)=>{!l[r]||!l[r][e]||(l[r][e]={...u?l[r][e]:{},...t})})}function T(e){a==null||a.setFieldValue(n.name,e)}function V(e){var u;const t=e==="end"?d.value.length-1:e;(u=m.value)==null||u.scrollToRow(t)}function E(){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:L,addMultiple:_,scrollTo:V,setTableData:T,clear:E}),(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(b)(),columns:o.unref(v),"data-source":d.value,"search-form":!1}),o.createSlots({_:2},[o.renderList(w,(u,l)=>({name:l,fn:o.withCtx(r=>[o.renderSlot(e.$slots,l,o.normalizeProps(o.guardReactiveProps(r||{})))])}))]),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:{},rowSelection:{type:Boolean,default:void 0},onLoadingChange:{},onShownColumnsChange:{},pagination:{type:[Boolean,Object],default:!1},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},size:{default:"medium"},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 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 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(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 a=require("vue"),C=require("../../ap-form/index.js"),c=require("lodash-unified");require("../../config-provider/index.js");require("../../hooks/index.js");const y=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"),U=require("../index.vue.js"),W=a.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:"medium"},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:x,emit:v}){const b=a.useSlots(),n=w,{b:R}=I.useNamespace("editable-grid"),S=v,g=a.ref(),{value:p,updateValue:F}=G.useControllableValue(n,S),i=a.ref(),B=H.useGlobalConfig("valueTypeMap"),h=C.ApForm.useWatch(n.name,i);a.watch(()=>h.value,e=>{var t;F(e),(t=n.onChange)==null||t.call(n,e)},{deep:!0,flush:"post"}),a.watch(p,e=>{var t;e!==a.unref(h)&&(c.isEqual(e,a.unref(h))||(t=i.value)==null||t.setFieldValue(n.name,e))},{deep:!0});const _=z.useGetEditableColumns(n,B);function N(){var e;(e=i.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,t){var o;const l=await((o=i.value)==null?void 0:o.validateFields(V(e),t));return l==null?void 0:l[n.name]}function E(e,t){var u,r,s;const l=((u=a.unref(p))==null?void 0:u.length)||0;if(y.isDef(n.maxLength)&&l>=n.maxLength)return;const o={...e||{}};(s=(r=i.value)==null?void 0:r.setFieldValue)==null||s.call(r,n.name,o,!0,(d,f)=>{if(!d[f]){d[f]=[o];return}c.isUndefined(t)?d[f].push(o):d[f].splice(t,0,o)})}function L(e,t="suffix"){var r,s,d;const l=((r=a.unref(p))==null?void 0:r.length)||0,o=c.isNumber(e)?e:e.length;if(y.isDef(n.maxLength)&&l+o>n.maxLength)return;const u=c.isNumber(e)?new Array(e).fill(0).map(()=>({})):c.cloneDeep(e);(d=(s=i.value)==null?void 0:s.setFieldValue)==null||d.call(s,n.name,u,!0,(f,m)=>{if(!f[m]){f[m]=[...u];return}t==="suffix"?f[m].push(...u):f[m].unshift(...u)})}function A(e){var l,o;const t=new Set(c.isNumber(e)?[e]:e);(o=(l=i.value)==null?void 0:l.setFieldValue)==null||o.call(l,n.name,void 0,!0,(u,r)=>{u[r]=u[r].filter((s,d)=>!t.has(d))})}function D(){return a.unref(p)}function T(e){var t;(t=i.value)==null||t.setFieldValue(n.name,e)}function k(e){var t;return(t=a.unref(p))==null?void 0:t[e]}function j(e,t,l=!0){var o,u;(u=(o=i.value)==null?void 0:o.setFieldValue)==null||u.call(o,n.name,void 0,!0,(r,s)=>{!r[s]||!r[s][e]||(r[s][e]={...l?r[s][e]:{},...t})})}function O(e){var l;const t=e==="end"?p.value.length-1:e;(l=g.value)==null||l.scrollToRow(t)}function P(){var e,t;(t=(e=i.value)==null?void 0:e.setFieldValue)==null||t.call(e,n.name,[])}return x({resetFields:N,validateFields:q,add:E,remove:A,getRowData:k,getRowsData:D,setRowData:j,addMultiple:L,scrollTo:O,clear:P,setTableData:T}),(e,t)=>(a.openBlock(),a.createBlock(a.unref(C.ApForm),{ref_key:"formRef",ref:i,"initial-values":{[n.name]:a.unref(p)},style:{height:"100%"}},{default:a.withCtx(()=>[a.createVNode(a.unref(C.ApForm).FormItem,{name:e.name,"no-style":""},{default:a.withCtx(()=>[a.createVNode(U.default,a.mergeProps(a.unref(c.omit)(n,["name","value","onUpdate:value","maxLength","onChange","defaultValue"]),{ref_key:"tableRef",ref:g,class:a.unref(R)(),columns:a.unref(_),"data-source":a.unref(p),"search-form":!1}),a.createSlots({_:2},[a.renderList(b,(l,o)=>({name:o,fn:a.withCtx(u=>[a.renderSlot(e.$slots,o,a.normalizeProps(a.guardReactiveProps(u||{})))])}))]),1040,["class","columns","data-source"])]),_:3},8,["name"])]),_:3},8,["initial-values"]))}});exports.default=W;
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:"medium"},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 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),s=require("@aplus-frontend/antdv"),R=require("../ap-table/hooks/use-table-paging-ng.js");require("../config-provider/index.js");const c=require("lodash-unified"),$=require("./hooks/use-offline-list.js");require("vue-virtual-scroller/dist/vue-virtual-scroller.css");const m=require("vue-virtual-scroller"),j=require("../config-provider/hooks/use-namespace.js"),A=e.defineComponent({__name:"index",props:{dataSource:{},loading:{type:Boolean,default:void 0},onItem:{},params:{},request:{},defaultData:{},onLoadingChange:{},beforeSearchSubmit:{},pagination:{type:[Boolean,Object],default:void 0},manual:{type:Boolean},containerStyle:{type:[Boolean,null,String,Object,Array]},contentStyle:{type:[Boolean,null,String,Object,Array]},footerWarpperStyle:{type:[Boolean,null,String,Object,Array]},virtual:{default:void 0},rowKey:{}},setup(b,{expose:C}){const w=s.Empty.PRESENTED_IMAGE_SIMPLE,r=b,{b:i,e:z}=j.useNamespace("ap-list"),p=e.ref(),{formRef:g,submit:S,reset:y,handleTableChange:q,data:f,refresh:P,refreshByDelete:D,tableProps:h}=R.useTablePaging({async request(t){var a;const n=await((a=r.request)==null?void 0:a.call(r,t));return{data:(n==null?void 0:n.data)||[],total:(n==null?void 0:n.total)||0}},defaultParams:r.params,defaultData:r.defaultData,manual:r.manual,pagination:r.pagination,formatParams:r.beforeSearchSubmit}),E={form:g},{pagination:v,dataSource:N,onChange:V}=$.useOfflineList(r);function I(t,n){if(e.unref(u)){V(t,n);return}q({current:t,pageSize:n},{},{},{currentDataSource:[],action:"paginate"})}const l=e.computed(()=>e.unref(u)?e.unref(N):e.unref(f).records),d=e.computed(()=>c.isUndefined(r.loading)?e.unref(f).loading:r.loading),O=e.computed(()=>{var t,n;return r.pagination===!1||r.virtual?!1:((t=r.pagination)==null?void 0:t.hideOnSinglePage)!==!0?!0:e.unref(u)?(((n=r.dataSource)==null?void 0:n.length)||0)>e.unref(v).pageSize:e.unref(f).total>e.unref(h).pagination.pageSize}),u=e.computed(()=>!c.isUndefined(r.dataSource));e.watch(()=>e.unref(d),t=>{var n;(n=r.onLoadingChange)==null||n.call(r,t)});function T(t){var n,a;(a=(n=p.value)==null?void 0:n.querySelector(t||":first-child"))==null||a.scrollIntoView({behavior:"smooth",block:"center"})}function F(t=!1){var o;const n=(o=g.value)==null?void 0:o.apForm,a=t?n==null?void 0:n.getFieldsValueTransformed:n==null?void 0:n.getFieldsValue;return(a==null?void 0:a())||{}}return C({submit:()=>S(),reset:()=>y(),refresh:()=>P(),refreshByDelete:t=>D(t),scrollToFirstRow:T,getSearchFormValuesIfSetted:F}),(t,n)=>(e.openBlock(),e.createBlock(e.unref(s.Spin),{spinning:d.value,"wrapper-class-name":e.unref(i)("spin")},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(i)()),style:e.normalizeStyle(t.containerStyle)},[e.renderSlot(t.$slots,"header",{formIns:E,submit:e.unref(S),reset:e.unref(y)}),l.value.length===0?e.renderSlot(t.$slots,"empty",{key:0,loading:d.value},()=>[e.createVNode(e.unref(s.Empty),{image:e.unref(w)},null,8,["image"])]):(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"contentRef",ref:p,style:e.normalizeStyle(t.contentStyle)},[t.virtual?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.unref(c.isNumber)(t.virtual)?(e.openBlock(),e.createBlock(e.unref(m.RecycleScroller),{key:0,class:e.normalizeClass(e.unref(i)("scroll-wrapper")),items:l.value,"item-size":t.virtual,"key-field":r.rowKey||"id"},{default:e.withCtx(({item:a,index:o})=>[e.renderSlot(t.$slots,"renderItem",{item:a,index:o})]),_:3},8,["class","items","item-size","key-field"])):(e.openBlock(),e.createBlock(e.unref(m.DynamicScroller),{key:1,items:l.value,"min-item-size":t.virtual.minItemSize,class:e.normalizeClass(e.unref(i)("scroll-wrapper"))},{default:e.withCtx(({item:a,index:o,active:L})=>{var k,B;return[e.createVNode(e.unref(m.DynamicScrollerItem),{item:a,active:L,"data-index":o,"size-dependencies":(B=(k=t.virtual).sizeDependencies)==null?void 0:B.call(k,a)},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"renderItem",{item:a,index:o})]),_:2},1032,["item","active","data-index","size-dependencies"])]}),_:3},8,["items","min-item-size","class"]))],64)):e.renderSlot(t.$slots,"renderContent",{key:1,dataSource:l.value},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(a,o)=>e.renderSlot(t.$slots,"renderItem",{item:a,index:o})),256))])],4)),O.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(e.unref(z)("footer")),style:e.normalizeStyle(t.footerWarpperStyle)},[e.createVNode(e.unref(s.Pagination),e.mergeProps(u.value?e.unref(v):e.unref(c.omit)(e.unref(h).pagination,["showTotal"]),{onChange:I}),null,16)],6)):e.createCommentVNode("",!0)],6)]),_:3},8,["spinning","wrapper-class-name"]))}});exports.default=A;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("@aplus-frontend/antdv"),j=require("../ap-table/hooks/use-table-paging-ng.js");require("../config-provider/index.js");const d=require("lodash-unified"),A=require("./hooks/use-offline-list.js");require("vue-virtual-scroller/dist/vue-virtual-scroller.css");const p=require("vue-virtual-scroller"),M=require("../config-provider/hooks/use-namespace.js"),U=e.defineComponent({__name:"index",props:{dataSource:{},loading:{type:Boolean,default:void 0},onItem:{},params:{},request:{},defaultData:{},onLoadingChange:{},beforeSearchSubmit:{},pagination:{type:[Boolean,Object],default:void 0},manual:{type:Boolean},containerStyle:{type:[Boolean,null,String,Object,Array]},contentStyle:{type:[Boolean,null,String,Object,Array]},footerWarpperStyle:{type:[Boolean,null,String,Object,Array]},virtual:{default:void 0},rowKey:{},adaptive:{type:Boolean,default:!1}},setup(C,{expose:z}){const w=c.Empty.PRESENTED_IMAGE_SIMPLE,a=C,{b:u,e:f,bm:E,m:q}=M.useNamespace("ap-list"),g=e.ref(),{formRef:y,submit:S,reset:v,handleTableChange:P,data:m,refresh:D,refreshByDelete:N,tableProps:h}=j.useTablePaging({async request(n){var r;const t=await((r=a.request)==null?void 0:r.call(a,n));return{data:(t==null?void 0:t.data)||[],total:(t==null?void 0:t.total)||0}},defaultParams:a.params,defaultData:a.defaultData,manual:a.manual,pagination:a.pagination,formatParams:a.beforeSearchSubmit}),V={form:y},{pagination:k,dataSource:I,onChange:O}=A.useOfflineList(a);function T(n,t){if(e.unref(s)){O(n,t);return}P({current:n,pageSize:t},{},{},{currentDataSource:[],action:"paginate"})}const l=e.computed(()=>e.unref(s)?e.unref(I):e.unref(m).records),i=e.computed(()=>d.isUndefined(a.loading)?e.unref(m).loading:a.loading),F=e.computed(()=>{var n,t;return a.pagination===!1||a.virtual?!1:((n=a.pagination)==null?void 0:n.hideOnSinglePage)!==!0?!0:e.unref(s)?(((t=a.dataSource)==null?void 0:t.length)||0)>e.unref(k).pageSize:e.unref(m).total>e.unref(h).pagination.pageSize}),s=e.computed(()=>!d.isUndefined(a.dataSource));e.watch(()=>e.unref(i),n=>{var t;(t=a.onLoadingChange)==null||t.call(a,n)});function L(n){var t,r;(r=(t=g.value)==null?void 0:t.querySelector(n||":first-child"))==null||r.scrollIntoView({behavior:"smooth",block:"center"})}function R(n=!1){var o;const t=(o=y.value)==null?void 0:o.apForm,r=n?t==null?void 0:t.getFieldsValueTransformed:t==null?void 0:t.getFieldsValue;return(r==null?void 0:r())||{}}return z({submit:()=>S(),reset:()=>v(),refresh:()=>D(),refreshByDelete:n=>N(n),scrollToFirstRow:L,getSearchFormValuesIfSetted:R}),(n,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(u)(),{[e.unref(q)("adaptive")]:n.adaptive}]),style:e.normalizeStyle(n.containerStyle)},[e.renderSlot(n.$slots,"header",{formIns:V,submit:e.unref(S),reset:e.unref(v)}),e.createElementVNode("div",{class:e.normalizeClass([e.unref(u)("content-container"),{[e.unref(E)("content-container","spinning")]:i.value}])},[i.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(f)("spin-wrapper"))},[e.createVNode(e.unref(c.Spin),{spinning:i.value},null,8,["spinning"])],2)):e.createCommentVNode("",!0),l.value.length===0?e.renderSlot(n.$slots,"empty",{key:1,loading:i.value},()=>[e.createVNode(e.unref(c.Empty),{image:e.unref(w)},null,8,["image"])]):(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"contentRef",ref:g,style:e.normalizeStyle(n.contentStyle),class:e.normalizeClass(e.unref(f)("content"))},[n.virtual?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.unref(d.isNumber)(n.virtual)?(e.openBlock(),e.createBlock(e.unref(p.RecycleScroller),{key:0,class:e.normalizeClass(e.unref(u)("scroll-wrapper")),items:l.value,"item-size":n.virtual,"key-field":a.rowKey||"id"},{default:e.withCtx(({item:r,index:o})=>[e.renderSlot(n.$slots,"renderItem",{item:r,index:o})]),_:3},8,["class","items","item-size","key-field"])):(e.openBlock(),e.createBlock(e.unref(p.DynamicScroller),{key:1,items:l.value,"min-item-size":n.virtual.minItemSize,class:e.normalizeClass(e.unref(u)("scroll-wrapper"))},{default:e.withCtx(({item:r,index:o,active:$})=>{var B,b;return[e.createVNode(e.unref(p.DynamicScrollerItem),{item:r,active:$,"data-index":o,"size-dependencies":(b=(B=n.virtual).sizeDependencies)==null?void 0:b.call(B,r)},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"renderItem",{item:r,index:o})]),_:2},1032,["item","active","data-index","size-dependencies"])]}),_:3},8,["items","min-item-size","class"]))],64)):e.renderSlot(n.$slots,"renderContent",{key:1,dataSource:l.value},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(r,o)=>e.renderSlot(n.$slots,"renderItem",{item:r,index:o})),256))])],6))],2),F.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(f)("footer")),style:e.normalizeStyle(n.footerWarpperStyle)},[e.createVNode(e.unref(c.Pagination),e.mergeProps(s.value?e.unref(k):e.unref(d.omit)(e.unref(h).pagination,["showTotal"]),{onChange:T}),null,16)],6)):e.createCommentVNode("",!0)],6))}});exports.default=U;
@@ -86,6 +86,10 @@ export type ApListProps<RecordType = any, ParamsType = Recordable> = {
86
86
  * @default "id"
87
87
  */
88
88
  rowKey?: string;
89
+ /**
90
+ * 是否自适应外部容器高度(无数据时充满容器、数据超出时内部滚动)
91
+ */
92
+ adaptive?: boolean;
89
93
  };
90
94
  export type ApListExpose = {
91
95
  /**
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),re=require("./use-sorted-filtered.js");require("../../config-provider/index.js");const A=require("../utils.js"),E=require("lodash-unified"),_=require("../../utils/index.js"),ae=require("../../config-provider/hooks/use-locale.js"),oe=require("../../config-provider/hooks/use-namespace.js"),p=1,b=10,I={defaultCurrent:p,defaultPageSize:b,showLessItems:!1,showTotal:!0};function se(i){return i===!1?{}:i==null||i===!0?I:{...I,...i}}function ie(i){const d={};return i===!1||(i===!0||i==null?(d.current=p,d.pageSize=b):(d.current=i.defaultCurrent||p,d.pageSize=i.defaultPageSize||b)),d}const ce=({manual:i=!1,request:d,defaultParams:D={},defaultData:L=[],formatParams:v,paramsValueTypeMap:y,resetFieldsIgnores:N,filterFields:j,sortFields:M,namespace:B="ap-table",pagination:m})=>{let q=0,c={};const G=se(m),J=e=>v?v(e):e,T=a.ref(),u=a.reactive(ie(m)),{getColumnSFConfig:K,setSF:Q,clearAll:Z,sortedInfo:$,filteredInfo:W}=re.useTableSortedAndFiltered(),{t:z}=ae.useLocale(),{b:P}=oe.useNamespace(B),s=a.reactive({total:L.length,records:L,loading:!1}),F=()=>{var e,t;return((t=(e=T.value)==null?void 0:e.apForm)==null?void 0:t.getFieldsValueTransformed(!0))||{}},R=async e=>{var r;const t=J(e),n=Date.now();q=n,s.loading=!0;try{const o=await d({...a.unref(D),...t});q===n&&(s.total=o.total||((r=o.data)==null?void 0:r.length)||0,s.records=[...o.data||[]])}catch{q===n&&(s.records=[],s.total=0)}finally{s.loading=!1}},U=e=>{const t={};return Object.entries(e).forEach(([n,r])=>{if(t[n]=r,y&&r){const o=y[n];o&&(t[n]=A.parseFieldValue(o,r))}}),t},H=async e=>{var r,o,f,g,S;const t=F(),n={};Object.entries(t).forEach(([h,w])=>{N&&N.indexOf(h)>-1&&(n[h]=w)}),await((o=(r=T.value)==null?void 0:r.apForm)==null?void 0:o.resetFields()),(S=(g=(f=T.value)==null?void 0:f.apForm)==null?void 0:g.setFieldsValue)==null||S.call(g,n),a.nextTick(()=>{e==null||e()})},C=e=>{c=e;const t=U(e);R(t)},X=e=>{C({...c,...e})},x=()=>{const e=F(),t=m!==!1;t&&(u.current=p),C({...e,filter:c.filter,sort:c.sort,current:t?p:void 0,pageSize:t?c.pageSize||u.pageSize:void 0})},Y=()=>{Z(),c.sort={},c.filter={},H(x)},V=()=>{C(c)},k=e=>{if(m===!1)V();else{const{current:t,pageSize:n}=u,r=s.total-e,o=Math.ceil(r/n),f=t>o?o:t;X({current:f>0?f:1})}},O=(e,t,n)=>{var h,w;const r=F();u.current=e.current,u.pageSize=e.pageSize,Q(t,n);const o=E.isArray(n)?[...n]:[n],f={};for(const l of o)(h=a.unref(M))!=null&&h.includes(l.columnKey||l.field)&&l.order&&(f[A.dataIndexToStr(l.columnKey||l.field)]=l.order);const g={};for(const l of Object.keys(t))(w=a.unref(j))!=null&&w.includes(l)&&t[l]&&(g[l]=t[l]);const S={...r,filter:g,sort:f,current:e.current,pageSize:e.pageSize};E.isEqualWith(c,S,A.isEqualCustom)||C(S)};a.onMounted(()=>{const e=F(),{current:t,pageSize:n}=u;if(c={current:t,pageSize:n,filter:{},sort:{},...e},!i){const r=U(c);R(r)}}),a.watch(()=>a.unref(D),()=>{x()},{deep:!0});const ee=a.computed(()=>{if(s.total===0)return"-";const{current:e,pageSize:t}=u;return`${e}/${Math.ceil(s.total/t)}`});function te(e){E.isArray(e)&&(s.records=e,s.total=e.length)}const ne=a.computed(()=>{const{showLessItems:e,showTotal:t,showQuickJumper:n,showSizeChanger:r,pageSizeOptions:o}=G;return{loading:s.loading,pagination:{current:u.current,pageSize:u.pageSize,total:s.total,showSizeChanger:_.isDef(r)?r:!e,showQuickJumper:_.isDef(n)?n:!e,showLessItems:e,size:"default",pageSizeOptions:E.isUndefined(o)?["10","20","50","100"]:o,showTotal:t?f=>a.createVNode("span",{class:P("pagination-total-wrapper")},[z("ap.apTable.pagination.totalLeftPrefix")," ",a.createVNode("span",{class:P("pagination-count-text")},[f])," ",z("ap.apTable.pagination.totalLeftSuffix"),a.createVNode("span",{class:P("pagination--total-right")},[z("ap.apTable.pagination.totalRightPrefix")," ",a.createVNode("span",{class:P("pagination-count-text")},[a.unref(ee)])," ",z("ap.apTable.pagination.totalRightSuffix")])]):void 0},onChange:O,dataSource:s.records}});return{formRef:T,submit:x,reset:Y,refresh:V,refreshByDelete:k,data:s,current:u.current,pageSize:u.pageSize,handleTableChange:O,tableProps:ne,dataSource:a.computed(()=>s.records),setDataSource:te,getColumnSFConfig:K,sortedInfo:$,filteredInfo:W}};exports.DEFAULT_CURRENT=p;exports.DEFAULT_PAGE_SIZE=b;exports.useTablePaging=ce;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),re=require("./use-sorted-filtered.js");require("../../config-provider/index.js");const A=require("../utils.js"),E=require("lodash-unified"),_=require("../../utils/index.js"),ae=require("../../config-provider/hooks/use-locale.js"),oe=require("../../config-provider/hooks/use-namespace.js"),p=1,b=10,I={defaultCurrent:p,defaultPageSize:b,showLessItems:!1,showTotal:!0};function se(i){return i===!1?{}:i==null||i===!0?I:{...I,...i}}function ie(i){const d={};return i===!1||(i===!0||i==null?(d.current=p,d.pageSize=b):(d.current=i.defaultCurrent||p,d.pageSize=i.defaultPageSize||b)),d}const ce=({manual:i=!1,request:d,defaultParams:D={},defaultData:L=[],formatParams:v,paramsValueTypeMap:y,resetFieldsIgnores:N,filterFields:j,sortFields:M,namespace:B="ap-table",pagination:m})=>{let q=0,c={};const G=se(m),J=e=>v?v(e):e,T=a.ref(),u=a.reactive(ie(m)),{getColumnSFConfig:K,setSF:Q,clearAll:Z,sortedInfo:$,filteredInfo:W}=re.useTableSortedAndFiltered(),{t:z}=ae.useLocale(),{b:P}=oe.useNamespace(B),o=a.reactive({total:L.length,records:L,loading:!1}),F=()=>{var e,t;return((t=(e=T.value)==null?void 0:e.apForm)==null?void 0:t.getFieldsValueTransformed(!0))||{}},R=async e=>{var r;const t=J(e),n=Date.now();q=n,o.loading=!0;try{const s=await d({...a.unref(D),...t});q===n&&(o.total=s.total||((r=s.data)==null?void 0:r.length)||0,o.records=[...s.data||[]],o.loading=!1)}catch{q===n&&(o.records=[],o.total=0,o.loading=!1)}},U=e=>{const t={};return Object.entries(e).forEach(([n,r])=>{if(t[n]=r,y&&r){const s=y[n];s&&(t[n]=A.parseFieldValue(s,r))}}),t},H=async e=>{var r,s,f,g,S;const t=F(),n={};Object.entries(t).forEach(([h,w])=>{N&&N.indexOf(h)>-1&&(n[h]=w)}),await((s=(r=T.value)==null?void 0:r.apForm)==null?void 0:s.resetFields()),(S=(g=(f=T.value)==null?void 0:f.apForm)==null?void 0:g.setFieldsValue)==null||S.call(g,n),a.nextTick(()=>{e==null||e()})},C=e=>{c=e;const t=U(e);R(t)},X=e=>{C({...c,...e})},x=()=>{const e=F(),t=m!==!1;t&&(u.current=p),C({...e,filter:c.filter,sort:c.sort,current:t?p:void 0,pageSize:t?c.pageSize||u.pageSize:void 0})},Y=()=>{Z(),c.sort={},c.filter={},H(x)},V=()=>{C(c)},k=e=>{if(m===!1)V();else{const{current:t,pageSize:n}=u,r=o.total-e,s=Math.ceil(r/n),f=t>s?s:t;X({current:f>0?f:1})}},O=(e,t,n)=>{var h,w;const r=F();u.current=e.current,u.pageSize=e.pageSize,Q(t,n);const s=E.isArray(n)?[...n]:[n],f={};for(const l of s)(h=a.unref(M))!=null&&h.includes(l.columnKey||l.field)&&l.order&&(f[A.dataIndexToStr(l.columnKey||l.field)]=l.order);const g={};for(const l of Object.keys(t))(w=a.unref(j))!=null&&w.includes(l)&&t[l]&&(g[l]=t[l]);const S={...r,filter:g,sort:f,current:e.current,pageSize:e.pageSize};E.isEqualWith(c,S,A.isEqualCustom)||C(S)};a.onMounted(()=>{const e=F(),{current:t,pageSize:n}=u;if(c={current:t,pageSize:n,filter:{},sort:{},...e},!i){const r=U(c);R(r)}}),a.watch(()=>a.unref(D),()=>{x()},{deep:!0});const ee=a.computed(()=>{if(o.total===0)return"-";const{current:e,pageSize:t}=u;return`${e}/${Math.ceil(o.total/t)}`});function te(e){E.isArray(e)&&(o.records=e,o.total=e.length)}const ne=a.computed(()=>{const{showLessItems:e,showTotal:t,showQuickJumper:n,showSizeChanger:r,pageSizeOptions:s}=G;return{loading:o.loading,pagination:{current:u.current,pageSize:u.pageSize,total:o.total,showSizeChanger:_.isDef(r)?r:!e,showQuickJumper:_.isDef(n)?n:!e,showLessItems:e,size:"default",pageSizeOptions:E.isUndefined(s)?["10","20","50","100"]:s,showTotal:t?f=>a.createVNode("span",{class:P("pagination-total-wrapper")},[z("ap.apTable.pagination.totalLeftPrefix")," ",a.createVNode("span",{class:P("pagination-count-text")},[f])," ",z("ap.apTable.pagination.totalLeftSuffix"),a.createVNode("span",{class:P("pagination--total-right")},[z("ap.apTable.pagination.totalRightPrefix")," ",a.createVNode("span",{class:P("pagination-count-text")},[a.unref(ee)])," ",z("ap.apTable.pagination.totalRightSuffix")])]):void 0},onChange:O,dataSource:o.records}});return{formRef:T,submit:x,reset:Y,refresh:V,refreshByDelete:k,data:o,current:u.current,pageSize:u.pageSize,handleTableChange:O,tableProps:ne,dataSource:a.computed(()=>o.records),setDataSource:te,getColumnSFConfig:K,sortedInfo:$,filteredInfo:W}};exports.DEFAULT_CURRENT=p;exports.DEFAULT_PAGE_SIZE=b;exports.useTablePaging=ce;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aplus-frontend/ui",
3
- "version": "0.5.36",
3
+ "version": "0.5.37",
4
4
  "main": "./lib/index.js",
5
5
  "type": "module",
6
6
  "files": [
@@ -1,14 +1,48 @@
1
- .aplus-ap-list {
2
- padding: 16px 24px;
1
+ .aplus-ap-list-content-container {
2
+ position: relative;
3
+ }
4
+ .aplus-ap-list-content-container--spinning {
5
+ opacity: 0.5;
6
+ -webkit-user-select: none;
7
+ -moz-user-select: none;
8
+ user-select: none;
9
+ pointer-events: none;
3
10
  }
4
11
  .aplus-ap-list__footer {
5
12
  margin-top: 16px;
6
13
  display: flex;
7
14
  justify-content: flex-end;
8
15
  }
9
- .aplus-ap-list-spin {
10
- max-height: unset !important;
16
+ .aplus-ap-list__spin-wrapper {
17
+ position: absolute;
18
+ width: 100%;
19
+ top: 0;
20
+ bottom: 0;
21
+ border-radius: 4px;
22
+ display: flex;
23
+ justify-content: center;
24
+ align-items: center;
25
+ z-index: 1;
11
26
  }
12
27
  .aplus-ap-list-scroll-wrapper {
13
28
  height: 100%;
14
29
  }
30
+ .aplus-ap-list--adaptive {
31
+ height: 100%;
32
+ display: flex;
33
+ flex-direction: column;
34
+ }
35
+ .aplus-ap-list--adaptive .aplus-ap-list-content-container {
36
+ flex-grow: 1;
37
+ flex-shrink: 1;
38
+ overflow: hidden;
39
+ }
40
+ .aplus-ap-list--adaptive .aplus-ap-list-content-container:has(.ant-empty) {
41
+ display: flex;
42
+ justify-content: center;
43
+ align-items: center;
44
+ }
45
+ .aplus-ap-list--adaptive .aplus-ap-list-content-container .aplus-ap-list__content {
46
+ height: 100%;
47
+ overflow: auto;
48
+ }
@@ -1,16 +1,54 @@
1
1
  @import '../mixins/mixins.less';
2
2
 
3
+ @listCls: ~'@{ns}-ap-list';
4
+ @listContentContainerCls: ~'@{listCls}-content-container';
5
+ @contentCls: ~'@{listCls}__content';
6
+
3
7
  .b(ap-list, {
4
- padding: 16px 24px;
8
+ &-content-container {
9
+ position: relative;
10
+ &--spinning {
11
+ opacity: 0.5;
12
+ user-select: none;
13
+ pointer-events: none;
14
+ }
15
+ }
5
16
  &__footer {
6
17
  margin-top: 16px;
7
18
  display: flex;
8
19
  justify-content: flex-end;
9
20
  }
10
- &-spin {
11
- max-height: unset !important;
21
+ &__spin-wrapper {
22
+ position: absolute;
23
+ width: 100%;
24
+ top: 0;
25
+ bottom: 0;
26
+ border-radius: 4px;
27
+ display: flex;
28
+ justify-content: center;
29
+ align-items: center;
30
+ z-index: 1;
12
31
  }
13
32
  &-scroll-wrapper {
14
33
  height: 100%;
15
34
  }
35
+ &--adaptive {
36
+ height: 100%;
37
+ display: flex;
38
+ flex-direction: column;
39
+ .@{listContentContainerCls} {
40
+ flex-grow: 1;
41
+ flex-shrink: 1;
42
+ overflow: hidden;
43
+ &:has(.ant-empty) {
44
+ display: flex;
45
+ justify-content: center;
46
+ align-items: center;
47
+ }
48
+ .@{contentCls} {
49
+ height: 100%;
50
+ overflow: auto;
51
+ }
52
+ }
53
+ }
16
54
  });
package/theme/index.css CHANGED
@@ -863,20 +863,54 @@ div.aplus-ap-info-layout-admin__header-shadow.aplus-ap-info-layout-admin__sticky
863
863
  .aplus-ap-info-layout-admin__sticky_box-bordered {
864
864
  border-bottom: 1px solid #e9e9e9;
865
865
  }
866
- .aplus-ap-list {
867
- padding: 16px 24px;
866
+ .aplus-ap-list-content-container {
867
+ position: relative;
868
+ }
869
+ .aplus-ap-list-content-container--spinning {
870
+ opacity: 0.5;
871
+ -webkit-user-select: none;
872
+ -moz-user-select: none;
873
+ user-select: none;
874
+ pointer-events: none;
868
875
  }
869
876
  .aplus-ap-list__footer {
870
877
  margin-top: 16px;
871
878
  display: flex;
872
879
  justify-content: flex-end;
873
880
  }
874
- .aplus-ap-list-spin {
875
- max-height: unset !important;
881
+ .aplus-ap-list__spin-wrapper {
882
+ position: absolute;
883
+ width: 100%;
884
+ top: 0;
885
+ bottom: 0;
886
+ border-radius: 4px;
887
+ display: flex;
888
+ justify-content: center;
889
+ align-items: center;
890
+ z-index: 1;
876
891
  }
877
892
  .aplus-ap-list-scroll-wrapper {
878
893
  height: 100%;
879
894
  }
895
+ .aplus-ap-list--adaptive {
896
+ height: 100%;
897
+ display: flex;
898
+ flex-direction: column;
899
+ }
900
+ .aplus-ap-list--adaptive .aplus-ap-list-content-container {
901
+ flex-grow: 1;
902
+ flex-shrink: 1;
903
+ overflow: hidden;
904
+ }
905
+ .aplus-ap-list--adaptive .aplus-ap-list-content-container:has(.ant-empty) {
906
+ display: flex;
907
+ justify-content: center;
908
+ align-items: center;
909
+ }
910
+ .aplus-ap-list--adaptive .aplus-ap-list-content-container .aplus-ap-list__content {
911
+ height: 100%;
912
+ overflow: auto;
913
+ }
880
914
  .aplus-ap-select-layout {
881
915
  display: flex;
882
916
  height: 100%;