@aplus-frontend/ui 0.5.21 → 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 +6 -0
- package/es/src/ap-field/text/index.vue2.mjs +5 -5
- package/es/src/ap-field/text-area/index.vue.mjs +31 -25
- package/es/src/ap-form/items/tree-select/index.vue.d.ts +4 -8
- 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/business/ap-ladder/components/ValueGroupMode.vue2.mjs +42 -39
- package/lib/src/ap-field/interface.d.ts +6 -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/tree-select/index.vue.d.ts +4 -8
- 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/business/ap-ladder/components/ValueGroupMode.vue2.js +1 -1
- 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
|
@@ -97,6 +97,12 @@ export type ApFieldSwitchProps = BasicApFieldProps<Omit<SwitchProps, 'onClick'>>
|
|
|
97
97
|
};
|
|
98
98
|
export type ApFieldTextAreaProps = BasicApFieldProps<Omit<TextAreaProps, 'autosize'>> & {
|
|
99
99
|
emptyText?: string;
|
|
100
|
+
/**
|
|
101
|
+
* 输入生效前的事件,受控输入拦截
|
|
102
|
+
* @param nextVal
|
|
103
|
+
* @returns
|
|
104
|
+
*/
|
|
105
|
+
beforeInput?: (nextVal: string) => string;
|
|
100
106
|
};
|
|
101
107
|
export type ApFieldTextAreaExpose = {
|
|
102
108
|
focus: (options?: InputFocusOptions) => void;
|
|
@@ -122,18 +122,18 @@ const G = /* @__PURE__ */ I({
|
|
|
122
122
|
const x = y, o = a, {
|
|
123
123
|
value: i,
|
|
124
124
|
updateValue: v
|
|
125
|
-
} = F(o, x),
|
|
126
|
-
function
|
|
125
|
+
} = F(o, x), b = z("Text", o);
|
|
126
|
+
function B(e) {
|
|
127
127
|
var c, d, f;
|
|
128
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
129
|
l && (l.value = r), v(r);
|
|
130
130
|
}
|
|
131
131
|
function h() {
|
|
132
132
|
var e, n;
|
|
133
|
-
return o.mode === "edit" ? s(j, R(U(o, ["mode", "emptyText", "value", "onUpdate:value"]), {
|
|
134
|
-
placeholder: p(
|
|
133
|
+
return o.mode === "edit" ? s(j, R(U(o, ["mode", "emptyText", "value", "onUpdate:value", "beforeInput"]), {
|
|
134
|
+
placeholder: p(b),
|
|
135
135
|
value: p(i),
|
|
136
|
-
onInput:
|
|
136
|
+
onInput: B,
|
|
137
137
|
ref: u
|
|
138
138
|
}), M(t) ? t : {
|
|
139
139
|
default: () => [t]
|
|
@@ -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
|
};
|
|
@@ -705,8 +705,7 @@ declare function __VLS_template(): {
|
|
|
705
705
|
}>, {
|
|
706
706
|
blur: () => void;
|
|
707
707
|
focus: () => void;
|
|
708
|
-
request: (currentNode
|
|
709
|
-
/** @type { typeof __VLS_ctx.treeSelectRef } */ ? /** @type { typeof __VLS_ctx.treeSelectRef } */: LegacyDataNode, clear?: boolean) => Promise<void>;
|
|
708
|
+
request: (currentNode?: LegacyDataNode, clear?: boolean) => Promise<void>;
|
|
710
709
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
711
710
|
"update:value": (...args: any[]) => void;
|
|
712
711
|
}, string, {
|
|
@@ -774,8 +773,7 @@ declare function __VLS_template(): {
|
|
|
774
773
|
}>, "blur" | "focus" | "request" | ("mode" | "open" | "multiple" | "disabled" | "bordered" | "virtual" | "dropdownMatchSelectWidth" | "showSearch" | "loading" | "autofocus" | "allowClear" | "defaultOpen" | "showArrow" | "autoClearSearchValue" | "labelInValue" | "treeCheckable" | "treeDefaultExpandAll" | "treeCheckStrictly" | "emptyText")> & ShallowUnwrapRef<{
|
|
775
774
|
blur: () => void;
|
|
776
775
|
focus: () => void;
|
|
777
|
-
request: (currentNode
|
|
778
|
-
/** @type { typeof __VLS_ctx.treeSelectRef } */ ? /** @type { typeof __VLS_ctx.treeSelectRef } */: LegacyDataNode, clear?: boolean) => Promise<void>;
|
|
776
|
+
request: (currentNode?: LegacyDataNode, clear?: boolean) => Promise<void>;
|
|
779
777
|
}> & {} & ComponentCustomProperties & {} & {
|
|
780
778
|
$slots: Readonly<{
|
|
781
779
|
title?: any;
|
|
@@ -1481,8 +1479,7 @@ declare const __VLS_component: DefineComponent<ApFormItemTreeSelectProps, {
|
|
|
1481
1479
|
}>, {
|
|
1482
1480
|
blur: () => void;
|
|
1483
1481
|
focus: () => void;
|
|
1484
|
-
request: (currentNode
|
|
1485
|
-
/** @type { typeof __VLS_ctx.treeSelectRef } */ ? /** @type { typeof __VLS_ctx.treeSelectRef } */: LegacyDataNode, clear?: boolean) => Promise<void>;
|
|
1482
|
+
request: (currentNode?: LegacyDataNode, clear?: boolean) => Promise<void>;
|
|
1486
1483
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
1487
1484
|
"update:value": (...args: any[]) => void;
|
|
1488
1485
|
}, string, {
|
|
@@ -1550,8 +1547,7 @@ declare const __VLS_component: DefineComponent<ApFormItemTreeSelectProps, {
|
|
|
1550
1547
|
}>, "blur" | "focus" | "request" | ("mode" | "open" | "multiple" | "disabled" | "bordered" | "virtual" | "dropdownMatchSelectWidth" | "showSearch" | "loading" | "autofocus" | "allowClear" | "defaultOpen" | "showArrow" | "autoClearSearchValue" | "labelInValue" | "treeCheckable" | "treeDefaultExpandAll" | "treeCheckStrictly" | "emptyText")> & ShallowUnwrapRef<{
|
|
1551
1548
|
blur: () => void;
|
|
1552
1549
|
focus: () => void;
|
|
1553
|
-
request: (currentNode
|
|
1554
|
-
/** @type { typeof __VLS_ctx.treeSelectRef } */ ? /** @type { typeof __VLS_ctx.treeSelectRef } */: LegacyDataNode, clear?: boolean) => Promise<void>;
|
|
1550
|
+
request: (currentNode?: LegacyDataNode, clear?: boolean) => Promise<void>;
|
|
1555
1551
|
}> & {} & ComponentCustomProperties & {} & {
|
|
1556
1552
|
$slots: Readonly<{
|
|
1557
1553
|
title?: any;
|
|
@@ -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
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as P, isVNode as
|
|
1
|
+
import { defineComponent as P, isVNode as g, h as C, ref as x, createBlock as h, openBlock as r, unref as n, normalizeProps as A, guardReactiveProps as B, createSlots as w, withCtx as v, createElementVNode as d, normalizeClass as s, createElementBlock as i, Fragment as f, renderList as j, createCommentVNode as p, normalizeStyle as u, createTextVNode as O, toDisplayString as a, withModifiers as z, renderSlot as M, createVNode as R } from "vue";
|
|
2
2
|
import { Tooltip as Y } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../../../config-provider/index.mjs";
|
|
4
4
|
import { locales as E } from "../interface.mjs";
|
|
@@ -49,12 +49,12 @@ const T = { key: 0 }, D = ["href", "onClick"], U = ["onClick"], b = { key: 0 },
|
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
emits: ["update:valueRefs", "handleClick"],
|
|
52
|
-
setup(
|
|
53
|
-
const $ = N, { e:
|
|
52
|
+
setup(c, { emit: N }) {
|
|
53
|
+
const $ = N, { e: l } = G("ap-ladder"), m = (e) => g(e) || typeof e == "function", S = (e) => {
|
|
54
54
|
const { value: o, style: t } = e;
|
|
55
|
-
return
|
|
55
|
+
return g(o) ? C(o, {
|
|
56
56
|
style: t
|
|
57
|
-
}) : typeof o == "function" ?
|
|
57
|
+
}) : typeof o == "function" ? C(o(), {
|
|
58
58
|
ref: x,
|
|
59
59
|
style: {
|
|
60
60
|
...t
|
|
@@ -94,62 +94,65 @@ const T = { key: 0 }, D = ["href", "onClick"], U = ["onClick"], b = { key: 0 },
|
|
|
94
94
|
}, F = (e) => {
|
|
95
95
|
$("handleClick", e);
|
|
96
96
|
};
|
|
97
|
-
return (e, o) => (r(), h(
|
|
97
|
+
return (e, o) => (r(), h(n(Y), A(B(c.tooltipProps)), w({
|
|
98
98
|
default: v(() => [
|
|
99
99
|
d("div", {
|
|
100
|
-
class: s(
|
|
100
|
+
class: s(n(l)("value-group"))
|
|
101
101
|
}, [
|
|
102
|
-
(r(!0),
|
|
102
|
+
(r(!0), i(f, null, j(c.labelValues, (t, y) => (r(), i("div", {
|
|
103
103
|
key: y,
|
|
104
|
-
class: s(
|
|
104
|
+
class: s([
|
|
105
|
+
n(l)("value-group-item"),
|
|
106
|
+
t.label === "" && n(l)("value-group-value-end")
|
|
107
|
+
])
|
|
105
108
|
}, [
|
|
106
|
-
t.label ? (r(),
|
|
109
|
+
t.label ? (r(), i("div", {
|
|
107
110
|
key: 0,
|
|
108
111
|
class: s([
|
|
109
|
-
|
|
110
|
-
|
|
112
|
+
n(l)("value-group-label"),
|
|
113
|
+
c.labelAlign && n(l)(`label-align-${c.labelAlign}`)
|
|
111
114
|
]),
|
|
112
115
|
style: u(t.labelStyles)
|
|
113
116
|
}, [
|
|
114
117
|
O(a(t.label), 1),
|
|
115
|
-
t.label ? (r(),
|
|
118
|
+
t.label ? (r(), i("span", T, ":")) : p("", !0)
|
|
116
119
|
], 6)) : p("", !0),
|
|
117
120
|
d("div", {
|
|
118
|
-
class: s(
|
|
121
|
+
class: s(n(l)("value-group-value"))
|
|
119
122
|
}, [
|
|
120
123
|
m(t.value) ? (r(), h(S, {
|
|
121
124
|
key: 0,
|
|
122
125
|
value: t.value,
|
|
123
126
|
style: u([t.labelColor, t.valueStyles])
|
|
124
|
-
}, null, 8, ["value", "style"])) : (r(),
|
|
125
|
-
t.link ? (r(),
|
|
127
|
+
}, null, 8, ["value", "style"])) : (r(), i(f, { key: 1 }, [
|
|
128
|
+
t.link ? (r(), i("a", {
|
|
126
129
|
key: 0,
|
|
127
130
|
href: t.link,
|
|
128
131
|
target: "_blank",
|
|
129
|
-
class: s(
|
|
132
|
+
class: s(n(l)("value-group-link")),
|
|
130
133
|
style: u([
|
|
131
|
-
|
|
134
|
+
c.linkStyles,
|
|
132
135
|
t.linkStyles,
|
|
133
136
|
t.linkColor ? { color: t.linkColor } : void 0
|
|
134
137
|
]),
|
|
135
138
|
onClick: z((L) => F(t), ["prevent"])
|
|
136
|
-
}, a(k(t.value, { ...t })), 15, D)) : (r(),
|
|
139
|
+
}, a(k(t.value, { ...t })), 15, D)) : (r(), i(f, { key: 1 }, [
|
|
137
140
|
d("span", {
|
|
138
141
|
style: u([
|
|
139
|
-
|
|
142
|
+
c.valueStyles,
|
|
140
143
|
t.valueStyles,
|
|
141
144
|
t.valueColor ? { color: t.valueColor } : void 0
|
|
142
145
|
]),
|
|
143
146
|
class: s(
|
|
144
|
-
t.handleValueClick ?
|
|
147
|
+
t.handleValueClick ? n(l)("value-group-link") : void 0
|
|
145
148
|
),
|
|
146
|
-
onClick: (L) => t.handleValueClick && t.handleValueClick(
|
|
149
|
+
onClick: (L) => t.handleValueClick && t.handleValueClick(c.labelValues)
|
|
147
150
|
}, a(k(t.value, { ...t })), 15, U),
|
|
148
|
-
t.unit ? (r(),
|
|
151
|
+
t.unit ? (r(), i("span", {
|
|
149
152
|
key: 0,
|
|
150
|
-
class: s(
|
|
153
|
+
class: s(n(l)("value-group-unit")),
|
|
151
154
|
style: u([
|
|
152
|
-
|
|
155
|
+
c.unitStyles,
|
|
153
156
|
t.unitStyles,
|
|
154
157
|
t.unitColor ? { color: t.unitColor } : void 0
|
|
155
158
|
])
|
|
@@ -168,37 +171,37 @@ const T = { key: 0 }, D = ["href", "onClick"], U = ["onClick"], b = { key: 0 },
|
|
|
168
171
|
M(e.$slots, "title")
|
|
169
172
|
]),
|
|
170
173
|
key: "0"
|
|
171
|
-
} :
|
|
174
|
+
} : c.tooltip ? {
|
|
172
175
|
name: "title",
|
|
173
176
|
fn: v(() => [
|
|
174
177
|
d("div", {
|
|
175
|
-
class: s(
|
|
178
|
+
class: s(n(l)("tooltip"))
|
|
176
179
|
}, [
|
|
177
|
-
(r(!0),
|
|
180
|
+
(r(!0), i(f, null, j(c.labelValues, (t, y) => (r(), i("div", {
|
|
178
181
|
key: y,
|
|
179
|
-
class: s(
|
|
182
|
+
class: s(n(l)("tooltip-item"))
|
|
180
183
|
}, [
|
|
181
184
|
d("span", {
|
|
182
|
-
class: s(
|
|
183
|
-
style: u(
|
|
185
|
+
class: s(n(l)("tooltip-label")),
|
|
186
|
+
style: u(c.tooltipLabelStyles)
|
|
184
187
|
}, a(t.label ? t.label : "--") + ": ", 7),
|
|
185
|
-
m(t.value) ? (r(),
|
|
188
|
+
m(t.value) ? (r(), i("span", {
|
|
186
189
|
key: 0,
|
|
187
|
-
class: s(
|
|
188
|
-
style: u(
|
|
190
|
+
class: s(n(l)("tooltip-value")),
|
|
191
|
+
style: u(c.tooltipValueStyles)
|
|
189
192
|
}, [
|
|
190
193
|
R(S, {
|
|
191
194
|
value: t.value,
|
|
192
195
|
style: u([t.tooltipValueStyles])
|
|
193
196
|
}, null, 8, ["value", "style"]),
|
|
194
|
-
t.unit ? (r(),
|
|
195
|
-
], 6)) : (r(),
|
|
197
|
+
t.unit ? (r(), i("span", b, a(t.unit), 1)) : p("", !0)
|
|
198
|
+
], 6)) : (r(), i("span", {
|
|
196
199
|
key: 1,
|
|
197
|
-
class: s(
|
|
198
|
-
style: u(
|
|
200
|
+
class: s(n(l)("tooltip-value")),
|
|
201
|
+
style: u(c.tooltipValueStyles)
|
|
199
202
|
}, [
|
|
200
203
|
O(a(k(t.value, { ...t })) + " ", 1),
|
|
201
|
-
t.unit ? (r(),
|
|
204
|
+
t.unit ? (r(), i("span", q, a(t.unit), 1)) : p("", !0)
|
|
202
205
|
], 6))
|
|
203
206
|
], 2))), 128))
|
|
204
207
|
], 2)
|
|
@@ -97,6 +97,12 @@ export type ApFieldSwitchProps = BasicApFieldProps<Omit<SwitchProps, 'onClick'>>
|
|
|
97
97
|
};
|
|
98
98
|
export type ApFieldTextAreaProps = BasicApFieldProps<Omit<TextAreaProps, 'autosize'>> & {
|
|
99
99
|
emptyText?: string;
|
|
100
|
+
/**
|
|
101
|
+
* 输入生效前的事件,受控输入拦截
|
|
102
|
+
* @param nextVal
|
|
103
|
+
* @returns
|
|
104
|
+
*/
|
|
105
|
+
beforeInput?: (nextVal: string) => string;
|
|
100
106
|
};
|
|
101
107
|
export type ApFieldTextAreaExpose = {
|
|
102
108
|
focus: (options?: InputFocusOptions) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),B=require("@aplus-frontend/antdv");require("../../hooks/index.js");const g=require("lodash-unified"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),B=require("@aplus-frontend/antdv");require("../../hooks/index.js");const g=require("lodash-unified"),I=require("../hooks/use-default-placeholder.js"),C=require("../../hooks/useControllableValue.js");function S(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Object]"&&!t.isVNode(a)}const _=t.defineComponent({name:"ApFieldText",__name:"index",props:{mode:{default:"edit"},class:{},style:{},id:{},placeholder:{},autocomplete:{},type:{default:"text"},name:{},size:{},autofocus:{type:Boolean},lazy:{type:Boolean,default:!0},maxlength:{},loading:{type:Boolean},bordered:{type:Boolean,default:!0},showCount:{type:[Boolean,Object]},htmlSize:{},onPressEnter:{},onKeydown:{},onKeyup:{},onMousedown:{},onMouseUp:{},onFocus:{},onBlur:{},onChange:{},onInput:{},onRawInput:{},"onUpdate:value":{},onCompositionstart:{},onCompositionend:{},valueModifiers:{},hidden:{type:Boolean},status:{},value:{},defaultValue:{},inputElement:{},prefixCls:{},disabled:{type:Boolean,default:void 0},focused:{type:Boolean},triggerFocus:{},readonly:{type:Boolean},handleReset:{},addonBefore:{},addonAfter:{},prefix:{},suffix:{},clearIcon:{},allowClear:{type:Boolean,default:!0},emptyText:{default:"--"},beforeInput:{}},emits:["update:value"],setup(a,{expose:f,emit:m}){const l=t.ref(),o=t.useSlots();f({focus:e=>{var u;(u=l.value)==null||u.focus(e)},blur:()=>{var e;(e=l.value)==null||e.blur()},setSelectionRange:(e,u,c)=>{var r;(r=l.value)==null||r.setSelectionRange(e,u,c)},select:()=>{var e;(e=l.value)==null||e.select()},input:t.computed(()=>{var e;return(e=l.value)==null?void 0:e.input})});const y=m,n=a,{value:i,updateValue:v}=C.useControllableValue(n,y),b=I.useDefaultPlaceholder("Text",n);function x(e){var d,p,s;const u=e.target.value||"",c=n.beforeInput?(d=n.beforeInput)==null?void 0:d.call(n,u):u,r=(s=(p=l.value)==null?void 0:p.$el)==null?void 0:s.querySelector("input");r&&(r.value=c),v(c)}function h(){var e,u;return n.mode==="edit"?t.createVNode(B.Input,t.mergeProps(g.omit(n,["mode","emptyText","value","onUpdate:value","beforeInput"]),{placeholder:t.unref(b),value:t.unref(i),onInput:x,ref:l}),S(o)?o:{default:()=>[o]}):t.createVNode("span",null,[n.prefix||((e=o==null?void 0:o.prefix)==null?void 0:e.call(o)),t.unref(i)||n.emptyText,n.suffix||((u=o==null?void 0:o.suffix)==null?void 0:u.call(o))])}return(e,u)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(h())))}});exports.default=_;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("lodash-unified");require("../../hooks/index.js");require("../../config-provider/index.js");const h=require("@aplus-frontend/antdv"),I=require("../hooks/use-default-placeholder.js"),g=require("../../hooks/useControllableValue.js"),C=require("../../config-provider/hooks/use-namespace.js"),q=e.defineComponent({name:"ApFieldTextArea",__name:"index",props:{mode:{default:"edit"},class:{},style:{},rows:{},autoSize:{type:[Boolean,Object]},onResize:{},onCompositionstart:{},onCompositionend:{},valueModifiers:{},size:{},value:{},name:{},type:{default:"text"},onFocus:{},onBlur:{},onChange:{},onInput:{},onKeydown:{},onKeyup:{},onMousedown:{},focused:{type:Boolean},hidden:{type:Boolean},disabled:{type:Boolean,default:void 0},prefixCls:{},id:{},autofocus:{type:Boolean},autocomplete:{},readonly:{type:Boolean},status:{},defaultValue:{},"onUpdate:value":{},loading:{type:Boolean},placeholder:{},lazy:{type:Boolean,default:!0},maxlength:{},bordered:{type:Boolean,default:!0},showCount:{type:[Boolean,Object]},htmlSize:{},onPressEnter:{},onMouseUp:{},onRawInput:{},inputElement:{},triggerFocus:{},handleReset:{},clearIcon:{},allowClear:{type:Boolean,default:!0},emptyText:{default:"--"},beforeInput:{}},emits:["update:value"],setup(c,{expose:f,emit:m}){const n=e.ref(),o=c,y=m,{value:l,updateValue:v}=g.useControllableValue(o,y),{b}=C.useNamespace("field-text-area"),x=I.useDefaultPlaceholder("TextArea",o);function B(t){var s,p,i;const a=t.target.value||"",u=o.beforeInput?(s=o.beforeInput)==null?void 0:s.call(o,a):a,r=(i=(p=n.value)==null?void 0:p.$el)==null?void 0:i.querySelector("textarea");r&&(r.value=u),v(u)}return f({focus:t=>{var a;(a=n.value)==null||a.focus(t)},blur:()=>{var t;(t=n.value)==null||t.blur()},resizableTextArea:e.computed(()=>{var t;return(t=n.value)==null?void 0:t.resizableTextArea})}),(t,a)=>t.mode==="read"?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(b)())},e.toDisplayString(e.unref(d.isNil)(e.unref(l))||e.unref(l)===""?t.emptyText:e.unref(l)),3)):(e.openBlock(),e.createBlock(e.unref(h.Input).TextArea,e.mergeProps({key:1},e.unref(d.omit)(o,["onUpdate:value","value","beforeInput"]),{ref_key:"textAreaRef",ref:n,placeholder:e.unref(x),value:e.unref(l),onInput:B}),null,16,["placeholder","value"]))}});exports.default=q;
|
|
@@ -705,8 +705,7 @@ declare function __VLS_template(): {
|
|
|
705
705
|
}>, {
|
|
706
706
|
blur: () => void;
|
|
707
707
|
focus: () => void;
|
|
708
|
-
request: (currentNode
|
|
709
|
-
/** @type { typeof __VLS_ctx.treeSelectRef } */ ? /** @type { typeof __VLS_ctx.treeSelectRef } */: LegacyDataNode, clear?: boolean) => Promise<void>;
|
|
708
|
+
request: (currentNode?: LegacyDataNode, clear?: boolean) => Promise<void>;
|
|
710
709
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
711
710
|
"update:value": (...args: any[]) => void;
|
|
712
711
|
}, string, {
|
|
@@ -774,8 +773,7 @@ declare function __VLS_template(): {
|
|
|
774
773
|
}>, "blur" | "focus" | "request" | ("mode" | "open" | "multiple" | "disabled" | "bordered" | "virtual" | "dropdownMatchSelectWidth" | "showSearch" | "loading" | "autofocus" | "allowClear" | "defaultOpen" | "showArrow" | "autoClearSearchValue" | "labelInValue" | "treeCheckable" | "treeDefaultExpandAll" | "treeCheckStrictly" | "emptyText")> & ShallowUnwrapRef<{
|
|
775
774
|
blur: () => void;
|
|
776
775
|
focus: () => void;
|
|
777
|
-
request: (currentNode
|
|
778
|
-
/** @type { typeof __VLS_ctx.treeSelectRef } */ ? /** @type { typeof __VLS_ctx.treeSelectRef } */: LegacyDataNode, clear?: boolean) => Promise<void>;
|
|
776
|
+
request: (currentNode?: LegacyDataNode, clear?: boolean) => Promise<void>;
|
|
779
777
|
}> & {} & ComponentCustomProperties & {} & {
|
|
780
778
|
$slots: Readonly<{
|
|
781
779
|
title?: any;
|
|
@@ -1481,8 +1479,7 @@ declare const __VLS_component: DefineComponent<ApFormItemTreeSelectProps, {
|
|
|
1481
1479
|
}>, {
|
|
1482
1480
|
blur: () => void;
|
|
1483
1481
|
focus: () => void;
|
|
1484
|
-
request: (currentNode
|
|
1485
|
-
/** @type { typeof __VLS_ctx.treeSelectRef } */ ? /** @type { typeof __VLS_ctx.treeSelectRef } */: LegacyDataNode, clear?: boolean) => Promise<void>;
|
|
1482
|
+
request: (currentNode?: LegacyDataNode, clear?: boolean) => Promise<void>;
|
|
1486
1483
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
1487
1484
|
"update:value": (...args: any[]) => void;
|
|
1488
1485
|
}, string, {
|
|
@@ -1550,8 +1547,7 @@ declare const __VLS_component: DefineComponent<ApFormItemTreeSelectProps, {
|
|
|
1550
1547
|
}>, "blur" | "focus" | "request" | ("mode" | "open" | "multiple" | "disabled" | "bordered" | "virtual" | "dropdownMatchSelectWidth" | "showSearch" | "loading" | "autofocus" | "allowClear" | "defaultOpen" | "showArrow" | "autoClearSearchValue" | "labelInValue" | "treeCheckable" | "treeDefaultExpandAll" | "treeCheckStrictly" | "emptyText")> & ShallowUnwrapRef<{
|
|
1551
1548
|
blur: () => void;
|
|
1552
1549
|
focus: () => void;
|
|
1553
|
-
request: (currentNode
|
|
1554
|
-
/** @type { typeof __VLS_ctx.treeSelectRef } */ ? /** @type { typeof __VLS_ctx.treeSelectRef } */: LegacyDataNode, clear?: boolean) => Promise<void>;
|
|
1550
|
+
request: (currentNode?: LegacyDataNode, clear?: boolean) => Promise<void>;
|
|
1555
1551
|
}> & {} & ComponentCustomProperties & {} & {
|
|
1556
1552
|
$slots: Readonly<{
|
|
1557
1553
|
title?: any;
|
|
@@ -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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),re=require("./use-sorted-filtered.js");require("../../config-provider/index.js");const A=require("../utils.js"),b=require("lodash-unified"),_=require("../../utils/index.js"),ne=require("../../config-provider/hooks/use-locale.js"),ae=require("../../config-provider/hooks/use-namespace.js"),S=1,C=10;function oe(g){const f={};return g&&(g===!0?(f.current=S,f.pageSize=C):(f.current=g.defaultCurrent||S,f.pageSize=g.defaultPageSize||C)),f}const se=({manual:g=!1,request:f,defaultParams:D={},defaultData:L=[],formatParams:v,paramsValueTypeMap:y,resetFieldsIgnores:N,filterFields:I,sortFields:j,namespace:M="ap-table",pagination:p={defaultCurrent:S,defaultPageSize:C,showLessItems:!1,showTotal:!0}})=>{let q=0,i={};const B=p??{},G=e=>v?v(e):e,T=a.ref(),c=a.reactive(oe(p)),{getColumnSFConfig:J,setSF:K,clearAll:Q,sortedInfo:Z,filteredInfo:$}=re.useTableSortedAndFiltered(),{t:z}=ne.useLocale(),{b:P}=ae.useNamespace(M),s=a.reactive({total:L.length,records:L,loading:!1}),F=()=>{var e,t;return((t=(e=T.value)==null?void 0:e.apForm)==null?void 0:t.getFieldsValueTransformed(!0))||{}},R=async e=>{var n;const t=G(e),r=Date.now();q=r,s.loading=!0;try{const o=await f({...a.unref(D),...t});q===r&&(s.total=o.total||((n=o.data)==null?void 0:n.length)||0,s.records=[...o.data||[]])}catch{q===r&&(s.records=[],s.total=0)}finally{s.loading=!1}},U=e=>{const t={};return Object.entries(e).forEach(([r,n])=>{if(t[r]=n,y&&n){const o=y[r];o&&(t[r]=A.parseFieldValue(o,n))}}),t},W=async e=>{var n,o,l,d,h;const t=F(),r={};Object.entries(t).forEach(([m,E])=>{N&&N.indexOf(m)>-1&&(r[m]=E)}),await((o=(n=T.value)==null?void 0:n.apForm)==null?void 0:o.resetFields()),(h=(d=(l=T.value)==null?void 0:l.apForm)==null?void 0:d.setFieldsValue)==null||h.call(d,r),a.nextTick(()=>{e==null||e()})},w=e=>{i=e;const t=U(e);R(t)},H=e=>{w({...i,...e})},x=()=>{const e=F();p&&(c.current=S),w({...e,filter:i.filter,sort:i.sort,current:p?S:void 0,pageSize:p?i.pageSize||c.pageSize:void 0})},X=()=>{Q(),i.sort={},i.filter={},W(x)},V=()=>{w(i)},Y=e=>{if(!p)V();else{const{current:t,pageSize:r}=c,n=s.total-e,o=Math.ceil(n/r),l=t>o?o:t;H({current:l>0?l:1})}},O=(e,t,r)=>{var m,E;const n=F();c.current=e.current,c.pageSize=e.pageSize,K(t,r);const o=b.isArray(r)?[...r]:[r],l={};for(const u of o)(m=a.unref(j))!=null&&m.includes(u.columnKey||u.field)&&u.order&&(l[A.dataIndexToStr(u.columnKey||u.field)]=u.order);const d={};for(const u of Object.keys(t))(E=a.unref(I))!=null&&E.includes(u)&&t[u]&&(d[u]=t[u]);const h={...n,filter:d,sort:l,current:e.current,pageSize:e.pageSize};b.isEqualWith(i,h,A.isEqualCustom)||w(h)};a.onMounted(()=>{const e=F(),{current:t,pageSize:r}=c;if(i={current:t,pageSize:r,filter:{},sort:{},...e},!g){const n=U(i);R(n)}}),a.watch(()=>a.unref(D),()=>{x()},{deep:!0});const k=a.computed(()=>{if(s.total===0)return"-";const{current:e,pageSize:t}=c;return`${e}/${Math.ceil(s.total/t)}`});function ee(e){b.isArray(e)&&(s.records=e,s.total=e.length)}const te=a.computed(()=>{const{showLessItems:e,showTotal:t,showQuickJumper:r,showSizeChanger:n,pageSizeOptions:o}=B;return{loading:s.loading,pagination:{current:c.current,pageSize:c.pageSize,total:s.total,showSizeChanger:_.isDef(n)?n:!e,showQuickJumper:_.isDef(r)?r:!e,showLessItems:e,size:"default",pageSizeOptions:b.isUndefined(o)?["10","20","50","100"]:o,showTotal:t?l=>a.createVNode("span",{class:P("pagination-total-wrapper")},[z("ap.apTable.pagination.totalLeftPrefix")," ",a.createVNode("span",{class:P("pagination-count-text")},[l])," ",z("ap.apTable.pagination.totalLeftSuffix"),a.createVNode("span",{class:P("pagination--total-right")},[z("ap.apTable.pagination.totalRightPrefix")," ",a.createVNode("span",{class:P("pagination-count-text")},[a.unref(k)])," ",z("ap.apTable.pagination.totalRightSuffix")])]):void 0},onChange:O,dataSource:s.records}});return{formRef:T,submit:x,reset:X,refresh:V,refreshByDelete:Y,data:s,current:c.current,pageSize:c.pageSize,handleTableChange:O,tableProps:te,dataSource:a.computed(()=>s.records),setDataSource:ee,getColumnSFConfig:J,sortedInfo:Z,filteredInfo:$}};exports.DEFAULT_CURRENT=S;exports.DEFAULT_PAGE_SIZE=C;exports.useTablePaging=se;
|
|
@@ -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
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),p=require("@aplus-frontend/antdv");require("../../../config-provider/index.js");const k=require("../interface.js"),f=require("../../../config-provider/hooks/use-namespace.js"),S={key:0},
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),p=require("@aplus-frontend/antdv");require("../../../config-provider/index.js");const k=require("../interface.js"),f=require("../../../config-provider/hooks/use-namespace.js"),S={key:0},v=["href","onClick"],C=["onClick"],g={key:0},B={key:0},h=e.defineComponent({name:"ApLadderValueGroupMode",__name:"ValueGroupMode",props:{labelValues:{type:Array,default:()=>[]},labelAlign:{type:String,default:""},labelStyles:{type:Object,default:()=>({})},valueStyles:{type:Object,default:()=>({})},linkStyles:{type:Object,default:()=>({})},unitStyles:{type:Object,default:()=>({})},tooltipLabelStyles:{type:Object,default:()=>({})},tooltipValueStyles:{type:Object,default:()=>({})},tooltipProps:{type:Object,default:()=>({})},tooltip:{type:Boolean,default:!1}},emits:["update:valueRefs","handleClick"],setup(r,{emit:u}){const y=u,{e:l}=f.useNamespace("ap-ladder"),a=n=>e.isVNode(n)||typeof n=="function",s=n=>{const{value:o,style:t}=n;return e.isVNode(o)?e.h(o,{style:t}):typeof o=="function"?e.h(o(),{ref:e.ref,style:{...t}}):null},i=(n,o={rawValue:!0,precision:2,thousand:!0,thousandSeparator:",",currency:"CNY",percent:!1})=>{if(Object.prototype.toString.call(n)==="[object Null]"||Object.prototype.toString.call(n)==="[object Undefined]"||Object.prototype.toString.call(n)==="[object Object]"||Object.prototype.toString.call(n)==="[object Function]")return"--";if(typeof n=="number"){if(o.percent)return`${n.toFixed(o.precision)}%`;if(o.currency)return n.toLocaleString(k.locales[o.currency?o.currency:"CNY"],{style:"currency",currency:o.currency?o.currency:"CNY"});if(o.thousand){const[t,c]=n.toFixed(o.precision?o.precision:2).split(".");return`${t.replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${o.thousandSeparator?o.thousandSeparator:","}`)}.${c}`}return n.toFixed(o.precision?o.precision:2)}return n},d=n=>{y("handleClick",n)};return(n,o)=>(e.openBlock(),e.createBlock(e.unref(p.Tooltip),e.normalizeProps(e.guardReactiveProps(r.tooltipProps)),e.createSlots({default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(l)("value-group"))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.labelValues,(t,c)=>(e.openBlock(),e.createElementBlock("div",{key:c,class:e.normalizeClass([e.unref(l)("value-group-item"),t.label===""&&e.unref(l)("value-group-value-end")])},[t.label?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([e.unref(l)("value-group-label"),r.labelAlign&&e.unref(l)(`label-align-${r.labelAlign}`)]),style:e.normalizeStyle(t.labelStyles)},[e.createTextVNode(e.toDisplayString(t.label),1),t.label?(e.openBlock(),e.createElementBlock("span",S,":")):e.createCommentVNode("",!0)],6)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(l)("value-group-value"))},[a(t.value)?(e.openBlock(),e.createBlock(s,{key:0,value:t.value,style:e.normalizeStyle([t.labelColor,t.valueStyles])},null,8,["value","style"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.link?(e.openBlock(),e.createElementBlock("a",{key:0,href:t.link,target:"_blank",class:e.normalizeClass(e.unref(l)("value-group-link")),style:e.normalizeStyle([r.linkStyles,t.linkStyles,t.linkColor?{color:t.linkColor}:void 0]),onClick:e.withModifiers(m=>d(t),["prevent"])},e.toDisplayString(i(t.value,{...t})),15,v)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",{style:e.normalizeStyle([r.valueStyles,t.valueStyles,t.valueColor?{color:t.valueColor}:void 0]),class:e.normalizeClass(t.handleValueClick?e.unref(l)("value-group-link"):void 0),onClick:m=>t.handleValueClick&&t.handleValueClick(r.labelValues)},e.toDisplayString(i(t.value,{...t})),15,C),t.unit?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(l)("value-group-unit")),style:e.normalizeStyle([r.unitStyles,t.unitStyles,t.unitColor?{color:t.unitColor}:void 0])},e.toDisplayString(t.unit),7)):e.createCommentVNode("",!0)],64))],64))],2)],2))),128))],2)]),_:2},[n.$slots.title?{name:"title",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"title")]),key:"0"}:r.tooltip?{name:"title",fn:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(l)("tooltip"))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.labelValues,(t,c)=>(e.openBlock(),e.createElementBlock("div",{key:c,class:e.normalizeClass(e.unref(l)("tooltip-item"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(l)("tooltip-label")),style:e.normalizeStyle(r.tooltipLabelStyles)},e.toDisplayString(t.label?t.label:"--")+": ",7),a(t.value)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(l)("tooltip-value")),style:e.normalizeStyle(r.tooltipValueStyles)},[e.createVNode(s,{value:t.value,style:e.normalizeStyle([t.tooltipValueStyles])},null,8,["value","style"]),t.unit?(e.openBlock(),e.createElementBlock("span",g,e.toDisplayString(t.unit),1)):e.createCommentVNode("",!0)],6)):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(l)("tooltip-value")),style:e.normalizeStyle(r.tooltipValueStyles)},[e.createTextVNode(e.toDisplayString(i(t.value,{...t}))+" ",1),t.unit?(e.openBlock(),e.createElementBlock("span",B,e.toDisplayString(t.unit),1)):e.createCommentVNode("",!0)],6))],2))),128))],2)]),key:"1"}:void 0]),1040))}});exports.default=h;
|
package/package.json
CHANGED
|
@@ -13,11 +13,13 @@
|
|
|
13
13
|
white-space: nowrap;
|
|
14
14
|
min-width: 0;
|
|
15
15
|
}
|
|
16
|
+
.aplus-ap-ladder__value-group-value-end {
|
|
17
|
+
justify-content: flex-end;
|
|
18
|
+
}
|
|
16
19
|
.aplus-ap-ladder__value-group-label {
|
|
17
20
|
display: inline-block;
|
|
18
21
|
color: #8896B0;
|
|
19
22
|
word-break: break-all;
|
|
20
|
-
min-width: 50px;
|
|
21
23
|
}
|
|
22
24
|
.aplus-ap-ladder__value-group-value {
|
|
23
25
|
color: #182948;
|
|
@@ -31,6 +33,12 @@
|
|
|
31
33
|
color: #0070ff !important;
|
|
32
34
|
text-decoration: none !important;
|
|
33
35
|
}
|
|
36
|
+
.aplus-ap-ladder__label-align-left {
|
|
37
|
+
text-align: left;
|
|
38
|
+
}
|
|
39
|
+
.aplus-ap-ladder__label-align-right {
|
|
40
|
+
text-align: right;
|
|
41
|
+
}
|
|
34
42
|
.aplus-ap-ladder-base {
|
|
35
43
|
display: flex;
|
|
36
44
|
}
|
|
@@ -62,7 +70,7 @@
|
|
|
62
70
|
display: flex;
|
|
63
71
|
}
|
|
64
72
|
.aplus-ap-ladder__tooltip-label {
|
|
65
|
-
|
|
73
|
+
white-space: nowrap;
|
|
66
74
|
word-break: break-all;
|
|
67
75
|
}
|
|
68
76
|
.aplus-ap-ladder__tooltip-value {
|
|
@@ -112,6 +120,12 @@
|
|
|
112
120
|
color: #0070ff;
|
|
113
121
|
text-decoration: none;
|
|
114
122
|
}
|
|
123
|
+
.aplus-ap-ladder--admin .aplus-ap-ladder__value-group-label {
|
|
124
|
+
color: #999999;
|
|
125
|
+
}
|
|
126
|
+
.aplus-ap-ladder--admin .aplus-ap-ladder__value-group-value {
|
|
127
|
+
color: #333333;
|
|
128
|
+
}
|
|
115
129
|
.aplus-ap-ladder--admin .aplus-ap-ladder__major {
|
|
116
130
|
color: #333333;
|
|
117
131
|
}
|
|
@@ -15,12 +15,14 @@
|
|
|
15
15
|
white-space: nowrap;
|
|
16
16
|
min-width: 0; // Import
|
|
17
17
|
}
|
|
18
|
+
&__value-group-value-end{
|
|
19
|
+
justify-content: flex-end;
|
|
20
|
+
}
|
|
18
21
|
|
|
19
22
|
&__value-group-label{
|
|
20
23
|
display: inline-block;
|
|
21
24
|
color: #8896B0;
|
|
22
25
|
word-break: break-all;
|
|
23
|
-
min-width: 50px;
|
|
24
26
|
}
|
|
25
27
|
&__value-group-value{
|
|
26
28
|
color: #182948;
|
|
@@ -34,7 +36,12 @@
|
|
|
34
36
|
color: @aplus-primary-color !important;
|
|
35
37
|
text-decoration: none !important;
|
|
36
38
|
}
|
|
37
|
-
|
|
39
|
+
&__label-align-left{
|
|
40
|
+
text-align: left;
|
|
41
|
+
}
|
|
42
|
+
&__label-align-right{
|
|
43
|
+
text-align: right;
|
|
44
|
+
}
|
|
38
45
|
&-base{
|
|
39
46
|
display: flex;
|
|
40
47
|
}
|
|
@@ -66,7 +73,7 @@
|
|
|
66
73
|
display: flex;
|
|
67
74
|
}
|
|
68
75
|
&__tooltip-label{
|
|
69
|
-
|
|
76
|
+
white-space: nowrap;
|
|
70
77
|
word-break: break-all;
|
|
71
78
|
}
|
|
72
79
|
&__tooltip-value{
|
|
@@ -122,6 +129,12 @@
|
|
|
122
129
|
/** Admin端样式 */
|
|
123
130
|
&--admin {
|
|
124
131
|
.@{root-cls} {
|
|
132
|
+
&__value-group-label{
|
|
133
|
+
color: #999999;
|
|
134
|
+
}
|
|
135
|
+
&__value-group-value{
|
|
136
|
+
color: #333333;
|
|
137
|
+
}
|
|
125
138
|
&__major {
|
|
126
139
|
color: #333333;
|
|
127
140
|
}
|
package/theme/index.css
CHANGED
|
@@ -601,11 +601,13 @@
|
|
|
601
601
|
white-space: nowrap;
|
|
602
602
|
min-width: 0;
|
|
603
603
|
}
|
|
604
|
+
.aplus-ap-ladder__value-group-value-end {
|
|
605
|
+
justify-content: flex-end;
|
|
606
|
+
}
|
|
604
607
|
.aplus-ap-ladder__value-group-label {
|
|
605
608
|
display: inline-block;
|
|
606
609
|
color: #8896B0;
|
|
607
610
|
word-break: break-all;
|
|
608
|
-
min-width: 50px;
|
|
609
611
|
}
|
|
610
612
|
.aplus-ap-ladder__value-group-value {
|
|
611
613
|
color: #182948;
|
|
@@ -619,6 +621,12 @@
|
|
|
619
621
|
color: #0070ff !important;
|
|
620
622
|
text-decoration: none !important;
|
|
621
623
|
}
|
|
624
|
+
.aplus-ap-ladder__label-align-left {
|
|
625
|
+
text-align: left;
|
|
626
|
+
}
|
|
627
|
+
.aplus-ap-ladder__label-align-right {
|
|
628
|
+
text-align: right;
|
|
629
|
+
}
|
|
622
630
|
.aplus-ap-ladder-base {
|
|
623
631
|
display: flex;
|
|
624
632
|
}
|
|
@@ -650,7 +658,7 @@
|
|
|
650
658
|
display: flex;
|
|
651
659
|
}
|
|
652
660
|
.aplus-ap-ladder__tooltip-label {
|
|
653
|
-
|
|
661
|
+
white-space: nowrap;
|
|
654
662
|
word-break: break-all;
|
|
655
663
|
}
|
|
656
664
|
.aplus-ap-ladder__tooltip-value {
|
|
@@ -700,6 +708,12 @@
|
|
|
700
708
|
color: #0070ff;
|
|
701
709
|
text-decoration: none;
|
|
702
710
|
}
|
|
711
|
+
.aplus-ap-ladder--admin .aplus-ap-ladder__value-group-label {
|
|
712
|
+
color: #999999;
|
|
713
|
+
}
|
|
714
|
+
.aplus-ap-ladder--admin .aplus-ap-ladder__value-group-value {
|
|
715
|
+
color: #333333;
|
|
716
|
+
}
|
|
703
717
|
.aplus-ap-ladder--admin .aplus-ap-ladder__major {
|
|
704
718
|
color: #333333;
|
|
705
719
|
}
|