@aplus-frontend/ui 0.5.20 → 0.5.22
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-field/interface.d.ts +12 -0
- package/es/src/ap-field/text/index.vue2.mjs +45 -39
- package/es/src/ap-field/text-area/index.vue.mjs +31 -25
- package/es/src/ap-form/items/text/index.vue.d.ts +2 -0
- package/es/src/ap-table/constants.d.ts +1 -0
- package/es/src/ap-table/hooks/use-table-paging-ng.d.ts +1 -0
- package/es/src/ap-table/hooks/use-table-paging-ng.mjs +106 -102
- package/es/src/ap-table/interface.d.ts +3 -0
- package/es/src/ap-table/utils.d.ts +1 -0
- package/es/src/business/ap-ladder/components/ValueGroupMode.vue2.mjs +74 -67
- package/es/src/business/ap-ladder/interface.d.ts +4 -0
- package/es/src/business/batch-input-group/index.vue.d.ts +1 -0
- package/es/src/business/batch-input-group/index.vue.mjs +2 -1
- package/lib/src/ap-field/interface.d.ts +12 -0
- package/lib/src/ap-field/text/index.vue2.js +1 -1
- package/lib/src/ap-field/text-area/index.vue.js +1 -1
- package/lib/src/ap-form/items/text/index.vue.d.ts +2 -0
- package/lib/src/ap-table/constants.d.ts +1 -0
- package/lib/src/ap-table/hooks/use-table-paging-ng.d.ts +1 -0
- package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
- package/lib/src/ap-table/interface.d.ts +3 -0
- package/lib/src/ap-table/utils.d.ts +1 -0
- package/lib/src/business/ap-ladder/components/ValueGroupMode.vue2.js +1 -1
- package/lib/src/business/ap-ladder/interface.d.ts +4 -0
- package/lib/src/business/batch-input-group/index.vue.d.ts +1 -0
- package/lib/src/business/batch-input-group/index.vue.js +2 -2
- package/package.json +1 -1
- package/theme/ap-ladder/ap-ladder.css +16 -2
- package/theme/ap-ladder/ap-ladder.less +16 -3
- package/theme/index.css +16 -2
|
@@ -15,6 +15,12 @@ export type BasicApFieldProps<FieldPropsType = any> = {
|
|
|
15
15
|
} & FieldPropsType;
|
|
16
16
|
export type ApFieldTextProps = BasicApFieldProps<InputProps> & {
|
|
17
17
|
emptyText?: string;
|
|
18
|
+
/**
|
|
19
|
+
* 输入生效前的事件,受控输入拦截
|
|
20
|
+
* @param nextVal
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
beforeInput?: (nextVal: string) => string;
|
|
18
24
|
};
|
|
19
25
|
export type ApFieldTextPasswordProps = BasicApFieldProps<InputPasswordProps> & {
|
|
20
26
|
emptyText?: string;
|
|
@@ -91,6 +97,12 @@ export type ApFieldSwitchProps = BasicApFieldProps<Omit<SwitchProps, 'onClick'>>
|
|
|
91
97
|
};
|
|
92
98
|
export type ApFieldTextAreaProps = BasicApFieldProps<Omit<TextAreaProps, 'autosize'>> & {
|
|
93
99
|
emptyText?: string;
|
|
100
|
+
/**
|
|
101
|
+
* 输入生效前的事件,受控输入拦截
|
|
102
|
+
* @param nextVal
|
|
103
|
+
* @returns
|
|
104
|
+
*/
|
|
105
|
+
beforeInput?: (nextVal: string) => string;
|
|
94
106
|
};
|
|
95
107
|
export type ApFieldTextAreaExpose = {
|
|
96
108
|
focus: (options?: InputFocusOptions) => void;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { isVNode as
|
|
2
|
-
import { Input as
|
|
1
|
+
import { isVNode as g, defineComponent as I, ref as C, useSlots as S, computed as _, createVNode as s, mergeProps as R, unref as p, createBlock as V, openBlock as w, resolveDynamicComponent as T } from "vue";
|
|
2
|
+
import { Input as j } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../../hooks/index.mjs";
|
|
4
|
-
import { omit as
|
|
5
|
-
import { useDefaultPlaceholder as
|
|
6
|
-
import { useControllableValue as
|
|
7
|
-
function
|
|
8
|
-
return typeof
|
|
4
|
+
import { omit as U } from "lodash-unified";
|
|
5
|
+
import { useDefaultPlaceholder as z } from "../hooks/use-default-placeholder.mjs";
|
|
6
|
+
import { useControllableValue as F } from "../../hooks/useControllableValue.mjs";
|
|
7
|
+
function M(a) {
|
|
8
|
+
return typeof a == "function" || Object.prototype.toString.call(a) === "[object Object]" && !g(a);
|
|
9
9
|
}
|
|
10
|
-
const
|
|
10
|
+
const G = /* @__PURE__ */ I({
|
|
11
11
|
name: "ApFieldText",
|
|
12
12
|
__name: "index",
|
|
13
13
|
props: {
|
|
@@ -88,54 +88,60 @@ const E = /* @__PURE__ */ B({
|
|
|
88
88
|
},
|
|
89
89
|
emptyText: {
|
|
90
90
|
default: "--"
|
|
91
|
-
}
|
|
91
|
+
},
|
|
92
|
+
beforeInput: {}
|
|
92
93
|
},
|
|
93
94
|
emits: ["update:value"],
|
|
94
|
-
setup(
|
|
95
|
-
expose:
|
|
96
|
-
emit:
|
|
95
|
+
setup(a, {
|
|
96
|
+
expose: m,
|
|
97
|
+
emit: y
|
|
97
98
|
}) {
|
|
98
|
-
const
|
|
99
|
-
|
|
99
|
+
const u = C(), t = S();
|
|
100
|
+
m({
|
|
100
101
|
focus: (e) => {
|
|
101
|
-
var
|
|
102
|
-
(
|
|
102
|
+
var n;
|
|
103
|
+
(n = u.value) == null || n.focus(e);
|
|
103
104
|
},
|
|
104
105
|
blur: () => {
|
|
105
106
|
var e;
|
|
106
|
-
(e =
|
|
107
|
+
(e = u.value) == null || e.blur();
|
|
107
108
|
},
|
|
108
|
-
setSelectionRange: (e,
|
|
109
|
-
var
|
|
110
|
-
(
|
|
109
|
+
setSelectionRange: (e, n, r) => {
|
|
110
|
+
var l;
|
|
111
|
+
(l = u.value) == null || l.setSelectionRange(e, n, r);
|
|
111
112
|
},
|
|
112
113
|
select: () => {
|
|
113
114
|
var e;
|
|
114
|
-
(e =
|
|
115
|
+
(e = u.value) == null || e.select();
|
|
115
116
|
},
|
|
116
|
-
input:
|
|
117
|
+
input: _(() => {
|
|
117
118
|
var e;
|
|
118
|
-
return (e =
|
|
119
|
+
return (e = u.value) == null ? void 0 : e.input;
|
|
119
120
|
})
|
|
120
121
|
});
|
|
121
|
-
const
|
|
122
|
-
value:
|
|
123
|
-
updateValue:
|
|
124
|
-
} =
|
|
125
|
-
function
|
|
126
|
-
var
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
122
|
+
const x = y, o = a, {
|
|
123
|
+
value: i,
|
|
124
|
+
updateValue: v
|
|
125
|
+
} = F(o, x), b = z("Text", o);
|
|
126
|
+
function B(e) {
|
|
127
|
+
var c, d, f;
|
|
128
|
+
const n = e.target.value || "", r = o.beforeInput ? (c = o.beforeInput) == null ? void 0 : c.call(o, n) : n, l = (f = (d = u.value) == null ? void 0 : d.$el) == null ? void 0 : f.querySelector("input");
|
|
129
|
+
l && (l.value = r), v(r);
|
|
130
|
+
}
|
|
131
|
+
function h() {
|
|
132
|
+
var e, n;
|
|
133
|
+
return o.mode === "edit" ? s(j, R(U(o, ["mode", "emptyText", "value", "onUpdate:value", "beforeInput"]), {
|
|
134
|
+
placeholder: p(b),
|
|
135
|
+
value: p(i),
|
|
136
|
+
onInput: B,
|
|
137
|
+
ref: u
|
|
138
|
+
}), M(t) ? t : {
|
|
139
|
+
default: () => [t]
|
|
140
|
+
}) : s("span", null, [o.prefix || ((e = t == null ? void 0 : t.prefix) == null ? void 0 : e.call(t)), p(i) || o.emptyText, o.suffix || ((n = t == null ? void 0 : t.suffix) == null ? void 0 : n.call(t))]);
|
|
135
141
|
}
|
|
136
|
-
return (e,
|
|
142
|
+
return (e, n) => (w(), V(T(h())));
|
|
137
143
|
}
|
|
138
144
|
});
|
|
139
145
|
export {
|
|
140
|
-
|
|
146
|
+
G as default
|
|
141
147
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isNil as
|
|
1
|
+
import { defineComponent as h, ref as I, computed as A, createElementBlock as C, createBlock as g, openBlock as d, normalizeClass as z, unref as t, toDisplayString as T, mergeProps as k } from "vue";
|
|
2
|
+
import { isNil as w, omit as R } from "lodash-unified";
|
|
3
3
|
import "../../hooks/index.mjs";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
|
-
import { Input as
|
|
6
|
-
import { useDefaultPlaceholder as
|
|
7
|
-
import { useControllableValue as
|
|
8
|
-
import { useNamespace as
|
|
9
|
-
const
|
|
5
|
+
import { Input as _ } from "@aplus-frontend/antdv";
|
|
6
|
+
import { useDefaultPlaceholder as S } from "../hooks/use-default-placeholder.mjs";
|
|
7
|
+
import { useControllableValue as U } from "../../hooks/useControllableValue.mjs";
|
|
8
|
+
import { useNamespace as V } from "../../config-provider/hooks/use-namespace.mjs";
|
|
9
|
+
const O = /* @__PURE__ */ h({
|
|
10
10
|
name: "ApFieldTextArea",
|
|
11
11
|
__name: "index",
|
|
12
12
|
props: {
|
|
@@ -56,36 +56,42 @@ const S = /* @__PURE__ */ f({
|
|
|
56
56
|
handleReset: {},
|
|
57
57
|
clearIcon: {},
|
|
58
58
|
allowClear: { type: Boolean, default: !0 },
|
|
59
|
-
emptyText: { default: "--" }
|
|
59
|
+
emptyText: { default: "--" },
|
|
60
|
+
beforeInput: {}
|
|
60
61
|
},
|
|
61
62
|
emits: ["update:value"],
|
|
62
|
-
setup(
|
|
63
|
-
const
|
|
64
|
-
|
|
63
|
+
setup(c, { expose: f, emit: m }) {
|
|
64
|
+
const l = I(), o = c, y = m, { value: n, updateValue: x } = U(o, y), { b: v } = V("field-text-area"), B = S("TextArea", o);
|
|
65
|
+
function b(e) {
|
|
66
|
+
var p, s, i;
|
|
67
|
+
const a = e.target.value || "", r = o.beforeInput ? (p = o.beforeInput) == null ? void 0 : p.call(o, a) : a, u = (i = (s = l.value) == null ? void 0 : s.$el) == null ? void 0 : i.querySelector("textarea");
|
|
68
|
+
u && (u.value = r), x(r);
|
|
69
|
+
}
|
|
70
|
+
return f({
|
|
65
71
|
focus: (e) => {
|
|
66
|
-
var
|
|
67
|
-
(
|
|
72
|
+
var a;
|
|
73
|
+
(a = l.value) == null || a.focus(e);
|
|
68
74
|
},
|
|
69
75
|
blur: () => {
|
|
70
76
|
var e;
|
|
71
|
-
(e =
|
|
77
|
+
(e = l.value) == null || e.blur();
|
|
72
78
|
},
|
|
73
|
-
resizableTextArea:
|
|
79
|
+
resizableTextArea: A(() => {
|
|
74
80
|
var e;
|
|
75
|
-
return (e =
|
|
81
|
+
return (e = l.value) == null ? void 0 : e.resizableTextArea;
|
|
76
82
|
})
|
|
77
|
-
}), (e,
|
|
83
|
+
}), (e, a) => e.mode === "read" ? (d(), C("span", {
|
|
78
84
|
key: 0,
|
|
79
|
-
class:
|
|
80
|
-
},
|
|
85
|
+
class: z(t(v)())
|
|
86
|
+
}, T(t(w)(t(n)) || t(n) === "" ? e.emptyText : t(n)), 3)) : (d(), g(t(_).TextArea, k({ key: 1 }, t(R)(o, ["onUpdate:value", "value", "beforeInput"]), {
|
|
81
87
|
ref_key: "textAreaRef",
|
|
82
|
-
ref:
|
|
83
|
-
placeholder:
|
|
84
|
-
value:
|
|
85
|
-
|
|
86
|
-
}), null, 16, ["placeholder", "value"
|
|
88
|
+
ref: l,
|
|
89
|
+
placeholder: t(B),
|
|
90
|
+
value: t(n),
|
|
91
|
+
onInput: b
|
|
92
|
+
}), null, 16, ["placeholder", "value"]));
|
|
87
93
|
}
|
|
88
94
|
});
|
|
89
95
|
export {
|
|
90
|
-
|
|
96
|
+
O as default
|
|
91
97
|
};
|
|
@@ -75,6 +75,7 @@ declare function __VLS_template(): {
|
|
|
75
75
|
readonly clearIcon?: any;
|
|
76
76
|
readonly allowClear?: boolean | undefined;
|
|
77
77
|
readonly emptyText?: string | undefined;
|
|
78
|
+
readonly beforeInput?: ((nextVal: string) => string) | undefined;
|
|
78
79
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
79
80
|
$attrs: {
|
|
80
81
|
[x: string]: unknown;
|
|
@@ -230,6 +231,7 @@ declare const __VLS_component: DefineComponent<ApFormItemTextProps, {
|
|
|
230
231
|
readonly clearIcon?: any;
|
|
231
232
|
readonly allowClear?: boolean | undefined;
|
|
232
233
|
readonly emptyText?: string | undefined;
|
|
234
|
+
readonly beforeInput?: ((nextVal: string) => string) | undefined;
|
|
233
235
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
234
236
|
$attrs: {
|
|
235
237
|
[x: string]: unknown;
|
|
@@ -1666,6 +1666,7 @@ export declare const apTableFormItemMap: {
|
|
|
1666
1666
|
readonly clearIcon?: any;
|
|
1667
1667
|
readonly allowClear?: boolean | undefined;
|
|
1668
1668
|
readonly emptyText?: string | undefined;
|
|
1669
|
+
readonly beforeInput?: ((nextVal: string) => string) | undefined;
|
|
1669
1670
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
1670
1671
|
$attrs: {
|
|
1671
1672
|
[x: string]: unknown;
|
|
@@ -81,6 +81,7 @@ export declare const useTablePaging: <DataType = any, ParamsType = Record<string
|
|
|
81
81
|
showQuickJumper: boolean;
|
|
82
82
|
showLessItems: boolean | undefined;
|
|
83
83
|
size: "default" | "small";
|
|
84
|
+
pageSizeOptions: (string | number)[];
|
|
84
85
|
showTotal: ((total: number) => import("vue/jsx-runtime").JSX.Element) | undefined;
|
|
85
86
|
};
|
|
86
87
|
onChange: (pagination: TablePaginationConfig, filters: Record<string, FilterValue | null>, sorter: SorterResult<any> | SorterResult<any>[], extra: TableCurrentDataSource<any>) => void;
|
|
@@ -1,138 +1,138 @@
|
|
|
1
|
-
import { ref as ne, reactive as
|
|
1
|
+
import { ref as ne, reactive as j, unref as h, nextTick as ae, onMounted as se, watch as ie, computed as A, createVNode as x } from "vue";
|
|
2
2
|
import { useTableSortedAndFiltered as ce } from "./use-sorted-filtered.mjs";
|
|
3
3
|
import "../../config-provider/index.mjs";
|
|
4
4
|
import { parseFieldValue as le, dataIndexToStr as ue, isEqualCustom as fe } from "../utils.mjs";
|
|
5
|
-
import { isArray as
|
|
6
|
-
import { isDef as
|
|
7
|
-
import { useLocale as
|
|
8
|
-
import { useNamespace as
|
|
9
|
-
const
|
|
10
|
-
function
|
|
11
|
-
const
|
|
12
|
-
return g && (g === !0 ? (
|
|
5
|
+
import { isArray as q, isEqualWith as ge, isUndefined as pe } from "lodash-unified";
|
|
6
|
+
import { isDef as N } from "../../utils/index.mjs";
|
|
7
|
+
import { useLocale as de } from "../../config-provider/hooks/use-locale.mjs";
|
|
8
|
+
import { useNamespace as me } from "../../config-provider/hooks/use-namespace.mjs";
|
|
9
|
+
const S = 1, D = 10;
|
|
10
|
+
function he(g) {
|
|
11
|
+
const u = {};
|
|
12
|
+
return g && (g === !0 ? (u.current = S, u.pageSize = D) : (u.current = g.defaultCurrent || S, u.pageSize = g.defaultPageSize || D)), u;
|
|
13
13
|
}
|
|
14
|
-
const
|
|
14
|
+
const be = ({
|
|
15
15
|
manual: g = !1,
|
|
16
|
-
request:
|
|
17
|
-
defaultParams:
|
|
18
|
-
defaultData:
|
|
19
|
-
formatParams:
|
|
20
|
-
paramsValueTypeMap:
|
|
21
|
-
resetFieldsIgnores:
|
|
22
|
-
filterFields:
|
|
23
|
-
sortFields:
|
|
16
|
+
request: u,
|
|
17
|
+
defaultParams: L = {},
|
|
18
|
+
defaultData: v = [],
|
|
19
|
+
formatParams: y,
|
|
20
|
+
paramsValueTypeMap: O,
|
|
21
|
+
resetFieldsIgnores: R,
|
|
22
|
+
filterFields: B,
|
|
23
|
+
sortFields: J,
|
|
24
24
|
namespace: K = "ap-table",
|
|
25
25
|
pagination: p = {
|
|
26
|
-
defaultCurrent:
|
|
27
|
-
defaultPageSize:
|
|
26
|
+
defaultCurrent: S,
|
|
27
|
+
defaultPageSize: D,
|
|
28
28
|
showLessItems: !1,
|
|
29
29
|
showTotal: !0
|
|
30
30
|
}
|
|
31
31
|
}) => {
|
|
32
|
-
let
|
|
33
|
-
const
|
|
32
|
+
let b = 0, s = {};
|
|
33
|
+
const M = p ?? {}, Q = (e) => y ? y(e) : e, z = ne(), i = j(he(p)), {
|
|
34
34
|
getColumnSFConfig: $,
|
|
35
35
|
setSF: G,
|
|
36
36
|
clearAll: W,
|
|
37
37
|
sortedInfo: Z,
|
|
38
38
|
filteredInfo: H
|
|
39
39
|
} = ce(), {
|
|
40
|
-
t:
|
|
41
|
-
} =
|
|
40
|
+
t: T
|
|
41
|
+
} = de(), {
|
|
42
42
|
b: P
|
|
43
|
-
} =
|
|
44
|
-
total:
|
|
45
|
-
records:
|
|
43
|
+
} = me(K), a = j({
|
|
44
|
+
total: v.length,
|
|
45
|
+
records: v,
|
|
46
46
|
loading: !1
|
|
47
|
-
}),
|
|
47
|
+
}), w = () => {
|
|
48
48
|
var e, t;
|
|
49
|
-
return ((t = (e =
|
|
50
|
-
},
|
|
51
|
-
var
|
|
52
|
-
const t =
|
|
53
|
-
|
|
49
|
+
return ((t = (e = z.value) == null ? void 0 : e.apForm) == null ? void 0 : t.getFieldsValueTransformed(!0)) || {};
|
|
50
|
+
}, I = async (e) => {
|
|
51
|
+
var o;
|
|
52
|
+
const t = Q(e), r = Date.now();
|
|
53
|
+
b = r, a.loading = !0;
|
|
54
54
|
try {
|
|
55
|
-
const
|
|
56
|
-
...
|
|
55
|
+
const n = await u({
|
|
56
|
+
...h(L),
|
|
57
57
|
...t
|
|
58
58
|
});
|
|
59
|
-
|
|
59
|
+
b === r && (a.total = n.total || ((o = n.data) == null ? void 0 : o.length) || 0, a.records = [...n.data || []]);
|
|
60
60
|
} catch {
|
|
61
|
-
|
|
61
|
+
b === r && (a.records = [], a.total = 0);
|
|
62
62
|
} finally {
|
|
63
|
-
|
|
63
|
+
a.loading = !1;
|
|
64
64
|
}
|
|
65
|
-
},
|
|
65
|
+
}, V = (e) => {
|
|
66
66
|
const t = {};
|
|
67
|
-
return Object.entries(e).forEach(([r,
|
|
68
|
-
if (t[r] =
|
|
69
|
-
const
|
|
70
|
-
|
|
67
|
+
return Object.entries(e).forEach(([r, o]) => {
|
|
68
|
+
if (t[r] = o, O && o) {
|
|
69
|
+
const n = O[r];
|
|
70
|
+
n && (t[r] = le(n, o));
|
|
71
71
|
}
|
|
72
72
|
}), t;
|
|
73
73
|
}, X = async (e) => {
|
|
74
|
-
var
|
|
75
|
-
const t =
|
|
76
|
-
Object.entries(t).forEach(([
|
|
77
|
-
|
|
78
|
-
}), await ((
|
|
74
|
+
var o, n, l, f, d;
|
|
75
|
+
const t = w(), r = {};
|
|
76
|
+
Object.entries(t).forEach(([m, C]) => {
|
|
77
|
+
R && R.indexOf(m) > -1 && (r[m] = C);
|
|
78
|
+
}), await ((n = (o = z.value) == null ? void 0 : o.apForm) == null ? void 0 : n.resetFields()), (d = (f = (l = z.value) == null ? void 0 : l.apForm) == null ? void 0 : f.setFieldsValue) == null || d.call(f, r), ae(() => {
|
|
79
79
|
e == null || e();
|
|
80
80
|
});
|
|
81
81
|
}, F = (e) => {
|
|
82
82
|
s = e;
|
|
83
|
-
const t =
|
|
84
|
-
|
|
83
|
+
const t = V(e);
|
|
84
|
+
I(t);
|
|
85
85
|
}, Y = (e) => {
|
|
86
86
|
F({
|
|
87
87
|
...s,
|
|
88
88
|
...e
|
|
89
89
|
});
|
|
90
|
-
},
|
|
91
|
-
const e =
|
|
92
|
-
p && (i.current =
|
|
90
|
+
}, E = () => {
|
|
91
|
+
const e = w();
|
|
92
|
+
p && (i.current = S), F({
|
|
93
93
|
...e,
|
|
94
94
|
filter: s.filter,
|
|
95
95
|
sort: s.sort,
|
|
96
|
-
current: p ?
|
|
96
|
+
current: p ? S : void 0,
|
|
97
97
|
pageSize: p ? s.pageSize || i.pageSize : void 0
|
|
98
98
|
});
|
|
99
99
|
}, k = () => {
|
|
100
|
-
W(), s.sort = {}, s.filter = {}, X(
|
|
101
|
-
},
|
|
100
|
+
W(), s.sort = {}, s.filter = {}, X(E);
|
|
101
|
+
}, U = () => {
|
|
102
102
|
F(s);
|
|
103
103
|
}, ee = (e) => {
|
|
104
104
|
if (!p)
|
|
105
|
-
|
|
105
|
+
U();
|
|
106
106
|
else {
|
|
107
107
|
const {
|
|
108
108
|
current: t,
|
|
109
109
|
pageSize: r
|
|
110
|
-
} = i,
|
|
110
|
+
} = i, o = a.total - e, n = Math.ceil(o / r), l = t > n ? n : t;
|
|
111
111
|
Y({
|
|
112
|
-
current:
|
|
112
|
+
current: l > 0 ? l : 1
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
|
-
},
|
|
116
|
-
var
|
|
117
|
-
const
|
|
115
|
+
}, _ = (e, t, r) => {
|
|
116
|
+
var m, C;
|
|
117
|
+
const o = w();
|
|
118
118
|
i.current = e.current, i.pageSize = e.pageSize, G(t, r);
|
|
119
|
-
const
|
|
120
|
-
for (const c of
|
|
121
|
-
(
|
|
119
|
+
const n = q(r) ? [...r] : [r], l = {};
|
|
120
|
+
for (const c of n)
|
|
121
|
+
(m = h(J)) != null && m.includes(c.columnKey || c.field) && c.order && (l[ue(c.columnKey || c.field)] = c.order);
|
|
122
122
|
const f = {};
|
|
123
123
|
for (const c of Object.keys(t))
|
|
124
|
-
(
|
|
125
|
-
const
|
|
126
|
-
...
|
|
124
|
+
(C = h(B)) != null && C.includes(c) && t[c] && (f[c] = t[c]);
|
|
125
|
+
const d = {
|
|
126
|
+
...o,
|
|
127
127
|
filter: f,
|
|
128
|
-
sort:
|
|
128
|
+
sort: l,
|
|
129
129
|
current: e.current,
|
|
130
130
|
pageSize: e.pageSize
|
|
131
131
|
};
|
|
132
|
-
ge(s,
|
|
132
|
+
ge(s, d, fe) || F(d);
|
|
133
133
|
};
|
|
134
134
|
se(() => {
|
|
135
|
-
const e =
|
|
135
|
+
const e = w(), {
|
|
136
136
|
current: t,
|
|
137
137
|
pageSize: r
|
|
138
138
|
} = i;
|
|
@@ -143,67 +143,71 @@ const xe = ({
|
|
|
143
143
|
sort: {},
|
|
144
144
|
...e
|
|
145
145
|
}, !g) {
|
|
146
|
-
const
|
|
147
|
-
|
|
146
|
+
const o = V(s);
|
|
147
|
+
I(o);
|
|
148
148
|
}
|
|
149
|
-
}), ie(() =>
|
|
150
|
-
|
|
149
|
+
}), ie(() => h(L), () => {
|
|
150
|
+
E();
|
|
151
151
|
}, {
|
|
152
152
|
deep: !0
|
|
153
153
|
});
|
|
154
|
-
const te =
|
|
155
|
-
if (
|
|
154
|
+
const te = A(() => {
|
|
155
|
+
if (a.total === 0)
|
|
156
156
|
return "-";
|
|
157
157
|
const {
|
|
158
158
|
current: e,
|
|
159
159
|
pageSize: t
|
|
160
160
|
} = i;
|
|
161
|
-
return `${e}/${Math.ceil(
|
|
161
|
+
return `${e}/${Math.ceil(a.total / t)}`;
|
|
162
162
|
});
|
|
163
163
|
function re(e) {
|
|
164
|
-
|
|
164
|
+
q(e) && (a.records = e, a.total = e.length);
|
|
165
165
|
}
|
|
166
|
-
const oe =
|
|
166
|
+
const oe = A(() => {
|
|
167
167
|
const {
|
|
168
168
|
showLessItems: e,
|
|
169
|
-
showTotal: t
|
|
170
|
-
|
|
169
|
+
showTotal: t,
|
|
170
|
+
showQuickJumper: r,
|
|
171
|
+
showSizeChanger: o,
|
|
172
|
+
pageSizeOptions: n
|
|
173
|
+
} = M;
|
|
171
174
|
return {
|
|
172
|
-
loading:
|
|
175
|
+
loading: a.loading,
|
|
173
176
|
pagination: {
|
|
174
177
|
current: i.current,
|
|
175
178
|
pageSize: i.pageSize,
|
|
176
|
-
total:
|
|
177
|
-
showSizeChanger:
|
|
178
|
-
showQuickJumper:
|
|
179
|
+
total: a.total,
|
|
180
|
+
showSizeChanger: N(o) ? o : !e,
|
|
181
|
+
showQuickJumper: N(r) ? r : !e,
|
|
179
182
|
showLessItems: e,
|
|
180
183
|
size: "default",
|
|
181
|
-
|
|
184
|
+
pageSizeOptions: pe(n) ? ["10", "20", "50", "100"] : n,
|
|
185
|
+
showTotal: t ? (l) => x("span", {
|
|
182
186
|
class: P("pagination-total-wrapper")
|
|
183
|
-
}, [
|
|
187
|
+
}, [T("ap.apTable.pagination.totalLeftPrefix"), " ", x("span", {
|
|
184
188
|
class: P("pagination-count-text")
|
|
185
|
-
}, [
|
|
189
|
+
}, [l]), " ", T("ap.apTable.pagination.totalLeftSuffix"), x("span", {
|
|
186
190
|
class: P("pagination--total-right")
|
|
187
|
-
}, [
|
|
191
|
+
}, [T("ap.apTable.pagination.totalRightPrefix"), " ", x("span", {
|
|
188
192
|
class: P("pagination-count-text")
|
|
189
|
-
}, [
|
|
193
|
+
}, [h(te)]), " ", T("ap.apTable.pagination.totalRightSuffix")])]) : void 0
|
|
190
194
|
},
|
|
191
|
-
onChange:
|
|
192
|
-
dataSource:
|
|
195
|
+
onChange: _,
|
|
196
|
+
dataSource: a.records
|
|
193
197
|
};
|
|
194
198
|
});
|
|
195
199
|
return {
|
|
196
|
-
formRef:
|
|
197
|
-
submit:
|
|
200
|
+
formRef: z,
|
|
201
|
+
submit: E,
|
|
198
202
|
reset: k,
|
|
199
|
-
refresh:
|
|
203
|
+
refresh: U,
|
|
200
204
|
refreshByDelete: ee,
|
|
201
|
-
data:
|
|
205
|
+
data: a,
|
|
202
206
|
current: i.current,
|
|
203
207
|
pageSize: i.pageSize,
|
|
204
|
-
handleTableChange:
|
|
208
|
+
handleTableChange: _,
|
|
205
209
|
tableProps: oe,
|
|
206
|
-
dataSource:
|
|
210
|
+
dataSource: A(() => a.records),
|
|
207
211
|
setDataSource: re,
|
|
208
212
|
getColumnSFConfig: $,
|
|
209
213
|
sortedInfo: Z,
|
|
@@ -211,7 +215,7 @@ const xe = ({
|
|
|
211
215
|
};
|
|
212
216
|
};
|
|
213
217
|
export {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
218
|
+
S as DEFAULT_CURRENT,
|
|
219
|
+
D as DEFAULT_PAGE_SIZE,
|
|
220
|
+
be as useTablePaging
|
|
217
221
|
};
|
|
@@ -8,6 +8,7 @@ import { ApActionGroupProps } from '../ap-action';
|
|
|
8
8
|
import { ApTableIndexProps } from './components/interface';
|
|
9
9
|
import { EllipsisConfig } from '@aplus-frontend/antdv/es/typography/Base';
|
|
10
10
|
import { RowSelectionReturnType } from './hooks/use-table-row-selection';
|
|
11
|
+
import { PaginationProps } from '@aplus-frontend/antdv';
|
|
11
12
|
export type ValueEnumType = {
|
|
12
13
|
text: string;
|
|
13
14
|
/**
|
|
@@ -238,6 +239,8 @@ export type ApTablePaginationConfig = {
|
|
|
238
239
|
* 是否显示快速跳转
|
|
239
240
|
*/
|
|
240
241
|
showQuickJumper?: boolean;
|
|
242
|
+
} & {
|
|
243
|
+
pageSizeOptions?: PaginationProps['pageSizeOptions'];
|
|
241
244
|
};
|
|
242
245
|
export type ApTableProps<RecordType = any, ParamsType = any> = Omit<TableProps<RecordType>, 'columns' | 'pagination' | 'dataSource' | 'size' | 'rowSelection'> & {
|
|
243
246
|
/**
|
|
@@ -374,6 +374,7 @@ export declare function getSearchFormItemRenderNode(item: any, extraRenderMap?:
|
|
|
374
374
|
readonly clearIcon?: any;
|
|
375
375
|
readonly allowClear?: boolean | undefined;
|
|
376
376
|
readonly emptyText?: string | undefined;
|
|
377
|
+
readonly beforeInput?: ((nextVal: string) => string) | undefined;
|
|
377
378
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
378
379
|
$attrs: {
|
|
379
380
|
[x: string]: unknown;
|