@aplus-frontend/ui 0.0.19 → 0.0.20
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-form/ap-form-item.vue.d.ts +2 -8
- package/es/src/ap-form/constant.d.ts +4 -0
- package/es/src/ap-form/constant.mjs +4 -3
- package/es/src/ap-form/interface.d.ts +10 -0
- package/es/src/ap-form/items/checkbox/index.vue.d.ts +9 -2
- package/es/src/ap-form/items/checkbox/index.vue.mjs +20 -13
- package/es/src/ap-form/items/date/index.vue.d.ts +26 -14
- package/es/src/ap-form/items/date/index.vue.mjs +26 -18
- package/es/src/ap-form/items/date-range/index.vue.d.ts +24 -13
- package/es/src/ap-form/items/date-range/index.vue.mjs +27 -19
- package/es/src/ap-form/items/number/index.vue.d.ts +16 -9
- package/es/src/ap-form/items/number/index.vue.mjs +30 -22
- package/es/src/ap-form/items/radio/index.vue.d.ts +9 -2
- package/es/src/ap-form/items/radio/index.vue.mjs +21 -14
- package/es/src/ap-form/items/select/index.vue.d.ts +28 -15
- package/es/src/ap-form/items/select/index.vue.mjs +30 -22
- package/es/src/ap-form/items/switch/index.vue.d.ts +10 -6
- package/es/src/ap-form/items/switch/index.vue.mjs +25 -17
- package/es/src/ap-form/items/text/index.vue.d.ts +14 -8
- package/es/src/ap-form/items/text/index.vue2.mjs +32 -24
- package/es/src/ap-form/items/text/password.vue.d.ts +16 -9
- package/es/src/ap-form/items/text/password.vue.mjs +29 -21
- package/es/src/ap-form/items/text-area/index.vue.d.ts +9 -2
- package/es/src/ap-form/items/text-area/index.vue.mjs +24 -17
- package/es/src/ap-table/ap-table.vue.mjs +69 -71
- package/es/src/ap-table/constants.d.ts +2692 -1453
- package/lib/src/ap-form/ap-form-item.vue.d.ts +2 -8
- package/lib/src/ap-form/constant.d.ts +4 -0
- package/lib/src/ap-form/constant.js +1 -1
- package/lib/src/ap-form/interface.d.ts +10 -0
- package/lib/src/ap-form/items/checkbox/index.vue.d.ts +9 -2
- package/lib/src/ap-form/items/checkbox/index.vue.js +1 -1
- package/lib/src/ap-form/items/date/index.vue.d.ts +26 -14
- package/lib/src/ap-form/items/date/index.vue.js +1 -1
- package/lib/src/ap-form/items/date-range/index.vue.d.ts +24 -13
- package/lib/src/ap-form/items/date-range/index.vue.js +1 -1
- package/lib/src/ap-form/items/number/index.vue.d.ts +16 -9
- package/lib/src/ap-form/items/number/index.vue.js +1 -1
- package/lib/src/ap-form/items/radio/index.vue.d.ts +9 -2
- package/lib/src/ap-form/items/radio/index.vue.js +1 -1
- package/lib/src/ap-form/items/select/index.vue.d.ts +28 -15
- package/lib/src/ap-form/items/select/index.vue.js +1 -1
- package/lib/src/ap-form/items/switch/index.vue.d.ts +10 -6
- package/lib/src/ap-form/items/switch/index.vue.js +1 -1
- package/lib/src/ap-form/items/text/index.vue.d.ts +14 -8
- package/lib/src/ap-form/items/text/index.vue2.js +1 -1
- package/lib/src/ap-form/items/text/password.vue.d.ts +16 -9
- package/lib/src/ap-form/items/text/password.vue.js +1 -1
- package/lib/src/ap-form/items/text-area/index.vue.d.ts +9 -2
- package/lib/src/ap-form/items/text-area/index.vue.js +1 -1
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/constants.d.ts +2692 -1453
- package/package.json +3 -3
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as Z, useSlots as ee, computed as d, createVNode as s, mergeProps as m, unref as
|
|
1
|
+
import { defineComponent as Z, useSlots as ee, computed as d, createVNode as s, mergeProps as m, unref as n, watch as ae, openBlock as i, createElementBlock as f, normalizeClass as F, normalizeStyle as R, createSlots as k, withCtx as p, Fragment as te, renderList as E, createBlock as oe, resolveDynamicComponent as re, renderSlot as x, createCommentVNode as O, createElementVNode as L, toDisplayString as ne, normalizeProps as le, guardReactiveProps as de } from "vue";
|
|
2
2
|
import { Typography as se, Table as ue, Tooltip as ie } from "ant-design-vue";
|
|
3
3
|
import { useToken as pe } from "ant-design-vue/es/theme/internal";
|
|
4
4
|
import { ApForm as ce } from "../ap-form/index.mjs";
|
|
5
|
-
import { apTableRenderItemMap as me, noRenderAsFormItemValueList as
|
|
5
|
+
import { apTableRenderItemMap as me, noRenderAsFormItemValueList as z, apTableFormItemMap as fe } from "./constants.mjs";
|
|
6
6
|
import "../config-provider/index.mjs";
|
|
7
7
|
import { useTablePaging as ge } from "./hooks/use-table-paging.mjs";
|
|
8
8
|
import { isUndefined as T, 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 Se, getColumnOrder as
|
|
11
|
+
import { apColumnToColumn as be, getTableRenderType as Ce, getTableRenderProps as Se, getColumnOrder as N, updateFormProps as Fe, getFieldProps as Re, getPlaceholder as xe } from "./utils.mjs";
|
|
12
12
|
import Te from "./hooks/use-table-content-height.mjs";
|
|
13
13
|
import { useLocale as we } from "../config-provider/hooks/use-locale.mjs";
|
|
14
14
|
import { useNamespace as Be } from "../config-provider/hooks/use-namespace.mjs";
|
|
@@ -129,35 +129,35 @@ const ve = {
|
|
|
129
129
|
default: !1
|
|
130
130
|
}
|
|
131
131
|
},
|
|
132
|
-
setup(
|
|
133
|
-
expose:
|
|
132
|
+
setup(V, {
|
|
133
|
+
expose: D
|
|
134
134
|
}) {
|
|
135
|
-
const t =
|
|
136
|
-
t:
|
|
135
|
+
const t = V, w = ee(), [, W] = pe(), {
|
|
136
|
+
t: j
|
|
137
137
|
} = we(), {
|
|
138
138
|
e: g,
|
|
139
139
|
b: u
|
|
140
|
-
} = Be("ap-table"),
|
|
141
|
-
height:
|
|
142
|
-
contentRef:
|
|
140
|
+
} = Be("ap-table"), _ = Pe("uiMode", "aplus"), {
|
|
141
|
+
height: A,
|
|
142
|
+
contentRef: M
|
|
143
143
|
} = Te(), y = d(() => {
|
|
144
144
|
var o;
|
|
145
145
|
let e = ((o = t.columns) == null ? void 0 : o.filter((a) => !a.hideInTable)) || [];
|
|
146
146
|
return e = e.map((a) => ({
|
|
147
147
|
...be(a),
|
|
148
148
|
customRender({
|
|
149
|
-
value:
|
|
149
|
+
value: r,
|
|
150
150
|
...l
|
|
151
151
|
}) {
|
|
152
|
-
const C = Ce(a),
|
|
153
|
-
value:
|
|
152
|
+
const C = Ce(a), I = me[C], Y = Se(a, {
|
|
153
|
+
value: r,
|
|
154
154
|
...l
|
|
155
155
|
});
|
|
156
|
-
let S = U(a,
|
|
156
|
+
let S = U(a, r, s(I, m(Y, {
|
|
157
157
|
mode: "read"
|
|
158
158
|
}), null));
|
|
159
159
|
return a.customRender && (S = a.customRender({
|
|
160
|
-
value:
|
|
160
|
+
value: r,
|
|
161
161
|
...l,
|
|
162
162
|
column: a,
|
|
163
163
|
originalNode: S
|
|
@@ -166,58 +166,56 @@ const ve = {
|
|
|
166
166
|
})), e;
|
|
167
167
|
}), B = d(() => {
|
|
168
168
|
var e, o, a;
|
|
169
|
-
return ((a = (o = (e = t.columns) == null ? void 0 : e.filter((
|
|
170
|
-
let C =
|
|
171
|
-
return
|
|
172
|
-
})) == null ? void 0 : a.map((
|
|
173
|
-
const l = Fe(
|
|
169
|
+
return ((a = (o = (e = t.columns) == null ? void 0 : e.filter((r) => !r.hideInSearch && r.dataIndex && (r.valueType || r.customRenderFormItem) && !z.includes(r.valueType))) == null ? void 0 : o.sort((r, l) => {
|
|
170
|
+
let C = N(r.order);
|
|
171
|
+
return N(l.order) - C;
|
|
172
|
+
})) == null ? void 0 : a.map((r) => {
|
|
173
|
+
const l = Fe(r, Re(r.fieldProps, {}));
|
|
174
174
|
return {
|
|
175
|
-
...
|
|
175
|
+
...r,
|
|
176
176
|
fieldProps: {
|
|
177
|
-
label:
|
|
178
|
-
name:
|
|
177
|
+
label: r.title,
|
|
178
|
+
name: r.dataIndex,
|
|
179
179
|
...l || {},
|
|
180
180
|
// 格式化placeholder
|
|
181
|
-
placeholder:
|
|
181
|
+
placeholder: xe(j, r.valueType, l == null ? void 0 : l.placeholder)
|
|
182
182
|
}
|
|
183
183
|
};
|
|
184
184
|
})) || [];
|
|
185
|
-
}),
|
|
185
|
+
}), q = d(() => n(y).filter((e) => e.sorter === !0).map((e) => e.dataIndex)), H = d(() => n(y).filter((e) => e.filters && !e.onFilter).map((e) => e.dataIndex)), {
|
|
186
186
|
formRef: h,
|
|
187
187
|
submit: P,
|
|
188
188
|
reset: v,
|
|
189
189
|
tableProps: c,
|
|
190
|
-
handleTableChange:
|
|
190
|
+
handleTableChange: K,
|
|
191
191
|
data: b
|
|
192
192
|
} = ge({
|
|
193
193
|
async request(e) {
|
|
194
|
-
var a,
|
|
194
|
+
var a, r;
|
|
195
195
|
const o = await ((a = t.request) == null ? void 0 : a.call(t, e));
|
|
196
|
-
return (
|
|
196
|
+
return (r = t.onLoad) == null || r.call(t, (o == null ? void 0 : o.data) || []), {
|
|
197
197
|
data: (o == null ? void 0 : o.data) || [],
|
|
198
198
|
total: (o == null ? void 0 : o.total) || 0
|
|
199
199
|
};
|
|
200
200
|
},
|
|
201
|
-
filterFields:
|
|
202
|
-
sortFields:
|
|
201
|
+
filterFields: n(H),
|
|
202
|
+
sortFields: n(q),
|
|
203
203
|
defaultParams: t.params,
|
|
204
204
|
defaultData: t.defaultData,
|
|
205
205
|
manual: t.manual,
|
|
206
206
|
defaultCurrent: t.pagination ? t.pagination.defaultCurrent : void 0,
|
|
207
207
|
defaultPageSize: t.pagination ? t.pagination.defaultPageSize : void 0,
|
|
208
208
|
formatParams: t.beforeSearchSubmit
|
|
209
|
-
}),
|
|
209
|
+
}), $ = d(() => {
|
|
210
210
|
var e;
|
|
211
211
|
return t.scroll ? t.scroll : t.adaptive && (b.value.total > 0 || (e = t.dataSource) != null && e.length) ? {
|
|
212
|
-
y:
|
|
212
|
+
y: n(A),
|
|
213
213
|
x: "100%"
|
|
214
214
|
} : {
|
|
215
215
|
x: !0
|
|
216
216
|
};
|
|
217
217
|
}), G = d(() => {
|
|
218
|
-
const e =
|
|
219
|
-
console.log("xxx", r(I));
|
|
220
|
-
const o = T(t.dataSource) ? e : {
|
|
218
|
+
const e = n(c), o = T(t.dataSource) ? e : {
|
|
221
219
|
...e,
|
|
222
220
|
dataSource: t.dataSource,
|
|
223
221
|
onChange: t.onChange
|
|
@@ -225,13 +223,13 @@ const ve = {
|
|
|
225
223
|
return {
|
|
226
224
|
...t,
|
|
227
225
|
...o,
|
|
228
|
-
loading: T(t.loading) ?
|
|
229
|
-
pagination: t.pagination === !1 ? !1 :
|
|
230
|
-
scroll:
|
|
226
|
+
loading: T(t.loading) ? n(c).loading : t.loading,
|
|
227
|
+
pagination: t.pagination === !1 ? !1 : n(c).pagination,
|
|
228
|
+
scroll: n($)
|
|
231
229
|
};
|
|
232
230
|
}), Q = d(() => [u(), t.card ? null : u("wrapper"), t.adaptive ? u("adaptive") : null].filter(Boolean));
|
|
233
231
|
function U(e, o, a) {
|
|
234
|
-
return
|
|
232
|
+
return z.includes(e.valueType) ? a : e.copyable || e.ellipsis ? s(se.Text, {
|
|
235
233
|
copyable: e.copyable ? {
|
|
236
234
|
text: o,
|
|
237
235
|
tooltip: !1
|
|
@@ -242,39 +240,39 @@ const ve = {
|
|
|
242
240
|
content: a
|
|
243
241
|
}, null) : a;
|
|
244
242
|
}
|
|
245
|
-
ae(() =>
|
|
243
|
+
ae(() => n(b).loading, (e) => {
|
|
246
244
|
var o;
|
|
247
245
|
(o = t.onLoadingChange) == null || o.call(t, e);
|
|
248
246
|
});
|
|
249
247
|
function J(e) {
|
|
250
|
-
var o, a,
|
|
251
|
-
(
|
|
248
|
+
var o, a, r;
|
|
249
|
+
(r = (a = (o = h.value) == null ? void 0 : o.apForm) == null ? void 0 : a.setFieldsValue) == null || r.call(a, e);
|
|
252
250
|
}
|
|
253
251
|
function X() {
|
|
254
252
|
var e, o, a;
|
|
255
253
|
return (a = (o = (e = h.value) == null ? void 0 : e.apForm) == null ? void 0 : o.getFieldsValue) == null ? void 0 : a.call(o, !0);
|
|
256
254
|
}
|
|
257
|
-
return
|
|
255
|
+
return D({
|
|
258
256
|
submit: () => P(),
|
|
259
257
|
reset: () => v(),
|
|
260
258
|
setSearchFormValues: J,
|
|
261
259
|
getSearchFormValues: X,
|
|
262
|
-
dataSource: d(() =>
|
|
260
|
+
dataSource: d(() => n(b).records)
|
|
263
261
|
}), (e, o) => (i(), f("div", {
|
|
264
262
|
class: F(Q.value)
|
|
265
|
-
}, [
|
|
263
|
+
}, [n(T)(e.dataSource) && e.searchForm !== !1 && B.value.length > 0 ? (i(), f("div", {
|
|
266
264
|
key: 0,
|
|
267
|
-
class: F(e.card ?
|
|
268
|
-
style:
|
|
269
|
-
}, [s(
|
|
265
|
+
class: F(e.card ? n(g)("search-wrapper") : null),
|
|
266
|
+
style: R(e.searchFormWrapperStyle)
|
|
267
|
+
}, [s(n(ce).SearchForm, m(e.searchForm || {}, {
|
|
270
268
|
ref_key: "formRef",
|
|
271
269
|
ref: h,
|
|
272
270
|
"custom-reset": "",
|
|
273
|
-
onSubmit:
|
|
274
|
-
onReset:
|
|
275
|
-
"submit-loading":
|
|
276
|
-
}),
|
|
277
|
-
default: p(() => [(i(!0), f(te, null,
|
|
271
|
+
onSubmit: n(P),
|
|
272
|
+
onReset: n(v),
|
|
273
|
+
"submit-loading": n(c).loading
|
|
274
|
+
}), k({
|
|
275
|
+
default: p(() => [(i(!0), f(te, null, E(B.value, (a) => (i(), oe(re(a.customRenderFormItem ? a.customRenderFormItem(a) : n(fe)[a.valueType || "text"]), m({
|
|
278
276
|
key: a.dataIndex,
|
|
279
277
|
ref_for: !0
|
|
280
278
|
}, a.fieldProps || {}, {
|
|
@@ -283,38 +281,38 @@ const ve = {
|
|
|
283
281
|
_: 2
|
|
284
282
|
}, [w.searchFormExtra ? {
|
|
285
283
|
name: "extra",
|
|
286
|
-
fn: p(() => [
|
|
284
|
+
fn: p(() => [x(e.$slots, "searchFormExtra")]),
|
|
287
285
|
key: "0"
|
|
288
|
-
} : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) :
|
|
286
|
+
} : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) : O("", !0), L("div", {
|
|
289
287
|
ref_key: "contentRef",
|
|
290
|
-
ref:
|
|
291
|
-
class: F([
|
|
292
|
-
style:
|
|
293
|
-
}, [
|
|
294
|
-
class:
|
|
288
|
+
ref: M,
|
|
289
|
+
class: F([n(g)("table-wrapper"), e.card ? n(g)("table-wrapper-card") : null]),
|
|
290
|
+
style: R(e.tableWrapperStyle)
|
|
291
|
+
}, [x(e.$slots, "title"), s(n(ue), m({
|
|
292
|
+
class: n(_) === "admin" ? n(u)("table-admin") : n(u)("table")
|
|
295
293
|
}, G.value, {
|
|
296
|
-
onChange:
|
|
294
|
+
onChange: n(K),
|
|
297
295
|
columns: y.value
|
|
298
|
-
}),
|
|
296
|
+
}), k({
|
|
299
297
|
headerCell: p(({
|
|
300
298
|
column: a,
|
|
301
|
-
title:
|
|
302
|
-
}) => [a.tooltip ? (i(), f("span", ve, [
|
|
299
|
+
title: r
|
|
300
|
+
}) => [a.tooltip ? (i(), f("span", ve, [L("span", null, ne(r), 1), s(n(ie), {
|
|
303
301
|
title: a.tooltip,
|
|
304
302
|
placement: "bottom"
|
|
305
303
|
}, {
|
|
306
|
-
default: p(() => [s(
|
|
307
|
-
style:
|
|
304
|
+
default: p(() => [s(n(he), {
|
|
305
|
+
style: R({
|
|
308
306
|
paddingLeft: "4px",
|
|
309
|
-
color:
|
|
307
|
+
color: n(W).colorPrimary
|
|
310
308
|
})
|
|
311
309
|
}, null, 8, ["style"])]),
|
|
312
310
|
_: 2
|
|
313
|
-
}, 1032, ["title"])])) :
|
|
311
|
+
}, 1032, ["title"])])) : O("", !0)]),
|
|
314
312
|
_: 2
|
|
315
|
-
}, [
|
|
316
|
-
name:
|
|
317
|
-
fn: p((l) => [
|
|
313
|
+
}, [E(n(ye)(w, ["title", "searchFormExtra"]), (a, r) => ({
|
|
314
|
+
name: r,
|
|
315
|
+
fn: p((l) => [x(e.$slots, r, le(de(l || {})))])
|
|
318
316
|
}))]), 1040, ["class", "onChange", "columns"])], 6)], 2));
|
|
319
317
|
}
|
|
320
318
|
});
|