@aplus-frontend/ui 0.5.4 → 0.5.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/src/ap-grid/index.vue.mjs +140 -131
- package/es/src/ap-grid/utils/table.d.ts +3 -2
- package/es/src/ap-grid/utils/table.mjs +37 -30
- package/es/src/ap-table/ap-table.vue2.mjs +172 -159
- package/es/src/ap-table/context.d.ts +4 -4
- package/es/src/ap-table/hooks/use-sorted-filtered.d.ts +4 -1
- package/es/src/ap-table/hooks/use-sorted-filtered.mjs +11 -9
- package/es/src/ap-table/hooks/use-table-paging-ng.d.ts +3 -1
- package/es/src/ap-table/hooks/use-table-paging-ng.mjs +53 -49
- package/es/src/ap-table/hooks/use-table-paging.d.ts +1 -1
- package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue.d.ts +2 -2
- package/es/src/business/ap-batch-action-group/index.d.ts +4 -4
- package/es/src/config-provider/hooks/use-namespace.d.ts +5 -1
- package/es/src/locale/lang/en.mjs +5 -3
- package/es/src/locale/lang/zh-cn.mjs +5 -3
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-grid/utils/table.d.ts +3 -2
- package/lib/src/ap-grid/utils/table.js +1 -1
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/context.d.ts +4 -4
- package/lib/src/ap-table/hooks/use-sorted-filtered.d.ts +4 -1
- package/lib/src/ap-table/hooks/use-sorted-filtered.js +1 -1
- package/lib/src/ap-table/hooks/use-table-paging-ng.d.ts +3 -1
- package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
- package/lib/src/ap-table/hooks/use-table-paging.d.ts +1 -1
- package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue.d.ts +2 -2
- package/lib/src/business/ap-batch-action-group/index.d.ts +4 -4
- package/lib/src/config-provider/hooks/use-namespace.d.ts +5 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/package.json +3 -3
- package/theme/antd-global-overwrite/aplus/field.css +6 -0
- package/theme/antd-global-overwrite/aplus/field.less +7 -0
- package/theme/antd-global-overwrite/aplus/index.css +6 -0
- package/theme/antd-global-overwrite/aplus/index.less +1 -0
- package/theme/ap-grid/index.css +0 -1
- package/theme/ap-grid/index.less +0 -1
- package/theme/index.css +0 -1
- package/es/src/ap-grid/hooks/use-load-vxe.mjs +0 -32
- package/lib/src/ap-grid/hooks/use-load-vxe.js +0 -1
|
@@ -1,25 +1,28 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { VxeTable as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { defineComponent as ke, useSlots as Fe, getCurrentInstance as Be, ref as R, computed as n, unref as o, watch as N, createElementBlock as k, openBlock as s, normalizeStyle as z, normalizeClass as f, createCommentVNode as C, createElementVNode as F, createVNode as U, mergeProps as g, createSlots as G, withCtx as v, Fragment as X, renderList as T, createBlock as u, resolveDynamicComponent as A, renderSlot as _, normalizeProps as J, guardReactiveProps as Ie } from "vue";
|
|
2
|
+
import { VxeTable as Pe, VxeColumn as Q } from "vxe-table";
|
|
3
|
+
import "vxe-table/lib/style.css";
|
|
4
|
+
import "vxe-pc-ui/lib/style.css";
|
|
5
|
+
import { VxeUI as V } from "vxe-pc-ui";
|
|
6
|
+
import { isUndefined as B, omit as Ee } from "lodash-unified";
|
|
7
|
+
import { ApForm as Ne } from "../ap-form/index.mjs";
|
|
5
8
|
import "../config-provider/index.mjs";
|
|
6
|
-
import { noRenderAsFormItemValueList as
|
|
7
|
-
import { getColumnOrder as
|
|
8
|
-
import { useTablePaging as
|
|
9
|
-
import { Empty as
|
|
10
|
-
import { useInnerParams as
|
|
11
|
-
import { toVxeProps as
|
|
12
|
-
import
|
|
13
|
-
import { useProvideApTable as
|
|
14
|
-
import { sizeReverseMap as
|
|
15
|
-
import { useRenderColumns as
|
|
16
|
-
import { useToken as
|
|
9
|
+
import { noRenderAsFormItemValueList as ze } from "../ap-table/constants.mjs";
|
|
10
|
+
import { getColumnOrder as Y, updateFormProps as Te, getFieldProps as Ae, getSearchFormItemRenderNode as _e, recursionApColumns as Z } from "../ap-table/utils.mjs";
|
|
11
|
+
import { useTablePaging as Ve } from "../ap-table/hooks/use-table-paging-ng.mjs";
|
|
12
|
+
import { Empty as ee, Pagination as Le } from "@aplus-frontend/antdv";
|
|
13
|
+
import { useInnerParams as Oe } from "./hooks/use-inner-params.mjs";
|
|
14
|
+
import { toVxeProps as De, getRowExpandProps as Ke, getRowSelectionProps as $e } from "./utils/table.mjs";
|
|
15
|
+
import je from "../ap-table/hooks/use-table-row-selection.mjs";
|
|
16
|
+
import { useProvideApTable as He } from "../ap-table/context.mjs";
|
|
17
|
+
import { sizeReverseMap as We, sizeMap as Me } from "./constants.mjs";
|
|
18
|
+
import { useRenderColumns as qe } from "./hooks/use-render-columns.mjs";
|
|
19
|
+
import { useToken as Ue } from "@aplus-frontend/antdv/es/theme/internal";
|
|
17
20
|
import "../scroll-bar/index.mjs";
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import
|
|
22
|
-
const
|
|
21
|
+
import { useNamespace as Ge } from "../config-provider/hooks/use-namespace.mjs";
|
|
22
|
+
import { useGlobalConfig as Xe } from "../config-provider/hooks/use-global-config.mjs";
|
|
23
|
+
import { useLocale as Je } from "../config-provider/hooks/use-locale.mjs";
|
|
24
|
+
import Qe from "../scroll-bar/index.vue.mjs";
|
|
25
|
+
const Ro = /* @__PURE__ */ ke({
|
|
23
26
|
name: "ApGrid",
|
|
24
27
|
__name: "index",
|
|
25
28
|
props: {
|
|
@@ -103,66 +106,72 @@ const vo = /* @__PURE__ */ Ce({
|
|
|
103
106
|
expandable: {},
|
|
104
107
|
value: {}
|
|
105
108
|
},
|
|
106
|
-
setup(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
const te =
|
|
109
|
+
setup(oe, { expose: ae }) {
|
|
110
|
+
var q;
|
|
111
|
+
console.log(V);
|
|
112
|
+
const L = Fe(), a = oe, w = (q = Be()) == null ? void 0 : q.appContext.app;
|
|
113
|
+
w && !w.__VXE_PC_UI_INSTALLED__ && (w.use(V), w.__VXE_PC_UI_INSTALLED__ = !0);
|
|
114
|
+
const { e: I, b: i, be: re } = Ge("ap-grid"), te = Xe("valueTypeMap"), d = R([]), O = R([]), p = R(), b = R(a.size), [, m] = Ue(), { t: le } = Je();
|
|
115
|
+
V.setConfig({
|
|
116
|
+
i18n: (e, l) => le(`ap.${e}`, l)
|
|
117
|
+
});
|
|
118
|
+
const { renderConfig: ne, updateSignal: se } = qe(d);
|
|
119
|
+
let D = 0;
|
|
120
|
+
const de = n(() => {
|
|
112
121
|
if (p.value)
|
|
113
122
|
return p.value.$el.querySelector(
|
|
114
123
|
".vxe-table--header-inner-wrapper"
|
|
115
124
|
);
|
|
116
|
-
}),
|
|
125
|
+
}), K = n(() => {
|
|
117
126
|
var e, l, t;
|
|
118
|
-
return
|
|
119
|
-
(r) => !r.hideInSearch && r.dataIndex && (r.valueType || r.customRenderFormItem) && !
|
|
127
|
+
return D++, ((t = (l = (e = a.columns) == null ? void 0 : e.filter(
|
|
128
|
+
(r) => !r.hideInSearch && r.dataIndex && (r.valueType || r.customRenderFormItem) && !ze.includes(r.valueType)
|
|
120
129
|
)) == null ? void 0 : l.sort((r, c) => {
|
|
121
|
-
let y =
|
|
122
|
-
return
|
|
130
|
+
let y = Y(r.order);
|
|
131
|
+
return Y(c.order) - y;
|
|
123
132
|
})) == null ? void 0 : t.map((r) => {
|
|
124
|
-
const c =
|
|
133
|
+
const c = Te(
|
|
125
134
|
r,
|
|
126
|
-
|
|
135
|
+
Ae(r.fieldProps, {})
|
|
127
136
|
), y = {
|
|
128
137
|
...r,
|
|
129
138
|
fieldProps: {
|
|
130
139
|
label: r.title,
|
|
131
140
|
name: r.dataIndex,
|
|
132
141
|
...c || {},
|
|
133
|
-
_signal:
|
|
142
|
+
_signal: D
|
|
134
143
|
},
|
|
135
144
|
renderNode: void 0
|
|
136
145
|
};
|
|
137
|
-
return y.renderNode =
|
|
146
|
+
return y.renderNode = _e(
|
|
138
147
|
y,
|
|
139
|
-
o(
|
|
148
|
+
o(te)
|
|
140
149
|
), y;
|
|
141
150
|
})) || [];
|
|
142
|
-
}),
|
|
151
|
+
}), ie = n(() => [
|
|
143
152
|
i(),
|
|
144
153
|
a.card ? null : i("wrapper"),
|
|
145
154
|
a.adaptive ? i("adaptive") : null,
|
|
146
155
|
a.sticky ? i("sticky") : null
|
|
147
|
-
].filter(Boolean)),
|
|
156
|
+
].filter(Boolean)), $ = n(() => Z(o(d), (e) => {
|
|
148
157
|
if (e.sorter === !0)
|
|
149
158
|
return e.key || e.dataIndex;
|
|
150
|
-
}).filter(Boolean)),
|
|
159
|
+
}).filter(Boolean)), j = n(() => Z(o(d), (e) => {
|
|
151
160
|
if (e.filters && !e.onFilter)
|
|
152
161
|
return e.key || e.dataIndex;
|
|
153
162
|
}).filter(Boolean)), {
|
|
154
163
|
formRef: P,
|
|
155
|
-
submit:
|
|
156
|
-
reset:
|
|
157
|
-
refresh:
|
|
164
|
+
submit: H,
|
|
165
|
+
reset: W,
|
|
166
|
+
refresh: ce,
|
|
158
167
|
data: h,
|
|
159
|
-
tableProps:
|
|
160
|
-
setDataSource:
|
|
161
|
-
handleTableChange:
|
|
162
|
-
} =
|
|
168
|
+
tableProps: ue,
|
|
169
|
+
setDataSource: pe,
|
|
170
|
+
handleTableChange: me
|
|
171
|
+
} = Ve({
|
|
163
172
|
async request(e) {
|
|
164
173
|
var t;
|
|
165
|
-
if (!
|
|
174
|
+
if (!x.value.preserveSelectedRowKeys && B(a.dataSource) && E(), !B(a.dataSource)) {
|
|
166
175
|
const r = e.pageSize * (e.current - 1);
|
|
167
176
|
return {
|
|
168
177
|
data: (a.pagination === !1 ? a.dataSource : a.dataSource.slice(r, r + e.pageSize)) || [],
|
|
@@ -176,126 +185,126 @@ const vo = /* @__PURE__ */ Ce({
|
|
|
176
185
|
};
|
|
177
186
|
},
|
|
178
187
|
namespace: "ap-grid",
|
|
179
|
-
filterFields:
|
|
180
|
-
sortFields:
|
|
188
|
+
filterFields: j,
|
|
189
|
+
sortFields: $,
|
|
181
190
|
defaultParams: a.params,
|
|
182
191
|
defaultData: a.defaultData,
|
|
183
192
|
manual: a.manual,
|
|
184
193
|
formatParams: a.beforeSearchSubmit,
|
|
185
194
|
pagination: a.pagination
|
|
186
|
-
}), { sortChangeEvent:
|
|
187
|
-
|
|
195
|
+
}), { sortChangeEvent: fe, filterChangeEvent: ge, paginationChangeEvent: ve } = Oe(me);
|
|
196
|
+
He({
|
|
188
197
|
columns: n(() => d.value),
|
|
189
198
|
columnsBackup: n(() => O.value),
|
|
190
|
-
size: n(() =>
|
|
199
|
+
size: n(() => b.value ? Me[b.value] : "middle"),
|
|
191
200
|
updateColumns(e) {
|
|
192
201
|
d.value = e;
|
|
193
202
|
},
|
|
194
203
|
updateSize(e) {
|
|
195
|
-
|
|
204
|
+
b.value = We[e];
|
|
196
205
|
},
|
|
197
206
|
renderConfig: n(() => ({
|
|
198
|
-
className:
|
|
207
|
+
className: re("table-header", "title"),
|
|
199
208
|
color: m.value.colorPrimary
|
|
200
209
|
}))
|
|
201
210
|
});
|
|
202
|
-
const
|
|
211
|
+
const he = n(
|
|
203
212
|
() => d.value.some(
|
|
204
213
|
(e) => e.fixed === "left" || e.fixed === !0
|
|
205
214
|
) ? "left" : void 0
|
|
206
|
-
),
|
|
207
|
-
() =>
|
|
208
|
-
), { selectedRows:
|
|
215
|
+
), ye = n(
|
|
216
|
+
() => B(a.dataSource) ? h.records : a.dataSource
|
|
217
|
+
), { selectedRows: S, rowSelection: x, ...Ce } = je({
|
|
209
218
|
...a.rowSelection === !0 ? {} : a.rowSelection,
|
|
210
|
-
dataSource:
|
|
219
|
+
dataSource: ye,
|
|
211
220
|
rowKey: a.rowKey
|
|
212
221
|
}), M = () => {
|
|
213
222
|
const e = p.value;
|
|
214
|
-
e && (
|
|
223
|
+
e && (S.value = [
|
|
215
224
|
...e.getCheckboxReserveRecords(),
|
|
216
225
|
...e.getCheckboxRecords()
|
|
217
226
|
]);
|
|
218
|
-
},
|
|
227
|
+
}, we = () => {
|
|
219
228
|
const e = p.value;
|
|
220
|
-
e && (
|
|
229
|
+
e && (S.value = [e.getRadioRecord()]);
|
|
221
230
|
};
|
|
222
|
-
function
|
|
231
|
+
function be() {
|
|
223
232
|
var e;
|
|
224
233
|
return ((e = a.columns) == null ? void 0 : e.filter((l) => !l.hideInTable)) || [];
|
|
225
234
|
}
|
|
226
|
-
function
|
|
235
|
+
function Se(e) {
|
|
227
236
|
var l, t, r;
|
|
228
237
|
(r = (t = (l = P.value) == null ? void 0 : l.apForm) == null ? void 0 : t.setFieldsValue) == null || r.call(t, e);
|
|
229
238
|
}
|
|
230
|
-
function
|
|
239
|
+
function xe(e = !1) {
|
|
231
240
|
var t, r, c;
|
|
232
241
|
const l = e ? "getFieldsValueTransformed" : "getFieldsValue";
|
|
233
242
|
return (c = (r = (t = P.value) == null ? void 0 : t.apForm) == null ? void 0 : r[l]) == null ? void 0 : c.call(r, !0);
|
|
234
243
|
}
|
|
235
|
-
function
|
|
236
|
-
|
|
244
|
+
function E() {
|
|
245
|
+
Ce.clearAll();
|
|
237
246
|
const e = p.value;
|
|
238
|
-
e && (
|
|
247
|
+
e && (x.value.type === "radio" ? (e.clearRadioRow(), e.clearRadioReserve()) : (e.clearCheckboxRow(), e.clearCheckboxReserve()));
|
|
239
248
|
}
|
|
240
|
-
async function
|
|
249
|
+
async function Re(e, l) {
|
|
241
250
|
var r;
|
|
242
251
|
const t = h.records[e];
|
|
243
252
|
if (t)
|
|
244
253
|
return (r = p.value) == null ? void 0 : r.scrollToRow(t, l);
|
|
245
254
|
}
|
|
246
|
-
return
|
|
255
|
+
return N(
|
|
247
256
|
() => [a.columnResizable, a.columns],
|
|
248
257
|
() => {
|
|
249
|
-
const e =
|
|
258
|
+
const e = be();
|
|
250
259
|
d.value = e, O.value = e;
|
|
251
260
|
},
|
|
252
261
|
{
|
|
253
262
|
deep: !0,
|
|
254
263
|
immediate: !0
|
|
255
264
|
}
|
|
256
|
-
),
|
|
265
|
+
), N(
|
|
257
266
|
() => a.dataSource,
|
|
258
267
|
(e) => {
|
|
259
|
-
|
|
268
|
+
pe(e);
|
|
260
269
|
},
|
|
261
270
|
{ immediate: !0 }
|
|
262
|
-
),
|
|
271
|
+
), N(
|
|
263
272
|
() => o(h).loading,
|
|
264
273
|
(e) => {
|
|
265
274
|
var l;
|
|
266
275
|
(l = a.onLoadingChange) == null || l.call(a, e);
|
|
267
276
|
}
|
|
268
|
-
),
|
|
269
|
-
submit:
|
|
270
|
-
reset:
|
|
271
|
-
refresh:
|
|
272
|
-
setSearchFormValues:
|
|
273
|
-
getSearchFormValues:
|
|
277
|
+
), ae({
|
|
278
|
+
submit: H,
|
|
279
|
+
reset: W,
|
|
280
|
+
refresh: ce,
|
|
281
|
+
setSearchFormValues: Se,
|
|
282
|
+
getSearchFormValues: xe,
|
|
274
283
|
getShowColumns: () => o(d),
|
|
275
284
|
rowSelection: {
|
|
276
|
-
selectedRows: n(() =>
|
|
277
|
-
clearAll:
|
|
285
|
+
selectedRows: n(() => S.value),
|
|
286
|
+
clearAll: E
|
|
278
287
|
},
|
|
279
|
-
scrollToRow:
|
|
280
|
-
}), (e, l) => (s(),
|
|
281
|
-
class: f(
|
|
282
|
-
style:
|
|
288
|
+
scrollToRow: Re
|
|
289
|
+
}), (e, l) => (s(), k("div", {
|
|
290
|
+
class: f(ie.value),
|
|
291
|
+
style: z(e.wrapperStyle)
|
|
283
292
|
}, [
|
|
284
|
-
o(
|
|
293
|
+
o(B)(e.dataSource) && e.searchForm !== !1 && K.value.length > 0 ? (s(), k("div", {
|
|
285
294
|
key: 0,
|
|
286
|
-
class: f(e.card ? o(
|
|
287
|
-
style:
|
|
295
|
+
class: f(e.card ? o(I)("search-wrapper") : null),
|
|
296
|
+
style: z(e.searchFormWrapperStyle)
|
|
288
297
|
}, [
|
|
289
|
-
|
|
298
|
+
U(o(Ne).SearchForm, g(e.searchForm || {}, {
|
|
290
299
|
ref_key: "formRef",
|
|
291
300
|
ref: P,
|
|
292
301
|
"custom-reset": "",
|
|
293
302
|
"submit-loading": !1,
|
|
294
|
-
onSubmit: o(
|
|
295
|
-
onReset: o(
|
|
296
|
-
}),
|
|
303
|
+
onSubmit: o(H),
|
|
304
|
+
onReset: o(W)
|
|
305
|
+
}), G({
|
|
297
306
|
default: v(() => [
|
|
298
|
-
(s(!0),
|
|
307
|
+
(s(!0), k(X, null, T(K.value, (t) => (s(), u(A(t.renderNode.Comp), g({
|
|
299
308
|
key: t.dataIndex,
|
|
300
309
|
item: t,
|
|
301
310
|
ref_for: !0
|
|
@@ -306,39 +315,39 @@ const vo = /* @__PURE__ */ Ce({
|
|
|
306
315
|
]),
|
|
307
316
|
_: 2
|
|
308
317
|
}, [
|
|
309
|
-
|
|
318
|
+
L.searchFormExtra ? {
|
|
310
319
|
name: "extra",
|
|
311
320
|
fn: v(() => [
|
|
312
|
-
|
|
321
|
+
_(e.$slots, "searchFormExtra")
|
|
313
322
|
]),
|
|
314
323
|
key: "0"
|
|
315
324
|
} : void 0
|
|
316
325
|
]), 1040, ["onSubmit", "onReset"])
|
|
317
|
-
], 6)) :
|
|
318
|
-
|
|
319
|
-
class: f([o(
|
|
320
|
-
style:
|
|
326
|
+
], 6)) : C("", !0),
|
|
327
|
+
F("div", {
|
|
328
|
+
class: f([o(I)("table-wrapper"), e.card ? o(I)("table-wrapper-card") : null]),
|
|
329
|
+
style: z(e.tableWrapperStyle)
|
|
321
330
|
}, [
|
|
322
|
-
|
|
331
|
+
F("div", {
|
|
323
332
|
class: f(o(i)("header-wrapper"))
|
|
324
333
|
}, [
|
|
325
|
-
|
|
326
|
-
selectedRows: o(
|
|
327
|
-
selectedRowKeys: o(
|
|
334
|
+
_(e.$slots, "title", {
|
|
335
|
+
selectedRows: o(S),
|
|
336
|
+
selectedRowKeys: o(x).selectedRowKeys,
|
|
328
337
|
shownColumns: d.value,
|
|
329
|
-
clearAll:
|
|
338
|
+
clearAll: E
|
|
330
339
|
})
|
|
331
340
|
], 2),
|
|
332
|
-
|
|
341
|
+
F("div", {
|
|
333
342
|
class: f(o(i)("vxe-wrapper"))
|
|
334
343
|
}, [
|
|
335
|
-
(s(), u(o(
|
|
344
|
+
(s(), u(o(Pe), g(o(De)(a), {
|
|
336
345
|
ref_key: "tableRef",
|
|
337
346
|
ref: p,
|
|
338
|
-
key: o(
|
|
347
|
+
key: o(se),
|
|
339
348
|
data: o(h).records,
|
|
340
|
-
"sort-config": { remote:
|
|
341
|
-
"filter-config": { remote:
|
|
349
|
+
"sort-config": { remote: $.value.length > 0 },
|
|
350
|
+
"filter-config": { remote: j.value.length > 0 },
|
|
342
351
|
loading: o(h).loading,
|
|
343
352
|
"row-config": {
|
|
344
353
|
isHover: !0,
|
|
@@ -354,57 +363,57 @@ const vo = /* @__PURE__ */ Ce({
|
|
|
354
363
|
"--vxe-ui-table-row-radio-checked-background-color": o(m).controlItemBgActive,
|
|
355
364
|
"--vxe-ui-table-row-hover-radio-checked-background-color": o(m).controlItemBgActiveHover
|
|
356
365
|
},
|
|
357
|
-
size:
|
|
358
|
-
onSortChange: o(
|
|
359
|
-
onFilterChange: o(
|
|
366
|
+
size: b.value,
|
|
367
|
+
onSortChange: o(fe),
|
|
368
|
+
onFilterChange: o(ge),
|
|
360
369
|
onCheckboxChange: M,
|
|
361
370
|
onCheckboxAll: M,
|
|
362
|
-
onRadioChange:
|
|
363
|
-
}),
|
|
371
|
+
onRadioChange: we
|
|
372
|
+
}), G({
|
|
364
373
|
empty: v(() => [
|
|
365
|
-
|
|
366
|
-
image: o(
|
|
374
|
+
U(o(ee), {
|
|
375
|
+
image: o(ee).PRESENTED_IMAGE_SIMPLE
|
|
367
376
|
}, null, 8, ["image"])
|
|
368
377
|
]),
|
|
369
378
|
default: v(() => [
|
|
370
|
-
a.expandable ? (s(), u(o(
|
|
379
|
+
a.expandable ? (s(), u(o(Q), g({ key: 0 }, o(Ke)(e.expandable), { fixed: he.value }), {
|
|
371
380
|
content: v((t) => [
|
|
372
|
-
(s(), u(
|
|
381
|
+
(s(), u(A(a.expandable.renderContent(t))))
|
|
373
382
|
]),
|
|
374
383
|
_: 1
|
|
375
|
-
}, 16, ["fixed"])) :
|
|
376
|
-
a.rowSelection ? (s(), u(o(
|
|
377
|
-
(s(!0),
|
|
384
|
+
}, 16, ["fixed"])) : C("", !0),
|
|
385
|
+
a.rowSelection ? (s(), u(o(Q), J(g({ key: 1 }, o($e)(o(x), d.value))), null, 16)) : C("", !0),
|
|
386
|
+
(s(!0), k(X, null, T(o(ne), (t) => (s(), u(A(t), {
|
|
378
387
|
key: t.props.colId
|
|
379
388
|
}))), 128))
|
|
380
389
|
]),
|
|
381
390
|
_: 2
|
|
382
391
|
}, [
|
|
383
|
-
|
|
392
|
+
T(o(Ee)(L, ["searchFormExtra"]), (t, r) => ({
|
|
384
393
|
name: r,
|
|
385
394
|
fn: v((c) => [
|
|
386
|
-
|
|
395
|
+
_(e.$slots, r, J(Ie(c || {})))
|
|
387
396
|
])
|
|
388
397
|
}))
|
|
389
398
|
]), 1040, ["data", "sort-config", "filter-config", "loading", "row-config", "style", "size", "onSortChange", "onFilterChange"]))
|
|
390
399
|
], 2),
|
|
391
|
-
|
|
400
|
+
F("div", {
|
|
392
401
|
class: f(o(i)("pagination-wrapper"))
|
|
393
402
|
}, [
|
|
394
|
-
e.sticky ? (s(), u(o(
|
|
403
|
+
e.sticky ? (s(), u(o(Qe), {
|
|
395
404
|
key: 0,
|
|
396
405
|
direction: "horizontal",
|
|
397
|
-
"scroll-container":
|
|
398
|
-
}, null, 8, ["scroll-container"])) :
|
|
399
|
-
e.pagination !== !1 ? (s(), u(o(
|
|
406
|
+
"scroll-container": de.value
|
|
407
|
+
}, null, 8, ["scroll-container"])) : C("", !0),
|
|
408
|
+
e.pagination !== !1 ? (s(), u(o(Le), g({
|
|
400
409
|
key: 1,
|
|
401
410
|
class: o(i)("pagination")
|
|
402
|
-
}, o(
|
|
411
|
+
}, o(ue).pagination, { onChange: o(ve) }), null, 16, ["class", "onChange"])) : C("", !0)
|
|
403
412
|
], 2)
|
|
404
413
|
], 6)
|
|
405
414
|
], 6));
|
|
406
415
|
}
|
|
407
416
|
});
|
|
408
417
|
export {
|
|
409
|
-
|
|
418
|
+
Ro as default
|
|
410
419
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { VxeTableEventProps, VxeTableProps } from 'vxe-table';
|
|
2
|
-
import { ApGridProps, ApGridRowSelection } from '../interface';
|
|
2
|
+
import { ApGridColumnType, ApGridProps, ApGridRowSelection } from '../interface';
|
|
3
3
|
import { RowSelectionType } from '@aplus-frontend/antdv/es/table/interface';
|
|
4
4
|
export declare function toVxeProps<RecordType>(props: any): VxeTableProps<RecordType> & VxeTableEventProps<RecordType>;
|
|
5
|
-
export declare function getRowSelectionProps(rowSelection: ApGridRowSelection<any> | true): {
|
|
5
|
+
export declare function getRowSelectionProps(rowSelection: ApGridRowSelection<any> | true, columns: ApGridColumnType[]): {
|
|
6
6
|
type: RowSelectionType;
|
|
7
7
|
width: string | number;
|
|
8
|
+
fixed: "left" | "right" | undefined;
|
|
8
9
|
};
|
|
9
10
|
export declare function getRowExpandProps(config: ApGridProps['expandable']): {
|
|
10
11
|
readonly type: "expand";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { omit as
|
|
2
|
-
const h = 30,
|
|
3
|
-
function
|
|
4
|
-
var r, l,
|
|
1
|
+
import { omit as d, isUndefined as n, isFunction as f, isNumber as c } from "lodash-unified";
|
|
2
|
+
const h = 30, v = 50;
|
|
3
|
+
function R(e) {
|
|
4
|
+
var r, l, o;
|
|
5
5
|
const t = {
|
|
6
|
-
...
|
|
6
|
+
...d(e, [
|
|
7
7
|
"columns",
|
|
8
8
|
"request",
|
|
9
9
|
"searchForm",
|
|
@@ -15,48 +15,55 @@ function v(e) {
|
|
|
15
15
|
if (e.adaptive && (t.autoResize = !0, t.height = "100%"), e.columnResizable && (t.columnConfig ? t.columnConfig.resizable = !0 : t.columnConfig = {
|
|
16
16
|
resizable: !0
|
|
17
17
|
}), e.rowSelection) {
|
|
18
|
-
const
|
|
19
|
-
|
|
18
|
+
const i = e.rowSelection === !0 ? {} : e.rowSelection;
|
|
19
|
+
i.type === "radio" ? t.radioConfig = {
|
|
20
20
|
highlight: !0,
|
|
21
|
-
checkMethod({ row:
|
|
22
|
-
return
|
|
21
|
+
checkMethod({ row: u }) {
|
|
22
|
+
return i.disabled ? !i.disabled(u) : !0;
|
|
23
23
|
},
|
|
24
|
-
checkRowKey: (r =
|
|
25
|
-
reserve:
|
|
24
|
+
checkRowKey: (r = i.defaultSelectedRowKeys) == null ? void 0 : r[0],
|
|
25
|
+
reserve: n(i.preserveSelectedRowKeys) ? !0 : i.preserveSelectedRowKeys
|
|
26
26
|
} : t.checkboxConfig = {
|
|
27
27
|
highlight: !0,
|
|
28
|
-
checkMethod({ row:
|
|
29
|
-
return
|
|
28
|
+
checkMethod({ row: u }) {
|
|
29
|
+
return i.disabled ? !i.disabled(u) : !0;
|
|
30
30
|
},
|
|
31
|
-
checkRowKeys:
|
|
32
|
-
reserve:
|
|
31
|
+
checkRowKeys: i.defaultSelectedRowKeys,
|
|
32
|
+
reserve: n(i.preserveSelectedRowKeys) ? !0 : i.preserveSelectedRowKeys
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
return t.border = e.bordered, e.expandable && (t.expandConfig =
|
|
35
|
+
return t.border = e.bordered, e.expandable && (t.expandConfig = d(e.expandable, [
|
|
36
36
|
"renderContent",
|
|
37
37
|
"width",
|
|
38
38
|
"title"
|
|
39
|
-
])), e.footer && (t.showFooter = !0,
|
|
39
|
+
])), e.footer && (t.showFooter = !0, f(e.footer) ? t.footerMethod = e.footer : t.footerData = e.footer), e.virtual === !1 ? (t.virtualXConfig = {
|
|
40
40
|
enabled: !1
|
|
41
41
|
}, t.virtualYConfig = {
|
|
42
42
|
enabled: !1
|
|
43
|
-
}) : (a(t, "X", (l = e.virtual) == null ? void 0 : l.x), a(t, "Y", (
|
|
43
|
+
}) : (a(t, "X", (l = e.virtual) == null ? void 0 : l.x), a(t, "Y", (o = e.virtual) == null ? void 0 : o.y)), t;
|
|
44
44
|
}
|
|
45
45
|
function a(e, t, r) {
|
|
46
|
-
const l = t === "X",
|
|
47
|
-
e[
|
|
48
|
-
enabled:
|
|
46
|
+
const l = t === "X", o = l ? "virtualXConfig" : "virtualYConfig", i = r !== !1, u = l ? h : v, s = c(r) && r >= 0 ? r : u;
|
|
47
|
+
e[o] = {
|
|
48
|
+
enabled: i,
|
|
49
49
|
gt: s
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
function b(e) {
|
|
53
|
+
return e === !0 ? "left" : e;
|
|
54
|
+
}
|
|
55
|
+
function w(e, t) {
|
|
56
|
+
const r = e === !0 || !e.type ? "checkbox" : e.type, l = e === !0 ? 60 : e.columnWidth || 60;
|
|
57
|
+
let o = e === !0 ? void 0 : b(e.fixed);
|
|
58
|
+
return o || (o === !1 ? o = void 0 : o = t.some(
|
|
59
|
+
(i) => i.fixed === "left" || i.fixed === !0
|
|
60
|
+
) ? "left" : void 0), {
|
|
61
|
+
type: r,
|
|
62
|
+
width: l,
|
|
63
|
+
fixed: o
|
|
57
64
|
};
|
|
58
65
|
}
|
|
59
|
-
function
|
|
66
|
+
function x(e) {
|
|
60
67
|
const t = (e == null ? void 0 : e.width) || "auto";
|
|
61
68
|
return {
|
|
62
69
|
type: "expand",
|
|
@@ -65,7 +72,7 @@ function R(e) {
|
|
|
65
72
|
};
|
|
66
73
|
}
|
|
67
74
|
export {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
75
|
+
x as getRowExpandProps,
|
|
76
|
+
w as getRowSelectionProps,
|
|
77
|
+
R as toVxeProps
|
|
71
78
|
};
|