@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.
- package/es/src/ap-table/ap-table.vue2.mjs +168 -169
- package/es/src/ap-table/hooks/use-sticky-scroll.d.ts +6 -0
- package/es/src/ap-table/hooks/use-sticky-scroll.mjs +16 -0
- package/es/src/ap-table/hooks/use-table-paging-ng.mjs +1 -1
- package/es/src/config-provider/css-var.d.ts +1 -0
- package/es/src/config-provider/css-var.mjs +1 -0
- package/es/src/scroll-bar/index.vue.d.ts +1 -0
- package/es/src/scroll-bar/index.vue.mjs +25 -21
- package/es/src/scroll-bar/interface.d.ts +2 -1
- package/es/src/theme/antd-global-overwrite/admin/index.css +28 -0
- package/es/src/theme/antd-global-overwrite/admin/table.css +28 -0
- package/es/src/theme/antd-global-overwrite/aplus/index.css +26 -6
- package/es/src/theme/antd-global-overwrite/aplus/table.css +26 -6
- package/es/src/utils/index.mjs +1 -1
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/hooks/use-sticky-scroll.d.ts +6 -0
- package/lib/src/ap-table/hooks/use-sticky-scroll.js +1 -0
- package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
- package/lib/src/config-provider/css-var.d.ts +1 -0
- package/lib/src/config-provider/css-var.js +1 -1
- package/lib/src/scroll-bar/index.vue.d.ts +1 -0
- package/lib/src/scroll-bar/index.vue.js +1 -1
- package/lib/src/scroll-bar/interface.d.ts +2 -1
- package/lib/src/theme/antd-global-overwrite/admin/index.css +28 -0
- package/lib/src/theme/antd-global-overwrite/admin/table.css +28 -0
- package/lib/src/theme/antd-global-overwrite/aplus/index.css +26 -6
- package/lib/src/theme/antd-global-overwrite/aplus/table.css +26 -6
- package/lib/src/utils/index.js +1 -1
- package/package.json +5 -5
- package/theme/antd-global-overwrite/admin/index.css +28 -0
- package/theme/antd-global-overwrite/admin/table.css +28 -0
- package/theme/antd-global-overwrite/admin/table.less +10 -0
- package/theme/antd-global-overwrite/aplus/index.css +26 -6
- package/theme/antd-global-overwrite/aplus/table.css +26 -6
- package/theme/antd-global-overwrite/aplus/table.less +9 -1
- package/theme/ap-table/ap-table.css +7 -5
- package/theme/ap-table/ap-table.less +17 -7
- package/theme/ap-table-modal/index.css +7 -5
- package/theme/index.css +7 -5
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
import { defineComponent as ze, useSlots as Pe, ref as
|
|
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
|
|
9
|
-
import { getColumnOrder as re, updateFormProps as
|
|
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 {
|
|
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
|
|
15
|
+
import { useProvideApTable as Ze } from "./context.mjs";
|
|
16
16
|
import "../scroll-bar/index.mjs";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
|
|
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
|
|
151
|
-
const
|
|
152
|
-
e:
|
|
152
|
+
let I = 0;
|
|
153
|
+
const C = Pe(), [, se] = Ve(), {
|
|
154
|
+
e: x,
|
|
153
155
|
b: i,
|
|
154
|
-
be:
|
|
155
|
-
|
|
156
|
-
} =
|
|
157
|
-
height:
|
|
158
|
-
contentRef:
|
|
159
|
-
} = Qe(),
|
|
160
|
-
|
|
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(() =>
|
|
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(() =>
|
|
175
|
+
dataSource: s(() => t(g).records)
|
|
171
176
|
});
|
|
172
|
-
const
|
|
173
|
-
var e,
|
|
174
|
-
return
|
|
175
|
-
let n = re(
|
|
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((
|
|
178
|
-
const d =
|
|
179
|
-
...
|
|
182
|
+
})) == null ? void 0 : a.map((r) => {
|
|
183
|
+
const d = We(r, je(r.fieldProps, {})), n = {
|
|
184
|
+
...r,
|
|
180
185
|
fieldProps: {
|
|
181
|
-
label:
|
|
182
|
-
name:
|
|
186
|
+
label: r.title,
|
|
187
|
+
name: r.dataIndex,
|
|
183
188
|
...d || {},
|
|
184
|
-
_signal:
|
|
189
|
+
_signal: I
|
|
185
190
|
},
|
|
186
191
|
renderNode: void 0
|
|
187
192
|
};
|
|
188
|
-
return n.renderNode =
|
|
193
|
+
return n.renderNode = _e(n, t(K)), n;
|
|
189
194
|
})) || [];
|
|
190
|
-
}),
|
|
195
|
+
}), fe = s(() => te(t(u), (e) => {
|
|
191
196
|
if (e.sorter === !0)
|
|
192
197
|
return e.key || e.dataIndex;
|
|
193
|
-
}).filter(Boolean)),
|
|
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(() =>
|
|
197
|
-
rowSelection:
|
|
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:
|
|
208
|
-
reset:
|
|
209
|
-
tableProps:
|
|
212
|
+
submit: $,
|
|
213
|
+
reset: W,
|
|
214
|
+
tableProps: j,
|
|
210
215
|
refresh: ye,
|
|
211
|
-
data:
|
|
216
|
+
data: g,
|
|
212
217
|
setDataSource: ge,
|
|
213
218
|
getColumnSFConfig: be
|
|
214
219
|
} = De({
|
|
215
220
|
async request(e) {
|
|
216
|
-
var a,
|
|
217
|
-
if (!
|
|
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
|
|
223
|
-
return (
|
|
224
|
-
data: (
|
|
225
|
-
total: (
|
|
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:
|
|
229
|
-
sortFields:
|
|
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
|
-
}),
|
|
240
|
+
}), Se = () => {
|
|
236
241
|
var a;
|
|
237
|
-
let e = ((a = o.columns) == null ? void 0 : a.filter((
|
|
238
|
-
function
|
|
239
|
-
return
|
|
240
|
-
resizable:
|
|
241
|
-
...ae(
|
|
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:
|
|
249
|
+
title: Ue(n, E("table-header", "title"), C.headerCell, t(se).colorPrimary),
|
|
245
250
|
customRender({
|
|
246
|
-
value:
|
|
247
|
-
...
|
|
251
|
+
value: c,
|
|
252
|
+
...b
|
|
248
253
|
}) {
|
|
249
|
-
var
|
|
250
|
-
const
|
|
254
|
+
var q, M;
|
|
255
|
+
const H = qe(n), Be = Me({
|
|
251
256
|
...n,
|
|
252
|
-
valueType:
|
|
257
|
+
valueType: H
|
|
253
258
|
}, {
|
|
254
|
-
value:
|
|
255
|
-
...
|
|
256
|
-
}),
|
|
257
|
-
value:
|
|
258
|
-
...
|
|
259
|
-
})) ||
|
|
260
|
-
value:
|
|
261
|
-
...
|
|
262
|
-
})]) :
|
|
263
|
-
let
|
|
264
|
-
return n.customRender && (
|
|
265
|
-
value:
|
|
266
|
-
...
|
|
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:
|
|
273
|
+
originalNode: P,
|
|
269
274
|
originalText: U
|
|
270
|
-
})),
|
|
275
|
+
})), P;
|
|
271
276
|
},
|
|
272
|
-
children:
|
|
277
|
+
children: l(n.children || [], d || n)
|
|
273
278
|
}));
|
|
274
279
|
}
|
|
275
|
-
return
|
|
280
|
+
return l(e);
|
|
276
281
|
};
|
|
277
282
|
Ne(() => {
|
|
278
|
-
const e =
|
|
279
|
-
u.value = e,
|
|
283
|
+
const e = Se();
|
|
284
|
+
u.value = e, A.value = e;
|
|
280
285
|
});
|
|
281
|
-
const
|
|
282
|
-
var
|
|
283
|
-
if (o.adaptive && (
|
|
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:
|
|
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((
|
|
299
|
+
if ((e = o.columns) != null && e.some((l) => l.ellipsis))
|
|
295
300
|
return "fixed";
|
|
296
|
-
}),
|
|
301
|
+
}), _ = s(() => {
|
|
297
302
|
var a;
|
|
298
|
-
const e =
|
|
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
|
-
...
|
|
308
|
+
...l,
|
|
304
309
|
// tips 如果是前端分页,则默认会走缓存
|
|
305
|
-
preserveSelectedRowKeys:
|
|
310
|
+
preserveSelectedRowKeys: y(o.dataSource) ? l.preserveSelectedRowKeys : !0
|
|
306
311
|
} : Je(o.rowSelection),
|
|
307
|
-
loading:
|
|
312
|
+
loading: y(o.loading) ? e.loading : o.loading,
|
|
308
313
|
pagination: o.pagination === !1 ? !1 : e.pagination,
|
|
309
|
-
scroll:
|
|
314
|
+
scroll: t(he)
|
|
310
315
|
};
|
|
311
|
-
}), Re = s(() => {
|
|
312
|
-
|
|
313
|
-
return
|
|
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
|
-
|
|
329
|
-
var
|
|
330
|
-
(
|
|
331
|
-
}),
|
|
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
|
|
344
|
-
var
|
|
345
|
-
(
|
|
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,
|
|
349
|
-
const
|
|
350
|
-
return (d = (
|
|
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
|
|
348
|
+
return t(u);
|
|
354
349
|
}
|
|
355
350
|
return ne({
|
|
356
|
-
submit: () =>
|
|
357
|
-
reset: () =>
|
|
351
|
+
submit: () => $(),
|
|
352
|
+
reset: () => W(),
|
|
358
353
|
refresh: () => ye(),
|
|
359
|
-
setSearchFormValues:
|
|
354
|
+
setSearchFormValues: ve,
|
|
360
355
|
getSearchFormValues: Te,
|
|
361
356
|
getShownColumns: Fe,
|
|
362
|
-
dataSource: s(() =>
|
|
357
|
+
dataSource: s(() => t(g).records),
|
|
363
358
|
rowSelection: {
|
|
364
|
-
selectedRows: s(() =>
|
|
359
|
+
selectedRows: s(() => t(T)),
|
|
365
360
|
...F
|
|
366
361
|
}
|
|
367
|
-
}), (e,
|
|
368
|
-
ref_key: "
|
|
369
|
-
ref:
|
|
370
|
-
class:
|
|
371
|
-
}, [
|
|
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:
|
|
368
|
+
class: m(e.card ? t(x)("search-wrapper") : null),
|
|
374
369
|
style: Q(e.searchFormWrapperStyle)
|
|
375
|
-
}, [
|
|
370
|
+
}, [f(t(Ae).SearchForm, h(e.searchForm || {}, {
|
|
376
371
|
ref_key: "formRef",
|
|
377
372
|
ref: z,
|
|
378
373
|
"custom-reset": "",
|
|
379
|
-
"submit-loading":
|
|
380
|
-
onSubmit:
|
|
381
|
-
onReset:
|
|
374
|
+
"submit-loading": t(j).loading,
|
|
375
|
+
onSubmit: t($),
|
|
376
|
+
onReset: t(W)
|
|
382
377
|
}), X({
|
|
383
|
-
default: w(() => [(
|
|
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
|
-
}, [
|
|
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),
|
|
391
|
+
} : void 0]), 1040, ["submit-loading", "onSubmit", "onReset"])], 6)) : ee("", !0), N("div", {
|
|
397
392
|
ref_key: "contentRef",
|
|
398
|
-
ref:
|
|
399
|
-
class:
|
|
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
|
-
}, [
|
|
402
|
-
class:
|
|
403
|
-
}, [e.settings ? (
|
|
396
|
+
}, [N("div", {
|
|
397
|
+
class: m(t(i)("header-wrapper"))
|
|
398
|
+
}, [e.settings ? (p(), B("div", {
|
|
404
399
|
key: 0,
|
|
405
|
-
class:
|
|
406
|
-
}, [
|
|
407
|
-
class:
|
|
408
|
-
}, [R(e.$slots, "title",
|
|
409
|
-
selectedRows:
|
|
410
|
-
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),
|
|
407
|
+
}, F))], 2), C.title ? (p(), Z(t(Oe), {
|
|
413
408
|
key: 0,
|
|
414
409
|
type: "vertical"
|
|
415
|
-
})) : ee("", !0),
|
|
410
|
+
})) : ee("", !0), f(lo, {
|
|
416
411
|
config: e.settings === !0 ? {} : e.settings
|
|
417
|
-
}, null, 8, ["config"])], 2)) : R(e.$slots, "title",
|
|
412
|
+
}, null, 8, ["config"])], 2)) : R(e.$slots, "title", h({
|
|
418
413
|
key: 1,
|
|
419
|
-
selectedRows:
|
|
420
|
-
selectedRowKeys:
|
|
414
|
+
selectedRows: t(T),
|
|
415
|
+
selectedRowKeys: t(v).selectedRowKeys,
|
|
421
416
|
shownColumns: u.value
|
|
422
|
-
}, F))], 2),
|
|
423
|
-
|
|
424
|
-
|
|
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:
|
|
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:
|
|
433
|
-
selectedRows:
|
|
429
|
+
records: _.value.dataSource,
|
|
430
|
+
selectedRows: t(T)
|
|
434
431
|
})]),
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
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:
|
|
440
|
-
"scroll-container":
|
|
441
|
-
direction: "horizontal"
|
|
442
|
-
|
|
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
|
-
|
|
446
|
-
},
|
|
447
|
-
name:
|
|
448
|
-
fn: w((d) => [R(e.$slots,
|
|
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
|
-
|
|
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 =
|
|
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;
|
|
@@ -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
|
|
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
|
|
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
|
|
29
|
-
const r = S, o = x(r, "scrollContainer"), l =
|
|
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:
|
|
32
|
+
const { totalSize: e, visibleSize: t, distance: c } = u(
|
|
33
33
|
o.value,
|
|
34
34
|
r.direction
|
|
35
|
-
),
|
|
36
|
-
l.value.scroll(
|
|
35
|
+
), i = c / (e + r.extraSize - t || 1) * 100;
|
|
36
|
+
l.value.scroll(i);
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
const { visibleSize: e, totalSize: t } =
|
|
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
|
-
|
|
48
|
+
f();
|
|
49
49
|
}), _(
|
|
50
50
|
() => {
|
|
51
|
-
const e =
|
|
52
|
-
e && (
|
|
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 =
|
|
62
|
+
const t = a(o);
|
|
63
63
|
if (!t) return;
|
|
64
|
-
const { totalSize:
|
|
64
|
+
const { totalSize: c, visibleSize: i, topOrLeft: h } = u(
|
|
65
65
|
t,
|
|
66
66
|
r.direction
|
|
67
67
|
);
|
|
68
|
-
if (
|
|
68
|
+
if (c <= i) return;
|
|
69
69
|
const z = `scroll${h}`;
|
|
70
|
-
t[z] = e * (
|
|
70
|
+
t[z] = e * (c + r.extraSize - i) / 100;
|
|
71
71
|
}
|
|
72
72
|
return m({
|
|
73
|
-
currentScroll:
|
|
73
|
+
currentScroll: s(() => {
|
|
74
74
|
var e;
|
|
75
|
-
return
|
|
75
|
+
return a((e = l.value) == null ? void 0 : e.currentScroll);
|
|
76
76
|
}),
|
|
77
|
-
scroll: (
|
|
78
|
-
visible:
|
|
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
|
-
},
|
|
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);
|