@aplus-frontend/ui 0.2.4 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.mjs +133 -131
- package/es/src/ap-form/interface.d.ts +1 -0
- package/es/src/ap-scroll-bar/ap-scroll-bar.vue.d.ts +27 -0
- package/es/src/ap-scroll-bar/ap-scroll-bar.vue.mjs +4 -0
- package/es/src/ap-scroll-bar/ap-scroll-bar.vue2.mjs +116 -0
- package/es/src/ap-scroll-bar/index.d.ts +62 -0
- package/es/src/ap-scroll-bar/index.mjs +8 -0
- package/es/src/ap-scroll-bar/interface.d.ts +4 -0
- package/es/src/ap-scroll-bar/interface.mjs +1 -0
- package/es/src/ap-scroll-bar/style/css.d.ts +0 -0
- package/es/src/ap-scroll-bar/style/css.js +1 -0
- package/es/src/ap-scroll-bar/style/index.d.ts +0 -0
- package/es/src/ap-scroll-bar/style/index.js +1 -0
- package/es/src/ap-table/ap-table.vue.d.ts +2 -0
- package/es/src/ap-table/ap-table.vue2.mjs +116 -123
- package/es/src/ap-table/components/setting/modal/index.vue.d.ts +1 -1
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +62 -56
- package/es/src/ap-table/constants.d.ts +40 -40
- package/es/src/ap-table/utils.d.ts +40 -40
- package/es/src/business/ap-appendix/ap-appendix.vue2.mjs +70 -63
- package/es/src/index.d.ts +1 -0
- package/es/src/index.mjs +192 -190
- package/es/src/path-map.mjs +1 -0
- package/lib/index.js +1 -1
- package/lib/src/ap-form/interface.d.ts +1 -0
- package/lib/src/ap-scroll-bar/ap-scroll-bar.vue.d.ts +27 -0
- package/lib/src/ap-scroll-bar/ap-scroll-bar.vue.js +1 -0
- package/lib/src/ap-scroll-bar/ap-scroll-bar.vue2.js +1 -0
- package/lib/src/ap-scroll-bar/index.d.ts +62 -0
- package/lib/src/ap-scroll-bar/index.js +1 -0
- package/lib/src/ap-scroll-bar/interface.d.ts +4 -0
- package/lib/src/ap-scroll-bar/interface.js +1 -0
- package/lib/src/ap-scroll-bar/style/css.d.ts +0 -0
- package/lib/src/ap-scroll-bar/style/css.js +1 -0
- package/lib/src/ap-scroll-bar/style/index.d.ts +0 -0
- package/lib/src/ap-scroll-bar/style/index.js +1 -0
- package/lib/src/ap-table/ap-table.vue.d.ts +2 -0
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/modal/index.vue.d.ts +1 -1
- package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
- package/lib/src/ap-table/constants.d.ts +40 -40
- package/lib/src/ap-table/utils.d.ts +40 -40
- package/lib/src/business/ap-appendix/ap-appendix.vue2.js +1 -1
- package/lib/src/index.d.ts +1 -0
- package/lib/src/index.js +1 -1
- package/lib/src/path-map.js +1 -1
- package/package.json +6 -4
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import { defineComponent as ve, useSlots as Te, ref as z, computed as s, unref as
|
|
2
|
-
import { Typography as
|
|
3
|
-
import { useToken as
|
|
4
|
-
import { ApForm as
|
|
1
|
+
import { defineComponent as ve, useSlots as Te, ref as z, computed as s, unref as r, createVNode as y, Fragment as U, watchEffect as Fe, watch as G, openBlock as p, createElementBlock as T, normalizeClass as f, normalizeStyle as M, mergeProps as h, createSlots as J, withCtx as F, renderList as Q, createBlock as X, resolveDynamicComponent as Be, renderSlot as w, createCommentVNode as Y, createElementVNode as I, normalizeProps as xe, guardReactiveProps as ke } from "vue";
|
|
2
|
+
import { Typography as Pe, Divider as ze, Table as Ie } from "@aplus-frontend/antdv";
|
|
3
|
+
import { useToken as Ne } from "@aplus-frontend/antdv/es/theme/internal";
|
|
4
|
+
import { ApForm as Ee } from "../ap-form/index.mjs";
|
|
5
5
|
import { noRenderAsFormItemValueList as Z } from "./constants.mjs";
|
|
6
6
|
import "../config-provider/index.mjs";
|
|
7
|
-
import { useTablePaging as
|
|
8
|
-
import { omit as _, isUndefined as
|
|
9
|
-
import { apColumnToColumn as
|
|
10
|
-
import
|
|
11
|
-
import { getRawDisplayValue as
|
|
12
|
-
import
|
|
13
|
-
import { isDef as
|
|
14
|
-
import { SettingOutlined as Ye } from "@ant-design/icons-vue";
|
|
7
|
+
import { useTablePaging as Ke } from "./hooks/use-table-paging.mjs";
|
|
8
|
+
import { omit as _, isUndefined as m, isBoolean as Le } from "lodash-unified";
|
|
9
|
+
import { apColumnToColumn as Oe, getTableTitle as Ve, getTableRenderType as De, getTableRenderProps as Ae, getTableCellRenderNode as je, getColumnOrder as ee, updateFormProps as We, getFieldProps as $e, getSearchFormItemRenderNode as He, recursionApColumns as ae, objectToString as qe } from "./utils.mjs";
|
|
10
|
+
import Ue from "./hooks/use-table-content-height.mjs";
|
|
11
|
+
import { getRawDisplayValue as Ge } from "../editable-table/utils.mjs";
|
|
12
|
+
import Me from "./hooks/use-table-row-selection.mjs";
|
|
13
|
+
import { isDef as Je } from "../utils/index.mjs";
|
|
15
14
|
import "./components/setting/modal/index.vue.mjs";
|
|
16
|
-
import { useProvideApTable as
|
|
17
|
-
import { useNamespace as
|
|
18
|
-
import { useGlobalConfig as
|
|
19
|
-
import
|
|
20
|
-
const
|
|
15
|
+
import { useProvideApTable as Qe } from "./context.mjs";
|
|
16
|
+
import { useNamespace as Xe } from "../config-provider/hooks/use-namespace.mjs";
|
|
17
|
+
import { useGlobalConfig as Ye } from "../config-provider/hooks/use-global-config.mjs";
|
|
18
|
+
import Ze from "./components/setting/modal/index.vue2.mjs";
|
|
19
|
+
const ha = /* @__PURE__ */ ve({
|
|
21
20
|
name: "ApTable",
|
|
22
21
|
__name: "ap-table",
|
|
23
22
|
props: {
|
|
@@ -146,15 +145,15 @@ const Ra = /* @__PURE__ */ ve({
|
|
|
146
145
|
}) {
|
|
147
146
|
const a = oe;
|
|
148
147
|
let N = 0;
|
|
149
|
-
const
|
|
148
|
+
const S = Te(), [, re] = Ne(), {
|
|
150
149
|
e: B,
|
|
151
150
|
b: i,
|
|
152
151
|
be: E
|
|
153
|
-
} =
|
|
152
|
+
} = Xe("ap-table"), K = Ye("valueTypeMap"), {
|
|
154
153
|
height: le,
|
|
155
154
|
contentRef: ne
|
|
156
|
-
} =
|
|
157
|
-
|
|
155
|
+
} = Ue(), x = z(a.size), d = z([]), L = z([]);
|
|
156
|
+
Qe({
|
|
158
157
|
columns: s(() => d.value),
|
|
159
158
|
columnsBackup: s(() => L.value),
|
|
160
159
|
size: s(() => x.value),
|
|
@@ -166,36 +165,36 @@ const Ra = /* @__PURE__ */ ve({
|
|
|
166
165
|
}
|
|
167
166
|
});
|
|
168
167
|
const se = () => {
|
|
169
|
-
var
|
|
170
|
-
let e = ((
|
|
168
|
+
var t;
|
|
169
|
+
let e = ((t = a.columns) == null ? void 0 : t.filter((l) => !l.hideInTable)) || [];
|
|
171
170
|
function o(l, u) {
|
|
172
171
|
return l.map((n) => ({
|
|
173
|
-
resizable:
|
|
174
|
-
..._(
|
|
172
|
+
resizable: Je(n.resizable) ? n.resizable : a.columnResizable,
|
|
173
|
+
..._(Oe(n), ["ellipsis"]),
|
|
175
174
|
fixed: u ? u.fixed : n.fixed,
|
|
176
|
-
title:
|
|
175
|
+
title: Ve(n, E("table-header", "title"), S.headerCell, r(re).colorPrimary),
|
|
177
176
|
customRender({
|
|
178
|
-
value:
|
|
179
|
-
...
|
|
177
|
+
value: c,
|
|
178
|
+
...g
|
|
180
179
|
}) {
|
|
181
180
|
var H, q;
|
|
182
|
-
const W =
|
|
181
|
+
const W = De(n), be = Ae({
|
|
183
182
|
...n,
|
|
184
183
|
valueType: W
|
|
185
184
|
}, {
|
|
186
|
-
value:
|
|
187
|
-
...
|
|
188
|
-
}), Re =
|
|
189
|
-
value:
|
|
190
|
-
...
|
|
191
|
-
})) ||
|
|
192
|
-
value:
|
|
193
|
-
...
|
|
185
|
+
value: c,
|
|
186
|
+
...g
|
|
187
|
+
}), Re = je(W, be, g.record, r(K)), $ = ((H = n.renderText) == null ? void 0 : H.call(n, {
|
|
188
|
+
value: c,
|
|
189
|
+
...g
|
|
190
|
+
})) || c, Ce = n.renderText ? y(U, null, [(q = n.renderText) == null ? void 0 : q.call(n, {
|
|
191
|
+
value: c,
|
|
192
|
+
...g
|
|
194
193
|
})]) : Re;
|
|
195
194
|
let P = ye(n, $, Ce);
|
|
196
195
|
return n.customRender && (P = n.customRender({
|
|
197
|
-
value:
|
|
198
|
-
...
|
|
196
|
+
value: c,
|
|
197
|
+
...g,
|
|
199
198
|
column: n,
|
|
200
199
|
originalNode: P,
|
|
201
200
|
originalText: $
|
|
@@ -211,12 +210,12 @@ const Ra = /* @__PURE__ */ ve({
|
|
|
211
210
|
d.value = e, L.value = e;
|
|
212
211
|
});
|
|
213
212
|
const O = s(() => {
|
|
214
|
-
var e, o,
|
|
215
|
-
return N++, ((
|
|
213
|
+
var e, o, t;
|
|
214
|
+
return N++, ((t = (o = (e = a.columns) == null ? void 0 : e.filter((l) => !l.hideInSearch && l.dataIndex && (l.valueType || l.customRenderFormItem) && !Z.includes(l.valueType))) == null ? void 0 : o.sort((l, u) => {
|
|
216
215
|
let n = ee(l.order);
|
|
217
216
|
return ee(u.order) - n;
|
|
218
|
-
})) == null ? void 0 :
|
|
219
|
-
const u =
|
|
217
|
+
})) == null ? void 0 : t.map((l) => {
|
|
218
|
+
const u = We(l, $e(l.fieldProps, {})), n = {
|
|
220
219
|
...l,
|
|
221
220
|
fieldProps: {
|
|
222
221
|
label: l.title,
|
|
@@ -226,19 +225,19 @@ const Ra = /* @__PURE__ */ ve({
|
|
|
226
225
|
},
|
|
227
226
|
renderNode: void 0
|
|
228
227
|
};
|
|
229
|
-
return n.renderNode =
|
|
228
|
+
return n.renderNode = He(n, r(K)), n;
|
|
230
229
|
})) || [];
|
|
231
|
-
}), de = s(() => ae(
|
|
230
|
+
}), de = s(() => ae(r(d), (e) => {
|
|
232
231
|
if (e.sorter === !0)
|
|
233
232
|
return e.key;
|
|
234
|
-
}).filter(Boolean)), ue = s(() => ae(
|
|
233
|
+
}).filter(Boolean)), ue = s(() => ae(r(d), (e) => {
|
|
235
234
|
if (e.filters && !e.onFilter)
|
|
236
235
|
return e.key;
|
|
237
|
-
}).filter(Boolean)), ie = s(() =>
|
|
238
|
-
rowSelection:
|
|
239
|
-
selectedRows:
|
|
240
|
-
...
|
|
241
|
-
} =
|
|
236
|
+
}).filter(Boolean)), ie = s(() => m(a.dataSource) ? v.value.records : a.dataSource), {
|
|
237
|
+
rowSelection: b,
|
|
238
|
+
selectedRows: R,
|
|
239
|
+
...C
|
|
240
|
+
} = Me({
|
|
242
241
|
...a.rowSelection === !0 ? {} : a.rowSelection,
|
|
243
242
|
rowKey: a.rowKey,
|
|
244
243
|
dataSource: ie
|
|
@@ -248,17 +247,17 @@ const Ra = /* @__PURE__ */ ve({
|
|
|
248
247
|
reset: D,
|
|
249
248
|
tableProps: A,
|
|
250
249
|
refresh: ce,
|
|
251
|
-
data:
|
|
250
|
+
data: v,
|
|
252
251
|
setDataSource: pe
|
|
253
|
-
} =
|
|
252
|
+
} = Ke({
|
|
254
253
|
async request(e) {
|
|
255
|
-
var
|
|
256
|
-
if (!
|
|
254
|
+
var t, l;
|
|
255
|
+
if (!b.value.preserveSelectedRowKeys && m(a.dataSource) && C.clearAll(), !m(a.dataSource))
|
|
257
256
|
return {
|
|
258
257
|
data: a.dataSource || [],
|
|
259
258
|
total: a.dataSource.length || 0
|
|
260
259
|
};
|
|
261
|
-
const o = await ((
|
|
260
|
+
const o = await ((t = a.request) == null ? void 0 : t.call(a, e));
|
|
262
261
|
return (l = a.onLoad) == null || l.call(a, (o == null ? void 0 : o.data) || []), {
|
|
263
262
|
data: (o == null ? void 0 : o.data) || [],
|
|
264
263
|
total: (o == null ? void 0 : o.total) || 0
|
|
@@ -275,11 +274,11 @@ const Ra = /* @__PURE__ */ ve({
|
|
|
275
274
|
showLessItems: a.pagination ? a.pagination.showLessItems : void 0,
|
|
276
275
|
showTotal: a.pagination ? a.pagination.showTotal : void 0
|
|
277
276
|
}), fe = s(() => {
|
|
278
|
-
var o,
|
|
279
|
-
if (a.adaptive && (
|
|
277
|
+
var o, t;
|
|
278
|
+
if (a.adaptive && (v.value.total > 0 || ((o = a.dataSource) == null ? void 0 : o.length)))
|
|
280
279
|
return {
|
|
281
|
-
y:
|
|
282
|
-
x: ((
|
|
280
|
+
y: r(le),
|
|
281
|
+
x: ((t = a.scroll) == null ? void 0 : t.x) || "100%"
|
|
283
282
|
};
|
|
284
283
|
if (a.scroll)
|
|
285
284
|
return a.scroll;
|
|
@@ -290,40 +289,40 @@ const Ra = /* @__PURE__ */ ve({
|
|
|
290
289
|
if ((e = a.columns) != null && e.some((o) => o.ellipsis))
|
|
291
290
|
return "fixed";
|
|
292
291
|
}), j = s(() => {
|
|
293
|
-
var
|
|
294
|
-
const e =
|
|
292
|
+
var t;
|
|
293
|
+
const e = r(A), o = r(b);
|
|
295
294
|
return {
|
|
296
295
|
...a,
|
|
297
296
|
...e,
|
|
298
|
-
rowSelection: a.rowSelection === !0 || ((
|
|
297
|
+
rowSelection: a.rowSelection === !0 || ((t = a.rowSelection) == null ? void 0 : t.mode) === "internal" ? {
|
|
299
298
|
...o,
|
|
300
299
|
// tips 如果是前端分页,则默认会走缓存
|
|
301
|
-
preserveSelectedRowKeys:
|
|
300
|
+
preserveSelectedRowKeys: m(a.dataSource) ? o.preserveSelectedRowKeys : !0
|
|
302
301
|
} : a.rowSelection,
|
|
303
|
-
loading:
|
|
302
|
+
loading: m(a.loading) ? e.loading : a.loading,
|
|
304
303
|
pagination: a.pagination === !1 ? !1 : e.pagination,
|
|
305
|
-
scroll:
|
|
304
|
+
scroll: r(fe)
|
|
306
305
|
};
|
|
307
306
|
}), ge = s(() => [i(), a.card ? null : i("wrapper"), a.adaptive ? i("adaptive") : null].filter(Boolean));
|
|
308
|
-
function ye(e, o,
|
|
307
|
+
function ye(e, o, t) {
|
|
309
308
|
if (Z.includes(e.valueType))
|
|
310
|
-
return
|
|
311
|
-
const l =
|
|
312
|
-
return e.copyable || e.ellipsis ?
|
|
309
|
+
return t;
|
|
310
|
+
const l = qe(o);
|
|
311
|
+
return e.copyable || e.ellipsis ? y(Pe.Paragraph, {
|
|
313
312
|
copyable: e.copyable ? {
|
|
314
313
|
text: l,
|
|
315
314
|
tooltip: !1
|
|
316
315
|
} : !1,
|
|
317
|
-
ellipsis: e.ellipsis ?
|
|
316
|
+
ellipsis: e.ellipsis ? Le(e.ellipsis) ? {
|
|
318
317
|
tooltip: l
|
|
319
318
|
} : {
|
|
320
319
|
...e.ellipsis,
|
|
321
320
|
tooltip: l
|
|
322
321
|
} : !1,
|
|
323
|
-
content: e.ellipsis ?
|
|
324
|
-
}, null) :
|
|
322
|
+
content: e.ellipsis ? Ge(e, o) : t
|
|
323
|
+
}, null) : t;
|
|
325
324
|
}
|
|
326
|
-
G(() =>
|
|
325
|
+
G(() => r(v).loading, (e) => {
|
|
327
326
|
var o;
|
|
328
327
|
(o = a.onLoadingChange) == null || o.call(a, e);
|
|
329
328
|
}), G(() => a.dataSource, (e) => {
|
|
@@ -332,15 +331,15 @@ const Ra = /* @__PURE__ */ ve({
|
|
|
332
331
|
immediate: !0
|
|
333
332
|
});
|
|
334
333
|
function he(e) {
|
|
335
|
-
var o,
|
|
336
|
-
(l = (
|
|
334
|
+
var o, t, l;
|
|
335
|
+
(l = (t = (o = k.value) == null ? void 0 : o.apForm) == null ? void 0 : t.setFieldsValue) == null || l.call(t, e);
|
|
337
336
|
}
|
|
338
337
|
function we() {
|
|
339
|
-
var e, o,
|
|
340
|
-
return (
|
|
338
|
+
var e, o, t;
|
|
339
|
+
return (t = (o = (e = k.value) == null ? void 0 : e.apForm) == null ? void 0 : o.getFieldsValue) == null ? void 0 : t.call(o, !0);
|
|
341
340
|
}
|
|
342
341
|
function Se() {
|
|
343
|
-
return
|
|
342
|
+
return r(d);
|
|
344
343
|
}
|
|
345
344
|
return te({
|
|
346
345
|
submit: () => V(),
|
|
@@ -349,88 +348,82 @@ const Ra = /* @__PURE__ */ ve({
|
|
|
349
348
|
setSearchFormValues: he,
|
|
350
349
|
getSearchFormValues: we,
|
|
351
350
|
getShownColumns: Se,
|
|
352
|
-
dataSource: s(() =>
|
|
351
|
+
dataSource: s(() => r(v).records),
|
|
353
352
|
rowSelection: {
|
|
354
|
-
selectedRows: s(() =>
|
|
355
|
-
...
|
|
353
|
+
selectedRows: s(() => r(R)),
|
|
354
|
+
...C
|
|
356
355
|
}
|
|
357
|
-
}), (e, o) => (
|
|
358
|
-
class:
|
|
359
|
-
}, [
|
|
356
|
+
}), (e, o) => (p(), T("div", {
|
|
357
|
+
class: f(ge.value)
|
|
358
|
+
}, [r(m)(e.dataSource) && e.searchForm !== !1 && O.value.length > 0 ? (p(), T("div", {
|
|
360
359
|
key: 0,
|
|
361
|
-
class:
|
|
360
|
+
class: f(e.card ? r(B)("search-wrapper") : null),
|
|
362
361
|
style: M(e.searchFormWrapperStyle)
|
|
363
|
-
}, [
|
|
362
|
+
}, [y(r(Ee).SearchForm, h(e.searchForm || {}, {
|
|
364
363
|
ref_key: "formRef",
|
|
365
364
|
ref: k,
|
|
366
365
|
"custom-reset": "",
|
|
367
|
-
onSubmit:
|
|
368
|
-
onReset:
|
|
369
|
-
"submit-loading":
|
|
366
|
+
onSubmit: r(V),
|
|
367
|
+
onReset: r(D),
|
|
368
|
+
"submit-loading": r(A).loading
|
|
370
369
|
}), J({
|
|
371
|
-
default:
|
|
372
|
-
key:
|
|
370
|
+
default: F(() => [(p(!0), T(U, null, Q(O.value, (t) => (p(), X(Be(t.renderNode), h({
|
|
371
|
+
key: t.dataIndex,
|
|
373
372
|
ref_for: !0
|
|
374
|
-
},
|
|
375
|
-
span:
|
|
373
|
+
}, t.fieldProps || {}, {
|
|
374
|
+
span: t.span
|
|
376
375
|
}), null, 16, ["span"]))), 128))]),
|
|
377
376
|
_: 2
|
|
378
|
-
}, [
|
|
377
|
+
}, [S.searchFormExtra ? {
|
|
379
378
|
name: "extra",
|
|
380
|
-
fn:
|
|
379
|
+
fn: F(() => [w(e.$slots, "searchFormExtra")]),
|
|
381
380
|
key: "0"
|
|
382
381
|
} : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) : Y("", !0), I("div", {
|
|
383
382
|
ref_key: "contentRef",
|
|
384
383
|
ref: ne,
|
|
385
|
-
class:
|
|
384
|
+
class: f([r(B)("table-wrapper"), e.card ? r(B)("table-wrapper-card") : null]),
|
|
386
385
|
style: M(e.tableWrapperStyle)
|
|
387
386
|
}, [I("div", {
|
|
388
|
-
class:
|
|
389
|
-
}, [e.settings ? (
|
|
387
|
+
class: f(r(i)("header-wrapper"))
|
|
388
|
+
}, [e.settings ? (p(), T("div", {
|
|
390
389
|
key: 0,
|
|
391
|
-
class:
|
|
390
|
+
class: f(r(i)("header"))
|
|
392
391
|
}, [I("div", {
|
|
393
|
-
class:
|
|
394
|
-
}, [
|
|
395
|
-
selectedRows:
|
|
396
|
-
selectedRowKeys:
|
|
392
|
+
class: f(r(E)("header", "title"))
|
|
393
|
+
}, [w(e.$slots, "title", h({
|
|
394
|
+
selectedRows: r(R),
|
|
395
|
+
selectedRowKeys: r(b).selectedRowKeys,
|
|
397
396
|
shownColumns: d.value
|
|
398
|
-
},
|
|
397
|
+
}, C))], 2), S.title ? (p(), X(r(ze), {
|
|
399
398
|
key: 0,
|
|
400
399
|
type: "vertical"
|
|
401
|
-
})) : Y("", !0),
|
|
400
|
+
})) : Y("", !0), y(Ze, {
|
|
402
401
|
config: e.settings === !0 ? {} : e.settings
|
|
403
|
-
}, {
|
|
404
|
-
trigger: w(() => [f(t(Ne), {
|
|
405
|
-
class: c(t(i)("setting-trigger-button")),
|
|
406
|
-
icon: xe(t(Ye))
|
|
407
|
-
}, null, 8, ["class", "icon"])]),
|
|
408
|
-
_: 1
|
|
409
|
-
}, 8, ["config"])], 2)) : S(e.$slots, "title", h({
|
|
402
|
+
}, null, 8, ["config"])], 2)) : w(e.$slots, "title", h({
|
|
410
403
|
key: 1,
|
|
411
|
-
selectedRows:
|
|
412
|
-
selectedRowKeys:
|
|
404
|
+
selectedRows: r(R),
|
|
405
|
+
selectedRowKeys: r(b).selectedRowKeys,
|
|
413
406
|
shownColumns: d.value
|
|
414
|
-
},
|
|
415
|
-
class:
|
|
407
|
+
}, C))], 2), y(r(Ie), h({
|
|
408
|
+
class: r(i)("table")
|
|
416
409
|
}, j.value, {
|
|
417
410
|
size: x.value,
|
|
418
411
|
"table-layout": me.value,
|
|
419
412
|
columns: d.value,
|
|
420
|
-
onResizeColumn: o[0] || (o[0] = (
|
|
413
|
+
onResizeColumn: o[0] || (o[0] = (t, l) => l.width = t)
|
|
421
414
|
}), J({
|
|
422
|
-
summary:
|
|
415
|
+
summary: F(() => [w(e.$slots, "summary", {
|
|
423
416
|
columns: d.value,
|
|
424
417
|
records: j.value.dataSource,
|
|
425
|
-
selectedRows:
|
|
418
|
+
selectedRows: r(R)
|
|
426
419
|
})]),
|
|
427
420
|
_: 2
|
|
428
|
-
}, [Q(
|
|
421
|
+
}, [Q(r(_)(S, ["title", "searchFormExtra", "headerCell", "summary"]), (t, l) => ({
|
|
429
422
|
name: l,
|
|
430
|
-
fn:
|
|
423
|
+
fn: F((u) => [w(e.$slots, l, xe(ke(u || {})))])
|
|
431
424
|
}))]), 1040, ["class", "size", "table-layout", "columns"])], 6)], 2));
|
|
432
425
|
}
|
|
433
426
|
});
|
|
434
427
|
export {
|
|
435
|
-
|
|
428
|
+
ha as default
|
|
436
429
|
};
|
|
@@ -2,7 +2,7 @@ import { ApTableSettingModalProps } from '../../interface';
|
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
|
|
3
3
|
import { ApTableSettingType } from '../../..';
|
|
4
4
|
type TableSettingModalSlots = {
|
|
5
|
-
trigger
|
|
5
|
+
trigger?: any;
|
|
6
6
|
};
|
|
7
7
|
declare function __VLS_template(): {
|
|
8
8
|
slots: Readonly<TableSettingModalSlots> & TableSettingModalSlots;
|
|
@@ -1,100 +1,106 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import { getSingleVNode as
|
|
4
|
-
import { useInjectApTable as
|
|
1
|
+
import { defineComponent as G, ref as x, unref as e, useSlots as H, createVNode as l, cloneVNode as L, openBlock as y, createElementBlock as M, Fragment as q, createBlock as J, resolveDynamicComponent as K, createCommentVNode as P, withCtx as s, createElementVNode as i, normalizeClass as r, toDisplayString as m, createTextVNode as v, isRef as Q } from "vue";
|
|
2
|
+
import { Button as B, Modal as W, RadioGroup as X, RadioButton as _, Divider as h } from "@aplus-frontend/antdv";
|
|
3
|
+
import { getSingleVNode as Y } from "../../../../utils/slot.mjs";
|
|
4
|
+
import { useInjectApTable as Z } from "../../../context.mjs";
|
|
5
5
|
import "../tree-select/index.vue.mjs";
|
|
6
|
-
import { useTableColumnState as
|
|
6
|
+
import { useTableColumnState as ee } 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 {
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
|
|
9
|
+
import te, { customCloneColumnStates as N } from "../utils.mjs";
|
|
10
|
+
import { SettingOutlined as le } from "@ant-design/icons-vue";
|
|
11
|
+
import { useLocale as oe } from "../../../../config-provider/hooks/use-locale.mjs";
|
|
12
|
+
import { useNamespace as T } from "../../../../config-provider/hooks/use-namespace.mjs";
|
|
13
|
+
import ne from "../tree-select/index.vue2.mjs";
|
|
14
|
+
import ae from "../sorter/index.vue2.mjs";
|
|
15
|
+
const ie = {
|
|
15
16
|
style: {
|
|
16
17
|
lineHeight: "22px",
|
|
17
18
|
color: "#8896B0"
|
|
18
19
|
}
|
|
19
|
-
},
|
|
20
|
+
}, xe = /* @__PURE__ */ G({
|
|
20
21
|
__name: "index",
|
|
21
22
|
props: {
|
|
22
23
|
config: {
|
|
23
24
|
default: () => ({})
|
|
24
25
|
}
|
|
25
26
|
},
|
|
26
|
-
setup(
|
|
27
|
-
const C =
|
|
28
|
-
columnsBackup:
|
|
29
|
-
size:
|
|
27
|
+
setup(A) {
|
|
28
|
+
const C = A, {
|
|
29
|
+
columnsBackup: V,
|
|
30
|
+
size: z,
|
|
30
31
|
updateSize: c,
|
|
31
32
|
updateColumns: d
|
|
32
|
-
} =
|
|
33
|
-
columnState:
|
|
34
|
-
setColumnState:
|
|
35
|
-
isAllSelected:
|
|
36
|
-
toggleSelectAll:
|
|
37
|
-
columnStateBackup:
|
|
38
|
-
setColumnStateBackup:
|
|
39
|
-
cacheColumnStateIfNeeded:
|
|
40
|
-
} =
|
|
41
|
-
t:
|
|
42
|
-
} =
|
|
33
|
+
} = Z(), f = x(e(z)), {
|
|
34
|
+
columnState: n,
|
|
35
|
+
setColumnState: R,
|
|
36
|
+
isAllSelected: w,
|
|
37
|
+
toggleSelectAll: D,
|
|
38
|
+
columnStateBackup: O,
|
|
39
|
+
setColumnStateBackup: U,
|
|
40
|
+
cacheColumnStateIfNeeded: E
|
|
41
|
+
} = ee(C.config, []), {
|
|
42
|
+
t: a
|
|
43
|
+
} = oe(), {
|
|
43
44
|
b: g,
|
|
44
45
|
be: S
|
|
45
|
-
} =
|
|
46
|
+
} = T("ap-column-setting"), {
|
|
47
|
+
b: I
|
|
48
|
+
} = T("ap-table"), u = x(!1), $ = H(), b = Y($.trigger) || l(B, {
|
|
49
|
+
icon: l(le, null, null),
|
|
50
|
+
class: I("setting-trigger-button")
|
|
51
|
+
}, null), k = b ? L(b, {
|
|
46
52
|
onClick: () => {
|
|
47
53
|
u.value = !0;
|
|
48
54
|
}
|
|
49
55
|
}) : null;
|
|
50
|
-
function
|
|
51
|
-
|
|
56
|
+
function j() {
|
|
57
|
+
R(N(e(O)));
|
|
52
58
|
}
|
|
53
|
-
function
|
|
59
|
+
function F() {
|
|
54
60
|
var t, o;
|
|
55
|
-
d == null || d(
|
|
56
|
-
const p =
|
|
57
|
-
|
|
61
|
+
d == null || d(te(e(V), e(n))), c == null || c(e(f)), u.value = !1;
|
|
62
|
+
const p = N(n.value);
|
|
63
|
+
U(p), E(p), (o = (t = C.config) == null ? void 0 : t.onChange) == null || o.call(t, p);
|
|
58
64
|
}
|
|
59
|
-
return (p, t) => (y(),
|
|
65
|
+
return (p, t) => (y(), M(q, null, [e(k) ? (y(), J(K(e(k)), {
|
|
60
66
|
key: 0
|
|
61
|
-
})) :
|
|
62
|
-
title: e(
|
|
67
|
+
})) : P("", !0), l(e(W), {
|
|
68
|
+
title: e(a)("ap.apTable.setting.title"),
|
|
63
69
|
open: u.value,
|
|
64
70
|
"onUpdate:open": t[2] || (t[2] = (o) => u.value = o),
|
|
65
71
|
width: 900,
|
|
66
|
-
onOk:
|
|
72
|
+
onOk: F,
|
|
67
73
|
"body-style": {
|
|
68
74
|
padding: "0px !important",
|
|
69
75
|
height: "450px"
|
|
70
76
|
}
|
|
71
77
|
}, {
|
|
72
|
-
default:
|
|
78
|
+
default: s(() => [i("div", {
|
|
73
79
|
class: r(e(g)("wrapper"))
|
|
74
|
-
}, [
|
|
80
|
+
}, [i("div", {
|
|
75
81
|
class: r(e(g)("left"))
|
|
76
|
-
}, [
|
|
82
|
+
}, [i("div", {
|
|
77
83
|
class: r(e(S)("left", "header"))
|
|
78
|
-
}, [
|
|
84
|
+
}, [i("div", null, [i("span", ie, m(e(a)("ap.apTable.setting.selectAllTip")), 1), l(e(B), {
|
|
79
85
|
type: "link",
|
|
80
86
|
size: "small",
|
|
81
|
-
onClick: e(
|
|
87
|
+
onClick: e(D)
|
|
82
88
|
}, {
|
|
83
|
-
default:
|
|
89
|
+
default: s(() => [v(m(e(w) ? e(a)("ap.apTable.setting.unSelectAll") : e(a)("ap.apTable.setting.selectAll")), 1)]),
|
|
84
90
|
_: 1
|
|
85
|
-
}, 8, ["onClick"])]), l(e(
|
|
91
|
+
}, 8, ["onClick"])]), l(e(X), {
|
|
86
92
|
value: f.value,
|
|
87
93
|
"onUpdate:value": t[0] || (t[0] = (o) => f.value = o)
|
|
88
94
|
}, {
|
|
89
|
-
default:
|
|
95
|
+
default: s(() => [l(e(_), {
|
|
90
96
|
value: "small"
|
|
91
97
|
}, {
|
|
92
|
-
default:
|
|
98
|
+
default: s(() => [v(m(e(a)("ap.apTable.setting.sizeSmall")), 1)]),
|
|
93
99
|
_: 1
|
|
94
100
|
}), l(e(_), {
|
|
95
101
|
value: "middle"
|
|
96
102
|
}, {
|
|
97
|
-
default:
|
|
103
|
+
default: s(() => [v(m(e(a)("ap.apTable.setting.sizeNormal")), 1)]),
|
|
98
104
|
_: 1
|
|
99
105
|
})]),
|
|
100
106
|
_: 1
|
|
@@ -103,26 +109,26 @@ const ae = {
|
|
|
103
109
|
style: {
|
|
104
110
|
margin: "0px"
|
|
105
111
|
}
|
|
106
|
-
}), l(
|
|
112
|
+
}), l(ne, {
|
|
107
113
|
class: r(e(S)("left", "content")),
|
|
108
|
-
value: e(
|
|
114
|
+
value: e(n)
|
|
109
115
|
}, null, 8, ["class", "value"])], 2), l(e(h), {
|
|
110
116
|
type: "vertical",
|
|
111
117
|
style: {
|
|
112
118
|
height: "100%",
|
|
113
119
|
margin: "0px"
|
|
114
120
|
}
|
|
115
|
-
}),
|
|
121
|
+
}), i("div", {
|
|
116
122
|
class: r(e(g)("right"))
|
|
117
|
-
}, [l(
|
|
118
|
-
value: e(
|
|
119
|
-
"onUpdate:value": t[1] || (t[1] = (o) =>
|
|
120
|
-
onReset:
|
|
123
|
+
}, [l(ae, {
|
|
124
|
+
value: e(n),
|
|
125
|
+
"onUpdate:value": t[1] || (t[1] = (o) => Q(n) ? n.value = o : null),
|
|
126
|
+
onReset: j
|
|
121
127
|
}, null, 8, ["value"])], 2)], 2)]),
|
|
122
128
|
_: 1
|
|
123
129
|
}, 8, ["title", "open"])], 64));
|
|
124
130
|
}
|
|
125
131
|
});
|
|
126
132
|
export {
|
|
127
|
-
|
|
133
|
+
xe as default
|
|
128
134
|
};
|