@aplus-frontend/ui 0.4.15 → 0.4.17

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 (39) hide show
  1. package/es/src/ap-table/ap-table.vue2.mjs +168 -169
  2. package/es/src/ap-table/hooks/use-sticky-scroll.d.ts +6 -0
  3. package/es/src/ap-table/hooks/use-sticky-scroll.mjs +16 -0
  4. package/es/src/ap-table/hooks/use-table-paging-ng.mjs +1 -1
  5. package/es/src/config-provider/css-var.d.ts +1 -0
  6. package/es/src/config-provider/css-var.mjs +1 -0
  7. package/es/src/scroll-bar/index.vue.d.ts +1 -0
  8. package/es/src/scroll-bar/index.vue.mjs +25 -21
  9. package/es/src/scroll-bar/interface.d.ts +2 -1
  10. package/es/src/theme/antd-global-overwrite/admin/index.css +28 -0
  11. package/es/src/theme/antd-global-overwrite/admin/table.css +28 -0
  12. package/es/src/theme/antd-global-overwrite/aplus/index.css +26 -6
  13. package/es/src/theme/antd-global-overwrite/aplus/table.css +26 -6
  14. package/es/src/utils/index.mjs +1 -1
  15. package/lib/src/ap-table/ap-table.vue2.js +1 -1
  16. package/lib/src/ap-table/hooks/use-sticky-scroll.d.ts +6 -0
  17. package/lib/src/ap-table/hooks/use-sticky-scroll.js +1 -0
  18. package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
  19. package/lib/src/config-provider/css-var.d.ts +1 -0
  20. package/lib/src/config-provider/css-var.js +1 -1
  21. package/lib/src/scroll-bar/index.vue.d.ts +1 -0
  22. package/lib/src/scroll-bar/index.vue.js +1 -1
  23. package/lib/src/scroll-bar/interface.d.ts +2 -1
  24. package/lib/src/theme/antd-global-overwrite/admin/index.css +28 -0
  25. package/lib/src/theme/antd-global-overwrite/admin/table.css +28 -0
  26. package/lib/src/theme/antd-global-overwrite/aplus/index.css +26 -6
  27. package/lib/src/theme/antd-global-overwrite/aplus/table.css +26 -6
  28. package/lib/src/utils/index.js +1 -1
  29. package/package.json +5 -5
  30. package/theme/antd-global-overwrite/admin/index.css +28 -0
  31. package/theme/antd-global-overwrite/admin/table.css +28 -0
  32. package/theme/antd-global-overwrite/admin/table.less +10 -0
  33. package/theme/antd-global-overwrite/aplus/index.css +26 -6
  34. package/theme/antd-global-overwrite/aplus/table.css +26 -6
  35. package/theme/antd-global-overwrite/aplus/table.less +9 -1
  36. package/theme/ap-table/ap-table.css +7 -5
  37. package/theme/ap-table/ap-table.less +17 -7
  38. package/theme/ap-table-modal/index.css +7 -5
  39. package/theme/index.css +7 -5
@@ -1,25 +1,27 @@
1
- import { defineComponent as ze, useSlots as Pe, ref as f, computed as s, unref as r, createVNode as m, Fragment as J, watchEffect as Ne, watch as I, openBlock as y, createElementBlock as x, normalizeClass as g, normalizeStyle as Q, mergeProps as S, createSlots as X, withCtx as w, renderList as Y, createBlock as Z, resolveDynamicComponent as Ie, renderSlot as R, createCommentVNode as ee, createElementVNode as E, normalizeProps as Ee, guardReactiveProps as Ke } from "vue";
1
+ import { defineComponent as ze, useSlots as Pe, ref as S, computed as s, unref as t, createVNode as f, Fragment as G, watchEffect as Ne, watch as J, openBlock as p, createElementBlock as B, normalizeClass as m, normalizeStyle as Q, mergeProps as h, createSlots as X, withCtx as w, renderList as Y, createBlock as Z, resolveDynamicComponent as Ie, renderSlot as R, createCommentVNode as ee, createElementVNode as N, normalizeProps as Ee, guardReactiveProps as Ke } from "vue";
2
2
  import { Divider as Oe, Table as Le } from "@aplus-frontend/antdv";
3
3
  import { useToken as Ve } from "@aplus-frontend/antdv/es/theme/internal";
4
4
  import { ApForm as Ae } from "../ap-form/index.mjs";
5
5
  import { noRenderAsFormItemValueList as oe } from "./constants.mjs";
6
6
  import "../config-provider/index.mjs";
7
7
  import { useTablePaging as De } from "./hooks/use-table-paging-ng.mjs";
8
- import { isUndefined as b, omit as ae, isBoolean as $e } from "lodash-unified";
9
- import { getColumnOrder as re, updateFormProps as je, getFieldProps as We, getSearchFormItemRenderNode as He, recursionApColumns as te, apColumnToColumn as _e, getTableTitle as qe, getTableRenderType as Ue, getTableRenderProps as Ge, getTableCellRenderNode as Me, falseToUndefined as Je } from "./utils.mjs";
8
+ import { isUndefined as y, omit as ae, isBoolean as $e } from "lodash-unified";
9
+ import { getColumnOrder as re, updateFormProps as We, getFieldProps as je, getSearchFormItemRenderNode as _e, recursionApColumns as te, apColumnToColumn as He, getTableTitle as Ue, getTableRenderType as qe, getTableRenderProps as Me, getTableCellRenderNode as Ge, falseToUndefined as Je } from "./utils.mjs";
10
10
  import Qe from "./hooks/use-table-content-height.mjs";
11
11
  import Xe from "./hooks/use-table-row-selection.mjs";
12
- import { getScrollbarSize as Ye, isDef as Ze } from "../utils/index.mjs";
12
+ import { isDef as Ye } from "../utils/index.mjs";
13
13
  import "./components/setting/modal/index.vue.mjs";
14
14
  import "./components/paragraph-ellipsis/index.vue.mjs";
15
- import { useProvideApTable as eo } from "./context.mjs";
15
+ import { useProvideApTable as Ze } from "./context.mjs";
16
16
  import "../scroll-bar/index.mjs";
17
- import { useNamespace as oo } from "../config-provider/hooks/use-namespace.mjs";
18
- import { useGlobalConfig as ao } from "../config-provider/hooks/use-global-config.mjs";
19
- import ro from "./components/paragraph-ellipsis/index.vue2.mjs";
20
- import to from "./components/setting/modal/index.vue2.mjs";
21
- import lo from "../scroll-bar/index.vue.mjs";
22
- const ko = /* @__PURE__ */ ze({
17
+ import { useStickyScroll as eo } from "./hooks/use-sticky-scroll.mjs";
18
+ import { scrollbarSize as oo } from "../config-provider/css-var.mjs";
19
+ import { useNamespace as ao } from "../config-provider/hooks/use-namespace.mjs";
20
+ import { useGlobalConfig as ro } from "../config-provider/hooks/use-global-config.mjs";
21
+ import to from "./components/paragraph-ellipsis/index.vue2.mjs";
22
+ import lo from "./components/setting/modal/index.vue2.mjs";
23
+ import no from "../scroll-bar/index.vue.mjs";
24
+ const No = /* @__PURE__ */ ze({
23
25
  name: "ApTable",
24
26
  __name: "ap-table",
25
27
  props: {
@@ -147,19 +149,22 @@ const ko = /* @__PURE__ */ ze({
147
149
  expose: ne
148
150
  }) {
149
151
  const o = le;
150
- let K = 0;
151
- const se = Ye(), v = Pe(), [, de] = Ve(), {
152
- e: B,
152
+ let I = 0;
153
+ const C = Pe(), [, se] = Ve(), {
154
+ e: x,
153
155
  b: i,
154
- be: O,
155
- bm: ue
156
- } = oo("ap-table"), L = ao("valueTypeMap"), {
157
- height: ie,
158
- contentRef: ce
159
- } = Qe(), k = f(o.size), u = f([]), V = f([]), A = f(), D = f(), $ = f();
160
- eo({
156
+ be: E,
157
+ m: de
158
+ } = ao("ap-table"), K = ro("valueTypeMap"), {
159
+ height: ue,
160
+ contentRef: ie
161
+ } = Qe(), O = S(), L = S(), {
162
+ isStickyMode: V,
163
+ scrollBarRef: ce
164
+ } = eo(O), k = S(o.size), u = S([]), A = S([]);
165
+ Ze({
161
166
  columns: s(() => u.value),
162
- columnsBackup: s(() => V.value),
167
+ columnsBackup: s(() => A.value),
163
168
  size: s(() => k.value),
164
169
  updateColumns(e) {
165
170
  u.value = e;
@@ -167,34 +172,34 @@ const ko = /* @__PURE__ */ ze({
167
172
  updateSize(e) {
168
173
  k.value = e;
169
174
  },
170
- dataSource: s(() => r(c).records)
175
+ dataSource: s(() => t(g).records)
171
176
  });
172
- const j = s(() => {
173
- var e, t, a;
174
- return K++, ((a = (t = (e = o.columns) == null ? void 0 : e.filter((l) => !l.hideInSearch && l.dataIndex && (l.valueType || l.customRenderFormItem) && !oe.includes(l.valueType))) == null ? void 0 : t.sort((l, d) => {
175
- let n = re(l.order);
177
+ const D = s(() => {
178
+ var e, l, a;
179
+ return I++, ((a = (l = (e = o.columns) == null ? void 0 : e.filter((r) => !r.hideInSearch && r.dataIndex && (r.valueType || r.customRenderFormItem) && !oe.includes(r.valueType))) == null ? void 0 : l.sort((r, d) => {
180
+ let n = re(r.order);
176
181
  return re(d.order) - n;
177
- })) == null ? void 0 : a.map((l) => {
178
- const d = je(l, We(l.fieldProps, {})), n = {
179
- ...l,
182
+ })) == null ? void 0 : a.map((r) => {
183
+ const d = We(r, je(r.fieldProps, {})), n = {
184
+ ...r,
180
185
  fieldProps: {
181
- label: l.title,
182
- name: l.dataIndex,
186
+ label: r.title,
187
+ name: r.dataIndex,
183
188
  ...d || {},
184
- _signal: K
189
+ _signal: I
185
190
  },
186
191
  renderNode: void 0
187
192
  };
188
- return n.renderNode = He(n, r(L)), n;
193
+ return n.renderNode = _e(n, t(K)), n;
189
194
  })) || [];
190
- }), pe = s(() => te(r(u), (e) => {
195
+ }), fe = s(() => te(t(u), (e) => {
191
196
  if (e.sorter === !0)
192
197
  return e.key || e.dataIndex;
193
- }).filter(Boolean)), fe = s(() => te(r(u), (e) => {
198
+ }).filter(Boolean)), pe = s(() => te(t(u), (e) => {
194
199
  if (e.filters && !e.onFilter)
195
200
  return e.key || e.dataIndex;
196
- }).filter(Boolean)), me = s(() => b(o.dataSource) ? c.records : o.dataSource), {
197
- rowSelection: C,
201
+ }).filter(Boolean)), me = s(() => y(o.dataSource) ? g.records : o.dataSource), {
202
+ rowSelection: v,
198
203
  selectedRows: T,
199
204
  ...F
200
205
  } = Xe({
@@ -204,85 +209,85 @@ const ko = /* @__PURE__ */ ze({
204
209
  dataSource: me
205
210
  }), {
206
211
  formRef: z,
207
- submit: W,
208
- reset: H,
209
- tableProps: _,
212
+ submit: $,
213
+ reset: W,
214
+ tableProps: j,
210
215
  refresh: ye,
211
- data: c,
216
+ data: g,
212
217
  setDataSource: ge,
213
218
  getColumnSFConfig: be
214
219
  } = De({
215
220
  async request(e) {
216
- var a, l;
217
- if (!C.value.preserveSelectedRowKeys && b(o.dataSource) && F.clearAll(), !b(o.dataSource))
221
+ var a, r;
222
+ if (!v.value.preserveSelectedRowKeys && y(o.dataSource) && F.clearAll(), !y(o.dataSource))
218
223
  return {
219
224
  data: o.dataSource || [],
220
225
  total: o.dataSource.length || 0
221
226
  };
222
- const t = await ((a = o.request) == null ? void 0 : a.call(o, e));
223
- return (l = o.onLoad) == null || l.call(o, (t == null ? void 0 : t.data) || []), {
224
- data: (t == null ? void 0 : t.data) || [],
225
- total: (t == null ? void 0 : t.total) || 0
227
+ const l = await ((a = o.request) == null ? void 0 : a.call(o, e));
228
+ return (r = o.onLoad) == null || r.call(o, (l == null ? void 0 : l.data) || []), {
229
+ data: (l == null ? void 0 : l.data) || [],
230
+ total: (l == null ? void 0 : l.total) || 0
226
231
  };
227
232
  },
228
- filterFields: fe,
229
- sortFields: pe,
233
+ filterFields: pe,
234
+ sortFields: fe,
230
235
  defaultParams: o.params,
231
236
  defaultData: o.defaultData,
232
237
  manual: o.manual,
233
238
  formatParams: o.beforeSearchSubmit,
234
239
  pagination: o.pagination
235
- }), he = () => {
240
+ }), Se = () => {
236
241
  var a;
237
- let e = ((a = o.columns) == null ? void 0 : a.filter((l) => !l.hideInTable)) || [];
238
- function t(l, d) {
239
- return l.map((n) => ({
240
- resizable: Ze(n.resizable) ? n.resizable : o.columnResizable,
241
- ...ae(_e(n), ["ellipsis"]),
242
+ let e = ((a = o.columns) == null ? void 0 : a.filter((r) => !r.hideInTable)) || [];
243
+ function l(r, d) {
244
+ return r.map((n) => ({
245
+ resizable: Ye(n.resizable) ? n.resizable : o.columnResizable,
246
+ ...ae(He(n), ["ellipsis"]),
242
247
  ...be(n),
243
248
  fixed: d ? d.fixed : n.fixed,
244
- title: qe(n, O("table-header", "title"), v.headerCell, r(de).colorPrimary),
249
+ title: Ue(n, E("table-header", "title"), C.headerCell, t(se).colorPrimary),
245
250
  customRender({
246
- value: p,
247
- ...h
251
+ value: c,
252
+ ...b
248
253
  }) {
249
- var G, M;
250
- const q = Ue(n), xe = Ge({
254
+ var q, M;
255
+ const H = qe(n), Be = Me({
251
256
  ...n,
252
- valueType: q
257
+ valueType: H
253
258
  }, {
254
- value: p,
255
- ...h
256
- }), Be = Me(q, xe, h.record, r(L)), U = ((G = n.renderText) == null ? void 0 : G.call(n, {
257
- value: p,
258
- ...h
259
- })) || p, ke = n.renderText ? m(J, null, [(M = n.renderText) == null ? void 0 : M.call(n, {
260
- value: p,
261
- ...h
262
- })]) : Be;
263
- let N = ve(n, U, ke);
264
- return n.customRender && (N = n.customRender({
265
- value: p,
266
- ...h,
259
+ value: c,
260
+ ...b
261
+ }), xe = Ge(H, Be, b.record, t(K)), U = ((q = n.renderText) == null ? void 0 : q.call(n, {
262
+ value: c,
263
+ ...b
264
+ })) || c, ke = n.renderText ? f(G, null, [(M = n.renderText) == null ? void 0 : M.call(n, {
265
+ value: c,
266
+ ...b
267
+ })]) : xe;
268
+ let P = Ce(n, U, ke);
269
+ return n.customRender && (P = n.customRender({
270
+ value: c,
271
+ ...b,
267
272
  column: n,
268
- originalNode: N,
273
+ originalNode: P,
269
274
  originalText: U
270
- })), N;
275
+ })), P;
271
276
  },
272
- children: t(n.children || [], d || n)
277
+ children: l(n.children || [], d || n)
273
278
  }));
274
279
  }
275
- return t(e);
280
+ return l(e);
276
281
  };
277
282
  Ne(() => {
278
- const e = he();
279
- u.value = e, V.value = e;
283
+ const e = Se();
284
+ u.value = e, A.value = e;
280
285
  });
281
- const Se = s(() => {
282
- var t, a;
283
- if (o.adaptive && (c.total > 0 || ((t = o.dataSource) == null ? void 0 : t.length)))
286
+ const he = s(() => {
287
+ var l, a;
288
+ if (o.adaptive && (g.total > 0 || ((l = o.dataSource) == null ? void 0 : l.length)))
284
289
  return {
285
- y: r(ie),
290
+ y: t(ue),
286
291
  x: ((a = o.scroll) == null ? void 0 : a.x) || "100%"
287
292
  };
288
293
  if (o.scroll)
@@ -291,29 +296,26 @@ const ko = /* @__PURE__ */ ze({
291
296
  var e;
292
297
  if (o.tableLayout)
293
298
  return o.tableLayout;
294
- if ((e = o.columns) != null && e.some((t) => t.ellipsis))
299
+ if ((e = o.columns) != null && e.some((l) => l.ellipsis))
295
300
  return "fixed";
296
- }), P = s(() => {
301
+ }), _ = s(() => {
297
302
  var a;
298
- const e = r(_), t = r(C);
303
+ const e = t(j), l = t(v);
299
304
  return {
300
305
  ...o,
301
306
  ...e,
302
307
  rowSelection: o.rowSelection === !0 || ((a = o.rowSelection) == null ? void 0 : a.mode) === "internal" ? {
303
- ...t,
308
+ ...l,
304
309
  // tips 如果是前端分页,则默认会走缓存
305
- preserveSelectedRowKeys: b(o.dataSource) ? t.preserveSelectedRowKeys : !0
310
+ preserveSelectedRowKeys: y(o.dataSource) ? l.preserveSelectedRowKeys : !0
306
311
  } : Je(o.rowSelection),
307
- loading: b(o.loading) ? e.loading : o.loading,
312
+ loading: y(o.loading) ? e.loading : o.loading,
308
313
  pagination: o.pagination === !1 ? !1 : e.pagination,
309
- scroll: r(Se)
314
+ scroll: t(he)
310
315
  };
311
- }), Re = s(() => {
312
- var e;
313
- return [i(), o.card ? null : i("wrapper"), o.adaptive ? i("adaptive") : null, (e = D.value) != null && e.visible ? ue("horizontal", "scrollable") : null].filter(Boolean);
314
- });
315
- function ve(e, t, a) {
316
- return oe.includes(e.valueType) ? a : e.copyable || e.ellipsis ? m(ro, {
316
+ }), Re = s(() => [i(), o.card ? null : i("wrapper"), o.adaptive ? i("adaptive") : null, V ? de(`sticky-${oo === 0 ? "absolute" : "relative"}`) : null].filter(Boolean));
317
+ function Ce(e, l, a) {
318
+ return oe.includes(e.valueType) ? a : e.copyable || e.ellipsis ? f(to, {
317
319
  copyable: e.copyable,
318
320
  ellipsis: e.ellipsis ? $e(e.ellipsis) ? {
319
321
  tooltip: a,
@@ -325,62 +327,55 @@ const ko = /* @__PURE__ */ ze({
325
327
  content: a
326
328
  }, null) : a;
327
329
  }
328
- I(() => r(c).loading, (e) => {
329
- var t;
330
- (t = o.onLoadingChange) == null || t.call(o, e);
331
- }), I(() => r(c).records, () => {
332
- var e;
333
- $.value = (e = A.value) == null ? void 0 : e.querySelector(".ant-table-container > div:last-child");
334
- }, {
335
- flush: "post",
336
- immediate: !0,
337
- deep: !0
338
- }), I(() => o.dataSource, (e) => {
330
+ J(() => t(g).loading, (e) => {
331
+ var l;
332
+ (l = o.onLoadingChange) == null || l.call(o, e);
333
+ }), J(() => o.dataSource, (e) => {
339
334
  ge(e);
340
335
  }, {
341
336
  immediate: !0
342
337
  });
343
- function Ce(e) {
344
- var t, a, l;
345
- (l = (a = (t = z.value) == null ? void 0 : t.apForm) == null ? void 0 : a.setFieldsValue) == null || l.call(a, e);
338
+ function ve(e) {
339
+ var l, a, r;
340
+ (r = (a = (l = z.value) == null ? void 0 : l.apForm) == null ? void 0 : a.setFieldsValue) == null || r.call(a, e);
346
341
  }
347
342
  function Te(e = !1) {
348
- var a, l, d;
349
- const t = e ? "getFieldsValueTransformed" : "getFieldsValue";
350
- return (d = (l = (a = z.value) == null ? void 0 : a.apForm) == null ? void 0 : l[t]) == null ? void 0 : d.call(l, !0);
343
+ var a, r, d;
344
+ const l = e ? "getFieldsValueTransformed" : "getFieldsValue";
345
+ return (d = (r = (a = z.value) == null ? void 0 : a.apForm) == null ? void 0 : r[l]) == null ? void 0 : d.call(r, !0);
351
346
  }
352
347
  function Fe() {
353
- return r(u);
348
+ return t(u);
354
349
  }
355
350
  return ne({
356
- submit: () => W(),
357
- reset: () => H(),
351
+ submit: () => $(),
352
+ reset: () => W(),
358
353
  refresh: () => ye(),
359
- setSearchFormValues: Ce,
354
+ setSearchFormValues: ve,
360
355
  getSearchFormValues: Te,
361
356
  getShownColumns: Fe,
362
- dataSource: s(() => r(c).records),
357
+ dataSource: s(() => t(g).records),
363
358
  rowSelection: {
364
- selectedRows: s(() => r(T)),
359
+ selectedRows: s(() => t(T)),
365
360
  ...F
366
361
  }
367
- }), (e, t) => (y(), x("div", {
368
- ref_key: "apTableRef",
369
- ref: A,
370
- class: g(Re.value)
371
- }, [r(b)(e.dataSource) && e.searchForm !== !1 && j.value.length > 0 ? (y(), x("div", {
362
+ }), (e, l) => (p(), B("div", {
363
+ ref_key: "tableWrapperRef",
364
+ ref: O,
365
+ class: m(Re.value)
366
+ }, [t(y)(e.dataSource) && e.searchForm !== !1 && D.value.length > 0 ? (p(), B("div", {
372
367
  key: 0,
373
- class: g(e.card ? r(B)("search-wrapper") : null),
368
+ class: m(e.card ? t(x)("search-wrapper") : null),
374
369
  style: Q(e.searchFormWrapperStyle)
375
- }, [m(r(Ae).SearchForm, S(e.searchForm || {}, {
370
+ }, [f(t(Ae).SearchForm, h(e.searchForm || {}, {
376
371
  ref_key: "formRef",
377
372
  ref: z,
378
373
  "custom-reset": "",
379
- "submit-loading": r(_).loading,
380
- onSubmit: r(W),
381
- onReset: r(H)
374
+ "submit-loading": t(j).loading,
375
+ onSubmit: t($),
376
+ onReset: t(W)
382
377
  }), X({
383
- default: w(() => [(y(!0), x(J, null, Y(j.value, (a) => (y(), Z(Ie(a.renderNode.Comp), S({
378
+ default: w(() => [(p(!0), B(G, null, Y(D.value, (a) => (p(), Z(Ie(a.renderNode.Comp), h({
384
379
  key: a.dataIndex,
385
380
  item: a,
386
381
  ref_for: !0
@@ -389,66 +384,70 @@ const ko = /* @__PURE__ */ ze({
389
384
  "custom-render": a.renderNode.render
390
385
  }), null, 16, ["item", "span", "custom-render"]))), 128))]),
391
386
  _: 2
392
- }, [v.searchFormExtra ? {
387
+ }, [C.searchFormExtra ? {
393
388
  name: "extra",
394
389
  fn: w(() => [R(e.$slots, "searchFormExtra")]),
395
390
  key: "0"
396
- } : void 0]), 1040, ["submit-loading", "onSubmit", "onReset"])], 6)) : ee("", !0), E("div", {
391
+ } : void 0]), 1040, ["submit-loading", "onSubmit", "onReset"])], 6)) : ee("", !0), N("div", {
397
392
  ref_key: "contentRef",
398
- ref: ce,
399
- class: g([r(B)("table-wrapper"), e.card ? r(B)("table-wrapper-card") : null]),
393
+ ref: ie,
394
+ class: m([t(x)("table-wrapper"), e.card ? t(x)("table-wrapper-card") : null]),
400
395
  style: Q(e.tableWrapperStyle)
401
- }, [E("div", {
402
- class: g(r(i)("header-wrapper"))
403
- }, [e.settings ? (y(), x("div", {
396
+ }, [N("div", {
397
+ class: m(t(i)("header-wrapper"))
398
+ }, [e.settings ? (p(), B("div", {
404
399
  key: 0,
405
- class: g(r(i)("header"))
406
- }, [E("div", {
407
- class: g(r(O)("header", "title"))
408
- }, [R(e.$slots, "title", S({
409
- selectedRows: r(T),
410
- selectedRowKeys: r(C).selectedRowKeys,
400
+ class: m(t(i)("header"))
401
+ }, [N("div", {
402
+ class: m(t(E)("header", "title"))
403
+ }, [R(e.$slots, "title", h({
404
+ selectedRows: t(T),
405
+ selectedRowKeys: t(v).selectedRowKeys,
411
406
  shownColumns: u.value
412
- }, F))], 2), v.title ? (y(), Z(r(Oe), {
407
+ }, F))], 2), C.title ? (p(), Z(t(Oe), {
413
408
  key: 0,
414
409
  type: "vertical"
415
- })) : ee("", !0), m(to, {
410
+ })) : ee("", !0), f(lo, {
416
411
  config: e.settings === !0 ? {} : e.settings
417
- }, null, 8, ["config"])], 2)) : R(e.$slots, "title", S({
412
+ }, null, 8, ["config"])], 2)) : R(e.$slots, "title", h({
418
413
  key: 1,
419
- selectedRows: r(T),
420
- selectedRowKeys: r(C).selectedRowKeys,
414
+ selectedRows: t(T),
415
+ selectedRowKeys: t(v).selectedRowKeys,
421
416
  shownColumns: u.value
422
- }, F))], 2), m(r(Le), S({
423
- class: r(i)("table")
424
- }, P.value, {
417
+ }, F))], 2), f(t(Le), h({
418
+ ref_key: "antdTableRef",
419
+ ref: L,
420
+ class: t(i)("table")
421
+ }, _.value, {
425
422
  size: k.value,
426
423
  "table-layout": we.value,
427
424
  columns: u.value,
428
- onResizeColumn: t[0] || (t[0] = (a, l) => l.width = a)
425
+ onResizeColumn: l[0] || (l[0] = (a, r) => r.width = a)
429
426
  }), X({
430
427
  summary: w(() => [R(e.$slots, "summary", {
431
428
  columns: u.value,
432
- records: P.value.dataSource,
433
- selectedRows: r(T)
429
+ records: _.value.dataSource,
430
+ selectedRows: t(T)
434
431
  })]),
435
- bottomPaginationTop: w(() => {
436
- var a;
437
- return [m(r(lo), {
432
+ _: 2
433
+ }, [t(V) ? {
434
+ name: "bottomPaginationTop",
435
+ fn: w(() => {
436
+ var a, r;
437
+ return [f(t(no), {
438
438
  ref_key: "scrollBarRef",
439
- ref: D,
440
- "scroll-container": $.value,
441
- direction: "horizontal",
442
- "extra-size": (a = P.value.scroll) != null && a.y ? r(se) : 0
443
- }, null, 8, ["scroll-container", "extra-size"])];
439
+ ref: ce,
440
+ "scroll-container": (r = (a = L.value) == null ? void 0 : a.table) == null ? void 0 : r.scrollBodyRef,
441
+ direction: "horizontal"
442
+ }, null, 8, ["scroll-container"])];
444
443
  }),
445
- _: 2
446
- }, [Y(r(ae)(v, ["title", "searchFormExtra", "headerCell", "summary"]), (a, l) => ({
447
- name: l,
448
- fn: w((d) => [R(e.$slots, l, Ee(Ke(d || {})))])
444
+ key: "0"
445
+ } : void 0, Y(t(ae)(C, ["title", "searchFormExtra", "headerCell", "summary"]), (a, r) => ({
446
+ name: r,
447
+ fn: w((d) => [R(e.$slots, r, Ee(Ke(d || {})))])
449
448
  }))]), 1040, ["class", "size", "table-layout", "columns"])], 6)], 2));
450
449
  }
451
450
  });
452
451
  export {
453
- ko as default
452
+ No as default
454
453
  };
@@ -0,0 +1,6 @@
1
+ import { ScrollBarExpose } from '../../scroll-bar';
2
+ import { Ref, ComputedRef } from 'vue';
3
+ export declare const useStickyScroll: (tableWrapper: Ref<HTMLElement | undefined>) => {
4
+ isStickyMode: ComputedRef<boolean>;
5
+ scrollBarRef: Ref<ScrollBarExpose | undefined, ScrollBarExpose | undefined>;
6
+ };
@@ -0,0 +1,16 @@
1
+ import { ref as o, computed as e } from "vue";
2
+ const i = "ap-table--sticky", r = (t) => {
3
+ const c = o();
4
+ return {
5
+ isStickyMode: e(
6
+ () => {
7
+ var s;
8
+ return ((s = t.value) == null ? void 0 : s.classList.contains(i)) || !1;
9
+ }
10
+ ),
11
+ scrollBarRef: c
12
+ };
13
+ };
14
+ export {
15
+ r as useStickyScroll
16
+ };
@@ -5,7 +5,7 @@ import { parseFieldValue as ae, dataIndexToStr as se, isEqualCustom as ce } from
5
5
  import { isArray as N, isEqualWith as ie } from "lodash-unified";
6
6
  import { useLocale as le } from "../../config-provider/hooks/use-locale.mjs";
7
7
  import { useNamespace as ue } from "../../config-provider/hooks/use-namespace.mjs";
8
- const S = 1, L = 100;
8
+ const S = 1, L = 10;
9
9
  function fe(g) {
10
10
  const l = {};
11
11
  return g && (g === !0 ? (l.current = S, l.pageSize = L) : (l.current = g.defaultCurrent || S, l.pageSize = g.defaultPageSize || L)), l;
@@ -1,4 +1,5 @@
1
1
  import { RecursivePartial } from '../type';
2
+ export declare const scrollbarSize: number;
2
3
  declare const aplusCssVarObj: {
3
4
  'ap-form': {
4
5
  bordered: {
@@ -231,5 +231,6 @@ export {
231
231
  m as adminCssVar,
232
232
  g as aplusCssVar,
233
233
  n as generateCssVar,
234
+ l as scrollbarSize,
234
235
  D as setCSSVariables
235
236
  };
@@ -4,6 +4,7 @@ declare const _default: DefineComponent<ScrollBarProps, {
4
4
  currentScroll: ComputedRef<number | undefined>;
5
5
  scroll: ((percent: number) => void) | undefined;
6
6
  visible: ComputedRef<boolean>;
7
+ rootElement: ComputedRef<HTMLElement | undefined>;
7
8
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ScrollBarProps> & Readonly<{}>, {
8
9
  disabled: boolean;
9
10
  direction: ScrollBarDirection;
@@ -1,7 +1,7 @@
1
- import { defineComponent as g, toRef as x, ref as d, watchEffect as _, unref as i, watch as k, computed as p, openBlock as C, createBlock as B, mergeProps as L, createCommentVNode as R } from "vue";
1
+ import { defineComponent as g, toRef as x, ref as p, watchEffect as _, unref as a, watch as k, computed as s, openBlock as C, createBlock as B, mergeProps as L, createCommentVNode as R } from "vue";
2
2
  import "./internal.vue2.mjs";
3
3
  import { omit as w } from "lodash-unified";
4
- import { getScrollable as s, ensureRangeValue as y } from "./utils/index.mjs";
4
+ import { getScrollable as u, ensureRangeValue as y } from "./utils/index.mjs";
5
5
  import { useResizeObserver as E } from "@vueuse/core";
6
6
  import N from "./internal.vue.mjs";
7
7
  const j = /* @__PURE__ */ g({
@@ -25,18 +25,18 @@ const j = /* @__PURE__ */ g({
25
25
  onScrollEnd: {}
26
26
  },
27
27
  setup(S, { expose: m }) {
28
- var f;
29
- const r = S, o = x(r, "scrollContainer"), l = d(), n = d(r.barLength);
28
+ var d;
29
+ const r = S, o = x(r, "scrollContainer"), l = p(), n = p(r.barLength);
30
30
  function v() {
31
31
  if (!o.value || !l.value) return;
32
- const { totalSize: e, visibleSize: t, distance: a } = s(
32
+ const { totalSize: e, visibleSize: t, distance: c } = u(
33
33
  o.value,
34
34
  r.direction
35
- ), c = a / (e + r.extraSize - t || 1) * 100;
36
- l.value.scroll(c);
35
+ ), i = c / (e + r.extraSize - t || 1) * 100;
36
+ l.value.scroll(i);
37
37
  }
38
- function u() {
39
- const { visibleSize: e, totalSize: t } = s(
38
+ function f() {
39
+ const { visibleSize: e, totalSize: t } = u(
40
40
  o.value,
41
41
  r.direction
42
42
  );
@@ -45,11 +45,11 @@ const j = /* @__PURE__ */ g({
45
45
  );
46
46
  }
47
47
  E(o, () => {
48
- u();
48
+ f();
49
49
  }), _(
50
50
  () => {
51
- const e = i(o.value);
52
- e && (u(), e.addEventListener("scroll", v));
51
+ const e = a(o.value);
52
+ e && (f(), e.addEventListener("scroll", v));
53
53
  },
54
54
  { flush: "post" }
55
55
  ), k(
@@ -59,28 +59,32 @@ const j = /* @__PURE__ */ g({
59
59
  }
60
60
  );
61
61
  function b(e) {
62
- const t = i(o);
62
+ const t = a(o);
63
63
  if (!t) return;
64
- const { totalSize: a, visibleSize: c, topOrLeft: h } = s(
64
+ const { totalSize: c, visibleSize: i, topOrLeft: h } = u(
65
65
  t,
66
66
  r.direction
67
67
  );
68
- if (a <= c) return;
68
+ if (c <= i) return;
69
69
  const z = `scroll${h}`;
70
- t[z] = e * (a + r.extraSize - c) / 100;
70
+ t[z] = e * (c + r.extraSize - i) / 100;
71
71
  }
72
72
  return m({
73
- currentScroll: p(() => {
73
+ currentScroll: s(() => {
74
74
  var e;
75
- return i((e = l.value) == null ? void 0 : e.currentScroll);
75
+ return a((e = l.value) == null ? void 0 : e.currentScroll);
76
76
  }),
77
- scroll: (f = l.value) == null ? void 0 : f.scroll,
78
- visible: p(() => n.value < 100)
77
+ scroll: (d = l.value) == null ? void 0 : d.scroll,
78
+ visible: s(() => n.value < 100),
79
+ rootElement: s(() => {
80
+ var e;
81
+ return a((e = l.value) == null ? void 0 : e.container);
82
+ })
79
83
  }), (e, t) => n.value !== 100 ? (C(), B(N, L({
80
84
  key: 0,
81
85
  ref_key: "barRef",
82
86
  ref: l
83
- }, i(w)(r, ["onScroll", "extraSize", "scrollContainer"]), {
87
+ }, a(w)(r, ["onScroll", "extraSize", "scrollContainer"]), {
84
88
  "bar-length": n.value,
85
89
  onScroll: b
86
90
  }), null, 16, ["bar-length"])) : R("", !0);