@aplus-frontend/ui 6.13.0 → 6.13.2
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/search-form/index.vue.d.ts +2 -6
- package/es/src/ap-form/search-form/index.vue.mjs +47 -46
- package/es/src/ap-table/hooks/use-table-paging-ng.mjs +42 -39
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ap-form/search-form/index.vue.d.ts +2 -6
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +3 -3
|
@@ -398,9 +398,7 @@ declare function __VLS_template(): {
|
|
|
398
398
|
push: (StringConstructor | NumberConstructor)[];
|
|
399
399
|
pull: (StringConstructor | NumberConstructor)[];
|
|
400
400
|
xs: {
|
|
401
|
-
type: PropType<string | number |
|
|
402
|
-
* extra区域展开占据的span数(占据剩余所有空间)
|
|
403
|
-
*/).ColSize>;
|
|
401
|
+
type: PropType<string | number | ColSize>;
|
|
404
402
|
default: string | number | ColSize;
|
|
405
403
|
};
|
|
406
404
|
sm: {
|
|
@@ -1239,9 +1237,7 @@ declare const __VLS_component: DefineComponent<ApFormSearchFormProps, {
|
|
|
1239
1237
|
push: (StringConstructor | NumberConstructor)[];
|
|
1240
1238
|
pull: (StringConstructor | NumberConstructor)[];
|
|
1241
1239
|
xs: {
|
|
1242
|
-
type: PropType<string | number |
|
|
1243
|
-
* extra区域展开占据的span数(占据剩余所有空间)
|
|
1244
|
-
*/).ColSize>;
|
|
1240
|
+
type: PropType<string | number | ColSize>;
|
|
1245
1241
|
default: string | number | ColSize;
|
|
1246
1242
|
};
|
|
1247
1243
|
sm: {
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { isVNode as ne, defineComponent as le, useSlots as re, ref as D, shallowRef as U, computed as S, unref as n, watch as W, createVNode as o, Fragment as _, createBlock as
|
|
2
|
-
import { Col as w, Flex as
|
|
1
|
+
import { isVNode as ne, defineComponent as le, useSlots as re, ref as D, shallowRef as U, computed as S, unref as n, watch as W, createVNode as o, Fragment as _, createBlock as x, openBlock as d, mergeProps as se, withCtx as A, resolveDynamicComponent as B, createElementBlock as ie, renderList as ue } from "vue";
|
|
2
|
+
import { Col as w, Flex as I, Button as M, Row as ce } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../ap-form.vue.mjs";
|
|
4
4
|
import "../item/index.vue2.mjs";
|
|
5
5
|
import { genRealChildren as z } from "../item-group/helper.mjs";
|
|
6
6
|
import "../../config-provider/index.mjs";
|
|
7
|
-
import { isArray as pe, isBoolean as de, omit as
|
|
7
|
+
import { isArray as pe, isBoolean as de, omit as me } from "lodash-unified";
|
|
8
8
|
import { isDef as q } from "../../utils/index.mjs";
|
|
9
|
-
import { execFunc as H, diffFormItem as
|
|
9
|
+
import { execFunc as H, diffFormItem as fe } from "./utils.mjs";
|
|
10
10
|
import "./components/popover-filter.vue.mjs";
|
|
11
11
|
import { useCountPerRow as he } from "./hooks/use-count-per-row.mjs";
|
|
12
12
|
import "./components/popover-sorter/index.vue.mjs";
|
|
13
|
-
import { useSorter as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
13
|
+
import { useSorter as ge } from "./hooks/use-sorter.mjs";
|
|
14
|
+
import { getTargetNode as xe } from "./hooks/use-collapse-input-count.mjs";
|
|
15
|
+
import { useNamespace as ye } from "../../config-provider/hooks/use-namespace.mjs";
|
|
16
|
+
import { useLocale as ve } from "../../config-provider/hooks/use-locale.mjs";
|
|
16
17
|
import G from "../item/index.vue.mjs";
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
function
|
|
21
|
-
return typeof
|
|
18
|
+
import Ce from "./components/popover-filter.vue2.mjs";
|
|
19
|
+
import Se from "./components/popover-sorter/index.vue2.mjs";
|
|
20
|
+
import _e from "../ap-form.vue2.mjs";
|
|
21
|
+
function we(m) {
|
|
22
|
+
return typeof m == "function" || Object.prototype.toString.call(m) === "[object Object]" && !ne(m);
|
|
22
23
|
}
|
|
23
|
-
const s = 24,
|
|
24
|
+
const s = 24, He = /* @__PURE__ */ le({
|
|
24
25
|
name: "ApFormSearchForm",
|
|
25
26
|
__name: "index",
|
|
26
27
|
props: {
|
|
@@ -115,15 +116,15 @@ const s = 24, Me = /* @__PURE__ */ le({
|
|
|
115
116
|
default: 300
|
|
116
117
|
}
|
|
117
118
|
},
|
|
118
|
-
setup(
|
|
119
|
+
setup(m, {
|
|
119
120
|
expose: J
|
|
120
121
|
}) {
|
|
121
122
|
var L;
|
|
122
|
-
const i = re(), t =
|
|
123
|
-
b:
|
|
124
|
-
} =
|
|
123
|
+
const i = re(), t = m, {
|
|
124
|
+
b: f
|
|
125
|
+
} = ye("ap-form-search-form"), {
|
|
125
126
|
t: k
|
|
126
|
-
} =
|
|
127
|
+
} = ve(), K = he(t), y = D(), Q = D();
|
|
127
128
|
function T() {
|
|
128
129
|
var a;
|
|
129
130
|
const e = (a = y.value) == null ? void 0 : a.getFieldsValueTransformed(!0);
|
|
@@ -139,9 +140,9 @@ const s = 24, Me = /* @__PURE__ */ le({
|
|
|
139
140
|
items: R,
|
|
140
141
|
sorted: O,
|
|
141
142
|
handleClickConfirm: b
|
|
142
|
-
} =
|
|
143
|
+
} = ge(h);
|
|
143
144
|
W(() => i.default(), (e) => {
|
|
144
|
-
E = h.value, h.value =
|
|
145
|
+
E = h.value, h.value = fe(E, z(e)), O.value = !1;
|
|
145
146
|
}), W(() => {
|
|
146
147
|
var e;
|
|
147
148
|
return (e = i.extra) == null ? void 0 : e.call(i);
|
|
@@ -149,27 +150,27 @@ const s = 24, Me = /* @__PURE__ */ le({
|
|
|
149
150
|
c.value = e;
|
|
150
151
|
});
|
|
151
152
|
const l = S(() => {
|
|
152
|
-
const e = h.value, a = [], r = [],
|
|
153
|
+
const e = h.value, a = [], r = [], g = [], u = n(P);
|
|
153
154
|
let v = 0, F = 0;
|
|
154
155
|
const te = s * t.maxRows - u * (n(c) && !t.extraInAction ? 2 : 1);
|
|
155
|
-
e.forEach((
|
|
156
|
-
const p =
|
|
156
|
+
e.forEach((N) => {
|
|
157
|
+
const p = xe(N).props;
|
|
157
158
|
if (de(p.hidden) ? !!p.hidden : q(p.hidden))
|
|
158
|
-
a.push(
|
|
159
|
+
a.push(N);
|
|
159
160
|
else {
|
|
160
161
|
let C = p.span || u;
|
|
161
162
|
const V = {
|
|
162
|
-
node:
|
|
163
|
+
node: N,
|
|
163
164
|
span: C,
|
|
164
165
|
key: `ApFormSearchFormItem-${Y(p.name)}-${p._signal}`
|
|
165
166
|
}, $ = s - v % s;
|
|
166
|
-
$ < C && (C += $), v += C, v > te ? r.push(V) : (F = v,
|
|
167
|
+
$ < C && (C += $), v += C, v > te ? r.push(V) : (F = v, g.push(V));
|
|
167
168
|
}
|
|
168
169
|
});
|
|
169
170
|
const j = s - (F + u) % s, oe = F % s < u, ae = j < u ? s : j;
|
|
170
171
|
return {
|
|
171
172
|
hideNode: o(_, null, [a]),
|
|
172
|
-
nodes:
|
|
173
|
+
nodes: g,
|
|
173
174
|
collapseNodes: r,
|
|
174
175
|
extraSpan: ae,
|
|
175
176
|
lastRowOnlyIncludeActionAndExtra: oe
|
|
@@ -181,21 +182,21 @@ const s = 24, Me = /* @__PURE__ */ le({
|
|
|
181
182
|
key: "actionWrapper"
|
|
182
183
|
}, {
|
|
183
184
|
default: () => [o(G, null, {
|
|
184
|
-
default: () => [o(
|
|
185
|
+
default: () => [o(I, {
|
|
185
186
|
wrap: "wrap",
|
|
186
187
|
justify: l.value.lastRowOnlyIncludeActionAndExtra && !(n(c) && t.extraInAction) ? "flex-end" : "space-between"
|
|
187
188
|
}, {
|
|
188
|
-
default: () => [o(
|
|
189
|
+
default: () => [o(I, {
|
|
189
190
|
gap: 8,
|
|
190
191
|
wrap: "wrap"
|
|
191
192
|
}, {
|
|
192
193
|
default: () => [a ? o("div", {
|
|
193
|
-
class:
|
|
194
|
-
}, [l.value.collapseNodes.length ? o(
|
|
194
|
+
class: f("column-setting-trigger-wrapper")
|
|
195
|
+
}, [l.value.collapseNodes.length ? o(Ce, {
|
|
195
196
|
onSubmit: T,
|
|
196
197
|
config: l.value.collapseNodes,
|
|
197
198
|
submitLoading: t.submitLoading
|
|
198
|
-
}, null) : null, t.sortable && R.value.length ? o(
|
|
199
|
+
}, null) : null, t.sortable && R.value.length ? o(Se, {
|
|
199
200
|
ref: "sorterIns",
|
|
200
201
|
items: R.value,
|
|
201
202
|
onClickConfirm: b,
|
|
@@ -207,34 +208,34 @@ const s = 24, Me = /* @__PURE__ */ le({
|
|
|
207
208
|
delay: t.loadingDelay
|
|
208
209
|
} : !1,
|
|
209
210
|
htmlType: "submit",
|
|
210
|
-
class:
|
|
211
|
+
class: f("action-btn")
|
|
211
212
|
}, {
|
|
212
213
|
default: () => [t.searchText || k("ap.apForm.search.search")]
|
|
213
214
|
}), o(M, {
|
|
214
215
|
onClick: X,
|
|
215
216
|
type: "text",
|
|
216
|
-
class: [
|
|
217
|
+
class: [f("action-btn"), f("action-btn-reset")]
|
|
217
218
|
}, {
|
|
218
219
|
default: () => [t.resetText || k("ap.apForm.search.reset")]
|
|
219
220
|
})]
|
|
220
221
|
}), t.extraInAction ? n(c) : null]
|
|
221
222
|
})]
|
|
222
223
|
})]
|
|
223
|
-
}),
|
|
224
|
+
}), g = !t.extraInAction && n(c) ? o(w, {
|
|
224
225
|
span: l.value.extraSpan,
|
|
225
226
|
key: "extraNode"
|
|
226
227
|
}, {
|
|
227
228
|
default: () => [o(G, null, {
|
|
228
|
-
default: () => [o(
|
|
229
|
+
default: () => [o(I, {
|
|
229
230
|
justify: l.value.extraSpan === s || l.value.lastRowOnlyIncludeActionAndExtra ? "start" : "flex-end"
|
|
230
|
-
},
|
|
231
|
+
}, we(e = n(c)) ? e : {
|
|
231
232
|
default: () => [e]
|
|
232
233
|
})]
|
|
233
234
|
})]
|
|
234
235
|
}) : null, u = o(w, {
|
|
235
236
|
span: l.value.extraSpan
|
|
236
237
|
}, null);
|
|
237
|
-
return l.value.lastRowOnlyIncludeActionAndExtra ? o(_, null, [
|
|
238
|
+
return l.value.lastRowOnlyIncludeActionAndExtra ? o(_, null, [g || u, r]) : o(_, null, [r, g]);
|
|
238
239
|
});
|
|
239
240
|
function ee() {
|
|
240
241
|
var a;
|
|
@@ -246,21 +247,21 @@ const s = 24, Me = /* @__PURE__ */ le({
|
|
|
246
247
|
getSorterItems: () => R.value,
|
|
247
248
|
setSorterItems: b,
|
|
248
249
|
resetSorterItems: ee
|
|
249
|
-
}), (e, a) => (d(),
|
|
250
|
+
}), (e, a) => (d(), x(_e, se({
|
|
250
251
|
ref_key: "apForm",
|
|
251
252
|
ref: y,
|
|
252
|
-
class: n(
|
|
253
|
-
}, n(
|
|
254
|
-
default:
|
|
253
|
+
class: n(f)()
|
|
254
|
+
}, n(me)(t, ["collapse", "defaultCollapse", "onUpdate:collapse", "searchText", "resetText", "onSubmit", "onReset", "extraInAction", "forceExpand", "countPerRow"])), {
|
|
255
|
+
default: A(() => [(d(), x(B(l.value.hideNode))), o(n(ce), {
|
|
255
256
|
gutter: 8
|
|
256
257
|
}, {
|
|
257
|
-
default:
|
|
258
|
+
default: A(() => [(d(!0), ie(_, null, ue(l.value.nodes, (r) => (d(), x(n(w), {
|
|
258
259
|
key: r.key,
|
|
259
260
|
span: r.span
|
|
260
261
|
}, {
|
|
261
|
-
default:
|
|
262
|
+
default: A(() => [(d(), x(B(r.node)))]),
|
|
262
263
|
_: 2
|
|
263
|
-
}, 1032, ["span"]))), 128)), (d(),
|
|
264
|
+
}, 1032, ["span"]))), 128)), (d(), x(B(Z.value)))]),
|
|
264
265
|
_: 1
|
|
265
266
|
})]),
|
|
266
267
|
_: 1
|
|
@@ -268,5 +269,5 @@ const s = 24, Me = /* @__PURE__ */ le({
|
|
|
268
269
|
}
|
|
269
270
|
});
|
|
270
271
|
export {
|
|
271
|
-
|
|
272
|
+
He as default
|
|
272
273
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref as le, reactive as M, unref as
|
|
1
|
+
import { ref as le, reactive as M, unref as S, nextTick as fe, onMounted as ge, watch as de, computed as y, createVNode as C } from "vue";
|
|
2
2
|
import { useTableSortedAndFiltered as pe } from "./use-sorted-filtered.mjs";
|
|
3
3
|
import "../../config-provider/index.mjs";
|
|
4
4
|
import { parseFieldValue as me, dataIndexToStr as Se, isEqualCustom as he } from "../utils.mjs";
|
|
@@ -6,8 +6,8 @@ import { isArray as Q, isEqualWith as ze, isUndefined as Pe } from "lodash-unifi
|
|
|
6
6
|
import { isDef as $ } from "../../utils/index.mjs";
|
|
7
7
|
import { useLocale as Te } from "../../config-provider/hooks/use-locale.mjs";
|
|
8
8
|
import { useNamespace as we } from "../../config-provider/hooks/use-namespace.mjs";
|
|
9
|
-
const
|
|
10
|
-
defaultCurrent:
|
|
9
|
+
const h = 1, I = 20, G = {
|
|
10
|
+
defaultCurrent: h,
|
|
11
11
|
defaultPageSize: I,
|
|
12
12
|
showLessItems: !1,
|
|
13
13
|
showTotal: !0
|
|
@@ -20,7 +20,7 @@ function Fe(c) {
|
|
|
20
20
|
}
|
|
21
21
|
function be(c) {
|
|
22
22
|
const f = {};
|
|
23
|
-
return c === !1 || (c === !0 || c == null ? (f.current =
|
|
23
|
+
return c === !1 || (c === !0 || c == null ? (f.current = h, f.pageSize = I) : (f.current = c.defaultCurrent || h, f.pageSize = c.defaultPageSize || I)), f;
|
|
24
24
|
}
|
|
25
25
|
const Ie = ({
|
|
26
26
|
manual: c = !1,
|
|
@@ -33,35 +33,35 @@ const Ie = ({
|
|
|
33
33
|
filterFields: W,
|
|
34
34
|
sortFields: Z,
|
|
35
35
|
namespace: H = "ap-table",
|
|
36
|
-
pagination:
|
|
36
|
+
pagination: z,
|
|
37
37
|
onClickReset: x,
|
|
38
38
|
onAfterRequest: E
|
|
39
39
|
}) => {
|
|
40
40
|
let v = 0, s = {};
|
|
41
|
-
const X = Fe(
|
|
41
|
+
const X = Fe(z), Y = (e) => U ? U(e) : e, P = le(), i = M(be(z)), {
|
|
42
42
|
getColumnSFConfig: q,
|
|
43
43
|
setSF: R,
|
|
44
44
|
clearAll: k,
|
|
45
45
|
sortedInfo: N,
|
|
46
46
|
filteredInfo: B
|
|
47
47
|
} = pe(), {
|
|
48
|
-
t:
|
|
48
|
+
t: T
|
|
49
49
|
} = Te(), {
|
|
50
|
-
b:
|
|
50
|
+
b: w
|
|
51
51
|
} = we(H), o = M({
|
|
52
52
|
total: j.length,
|
|
53
53
|
records: j,
|
|
54
54
|
loading: !1
|
|
55
|
-
}),
|
|
55
|
+
}), d = () => {
|
|
56
56
|
var e, t;
|
|
57
|
-
return ((t = (e =
|
|
57
|
+
return ((t = (e = P.value) == null ? void 0 : e.apForm) == null ? void 0 : t.getFieldsValueTransformed(!0)) || {};
|
|
58
58
|
}, J = async (e) => {
|
|
59
59
|
var r;
|
|
60
60
|
const t = Y(e), n = Date.now();
|
|
61
61
|
v = n, o.loading = !0;
|
|
62
62
|
try {
|
|
63
63
|
const a = await f({
|
|
64
|
-
...
|
|
64
|
+
...S(V),
|
|
65
65
|
...t
|
|
66
66
|
});
|
|
67
67
|
v === n && (o.total = a.total || ((r = a.data) == null ? void 0 : r.length) || 0, o.records = [...a.data || []], o.loading = !1);
|
|
@@ -79,11 +79,11 @@ const Ie = ({
|
|
|
79
79
|
}
|
|
80
80
|
}), t;
|
|
81
81
|
}, ee = async (e) => {
|
|
82
|
-
var r, a, l, g,
|
|
83
|
-
const t =
|
|
84
|
-
Object.entries(t).forEach(([
|
|
85
|
-
A && A.indexOf(
|
|
86
|
-
}), await ((a = (r =
|
|
82
|
+
var r, a, l, g, p;
|
|
83
|
+
const t = d(), n = {};
|
|
84
|
+
Object.entries(t).forEach(([m, b]) => {
|
|
85
|
+
A && A.indexOf(m) > -1 && (n[m] = b);
|
|
86
|
+
}), await ((a = (r = P.value) == null ? void 0 : r.apForm) == null ? void 0 : a.resetFields()), (p = (g = (l = P.value) == null ? void 0 : l.apForm) == null ? void 0 : g.setFieldsValue) == null || p.call(g, n), fe(() => {
|
|
87
87
|
e == null || e();
|
|
88
88
|
});
|
|
89
89
|
}, F = (e) => {
|
|
@@ -96,20 +96,23 @@ const Ie = ({
|
|
|
96
96
|
...e
|
|
97
97
|
});
|
|
98
98
|
}, D = () => {
|
|
99
|
-
const e =
|
|
100
|
-
t && (i.current =
|
|
99
|
+
const e = d(), t = z !== !1;
|
|
100
|
+
t && (i.current = h), F({
|
|
101
101
|
...e,
|
|
102
102
|
filter: s.filter,
|
|
103
103
|
sort: s.sort,
|
|
104
|
-
current: t ?
|
|
104
|
+
current: t ? h : void 0,
|
|
105
105
|
pageSize: t ? s.pageSize || i.pageSize : void 0
|
|
106
106
|
});
|
|
107
107
|
}, ne = () => {
|
|
108
108
|
k(), s.sort = {}, s.filter = {}, x == null || x(), ee(D);
|
|
109
109
|
}, O = () => {
|
|
110
|
-
F(
|
|
110
|
+
F({
|
|
111
|
+
...s,
|
|
112
|
+
...d()
|
|
113
|
+
});
|
|
111
114
|
}, re = (e) => {
|
|
112
|
-
if (
|
|
115
|
+
if (z === !1)
|
|
113
116
|
O();
|
|
114
117
|
else {
|
|
115
118
|
const {
|
|
@@ -121,23 +124,23 @@ const Ie = ({
|
|
|
121
124
|
});
|
|
122
125
|
}
|
|
123
126
|
}, L = (e, t, n) => {
|
|
124
|
-
var
|
|
125
|
-
const r =
|
|
127
|
+
var m, b;
|
|
128
|
+
const r = d();
|
|
126
129
|
i.current = e.current, i.pageSize = e.pageSize, R(t, n);
|
|
127
130
|
const a = Q(n) ? [...n] : [n], l = {};
|
|
128
131
|
for (const u of a)
|
|
129
|
-
(
|
|
132
|
+
(m = S(Z)) != null && m.includes(u.columnKey || u.field) && u.order && (l[Se(u.columnKey || u.field)] = u.order);
|
|
130
133
|
const g = {};
|
|
131
134
|
for (const u of Object.keys(t))
|
|
132
|
-
(b =
|
|
133
|
-
const
|
|
135
|
+
(b = S(W)) != null && b.includes(u) && t[u] && (g[u] = t[u]);
|
|
136
|
+
const p = {
|
|
134
137
|
...r,
|
|
135
138
|
filter: g,
|
|
136
139
|
sort: l,
|
|
137
140
|
current: e.current,
|
|
138
141
|
pageSize: e.pageSize
|
|
139
142
|
};
|
|
140
|
-
ze(s,
|
|
143
|
+
ze(s, p, he) || F(p);
|
|
141
144
|
}, ae = (e, t = B.value || {}, n = N.value || {}) => {
|
|
142
145
|
const r = (e == null ? void 0 : e.current) ?? i.current, a = (e == null ? void 0 : e.pageSize) ?? i.pageSize;
|
|
143
146
|
L(
|
|
@@ -155,7 +158,7 @@ const Ie = ({
|
|
|
155
158
|
);
|
|
156
159
|
};
|
|
157
160
|
ge(() => {
|
|
158
|
-
const e =
|
|
161
|
+
const e = d(), {
|
|
159
162
|
current: t,
|
|
160
163
|
pageSize: n
|
|
161
164
|
} = i;
|
|
@@ -169,7 +172,7 @@ const Ie = ({
|
|
|
169
172
|
const r = K(s);
|
|
170
173
|
J(r);
|
|
171
174
|
}
|
|
172
|
-
}), de(() =>
|
|
175
|
+
}), de(() => S(V), () => {
|
|
173
176
|
D();
|
|
174
177
|
}, {
|
|
175
178
|
deep: !0
|
|
@@ -206,14 +209,14 @@ const Ie = ({
|
|
|
206
209
|
size: "default",
|
|
207
210
|
pageSizeOptions: Pe(a) ? ["10", "20", "50", "100"] : a,
|
|
208
211
|
showTotal: t ? (l) => C("span", {
|
|
209
|
-
class:
|
|
210
|
-
}, [
|
|
211
|
-
class:
|
|
212
|
-
}, [l]), " ",
|
|
213
|
-
class:
|
|
214
|
-
}, [
|
|
215
|
-
class:
|
|
216
|
-
}, [
|
|
212
|
+
class: w("pagination-total-wrapper")
|
|
213
|
+
}, [T("ap.apTable.pagination.totalLeftPrefix"), " ", C("span", {
|
|
214
|
+
class: w("pagination-count-text")
|
|
215
|
+
}, [l]), " ", T("ap.apTable.pagination.totalLeftSuffix"), C("span", {
|
|
216
|
+
class: w("pagination--total-right")
|
|
217
|
+
}, [T("ap.apTable.pagination.totalRightPrefix"), " ", C("span", {
|
|
218
|
+
class: w("pagination-count-text")
|
|
219
|
+
}, [S(oe)]), " ", T("ap.apTable.pagination.totalRightSuffix")])]) : void 0
|
|
217
220
|
},
|
|
218
221
|
onChange: L,
|
|
219
222
|
dataSource: o.records
|
|
@@ -228,7 +231,7 @@ const Ie = ({
|
|
|
228
231
|
};
|
|
229
232
|
}
|
|
230
233
|
return {
|
|
231
|
-
formRef:
|
|
234
|
+
formRef: P,
|
|
232
235
|
submit: D,
|
|
233
236
|
reset: ne,
|
|
234
237
|
refresh: O,
|
|
@@ -247,7 +250,7 @@ const Ie = ({
|
|
|
247
250
|
};
|
|
248
251
|
};
|
|
249
252
|
export {
|
|
250
|
-
|
|
253
|
+
h as DEFAULT_CURRENT,
|
|
251
254
|
I as DEFAULT_PAGE_SIZE,
|
|
252
255
|
Ie as useTablePaging
|
|
253
256
|
};
|
package/es/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "6.13.
|
|
1
|
+
declare const _default: "6.13.2";
|
|
2
2
|
export default _default;
|
package/es/src/version.mjs
CHANGED
|
@@ -398,9 +398,7 @@ declare function __VLS_template(): {
|
|
|
398
398
|
push: (StringConstructor | NumberConstructor)[];
|
|
399
399
|
pull: (StringConstructor | NumberConstructor)[];
|
|
400
400
|
xs: {
|
|
401
|
-
type: PropType<string | number |
|
|
402
|
-
* extra区域展开占据的span数(占据剩余所有空间)
|
|
403
|
-
*/).ColSize>;
|
|
401
|
+
type: PropType<string | number | ColSize>;
|
|
404
402
|
default: string | number | ColSize;
|
|
405
403
|
};
|
|
406
404
|
sm: {
|
|
@@ -1239,9 +1237,7 @@ declare const __VLS_component: DefineComponent<ApFormSearchFormProps, {
|
|
|
1239
1237
|
push: (StringConstructor | NumberConstructor)[];
|
|
1240
1238
|
pull: (StringConstructor | NumberConstructor)[];
|
|
1241
1239
|
xs: {
|
|
1242
|
-
type: PropType<string | number |
|
|
1243
|
-
* extra区域展开占据的span数(占据剩余所有空间)
|
|
1244
|
-
*/).ColSize>;
|
|
1240
|
+
type: PropType<string | number | ColSize>;
|
|
1245
1241
|
default: string | number | ColSize;
|
|
1246
1242
|
};
|
|
1247
1243
|
sm: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("@aplus-frontend/antdv");require("../ap-form.vue.js");require("../item/index.vue2.js");const T=require("../item-group/helper.js");require("../../config-provider/index.js");const w=require("lodash-unified"),P=require("../../utils/index.js"),S=require("./utils.js");require("./components/popover-filter.vue.js");const G=require("./hooks/use-count-per-row.js");require("./components/popover-sorter/index.vue.js");const J=require("./hooks/use-sorter.js"),K=require("../../config-provider/hooks/use-namespace.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("@aplus-frontend/antdv");require("../ap-form.vue.js");require("../item/index.vue2.js");const T=require("../item-group/helper.js");require("../../config-provider/index.js");const w=require("lodash-unified"),P=require("../../utils/index.js"),S=require("./utils.js");require("./components/popover-filter.vue.js");const G=require("./hooks/use-count-per-row.js");require("./components/popover-sorter/index.vue.js");const J=require("./hooks/use-sorter.js"),K=require("./hooks/use-collapse-input-count.js"),Q=require("../../config-provider/hooks/use-namespace.js"),X=require("../../config-provider/hooks/use-locale.js"),E=require("../item/index.vue.js"),Y=require("./components/popover-filter.vue2.js"),Z=require("./components/popover-sorter/index.vue2.js"),ee=require("../ap-form.vue2.js");function te(p){return typeof p=="function"||Object.prototype.toString.call(p)==="[object Object]"&&!e.isVNode(p)}const s=24,oe=e.defineComponent({name:"ApFormSearchForm",__name:"index",props:{layout:{default:"horizontal"},labelCol:{},wrapperCol:{},colon:{type:Boolean,default:!0},labelAlign:{default:"right"},labelWrap:{type:Boolean},prefixCls:{},requiredMark:{},hideRequiredMark:{type:Boolean,default:!1},rules:{},validateMessages:{},validateOnRuleChange:{type:Boolean,default:!0},scrollToFirstError:{},onSubmit:{},name:{},validateTrigger:{default:"change"},size:{},disabled:{type:Boolean},onFieldsChange:{},onFinish:{},onFinishFailed:{},onValidate:{},initialValues:{},onValuesChange:{},syncToUrl:{type:[Boolean,Function]},syncToUrlPriority:{type:Boolean},collapse:{type:Boolean,default:void 0},defaultCollapse:{type:Boolean,default:!0},"onUpdate:collapse":{},searchText:{},resetText:{},onReset:{},customReset:{type:Boolean,default:!1},extraInAction:{type:Boolean,default:!1},forceExpand:{type:Boolean,default:!1},countPerRow:{default:4},submitLoading:{type:Boolean},maxRows:{default:2},sortable:{type:Boolean,default:!0},resizeTarget:{},loadingDelay:{default:300}},setup(p,{expose:O}){var q;const u=e.useSlots(),o=p,{b:f}=Q.useNamespace("ap-form-search-form"),{t:B}=X.useLocale(),D=G.useCountPerRow(o),g=e.ref(),L=e.ref();function F(){var a;const t=(a=g.value)==null?void 0:a.getFieldsValueTransformed(!0);S.execFunc(o.onSubmit,t)}function j(){var t,a;o.customReset||(a=(t=g.value)==null?void 0:t.resetFields)==null||a.call(t),S.execFunc(o.onReset)}const M=t=>P.isDef(t)?(w.isArray(t)?t:[t]).join(""):Date.now();let R=[];const m=e.shallowRef(T.genRealChildren(u.default())),i=e.shallowRef((q=u.extra)==null?void 0:q.call(u)),b=e.computed(()=>Math.floor(s/e.unref(D))),{items:y,sorted:k,handleClickConfirm:v}=J.useSorter(m);e.watch(()=>u.default(),t=>{R=m.value,m.value=S.diffFormItem(R,T.genRealChildren(t)),k.value=!1}),e.watch(()=>{var t;return(t=u.extra)==null?void 0:t.call(u)},t=>{i.value=t});const n=e.computed(()=>{const t=m.value,a=[],l=[],h=[],c=e.unref(b);let x=0,C=0;const z=s*o.maxRows-c*(e.unref(i)&&!o.extraInAction?2:1);t.forEach(N=>{const d=K.getTargetNode(N).props;if(w.isBoolean(d.hidden)?!!d.hidden:P.isDef(d.hidden))a.push(N);else{let _=d.span||c;const A={node:N,span:_,key:`ApFormSearchFormItem-${M(d.name)}-${d._signal}`},I=s-x%s;I<_&&(_+=I),x+=_,x>z?l.push(A):(C=x,h.push(A))}});const V=s-(C+c)%s,$=C%s<c,H=V<c?s:V;return{hideNode:e.createVNode(e.Fragment,null,[a]),nodes:h,collapseNodes:l,extraSpan:H,lastRowOnlyIncludeActionAndExtra:$}}),U=e.computed(()=>{let t;const a=n.value.collapseNodes.length||o.sortable&&m.value.length,l=e.createVNode(r.Col,{span:e.unref(b),key:"actionWrapper"},{default:()=>[e.createVNode(E.default,null,{default:()=>[e.createVNode(r.Flex,{wrap:"wrap",justify:n.value.lastRowOnlyIncludeActionAndExtra&&!(e.unref(i)&&o.extraInAction)?"flex-end":"space-between"},{default:()=>[e.createVNode(r.Flex,{gap:8,wrap:"wrap"},{default:()=>[a?e.createVNode("div",{class:f("column-setting-trigger-wrapper")},[n.value.collapseNodes.length?e.createVNode(Y.default,{onSubmit:F,config:n.value.collapseNodes,submitLoading:o.submitLoading},null):null,o.sortable&&y.value.length?e.createVNode(Z.default,{ref:"sorterIns",items:y.value,onClickConfirm:v,sorted:k.value},null):null]):null,e.createVNode(r.Button,{type:"primary",onClick:F,loading:o.submitLoading?{delay:o.loadingDelay}:!1,htmlType:"submit",class:f("action-btn")},{default:()=>[o.searchText||B("ap.apForm.search.search")]}),e.createVNode(r.Button,{onClick:j,type:"text",class:[f("action-btn"),f("action-btn-reset")]},{default:()=>[o.resetText||B("ap.apForm.search.reset")]})]}),o.extraInAction?e.unref(i):null]})]})]}),h=!o.extraInAction&&e.unref(i)?e.createVNode(r.Col,{span:n.value.extraSpan,key:"extraNode"},{default:()=>[e.createVNode(E.default,null,{default:()=>[e.createVNode(r.Flex,{justify:n.value.extraSpan===s||n.value.lastRowOnlyIncludeActionAndExtra?"start":"flex-end"},te(t=e.unref(i))?t:{default:()=>[t]})]})]}):null,c=e.createVNode(r.Col,{span:n.value.extraSpan},null);return n.value.lastRowOnlyIncludeActionAndExtra?e.createVNode(e.Fragment,null,[h||c,l]):e.createVNode(e.Fragment,null,[l,h])});function W(){var a;const t=(a=L.value)==null?void 0:a.getCachedList();v(t)}return O({apForm:e.computed(()=>e.unref(g)),getSorterItems:()=>y.value,setSorterItems:v,resetSorterItems:W}),(t,a)=>(e.openBlock(),e.createBlock(ee.default,e.mergeProps({ref_key:"apForm",ref:g,class:e.unref(f)()},e.unref(w.omit)(o,["collapse","defaultCollapse","onUpdate:collapse","searchText","resetText","onSubmit","onReset","extraInAction","forceExpand","countPerRow"])),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.value.hideNode))),e.createVNode(e.unref(r.Row),{gutter:8},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value.nodes,l=>(e.openBlock(),e.createBlock(e.unref(r.Col),{key:l.key,span:l.span},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.node)))]),_:2},1032,["span"]))),128)),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(U.value)))]),_:1})]),_:1},16,["class"]))}});exports.default=oe;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),ce=require("./use-sorted-filtered.js");require("../../config-provider/index.js");const N=require("../utils.js"),E=require("lodash-unified"),G=require("../../utils/index.js"),ue=require("../../config-provider/hooks/use-locale.js"),le=require("../../config-provider/hooks/use-namespace.js"),p=1,C=20,J={defaultCurrent:p,defaultPageSize:C,showLessItems:!1,showTotal:!0};function fe(u){return u===!1?{}:u==null||u===!0?J:{...J,...u}}function ge(u){const g={};return u===!1||(u===!0||u==null?(g.current=p,g.pageSize=C):(g.current=u.defaultCurrent||p,g.pageSize=u.defaultPageSize||C)),g}const de=({manual:u=!1,request:g,params:U={},defaultData:V=[],formatParams:q,paramsValueTypeMap:A,resetFieldsIgnores:_,filterFields:K,sortFields:Q,namespace:Z="ap-table",pagination:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),ce=require("./use-sorted-filtered.js");require("../../config-provider/index.js");const N=require("../utils.js"),E=require("lodash-unified"),G=require("../../utils/index.js"),ue=require("../../config-provider/hooks/use-locale.js"),le=require("../../config-provider/hooks/use-namespace.js"),p=1,C=20,J={defaultCurrent:p,defaultPageSize:C,showLessItems:!1,showTotal:!0};function fe(u){return u===!1?{}:u==null||u===!0?J:{...J,...u}}function ge(u){const g={};return u===!1||(u===!0||u==null?(g.current=p,g.pageSize=C):(g.current=u.defaultCurrent||p,g.pageSize=u.defaultPageSize||C)),g}const de=({manual:u=!1,request:g,params:U={},defaultData:V=[],formatParams:q,paramsValueTypeMap:A,resetFieldsIgnores:_,filterFields:K,sortFields:Q,namespace:Z="ap-table",pagination:z,onClickReset:v,onAfterRequest:x})=>{let D=0,i={};const $=fe(z),W=e=>q?q(e):e,T=o.ref(),c=o.reactive(ge(z)),{getColumnSFConfig:H,setSF:R,clearAll:X,sortedInfo:I,filteredInfo:j}=ce.useTableSortedAndFiltered(),{t:P}=ue.useLocale(),{b:F}=le.useNamespace(Z),s=o.reactive({total:V.length,records:V,loading:!1}),S=()=>{var e,t;return((t=(e=T.value)==null?void 0:e.apForm)==null?void 0:t.getFieldsValueTransformed(!0))||{}},M=async e=>{var r;const t=W(e),n=Date.now();D=n,s.loading=!0;try{const a=await g({...o.unref(U),...t});D===n&&(s.total=a.total||((r=a.data)==null?void 0:r.length)||0,s.records=[...a.data||[]],s.loading=!1)}catch{D===n&&(s.records=[],s.total=0,s.loading=!1)}finally{x==null||x()}},B=e=>{const t={};return Object.entries(e).forEach(([n,r])=>{if(t[n]=r,A&&r){const a=A[n];a&&(t[n]=N.parseFieldValue(a,r))}}),t},Y=async e=>{var r,a,f,d,h;const t=S(),n={};Object.entries(t).forEach(([m,w])=>{_&&_.indexOf(m)>-1&&(n[m]=w)}),await((a=(r=T.value)==null?void 0:r.apForm)==null?void 0:a.resetFields()),(h=(d=(f=T.value)==null?void 0:f.apForm)==null?void 0:d.setFieldsValue)==null||h.call(d,n),o.nextTick(()=>{e==null||e()})},b=e=>{i=e;const t=B(e);M(t)},k=e=>{b({...i,...e})},L=()=>{const e=S(),t=z!==!1;t&&(c.current=p),b({...e,filter:i.filter,sort:i.sort,current:t?p:void 0,pageSize:t?i.pageSize||c.pageSize:void 0})},ee=()=>{X(),i.sort={},i.filter={},v==null||v(),Y(L)},y=()=>{b({...i,...S()})},te=e=>{if(z===!1)y();else{const{current:t,pageSize:n}=c,r=s.total-e,a=Math.ceil(r/n),f=t>a?a:t;k({current:f>0?f:1})}},O=(e,t,n)=>{var m,w;const r=S();c.current=e.current,c.pageSize=e.pageSize,R(t,n);const a=E.isArray(n)?[...n]:[n],f={};for(const l of a)(m=o.unref(Q))!=null&&m.includes(l.columnKey||l.field)&&l.order&&(f[N.dataIndexToStr(l.columnKey||l.field)]=l.order);const d={};for(const l of Object.keys(t))(w=o.unref(K))!=null&&w.includes(l)&&t[l]&&(d[l]=t[l]);const h={...r,filter:d,sort:f,current:e.current,pageSize:e.pageSize};E.isEqualWith(i,h,N.isEqualCustom)||b(h)},ne=(e,t=j.value||{},n=I.value||{})=>{const r=(e==null?void 0:e.current)??c.current,a=(e==null?void 0:e.pageSize)??c.pageSize;O({current:r,pageSize:a},t,n,{action:"sort",currentDataSource:[]})};o.onMounted(()=>{const e=S(),{current:t,pageSize:n}=c;if(i={current:t,pageSize:n,filter:{},sort:{},...e},!u){const r=B(i);M(r)}}),o.watch(()=>o.unref(U),()=>{L()},{deep:!0});const re=o.computed(()=>{if(s.total===0)return"-";const{current:e,pageSize:t}=c;return`${e}/${Math.ceil(s.total/t)}`});function ae(e){E.isArray(e)&&(s.records=e,s.total=e.length)}const oe=o.computed(()=>{const{showLessItems:e,showTotal:t,showQuickJumper:n,showSizeChanger:r,pageSizeOptions:a}=$;return{loading:s.loading,pagination:{current:c.current,pageSize:c.pageSize,total:s.total,showSizeChanger:G.isDef(r)?r:!e,showQuickJumper:G.isDef(n)?n:!e,showLessItems:e,size:"default",pageSizeOptions:E.isUndefined(a)?["10","20","50","100"]:a,showTotal:t?f=>o.createVNode("span",{class:F("pagination-total-wrapper")},[P("ap.apTable.pagination.totalLeftPrefix")," ",o.createVNode("span",{class:F("pagination-count-text")},[f])," ",P("ap.apTable.pagination.totalLeftSuffix"),o.createVNode("span",{class:F("pagination--total-right")},[P("ap.apTable.pagination.totalRightPrefix")," ",o.createVNode("span",{class:F("pagination-count-text")},[o.unref(re)])," ",P("ap.apTable.pagination.totalRightSuffix")])]):void 0},onChange:O,dataSource:s.records}});function se(e,t=!0){Object.assign(c,e),i.current=e.current,i.pageSize=e.pageSize,t&&y()}function ie(){return{...c}}return{formRef:T,submit:L,reset:ee,refresh:y,refreshByDelete:te,data:s,handleTableChange:O,handleTableChangeOptional:ne,tableProps:oe,dataSource:o.computed(()=>s.records),setDataSource:ae,getColumnSFConfig:H,sortedInfo:I,filteredInfo:j,getPaging:ie,setPaging:se}};exports.DEFAULT_CURRENT=p;exports.DEFAULT_PAGE_SIZE=C;exports.useTablePaging=de;
|
package/lib/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "6.13.
|
|
1
|
+
declare const _default: "6.13.2";
|
|
2
2
|
export default _default;
|
package/lib/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="6.13.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="6.13.2";exports.default=e;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aplus-frontend/ui",
|
|
3
|
-
"version": "6.13.
|
|
3
|
+
"version": "6.13.2",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"scroll-into-view-if-needed": "^3.1.0",
|
|
62
62
|
"vue-virtual-scroller": "2.0.0-beta.8",
|
|
63
63
|
"vuedraggable": "^4.1.0",
|
|
64
|
-
"@aplus-frontend/
|
|
65
|
-
"@aplus-frontend/
|
|
64
|
+
"@aplus-frontend/hooks": "1.0.7",
|
|
65
|
+
"@aplus-frontend/utils": "1.0.61"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"@aplus-frontend/antdv": "^1.1.12",
|