@aplus-frontend/ui 0.4.5 → 0.4.7
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-field/date/index.vue.d.ts +1 -0
- package/es/src/ap-field/date/index.vue.mjs +22 -15
- package/es/src/ap-field/date-range/index.vue.mjs +46 -42
- package/es/src/ap-field/hooks/use-default-presets.d.ts +11 -0
- package/es/src/ap-field/hooks/use-default-presets.mjs +15 -0
- package/es/src/ap-field/interface.d.ts +7 -1
- package/es/src/ap-table/ap-table.vue2.mjs +87 -85
- package/es/src/ap-table/components/dynamic-component/diff.d.ts +2 -0
- package/es/src/ap-table/components/dynamic-component/index.vue.d.ts +4 -0
- package/es/src/ap-table/components/dynamic-component/index.vue.mjs +4 -0
- package/es/src/ap-table/components/dynamic-component/index.vue2.mjs +14 -0
- package/es/src/ap-table/components/interface.d.ts +3 -0
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +55 -55
- package/es/src/ap-table/constants.d.ts +3 -0
- package/es/src/ap-table/hooks/use-table-column-state.d.ts +2 -2
- package/es/src/ap-table/hooks/use-table-column-state.mjs +92 -92
- package/es/src/ap-table/utils.d.ts +1549 -1539
- package/es/src/ap-table/utils.mjs +115 -104
- package/es/src/ap-upload/components/Picture.vue2.mjs +59 -55
- package/es/src/business/batch-input-group/form-item.vue.mjs +7 -6
- package/es/src/business/batch-input-group/interface.d.ts +5 -0
- package/es/src/business/hooks/usePageListApTable.d.ts +2 -2
- package/es/src/locale/lang/en.mjs +10 -1
- package/es/src/locale/lang/zh-cn.mjs +10 -1
- package/es/src/utils/data-range-persets.d.ts +87 -0
- package/es/src/utils/data-range-persets.mjs +107 -0
- package/lib/src/ap-field/date/index.vue.d.ts +1 -0
- package/lib/src/ap-field/date/index.vue.js +1 -1
- package/lib/src/ap-field/date-range/index.vue.js +1 -1
- package/lib/src/ap-field/hooks/use-default-presets.d.ts +11 -0
- package/lib/src/ap-field/hooks/use-default-presets.js +1 -0
- package/lib/src/ap-field/interface.d.ts +7 -1
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/components/dynamic-component/diff.d.ts +2 -0
- package/lib/src/ap-table/components/dynamic-component/index.vue.d.ts +4 -0
- package/lib/src/ap-table/components/dynamic-component/index.vue.js +1 -0
- package/lib/src/ap-table/components/dynamic-component/index.vue2.js +1 -0
- package/lib/src/ap-table/components/interface.d.ts +3 -0
- package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
- package/lib/src/ap-table/constants.d.ts +3 -0
- package/lib/src/ap-table/hooks/use-table-column-state.d.ts +2 -2
- package/lib/src/ap-table/hooks/use-table-column-state.js +1 -1
- package/lib/src/ap-table/utils.d.ts +1549 -1539
- package/lib/src/ap-table/utils.js +1 -1
- package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
- package/lib/src/business/batch-input-group/form-item.vue.js +1 -1
- package/lib/src/business/batch-input-group/interface.d.ts +5 -0
- package/lib/src/business/hooks/usePageListApTable.d.ts +2 -2
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/utils/data-range-persets.d.ts +87 -0
- package/lib/src/utils/data-range-persets.js +1 -0
- package/package.json +3 -3
- package/theme/ap-table/ap-table.css +4 -4
- package/theme/ap-table/ap-table.less +4 -4
- package/theme/ap-table-modal/index.css +4 -4
- package/theme/index.css +4 -4
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as Te, useSlots as Fe, ref as P, computed as s, unref as t, createVNode as w, Fragment as q, watchEffect as xe, watch as G, openBlock as p, createElementBlock as T, normalizeClass as f, normalizeStyle as M, mergeProps as S, createSlots as _, withCtx as F, renderList as J, createBlock as Q, resolveDynamicComponent as Be, renderSlot as b, createCommentVNode as X, createElementVNode as
|
|
2
|
-
import { Divider as Pe, Table as
|
|
3
|
-
import { useToken as
|
|
1
|
+
import { defineComponent as Te, useSlots as Fe, ref as P, computed as s, unref as t, createVNode as w, Fragment as q, watchEffect as xe, watch as G, openBlock as p, createElementBlock as T, normalizeClass as f, normalizeStyle as M, mergeProps as S, createSlots as _, withCtx as F, renderList as J, createBlock as Q, resolveDynamicComponent as Be, renderSlot as b, createCommentVNode as X, createElementVNode as N, normalizeProps as ke, guardReactiveProps as ze } from "vue";
|
|
2
|
+
import { Divider as Pe, Table as Ne } from "@aplus-frontend/antdv";
|
|
3
|
+
import { useToken as Ie } from "@aplus-frontend/antdv/es/theme/internal";
|
|
4
4
|
import { ApForm as Ee } from "../ap-form/index.mjs";
|
|
5
5
|
import { noRenderAsFormItemValueList as Y } from "./constants.mjs";
|
|
6
6
|
import "../config-provider/index.mjs";
|
|
7
7
|
import { useTablePaging as Ke } from "./hooks/use-table-paging-ng.mjs";
|
|
8
8
|
import { isUndefined as m, omit as Z, isBoolean as Oe } from "lodash-unified";
|
|
9
|
-
import { getColumnOrder as ee, updateFormProps as Le, getFieldProps as Ve, getSearchFormItemRenderNode as Ae, recursionApColumns as
|
|
9
|
+
import { getColumnOrder as ee, updateFormProps as Le, getFieldProps as Ve, getSearchFormItemRenderNode as Ae, recursionApColumns as oe, apColumnToColumn as De, getTableTitle as je, getTableRenderType as $e, getTableRenderProps as We, getTableCellRenderNode as He, falseToUndefined as Ue } from "./utils.mjs";
|
|
10
10
|
import qe from "./hooks/use-table-content-height.mjs";
|
|
11
11
|
import Ge from "./hooks/use-table-row-selection.mjs";
|
|
12
12
|
import { isDef as Me } from "../utils/index.mjs";
|
|
@@ -17,7 +17,7 @@ import { useNamespace as Je } from "../config-provider/hooks/use-namespace.mjs";
|
|
|
17
17
|
import { useGlobalConfig as Qe } from "../config-provider/hooks/use-global-config.mjs";
|
|
18
18
|
import Xe from "./components/paragraph-ellipsis/index.vue2.mjs";
|
|
19
19
|
import Ye from "./components/setting/modal/index.vue2.mjs";
|
|
20
|
-
const
|
|
20
|
+
const bo = /* @__PURE__ */ Te({
|
|
21
21
|
name: "ApTable",
|
|
22
22
|
__name: "ap-table",
|
|
23
23
|
props: {
|
|
@@ -141,19 +141,19 @@ const Sa = /* @__PURE__ */ Te({
|
|
|
141
141
|
default: void 0
|
|
142
142
|
}
|
|
143
143
|
},
|
|
144
|
-
setup(
|
|
144
|
+
setup(ae, {
|
|
145
145
|
expose: re
|
|
146
146
|
}) {
|
|
147
|
-
const
|
|
148
|
-
let
|
|
149
|
-
const h = Fe(), [, te] =
|
|
147
|
+
const o = ae;
|
|
148
|
+
let I = 0;
|
|
149
|
+
const h = Fe(), [, te] = Ie(), {
|
|
150
150
|
e: x,
|
|
151
151
|
b: i,
|
|
152
152
|
be: E
|
|
153
153
|
} = Je("ap-table"), K = Qe("valueTypeMap"), {
|
|
154
154
|
height: le,
|
|
155
155
|
contentRef: ne
|
|
156
|
-
} = qe(), B = P(
|
|
156
|
+
} = qe(), B = P(o.size), u = P([]), O = P([]);
|
|
157
157
|
_e({
|
|
158
158
|
columns: s(() => u.value),
|
|
159
159
|
columnsBackup: s(() => O.value),
|
|
@@ -167,37 +167,37 @@ const Sa = /* @__PURE__ */ Te({
|
|
|
167
167
|
dataSource: s(() => t(y).records)
|
|
168
168
|
});
|
|
169
169
|
const L = s(() => {
|
|
170
|
-
var e, r,
|
|
171
|
-
return
|
|
170
|
+
var e, r, a;
|
|
171
|
+
return I++, ((a = (r = (e = o.columns) == null ? void 0 : e.filter((l) => !l.hideInSearch && l.dataIndex && (l.valueType || l.customRenderFormItem) && !Y.includes(l.valueType))) == null ? void 0 : r.sort((l, d) => {
|
|
172
172
|
let n = ee(l.order);
|
|
173
173
|
return ee(d.order) - n;
|
|
174
|
-
})) == null ? void 0 :
|
|
174
|
+
})) == null ? void 0 : a.map((l) => {
|
|
175
175
|
const d = Le(l, Ve(l.fieldProps, {})), n = {
|
|
176
176
|
...l,
|
|
177
177
|
fieldProps: {
|
|
178
178
|
label: l.title,
|
|
179
179
|
name: l.dataIndex,
|
|
180
180
|
...d || {},
|
|
181
|
-
_signal:
|
|
181
|
+
_signal: I
|
|
182
182
|
},
|
|
183
183
|
renderNode: void 0
|
|
184
184
|
};
|
|
185
185
|
return n.renderNode = Ae(n, t(K)), n;
|
|
186
186
|
})) || [];
|
|
187
|
-
}), se = s(() =>
|
|
187
|
+
}), se = s(() => oe(t(u), (e) => {
|
|
188
188
|
if (e.sorter === !0)
|
|
189
189
|
return e.key || e.dataIndex;
|
|
190
|
-
}).filter(Boolean)), de = s(() =>
|
|
190
|
+
}).filter(Boolean)), de = s(() => oe(t(u), (e) => {
|
|
191
191
|
if (e.filters && !e.onFilter)
|
|
192
192
|
return e.key || e.dataIndex;
|
|
193
|
-
}).filter(Boolean)), ue = s(() => m(
|
|
194
|
-
rowSelection:
|
|
195
|
-
selectedRows:
|
|
193
|
+
}).filter(Boolean)), ue = s(() => m(o.dataSource) ? y.records : o.dataSource), {
|
|
194
|
+
rowSelection: C,
|
|
195
|
+
selectedRows: R,
|
|
196
196
|
...v
|
|
197
197
|
} = Ge({
|
|
198
198
|
fixed: !0,
|
|
199
|
-
...
|
|
200
|
-
rowKey:
|
|
199
|
+
...o.rowSelection === !0 ? {} : o.rowSelection,
|
|
200
|
+
rowKey: o.rowKey,
|
|
201
201
|
dataSource: ue
|
|
202
202
|
}), {
|
|
203
203
|
formRef: k,
|
|
@@ -210,31 +210,31 @@ const Sa = /* @__PURE__ */ Te({
|
|
|
210
210
|
getColumnSFConfig: pe
|
|
211
211
|
} = Ke({
|
|
212
212
|
async request(e) {
|
|
213
|
-
var
|
|
214
|
-
if (!
|
|
213
|
+
var a, l;
|
|
214
|
+
if (!C.value.preserveSelectedRowKeys && m(o.dataSource) && v.clearAll(), !m(o.dataSource))
|
|
215
215
|
return {
|
|
216
|
-
data:
|
|
217
|
-
total:
|
|
216
|
+
data: o.dataSource || [],
|
|
217
|
+
total: o.dataSource.length || 0
|
|
218
218
|
};
|
|
219
|
-
const r = await ((
|
|
220
|
-
return (l =
|
|
219
|
+
const r = await ((a = o.request) == null ? void 0 : a.call(o, e));
|
|
220
|
+
return (l = o.onLoad) == null || l.call(o, (r == null ? void 0 : r.data) || []), {
|
|
221
221
|
data: (r == null ? void 0 : r.data) || [],
|
|
222
222
|
total: (r == null ? void 0 : r.total) || 0
|
|
223
223
|
};
|
|
224
224
|
},
|
|
225
225
|
filterFields: de,
|
|
226
226
|
sortFields: se,
|
|
227
|
-
defaultParams:
|
|
228
|
-
defaultData:
|
|
229
|
-
manual:
|
|
230
|
-
formatParams:
|
|
231
|
-
pagination:
|
|
227
|
+
defaultParams: o.params,
|
|
228
|
+
defaultData: o.defaultData,
|
|
229
|
+
manual: o.manual,
|
|
230
|
+
formatParams: o.beforeSearchSubmit,
|
|
231
|
+
pagination: o.pagination
|
|
232
232
|
}), fe = () => {
|
|
233
|
-
var
|
|
234
|
-
let e = ((
|
|
233
|
+
var a;
|
|
234
|
+
let e = ((a = o.columns) == null ? void 0 : a.filter((l) => !l.hideInTable)) || [];
|
|
235
235
|
function r(l, d) {
|
|
236
236
|
return l.map((n) => ({
|
|
237
|
-
resizable: Me(n.resizable) ? n.resizable :
|
|
237
|
+
resizable: Me(n.resizable) ? n.resizable : o.columnResizable,
|
|
238
238
|
...Z(De(n), ["ellipsis"]),
|
|
239
239
|
...pe(n),
|
|
240
240
|
fixed: d ? d.fixed : n.fixed,
|
|
@@ -244,19 +244,19 @@ const Sa = /* @__PURE__ */ Te({
|
|
|
244
244
|
...g
|
|
245
245
|
}) {
|
|
246
246
|
var H, U;
|
|
247
|
-
const $ = $e(n),
|
|
247
|
+
const $ = $e(n), Ce = We({
|
|
248
248
|
...n,
|
|
249
249
|
valueType: $
|
|
250
250
|
}, {
|
|
251
251
|
value: c,
|
|
252
252
|
...g
|
|
253
|
-
}),
|
|
253
|
+
}), Re = He($, Ce, g.record, t(K)), W = ((H = n.renderText) == null ? void 0 : H.call(n, {
|
|
254
254
|
value: c,
|
|
255
255
|
...g
|
|
256
256
|
})) || c, ve = n.renderText ? w(q, null, [(U = n.renderText) == null ? void 0 : U.call(n, {
|
|
257
257
|
value: c,
|
|
258
258
|
...g
|
|
259
|
-
})]) :
|
|
259
|
+
})]) : Re;
|
|
260
260
|
let z = we(n, W, ve);
|
|
261
261
|
return n.customRender && (z = n.customRender({
|
|
262
262
|
value: c,
|
|
@@ -276,65 +276,65 @@ const Sa = /* @__PURE__ */ Te({
|
|
|
276
276
|
u.value = e, O.value = e;
|
|
277
277
|
});
|
|
278
278
|
const me = s(() => {
|
|
279
|
-
var r,
|
|
280
|
-
if (
|
|
279
|
+
var r, a;
|
|
280
|
+
if (o.adaptive && (y.total > 0 || ((r = o.dataSource) == null ? void 0 : r.length)))
|
|
281
281
|
return {
|
|
282
282
|
y: t(le),
|
|
283
|
-
x: ((
|
|
283
|
+
x: ((a = o.scroll) == null ? void 0 : a.x) || "100%"
|
|
284
284
|
};
|
|
285
|
-
if (
|
|
286
|
-
return
|
|
285
|
+
if (o.scroll)
|
|
286
|
+
return o.scroll;
|
|
287
287
|
}), ye = s(() => {
|
|
288
288
|
var e;
|
|
289
|
-
if (
|
|
290
|
-
return
|
|
291
|
-
if ((e =
|
|
289
|
+
if (o.tableLayout)
|
|
290
|
+
return o.tableLayout;
|
|
291
|
+
if ((e = o.columns) != null && e.some((r) => r.ellipsis))
|
|
292
292
|
return "fixed";
|
|
293
293
|
}), j = s(() => {
|
|
294
|
-
var
|
|
295
|
-
const e = t(D), r = t(
|
|
294
|
+
var a;
|
|
295
|
+
const e = t(D), r = t(C);
|
|
296
296
|
return {
|
|
297
|
-
...
|
|
297
|
+
...o,
|
|
298
298
|
...e,
|
|
299
|
-
rowSelection:
|
|
299
|
+
rowSelection: o.rowSelection === !0 || ((a = o.rowSelection) == null ? void 0 : a.mode) === "internal" ? {
|
|
300
300
|
...r,
|
|
301
301
|
// tips 如果是前端分页,则默认会走缓存
|
|
302
|
-
preserveSelectedRowKeys: m(
|
|
303
|
-
} : Ue(
|
|
304
|
-
loading: m(
|
|
305
|
-
pagination:
|
|
302
|
+
preserveSelectedRowKeys: m(o.dataSource) ? r.preserveSelectedRowKeys : !0
|
|
303
|
+
} : Ue(o.rowSelection),
|
|
304
|
+
loading: m(o.loading) ? e.loading : o.loading,
|
|
305
|
+
pagination: o.pagination === !1 ? !1 : e.pagination,
|
|
306
306
|
scroll: t(me)
|
|
307
307
|
};
|
|
308
|
-
}), ge = s(() => [i(),
|
|
309
|
-
function we(e, r,
|
|
310
|
-
return Y.includes(e.valueType) ?
|
|
308
|
+
}), ge = s(() => [i(), o.card ? null : i("wrapper"), o.adaptive ? i("adaptive") : null].filter(Boolean));
|
|
309
|
+
function we(e, r, a) {
|
|
310
|
+
return Y.includes(e.valueType) ? a : e.copyable || e.ellipsis ? w(Xe, {
|
|
311
311
|
copyable: e.copyable,
|
|
312
312
|
ellipsis: e.ellipsis ? Oe(e.ellipsis) ? {
|
|
313
|
-
tooltip:
|
|
313
|
+
tooltip: a,
|
|
314
314
|
rows: 1
|
|
315
315
|
} : {
|
|
316
316
|
...e.ellipsis,
|
|
317
|
-
tooltip:
|
|
317
|
+
tooltip: a
|
|
318
318
|
} : !1,
|
|
319
|
-
content:
|
|
320
|
-
}, null) :
|
|
319
|
+
content: a
|
|
320
|
+
}, null) : a;
|
|
321
321
|
}
|
|
322
322
|
G(() => t(y).loading, (e) => {
|
|
323
323
|
var r;
|
|
324
|
-
(r =
|
|
325
|
-
}), G(() =>
|
|
324
|
+
(r = o.onLoadingChange) == null || r.call(o, e);
|
|
325
|
+
}), G(() => o.dataSource, (e) => {
|
|
326
326
|
ce(e);
|
|
327
327
|
}, {
|
|
328
328
|
immediate: !0
|
|
329
329
|
});
|
|
330
330
|
function Se(e) {
|
|
331
|
-
var r,
|
|
332
|
-
(l = (
|
|
331
|
+
var r, a, l;
|
|
332
|
+
(l = (a = (r = k.value) == null ? void 0 : r.apForm) == null ? void 0 : a.setFieldsValue) == null || l.call(a, e);
|
|
333
333
|
}
|
|
334
334
|
function be(e = !1) {
|
|
335
|
-
var
|
|
335
|
+
var a, l, d;
|
|
336
336
|
const r = e ? "getFieldsValueTransformed" : "getFieldsValue";
|
|
337
|
-
return (d = (l = (
|
|
337
|
+
return (d = (l = (a = k.value) == null ? void 0 : a.apForm) == null ? void 0 : l[r]) == null ? void 0 : d.call(l, !0);
|
|
338
338
|
}
|
|
339
339
|
function he() {
|
|
340
340
|
return t(u);
|
|
@@ -348,7 +348,7 @@ const Sa = /* @__PURE__ */ Te({
|
|
|
348
348
|
getShownColumns: he,
|
|
349
349
|
dataSource: s(() => t(y).records),
|
|
350
350
|
rowSelection: {
|
|
351
|
-
selectedRows: s(() => t(
|
|
351
|
+
selectedRows: s(() => t(R)),
|
|
352
352
|
...v
|
|
353
353
|
}
|
|
354
354
|
}), (e, r) => (p(), T("div", {
|
|
@@ -365,32 +365,34 @@ const Sa = /* @__PURE__ */ Te({
|
|
|
365
365
|
onSubmit: t(V),
|
|
366
366
|
onReset: t(A)
|
|
367
367
|
}), _({
|
|
368
|
-
default: F(() => [(p(!0), T(q, null, J(L.value, (
|
|
369
|
-
key:
|
|
368
|
+
default: F(() => [(p(!0), T(q, null, J(L.value, (a) => (p(), Q(Be(a.renderNode.Comp), S({
|
|
369
|
+
key: a.dataIndex,
|
|
370
|
+
item: a,
|
|
370
371
|
ref_for: !0
|
|
371
|
-
},
|
|
372
|
-
span:
|
|
373
|
-
|
|
372
|
+
}, a.fieldProps || {}, {
|
|
373
|
+
span: a.span,
|
|
374
|
+
"custom-render": a.renderNode.render
|
|
375
|
+
}), null, 16, ["item", "span", "custom-render"]))), 128))]),
|
|
374
376
|
_: 2
|
|
375
377
|
}, [h.searchFormExtra ? {
|
|
376
378
|
name: "extra",
|
|
377
379
|
fn: F(() => [b(e.$slots, "searchFormExtra")]),
|
|
378
380
|
key: "0"
|
|
379
|
-
} : void 0]), 1040, ["submit-loading", "onSubmit", "onReset"])], 6)) : X("", !0),
|
|
381
|
+
} : void 0]), 1040, ["submit-loading", "onSubmit", "onReset"])], 6)) : X("", !0), N("div", {
|
|
380
382
|
ref_key: "contentRef",
|
|
381
383
|
ref: ne,
|
|
382
384
|
class: f([t(x)("table-wrapper"), e.card ? t(x)("table-wrapper-card") : null]),
|
|
383
385
|
style: M(e.tableWrapperStyle)
|
|
384
|
-
}, [
|
|
386
|
+
}, [N("div", {
|
|
385
387
|
class: f(t(i)("header-wrapper"))
|
|
386
388
|
}, [e.settings ? (p(), T("div", {
|
|
387
389
|
key: 0,
|
|
388
390
|
class: f(t(i)("header"))
|
|
389
|
-
}, [
|
|
391
|
+
}, [N("div", {
|
|
390
392
|
class: f(t(E)("header", "title"))
|
|
391
393
|
}, [b(e.$slots, "title", S({
|
|
392
|
-
selectedRows: t(
|
|
393
|
-
selectedRowKeys: t(
|
|
394
|
+
selectedRows: t(R),
|
|
395
|
+
selectedRowKeys: t(C).selectedRowKeys,
|
|
394
396
|
shownColumns: u.value
|
|
395
397
|
}, v))], 2), h.title ? (p(), Q(t(Pe), {
|
|
396
398
|
key: 0,
|
|
@@ -399,29 +401,29 @@ const Sa = /* @__PURE__ */ Te({
|
|
|
399
401
|
config: e.settings === !0 ? {} : e.settings
|
|
400
402
|
}, null, 8, ["config"])], 2)) : b(e.$slots, "title", S({
|
|
401
403
|
key: 1,
|
|
402
|
-
selectedRows: t(
|
|
403
|
-
selectedRowKeys: t(
|
|
404
|
+
selectedRows: t(R),
|
|
405
|
+
selectedRowKeys: t(C).selectedRowKeys,
|
|
404
406
|
shownColumns: u.value
|
|
405
|
-
}, v))], 2), w(t(
|
|
407
|
+
}, v))], 2), w(t(Ne), S({
|
|
406
408
|
class: t(i)("table")
|
|
407
409
|
}, j.value, {
|
|
408
410
|
size: B.value,
|
|
409
411
|
"table-layout": ye.value,
|
|
410
412
|
columns: u.value,
|
|
411
|
-
onResizeColumn: r[0] || (r[0] = (
|
|
413
|
+
onResizeColumn: r[0] || (r[0] = (a, l) => l.width = a)
|
|
412
414
|
}), _({
|
|
413
415
|
summary: F(() => [b(e.$slots, "summary", {
|
|
414
416
|
columns: u.value,
|
|
415
417
|
records: j.value.dataSource,
|
|
416
|
-
selectedRows: t(
|
|
418
|
+
selectedRows: t(R)
|
|
417
419
|
})]),
|
|
418
420
|
_: 2
|
|
419
|
-
}, [J(t(Z)(h, ["title", "searchFormExtra", "headerCell", "summary"]), (
|
|
421
|
+
}, [J(t(Z)(h, ["title", "searchFormExtra", "headerCell", "summary"]), (a, l) => ({
|
|
420
422
|
name: l,
|
|
421
423
|
fn: F((d) => [b(e.$slots, l, ke(ze(d || {})))])
|
|
422
424
|
}))]), 1040, ["class", "size", "table-layout", "columns"])], 6)], 2));
|
|
423
425
|
}
|
|
424
426
|
});
|
|
425
427
|
export {
|
|
426
|
-
|
|
428
|
+
bo as default
|
|
427
429
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ApTableDynamicCompProps } from '../interface';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
+
declare const _default: DefineComponent<ApTableDynamicCompProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ApTableDynamicCompProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { defineComponent as n, openBlock as o, createBlock as t, resolveDynamicComponent as r } from "vue";
|
|
2
|
+
const c = /* @__PURE__ */ n({
|
|
3
|
+
name: "ApTableDynamicComponent",
|
|
4
|
+
__name: "index",
|
|
5
|
+
props: {
|
|
6
|
+
customRender: { type: Function }
|
|
7
|
+
},
|
|
8
|
+
setup(p) {
|
|
9
|
+
return (e, m) => (o(), t(r(e.customRender(e.$attrs))));
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
export {
|
|
13
|
+
c as default
|
|
14
|
+
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { defineComponent as G, ref as
|
|
2
|
-
import { Button as B, Modal as
|
|
3
|
-
import { getSingleVNode as
|
|
4
|
-
import { useInjectApTable as
|
|
1
|
+
import { defineComponent as G, ref as y, unref as e, computed as H, useSlots as L, createVNode as l, cloneVNode as M, openBlock as x, createElementBlock as P, Fragment as q, createBlock as J, resolveDynamicComponent as Q, createCommentVNode as W, withCtx as i, createElementVNode as s, normalizeClass as r, toDisplayString as c, createTextVNode as C, isRef as X } from "vue";
|
|
2
|
+
import { Button as B, Modal as Y, RadioGroup as Z, RadioButton as _, Divider as h } from "@aplus-frontend/antdv";
|
|
3
|
+
import { getSingleVNode as ee } from "../../../../utils/slot.mjs";
|
|
4
|
+
import { useInjectApTable as te } from "../../../context.mjs";
|
|
5
5
|
import "../tree-select/index.vue.mjs";
|
|
6
|
-
import { useTableColumnState as
|
|
6
|
+
import { useTableColumnState as le } from "../../../hooks/use-table-column-state.mjs";
|
|
7
7
|
import "../../../../config-provider/index.mjs";
|
|
8
8
|
import "../sorter/index.vue.mjs";
|
|
9
|
-
import
|
|
10
|
-
import { SettingOutlined as
|
|
11
|
-
import { useLocale as
|
|
9
|
+
import oe, { customCloneColumnStates as N } from "../utils.mjs";
|
|
10
|
+
import { SettingOutlined as ne } from "@ant-design/icons-vue";
|
|
11
|
+
import { useLocale as ae } from "../../../../config-provider/hooks/use-locale.mjs";
|
|
12
12
|
import { useNamespace as T } from "../../../../config-provider/hooks/use-namespace.mjs";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
const
|
|
13
|
+
import se from "../tree-select/index.vue2.mjs";
|
|
14
|
+
import ie from "../sorter/index.vue2.mjs";
|
|
15
|
+
const re = {
|
|
16
16
|
style: {
|
|
17
17
|
lineHeight: "22px",
|
|
18
18
|
color: "#8896B0"
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, Be = /* @__PURE__ */ G({
|
|
21
21
|
__name: "index",
|
|
22
22
|
props: {
|
|
23
23
|
config: {
|
|
@@ -25,46 +25,46 @@ const ie = {
|
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
setup(A) {
|
|
28
|
-
const
|
|
28
|
+
const m = A, {
|
|
29
29
|
columnsBackup: V,
|
|
30
30
|
size: z,
|
|
31
|
-
updateSize:
|
|
32
|
-
updateColumns:
|
|
33
|
-
} =
|
|
31
|
+
updateSize: d,
|
|
32
|
+
updateColumns: f
|
|
33
|
+
} = te(), g = y(e(z)), R = H(() => m.config.persistenceKey), {
|
|
34
34
|
columnState: n,
|
|
35
|
-
setColumnState:
|
|
36
|
-
isAllSelected:
|
|
37
|
-
toggleSelectAll:
|
|
38
|
-
columnStateBackup:
|
|
39
|
-
setColumnStateBackup:
|
|
40
|
-
cacheColumnStateIfNeeded:
|
|
41
|
-
} =
|
|
35
|
+
setColumnState: w,
|
|
36
|
+
isAllSelected: D,
|
|
37
|
+
toggleSelectAll: O,
|
|
38
|
+
columnStateBackup: U,
|
|
39
|
+
setColumnStateBackup: E,
|
|
40
|
+
cacheColumnStateIfNeeded: I
|
|
41
|
+
} = le(m.config, R, []), {
|
|
42
42
|
t: a
|
|
43
|
-
} =
|
|
44
|
-
b:
|
|
43
|
+
} = ae(), {
|
|
44
|
+
b: v,
|
|
45
45
|
be: S
|
|
46
46
|
} = T("ap-column-setting"), {
|
|
47
|
-
b:
|
|
48
|
-
} = T("ap-table"), u =
|
|
49
|
-
icon: l(
|
|
50
|
-
class:
|
|
51
|
-
}, null), k = b ?
|
|
47
|
+
b: K
|
|
48
|
+
} = T("ap-table"), u = y(!1), $ = L(), b = ee($.trigger) || l(B, {
|
|
49
|
+
icon: l(ne, null, null),
|
|
50
|
+
class: K("setting-trigger-button")
|
|
51
|
+
}, null), k = b ? M(b, {
|
|
52
52
|
onClick: () => {
|
|
53
53
|
u.value = !0;
|
|
54
54
|
}
|
|
55
55
|
}) : null;
|
|
56
56
|
function j() {
|
|
57
|
-
|
|
57
|
+
w(N(e(U)));
|
|
58
58
|
}
|
|
59
59
|
function F() {
|
|
60
60
|
var t, o;
|
|
61
|
-
|
|
61
|
+
f == null || f(oe(e(V), e(n))), d == null || d(e(g)), u.value = !1;
|
|
62
62
|
const p = N(n.value);
|
|
63
|
-
|
|
63
|
+
E(p), I(p), (o = (t = m.config) == null ? void 0 : t.onChange) == null || o.call(t, p);
|
|
64
64
|
}
|
|
65
|
-
return (p, t) => (
|
|
65
|
+
return (p, t) => (x(), P(q, null, [e(k) ? (x(), J(Q(e(k)), {
|
|
66
66
|
key: 0
|
|
67
|
-
})) :
|
|
67
|
+
})) : W("", !0), l(e(Y), {
|
|
68
68
|
open: u.value,
|
|
69
69
|
"onUpdate:open": t[2] || (t[2] = (o) => u.value = o),
|
|
70
70
|
title: e(a)("ap.apTable.setting.title"),
|
|
@@ -76,32 +76,32 @@ const ie = {
|
|
|
76
76
|
},
|
|
77
77
|
onOk: F
|
|
78
78
|
}, {
|
|
79
|
-
default:
|
|
80
|
-
class: r(e(
|
|
81
|
-
}, [
|
|
82
|
-
class: r(e(
|
|
83
|
-
}, [
|
|
79
|
+
default: i(() => [s("div", {
|
|
80
|
+
class: r(e(v)("wrapper"))
|
|
81
|
+
}, [s("div", {
|
|
82
|
+
class: r(e(v)("left"))
|
|
83
|
+
}, [s("div", {
|
|
84
84
|
class: r(e(S)("left", "header"))
|
|
85
|
-
}, [
|
|
85
|
+
}, [s("div", null, [s("span", re, c(e(a)("ap.apTable.setting.selectAllTip")), 1), l(e(B), {
|
|
86
86
|
type: "link",
|
|
87
87
|
size: "small",
|
|
88
|
-
onClick: e(
|
|
88
|
+
onClick: e(O)
|
|
89
89
|
}, {
|
|
90
|
-
default:
|
|
90
|
+
default: i(() => [C(c(e(D) ? e(a)("ap.apTable.setting.unSelectAll") : e(a)("ap.apTable.setting.selectAll")), 1)]),
|
|
91
91
|
_: 1
|
|
92
|
-
}, 8, ["onClick"])]), l(e(
|
|
93
|
-
value:
|
|
94
|
-
"onUpdate:value": t[0] || (t[0] = (o) =>
|
|
92
|
+
}, 8, ["onClick"])]), l(e(Z), {
|
|
93
|
+
value: g.value,
|
|
94
|
+
"onUpdate:value": t[0] || (t[0] = (o) => g.value = o)
|
|
95
95
|
}, {
|
|
96
|
-
default:
|
|
96
|
+
default: i(() => [l(e(_), {
|
|
97
97
|
value: "small"
|
|
98
98
|
}, {
|
|
99
|
-
default:
|
|
99
|
+
default: i(() => [C(c(e(a)("ap.apTable.setting.sizeSmall")), 1)]),
|
|
100
100
|
_: 1
|
|
101
101
|
}), l(e(_), {
|
|
102
102
|
value: "middle"
|
|
103
103
|
}, {
|
|
104
|
-
default:
|
|
104
|
+
default: i(() => [C(c(e(a)("ap.apTable.setting.sizeNormal")), 1)]),
|
|
105
105
|
_: 1
|
|
106
106
|
})]),
|
|
107
107
|
_: 1
|
|
@@ -110,7 +110,7 @@ const ie = {
|
|
|
110
110
|
style: {
|
|
111
111
|
margin: "0px"
|
|
112
112
|
}
|
|
113
|
-
}), l(
|
|
113
|
+
}), l(se, {
|
|
114
114
|
class: r(e(S)("left", "content")),
|
|
115
115
|
value: e(n)
|
|
116
116
|
}, null, 8, ["class", "value"])], 2), l(e(h), {
|
|
@@ -119,11 +119,11 @@ const ie = {
|
|
|
119
119
|
height: "100%",
|
|
120
120
|
margin: "0px"
|
|
121
121
|
}
|
|
122
|
-
}),
|
|
123
|
-
class: r(e(
|
|
124
|
-
}, [l(
|
|
122
|
+
}), s("div", {
|
|
123
|
+
class: r(e(v)("right"))
|
|
124
|
+
}, [l(ie, {
|
|
125
125
|
value: e(n),
|
|
126
|
-
"onUpdate:value": t[1] || (t[1] = (o) =>
|
|
126
|
+
"onUpdate:value": t[1] || (t[1] = (o) => X(n) ? n.value = o : null),
|
|
127
127
|
onReset: j
|
|
128
128
|
}, null, 8, ["value"])], 2)], 2)]),
|
|
129
129
|
_: 1
|
|
@@ -131,5 +131,5 @@ const ie = {
|
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
133
|
export {
|
|
134
|
-
|
|
134
|
+
Be as default
|
|
135
135
|
};
|
|
@@ -1838,6 +1838,7 @@ export declare const apTableRenderItemMap: {
|
|
|
1838
1838
|
showToday: boolean;
|
|
1839
1839
|
showTime: boolean | SharedTimeProps<Dayjs>;
|
|
1840
1840
|
emptyText: string;
|
|
1841
|
+
formatBegins: boolean;
|
|
1841
1842
|
}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
|
|
1842
1843
|
P: {};
|
|
1843
1844
|
B: {};
|
|
@@ -1874,6 +1875,7 @@ export declare const apTableRenderItemMap: {
|
|
|
1874
1875
|
showToday: boolean;
|
|
1875
1876
|
showTime: boolean | SharedTimeProps<Dayjs>;
|
|
1876
1877
|
emptyText: string;
|
|
1878
|
+
formatBegins: boolean;
|
|
1877
1879
|
}>;
|
|
1878
1880
|
__isFragment?: never;
|
|
1879
1881
|
__isTeleport?: never;
|
|
@@ -1909,6 +1911,7 @@ export declare const apTableRenderItemMap: {
|
|
|
1909
1911
|
showToday: boolean;
|
|
1910
1912
|
showTime: boolean | SharedTimeProps<Dayjs>;
|
|
1911
1913
|
emptyText: string;
|
|
1914
|
+
formatBegins: boolean;
|
|
1912
1915
|
}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
|
|
1913
1916
|
$slots: Readonly<{
|
|
1914
1917
|
dateRender: any;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ApColumnState, ApTableSettingType } from '../interface';
|
|
2
1
|
import { Ref, ComputedRef, ShallowRef } from 'vue';
|
|
3
|
-
|
|
2
|
+
import { ApColumnState, ApTableSettingType } from '../interface';
|
|
3
|
+
export declare const useTableColumnState: (columnSetting: ApTableSettingType, persistenceKey: Ref<string | undefined>, initialColumnState: ApColumnState[]) => {
|
|
4
4
|
columnState: Ref<{
|
|
5
5
|
key: string | number;
|
|
6
6
|
show?: boolean | undefined;
|