@aplus-frontend/ui 0.0.17 → 0.0.18
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 +23 -22
- package/es/src/ap-field/date/helper.d.ts +7 -0
- package/es/src/ap-field/date/helper.mjs +17 -7
- package/es/src/ap-field/date/index.vue.mjs +46 -39
- package/es/src/ap-field/date-range/index.vue.mjs +63 -61
- package/es/src/ap-field/interface.d.ts +9 -0
- package/es/src/ap-table/ap-table.vue.mjs +92 -95
- package/es/src/ap-table/constants.d.ts +24 -0
- package/es/src/ap-table/interface.d.ts +18 -4
- package/es/src/ap-table/utils.d.ts +6831 -845
- package/es/src/business/ap-label/ApLabel.vue.d.ts +38 -0
- package/es/src/business/ap-label/ApLabel.vue.mjs +4 -0
- package/es/src/business/ap-label/ApLabel.vue2.mjs +52 -0
- package/es/src/business/ap-label/index.d.ts +4 -0
- package/es/src/business/ap-label/interface.d.ts +8 -0
- package/es/src/business/ap-label/style.css +4 -0
- package/es/src/business/index.d.ts +256 -1
- package/es/src/business/index.mjs +7 -4
- package/es/src/editable-table/interface.d.ts +1 -1
- package/es/src/index.mjs +178 -177
- package/es/src/theme/ap-label/ap-label.css +4 -0
- package/lib/index.js +1 -1
- package/lib/src/ap-field/date/helper.d.ts +7 -0
- package/lib/src/ap-field/date/helper.js +1 -1
- 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/interface.d.ts +9 -0
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/constants.d.ts +24 -0
- package/lib/src/ap-table/interface.d.ts +18 -4
- package/lib/src/ap-table/utils.d.ts +6831 -845
- package/lib/src/business/ap-label/ApLabel.vue.d.ts +38 -0
- package/lib/src/business/ap-label/ApLabel.vue.js +1 -0
- package/lib/src/business/ap-label/ApLabel.vue2.js +1 -0
- package/lib/src/business/ap-label/index.d.ts +4 -0
- package/lib/src/business/ap-label/interface.d.ts +8 -0
- package/lib/src/business/ap-label/style.css +4 -0
- package/lib/src/business/index.d.ts +256 -1
- package/lib/src/business/index.js +1 -1
- package/lib/src/editable-table/interface.d.ts +1 -1
- package/lib/src/index.js +1 -1
- package/lib/src/theme/ap-label/ap-label.css +4 -0
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as Y, useSlots as Z, computed as d, createVNode as s, mergeProps as
|
|
1
|
+
import { defineComponent as Y, useSlots as Z, computed as d, createVNode as s, mergeProps as m, unref as l, watch as ee, openBlock as i, createElementBlock as f, normalizeClass as S, normalizeStyle as x, createSlots as I, withCtx as p, Fragment as ae, renderList as k, createBlock as te, resolveDynamicComponent as oe, renderSlot as R, createCommentVNode as E, createElementVNode as O, toDisplayString as re, normalizeProps as le, guardReactiveProps as ne } from "vue";
|
|
2
2
|
import { Typography as de, Table as se, Tooltip as ue } from "ant-design-vue";
|
|
3
3
|
import { useToken as ie } from "ant-design-vue/es/theme/internal";
|
|
4
4
|
import { ApForm as pe } from "../ap-form/index.mjs";
|
|
5
|
-
import { apTableRenderItemMap as ce, noRenderAsFormItemValueList as
|
|
5
|
+
import { apTableRenderItemMap as ce, noRenderAsFormItemValueList as L, apTableFormItemMap as me } from "./constants.mjs";
|
|
6
6
|
import "../config-provider/index.mjs";
|
|
7
7
|
import { useTablePaging as fe } from "./hooks/use-table-paging.mjs";
|
|
8
8
|
import { isUndefined as ge, omit as ye } from "lodash-unified";
|
|
9
9
|
import "./style/ap-table.css";
|
|
10
10
|
import { QuestionCircleOutlined as he } from "@ant-design/icons-vue";
|
|
11
|
-
import { apColumnToColumn as be, getTableRenderType as Ce, getTableRenderProps as Fe, getColumnOrder as
|
|
11
|
+
import { apColumnToColumn as be, getTableRenderType as Ce, getTableRenderProps as Fe, getColumnOrder as z, updateFormProps as Se, getFieldProps as xe, getPlaceholder as Re } from "./utils.mjs";
|
|
12
12
|
import we from "./hooks/use-table-content-height.mjs";
|
|
13
13
|
import { useLocale as Te } from "../config-provider/hooks/use-locale.mjs";
|
|
14
14
|
import { useNamespace as Be } from "../config-provider/hooks/use-namespace.mjs";
|
|
@@ -128,18 +128,18 @@ const Pe = {
|
|
|
128
128
|
default: !1
|
|
129
129
|
}
|
|
130
130
|
},
|
|
131
|
-
setup(
|
|
131
|
+
setup(N, {
|
|
132
132
|
expose: V
|
|
133
133
|
}) {
|
|
134
|
-
const r =
|
|
135
|
-
t:
|
|
134
|
+
const r = N, w = Z(), [, D] = ie(), {
|
|
135
|
+
t: W
|
|
136
136
|
} = Te(), {
|
|
137
|
-
e:
|
|
137
|
+
e: g,
|
|
138
138
|
b: u
|
|
139
|
-
} = Be("ap-table"),
|
|
140
|
-
height:
|
|
141
|
-
contentRef:
|
|
142
|
-
} = we(),
|
|
139
|
+
} = Be("ap-table"), _ = ve("uiMode", "aplus"), {
|
|
140
|
+
height: j,
|
|
141
|
+
contentRef: A
|
|
142
|
+
} = we(), y = d(() => {
|
|
143
143
|
var t;
|
|
144
144
|
let e = ((t = r.columns) == null ? void 0 : t.filter((a) => !a.hideInTable)) || [];
|
|
145
145
|
return e = e.map((a) => ({
|
|
@@ -148,32 +148,28 @@ const Pe = {
|
|
|
148
148
|
value: o,
|
|
149
149
|
...n
|
|
150
150
|
}) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
mode: "read"
|
|
165
|
-
}), null);
|
|
166
|
-
}
|
|
167
|
-
return G(a, o, i);
|
|
151
|
+
const C = Ce(a), P = ce[C], X = Fe(a, {
|
|
152
|
+
value: o,
|
|
153
|
+
...n
|
|
154
|
+
});
|
|
155
|
+
let F = Q(a, o, s(P, m(X, {
|
|
156
|
+
mode: "read"
|
|
157
|
+
}), null));
|
|
158
|
+
return a.customRender && (F = a.customRender({
|
|
159
|
+
value: o,
|
|
160
|
+
...n,
|
|
161
|
+
column: a,
|
|
162
|
+
originalNode: F
|
|
163
|
+
})), F;
|
|
168
164
|
}
|
|
169
165
|
})), e;
|
|
170
|
-
}),
|
|
166
|
+
}), T = d(() => {
|
|
171
167
|
var e, t, a;
|
|
172
|
-
return ((a = (t = (e = r.columns) == null ? void 0 : e.filter((o) => !o.hideInSearch && o.dataIndex && (o.valueType || o.customRenderFormItem) && !
|
|
173
|
-
let
|
|
174
|
-
return
|
|
168
|
+
return ((a = (t = (e = r.columns) == null ? void 0 : e.filter((o) => !o.hideInSearch && o.dataIndex && (o.valueType || o.customRenderFormItem) && !L.includes(o.valueType))) == null ? void 0 : t.sort((o, n) => {
|
|
169
|
+
let C = z(o.order);
|
|
170
|
+
return z(n.order) - C;
|
|
175
171
|
})) == null ? void 0 : a.map((o) => {
|
|
176
|
-
const n = Se(o,
|
|
172
|
+
const n = Se(o, xe(o.fieldProps, {}));
|
|
177
173
|
return {
|
|
178
174
|
...o,
|
|
179
175
|
fieldProps: {
|
|
@@ -181,17 +177,17 @@ const Pe = {
|
|
|
181
177
|
name: o.dataIndex,
|
|
182
178
|
...n || {},
|
|
183
179
|
// 格式化placeholder
|
|
184
|
-
placeholder:
|
|
180
|
+
placeholder: Re(W, o.valueType, n == null ? void 0 : n.placeholder)
|
|
185
181
|
}
|
|
186
182
|
};
|
|
187
183
|
})) || [];
|
|
188
|
-
}),
|
|
189
|
-
formRef:
|
|
190
|
-
submit:
|
|
191
|
-
reset:
|
|
192
|
-
tableProps:
|
|
193
|
-
handleTableChange:
|
|
194
|
-
data:
|
|
184
|
+
}), M = d(() => l(y).filter((e) => e.sorter === !0).map((e) => e.dataIndex)), q = d(() => l(y).filter((e) => e.filters && !e.onFilter).map((e) => e.dataIndex)), {
|
|
185
|
+
formRef: h,
|
|
186
|
+
submit: B,
|
|
187
|
+
reset: v,
|
|
188
|
+
tableProps: c,
|
|
189
|
+
handleTableChange: H,
|
|
190
|
+
data: b
|
|
195
191
|
} = fe({
|
|
196
192
|
async request(e) {
|
|
197
193
|
var a, o;
|
|
@@ -201,27 +197,28 @@ const Pe = {
|
|
|
201
197
|
total: (t == null ? void 0 : t.total) || 0
|
|
202
198
|
};
|
|
203
199
|
},
|
|
204
|
-
filterFields: l(
|
|
205
|
-
sortFields: l(
|
|
200
|
+
filterFields: l(q),
|
|
201
|
+
sortFields: l(M),
|
|
206
202
|
defaultParams: r.params,
|
|
207
203
|
defaultData: r.defaultData,
|
|
208
204
|
manual: r.manual,
|
|
209
205
|
defaultCurrent: r.pagination ? r.pagination.defaultCurrent : void 0,
|
|
210
206
|
defaultPageSize: r.pagination ? r.pagination.defaultPageSize : void 0,
|
|
211
207
|
formatParams: r.beforeSearchSubmit
|
|
212
|
-
}),
|
|
213
|
-
y: l(
|
|
208
|
+
}), K = d(() => r.scroll ? r.scroll : r.adaptive && b.value.total > 0 ? {
|
|
209
|
+
y: l(j),
|
|
210
|
+
x: "100%"
|
|
214
211
|
} : {
|
|
215
212
|
x: !0
|
|
216
|
-
}),
|
|
213
|
+
}), $ = d(() => ({
|
|
217
214
|
...r,
|
|
218
|
-
...l(
|
|
219
|
-
loading: ge(r.loading) ? l(
|
|
220
|
-
pagination: r.pagination === !1 ? !1 : l(
|
|
221
|
-
scroll: l(
|
|
222
|
-
})),
|
|
223
|
-
function
|
|
224
|
-
return
|
|
215
|
+
...l(c),
|
|
216
|
+
loading: ge(r.loading) ? l(c).loading : r.loading,
|
|
217
|
+
pagination: r.pagination === !1 ? !1 : l(c).pagination,
|
|
218
|
+
scroll: l(K)
|
|
219
|
+
})), G = d(() => [u(), r.card ? null : u("wrapper"), r.adaptive ? u("adaptive") : null].filter(Boolean));
|
|
220
|
+
function Q(e, t, a) {
|
|
221
|
+
return L.includes(e.valueType) ? a : e.copyable || e.ellipsis ? s(de.Text, {
|
|
225
222
|
copyable: e.copyable ? {
|
|
226
223
|
text: t,
|
|
227
224
|
tooltip: !1
|
|
@@ -232,79 +229,79 @@ const Pe = {
|
|
|
232
229
|
content: a
|
|
233
230
|
}, null) : a;
|
|
234
231
|
}
|
|
235
|
-
ee(() => l(
|
|
232
|
+
ee(() => l(b).loading, (e) => {
|
|
236
233
|
var t;
|
|
237
234
|
(t = r.onLoadingChange) == null || t.call(r, e);
|
|
238
235
|
});
|
|
239
|
-
function
|
|
236
|
+
function U(e) {
|
|
240
237
|
var t, a, o;
|
|
241
|
-
(o = (a = (t =
|
|
238
|
+
(o = (a = (t = h.value) == null ? void 0 : t.apForm) == null ? void 0 : a.setFieldsValue) == null || o.call(a, e);
|
|
242
239
|
}
|
|
243
|
-
function
|
|
240
|
+
function J() {
|
|
244
241
|
var e, t, a;
|
|
245
|
-
return (a = (t = (e =
|
|
242
|
+
return (a = (t = (e = h.value) == null ? void 0 : e.apForm) == null ? void 0 : t.getFieldsValue) == null ? void 0 : a.call(t, !0);
|
|
246
243
|
}
|
|
247
244
|
return V({
|
|
248
|
-
submit: () =>
|
|
249
|
-
reset: () =>
|
|
250
|
-
setSearchFormValues:
|
|
251
|
-
getSearchFormValues:
|
|
252
|
-
dataSource: d(() => l(
|
|
253
|
-
}), (e, t) => (
|
|
254
|
-
class:
|
|
255
|
-
}, [e.searchForm !== !1 &&
|
|
245
|
+
submit: () => B(),
|
|
246
|
+
reset: () => v(),
|
|
247
|
+
setSearchFormValues: U,
|
|
248
|
+
getSearchFormValues: J,
|
|
249
|
+
dataSource: d(() => l(b).records)
|
|
250
|
+
}), (e, t) => (i(), f("div", {
|
|
251
|
+
class: S(G.value)
|
|
252
|
+
}, [e.searchForm !== !1 && T.value.length > 0 ? (i(), f("div", {
|
|
256
253
|
key: 0,
|
|
257
|
-
class:
|
|
258
|
-
style:
|
|
259
|
-
}, [s(l(pe).SearchForm,
|
|
254
|
+
class: S(e.card ? l(g)("search-wrapper") : null),
|
|
255
|
+
style: x(e.searchFormWrapperStyle)
|
|
256
|
+
}, [s(l(pe).SearchForm, m(e.searchForm || {}, {
|
|
260
257
|
ref_key: "formRef",
|
|
261
|
-
ref:
|
|
258
|
+
ref: h,
|
|
262
259
|
"custom-reset": "",
|
|
263
|
-
onSubmit: l(
|
|
264
|
-
onReset: l(
|
|
265
|
-
"submit-loading": l(
|
|
266
|
-
}),
|
|
267
|
-
default:
|
|
260
|
+
onSubmit: l(B),
|
|
261
|
+
onReset: l(v),
|
|
262
|
+
"submit-loading": l(c).loading
|
|
263
|
+
}), I({
|
|
264
|
+
default: p(() => [(i(!0), f(ae, null, k(T.value, (a) => (i(), te(oe(a.customRenderFormItem ? a.customRenderFormItem(a) : l(me)[a.valueType || "text"]), m({
|
|
268
265
|
key: a.dataIndex,
|
|
269
266
|
ref_for: !0
|
|
270
267
|
}, a.fieldProps || {}, {
|
|
271
268
|
span: a.span
|
|
272
269
|
}), null, 16, ["span"]))), 128))]),
|
|
273
270
|
_: 2
|
|
274
|
-
}, [
|
|
271
|
+
}, [w.searchFormExtra ? {
|
|
275
272
|
name: "extra",
|
|
276
|
-
fn:
|
|
273
|
+
fn: p(() => [R(e.$slots, "searchFormExtra")]),
|
|
277
274
|
key: "0"
|
|
278
|
-
} : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) :
|
|
275
|
+
} : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) : E("", !0), O("div", {
|
|
279
276
|
ref_key: "contentRef",
|
|
280
|
-
ref:
|
|
281
|
-
class:
|
|
282
|
-
style:
|
|
283
|
-
}, [R(e.$slots, "title"), s(l(se),
|
|
284
|
-
class: l(
|
|
285
|
-
},
|
|
286
|
-
onChange: l(
|
|
287
|
-
columns:
|
|
288
|
-
}),
|
|
289
|
-
headerCell:
|
|
277
|
+
ref: A,
|
|
278
|
+
class: S([l(g)("table-wrapper"), e.card ? l(g)("table-wrapper-card") : null]),
|
|
279
|
+
style: x(e.tableWrapperStyle)
|
|
280
|
+
}, [R(e.$slots, "title"), s(l(se), m({
|
|
281
|
+
class: l(_) === "admin" ? l(u)("table-admin") : l(u)("table")
|
|
282
|
+
}, $.value, {
|
|
283
|
+
onChange: l(H),
|
|
284
|
+
columns: y.value
|
|
285
|
+
}), I({
|
|
286
|
+
headerCell: p(({
|
|
290
287
|
column: a,
|
|
291
288
|
title: o
|
|
292
|
-
}) => [a.tooltip ? (
|
|
289
|
+
}) => [a.tooltip ? (i(), f("span", Pe, [O("span", null, re(o), 1), s(l(ue), {
|
|
293
290
|
title: a.tooltip,
|
|
294
291
|
placement: "bottom"
|
|
295
292
|
}, {
|
|
296
|
-
default:
|
|
297
|
-
style:
|
|
293
|
+
default: p(() => [s(l(he), {
|
|
294
|
+
style: x({
|
|
298
295
|
paddingLeft: "4px",
|
|
299
|
-
color: l(
|
|
296
|
+
color: l(D).colorPrimary
|
|
300
297
|
})
|
|
301
298
|
}, null, 8, ["style"])]),
|
|
302
299
|
_: 2
|
|
303
|
-
}, 1032, ["title"])])) :
|
|
300
|
+
}, 1032, ["title"])])) : E("", !0)]),
|
|
304
301
|
_: 2
|
|
305
|
-
}, [
|
|
302
|
+
}, [k(l(ye)(w, ["title", "searchFormExtra"]), (a, o) => ({
|
|
306
303
|
name: o,
|
|
307
|
-
fn:
|
|
304
|
+
fn: p((n) => [R(e.$slots, o, le(ne(n || {})))])
|
|
308
305
|
}))]), 1040, ["class", "onChange", "columns"])], 6)], 2));
|
|
309
306
|
}
|
|
310
307
|
});
|
|
@@ -7913,6 +7913,9 @@ export declare const apTableRenderItemMap: {
|
|
|
7913
7913
|
type: PropType<string>;
|
|
7914
7914
|
default: string;
|
|
7915
7915
|
};
|
|
7916
|
+
timezone: {
|
|
7917
|
+
type: PropType<"LA" | "NY" | "SH">;
|
|
7918
|
+
};
|
|
7916
7919
|
}>> & {
|
|
7917
7920
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
7918
7921
|
}, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
@@ -8115,6 +8118,9 @@ export declare const apTableRenderItemMap: {
|
|
|
8115
8118
|
type: PropType<string>;
|
|
8116
8119
|
default: string;
|
|
8117
8120
|
};
|
|
8121
|
+
timezone: {
|
|
8122
|
+
type: PropType<"LA" | "NY" | "SH">;
|
|
8123
|
+
};
|
|
8118
8124
|
}>> & {
|
|
8119
8125
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
8120
8126
|
}, {
|
|
@@ -8349,6 +8355,9 @@ export declare const apTableRenderItemMap: {
|
|
|
8349
8355
|
type: PropType<string>;
|
|
8350
8356
|
default: string;
|
|
8351
8357
|
};
|
|
8358
|
+
timezone: {
|
|
8359
|
+
type: PropType<"LA" | "NY" | "SH">;
|
|
8360
|
+
};
|
|
8352
8361
|
}>> & {
|
|
8353
8362
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
8354
8363
|
}, {}, {}, {}, {}, {
|
|
@@ -8580,6 +8589,9 @@ export declare const apTableRenderItemMap: {
|
|
|
8580
8589
|
type: PropType<string>;
|
|
8581
8590
|
default: string;
|
|
8582
8591
|
};
|
|
8592
|
+
timezone: {
|
|
8593
|
+
type: PropType<"LA" | "NY" | "SH">;
|
|
8594
|
+
};
|
|
8583
8595
|
}>> & {
|
|
8584
8596
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
8585
8597
|
}, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
@@ -8845,6 +8857,9 @@ export declare const apTableRenderItemMap: {
|
|
|
8845
8857
|
type: PropType<string>;
|
|
8846
8858
|
default: string;
|
|
8847
8859
|
};
|
|
8860
|
+
timezone: {
|
|
8861
|
+
type: PropType<"LA" | "NY" | "SH">;
|
|
8862
|
+
};
|
|
8848
8863
|
}>> & {
|
|
8849
8864
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
8850
8865
|
}, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
@@ -9055,6 +9070,9 @@ export declare const apTableRenderItemMap: {
|
|
|
9055
9070
|
type: PropType<string>;
|
|
9056
9071
|
default: string;
|
|
9057
9072
|
};
|
|
9073
|
+
timezone: {
|
|
9074
|
+
type: PropType<"LA" | "NY" | "SH">;
|
|
9075
|
+
};
|
|
9058
9076
|
}>> & {
|
|
9059
9077
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
9060
9078
|
}, {
|
|
@@ -9302,6 +9320,9 @@ export declare const apTableRenderItemMap: {
|
|
|
9302
9320
|
type: PropType<string>;
|
|
9303
9321
|
default: string;
|
|
9304
9322
|
};
|
|
9323
|
+
timezone: {
|
|
9324
|
+
type: PropType<"LA" | "NY" | "SH">;
|
|
9325
|
+
};
|
|
9305
9326
|
}>> & {
|
|
9306
9327
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
9307
9328
|
}, {}, {}, {}, {}, {
|
|
@@ -9546,6 +9567,9 @@ export declare const apTableRenderItemMap: {
|
|
|
9546
9567
|
type: PropType<string>;
|
|
9547
9568
|
default: string;
|
|
9548
9569
|
};
|
|
9570
|
+
timezone: {
|
|
9571
|
+
type: PropType<"LA" | "NY" | "SH">;
|
|
9572
|
+
};
|
|
9549
9573
|
}>> & {
|
|
9550
9574
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
9551
9575
|
}, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
@@ -3,7 +3,7 @@ import { CompareFn, SortOrder } from 'ant-design-vue/es/table/interface';
|
|
|
3
3
|
import { ApFormSearchFormProps } from '../ap-form';
|
|
4
4
|
import { ApFormItemCheckboxProps, ApFormItemDateProps, ApFormItemDateRangeProps, ApFormItemNumberProps, ApFormItemRadioProps, ApFormItemSelectProps, ApFormItemSwitchProps, ApFormItemTextAreaProps, ApFormItemTextPasswordProps, ApFormItemTextProps } from '../ap-form/items/interface';
|
|
5
5
|
import { Recordable } from '../type';
|
|
6
|
-
import { ComputedRef, CSSProperties } from 'vue';
|
|
6
|
+
import { ComputedRef, CSSProperties, VNode } from 'vue';
|
|
7
7
|
import { ApActionGroupProps } from '../ap-action';
|
|
8
8
|
import { ApTableIndexProps } from './components/interface';
|
|
9
9
|
|
|
@@ -56,7 +56,7 @@ export type ApTableValueFields = {
|
|
|
56
56
|
};
|
|
57
57
|
export type ApTableValueTypes = keyof ApTableValueFields;
|
|
58
58
|
export type ValueEnum = Record<string, ValueEnumType>;
|
|
59
|
-
export type ExtraProColumnType<T> = Omit<ColumnType<T>, 'children' | 'filters'> & {
|
|
59
|
+
export type ExtraProColumnType<T> = Omit<ColumnType<T>, 'children' | 'filters' | 'customRender'> & {
|
|
60
60
|
sorter?: string | boolean | CompareFn<T> | {
|
|
61
61
|
compare?: CompareFn<T>;
|
|
62
62
|
/** Config multiple sorter order priority */
|
|
@@ -100,14 +100,14 @@ export type ApColumnType<RecordType = any, ValueType extends ApTableValueTypes =
|
|
|
100
100
|
/**
|
|
101
101
|
* 值类型额外配置的参数(用于查询表单渲染)
|
|
102
102
|
*/
|
|
103
|
-
fieldProps?: ApTableValueFields[ValueType] | ((opt
|
|
103
|
+
fieldProps?: ApTableValueFields[ValueType] | ((opt: Partial<{
|
|
104
104
|
value: any;
|
|
105
105
|
text: any;
|
|
106
106
|
record: RecordType;
|
|
107
107
|
index: number;
|
|
108
108
|
renderIndex: number;
|
|
109
109
|
column: ApColumnType<RecordType, ValueType>;
|
|
110
|
-
}) => ApTableValueFields[ValueType]);
|
|
110
|
+
}>) => ApTableValueFields[ValueType]);
|
|
111
111
|
/**
|
|
112
112
|
* 用于表单项排序的字段
|
|
113
113
|
* @description 值越大,越排在前面,请设置正整数,设置为0或负数将会无效
|
|
@@ -117,6 +117,20 @@ export type ApColumnType<RecordType = any, ValueType extends ApTableValueTypes =
|
|
|
117
117
|
* 表头的菜单筛选项,设置为true后会尝试使用valueEnum生成filters
|
|
118
118
|
*/
|
|
119
119
|
filters?: ColumnType<RecordType>['filters'] | true;
|
|
120
|
+
/**
|
|
121
|
+
* 自定义渲染,添加了`editable`以及`originalNode`
|
|
122
|
+
* @param opt
|
|
123
|
+
* @returns
|
|
124
|
+
*/
|
|
125
|
+
customRender?: (opt: {
|
|
126
|
+
value: any;
|
|
127
|
+
text: any;
|
|
128
|
+
record: RecordType;
|
|
129
|
+
index: number;
|
|
130
|
+
renderIndex: number;
|
|
131
|
+
column: ApColumnType<RecordType>;
|
|
132
|
+
originalNode?: VNode;
|
|
133
|
+
}) => any;
|
|
120
134
|
} : never;
|
|
121
135
|
export type RequestData<T> = {
|
|
122
136
|
data: T[] | undefined;
|