@aplus-frontend/ui 0.0.38 → 0.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/src/ap-form/ap-form-item-group/index.vue.mjs +28 -27
- package/es/src/ap-form/search-form/index.vue.mjs +107 -102
- package/es/src/ap-table/ap-table.vue.d.ts +10 -4
- package/es/src/ap-table/ap-table.vue.mjs +58 -57
- package/es/src/ap-table/constants.d.ts +8 -8
- package/es/src/ap-table/hooks/use-table-row-selection.d.ts +1 -1
- package/es/src/ap-table/interface.d.ts +6 -2
- package/es/src/business/expandAlert/ApExpandAlert.vue2.mjs +1 -1
- package/es/src/business/expandAlert/interface.d.ts +1 -1
- package/lib/src/ap-form/ap-form-item-group/index.vue.js +1 -1
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-table/ap-table.vue.d.ts +10 -4
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/constants.d.ts +8 -8
- package/lib/src/ap-table/hooks/use-table-row-selection.d.ts +1 -1
- package/lib/src/ap-table/interface.d.ts +6 -2
- package/lib/src/business/expandAlert/ApExpandAlert.vue2.js +1 -1
- package/lib/src/business/expandAlert/interface.d.ts +1 -1
- package/package.json +3 -3
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { isVNode as
|
|
1
|
+
import { isVNode as h, defineComponent as k, useSlots as w, watch as _, shallowRef as P, computed as S, unref as n, createVNode as b, mergeProps as m, openBlock as s, createBlock as c, withCtx as x, createElementBlock as B, Fragment as N, renderList as R, resolveDynamicComponent as j } from "vue";
|
|
2
2
|
import { Col as v, Row as F } from "ant-design-vue";
|
|
3
|
-
import { pick as I } from "lodash-unified";
|
|
3
|
+
import { pick as D, isBoolean as I } from "lodash-unified";
|
|
4
4
|
import { apFormItemColPropKeys as O } from "../constant.mjs";
|
|
5
|
-
import { genRealChildren as
|
|
5
|
+
import { genRealChildren as u, buildColSpan as V, getStringName as $ } from "./helper.mjs";
|
|
6
6
|
import "../../config-provider/index.mjs";
|
|
7
7
|
import "../style/ap-form-item-group.css";
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
import { isDef as A } from "../../utils/index.mjs";
|
|
9
|
+
import { useNamespace as E } from "../../config-provider/hooks/use-namespace.mjs";
|
|
10
|
+
function G(t) {
|
|
11
|
+
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !h(t);
|
|
11
12
|
}
|
|
12
|
-
const
|
|
13
|
+
const U = /* @__PURE__ */ k({
|
|
13
14
|
name: "ApFormItemGroup",
|
|
14
15
|
__name: "index",
|
|
15
16
|
props: {
|
|
@@ -27,31 +28,31 @@ const M = /* @__PURE__ */ w({
|
|
|
27
28
|
default: 3
|
|
28
29
|
}
|
|
29
30
|
},
|
|
30
|
-
setup(
|
|
31
|
+
setup(t) {
|
|
31
32
|
const {
|
|
32
|
-
b:
|
|
33
|
-
} =
|
|
34
|
-
countPerRow:
|
|
35
|
-
...
|
|
36
|
-
} =
|
|
37
|
-
|
|
38
|
-
l.value =
|
|
33
|
+
b: a
|
|
34
|
+
} = E("ap-form-item-group"), {
|
|
35
|
+
countPerRow: d,
|
|
36
|
+
...f
|
|
37
|
+
} = t, p = w();
|
|
38
|
+
_(() => p.default(), (o) => {
|
|
39
|
+
l.value = u(o);
|
|
39
40
|
});
|
|
40
|
-
const l =
|
|
41
|
-
const e =
|
|
41
|
+
const l = P(u(p.default())), g = S(() => n(l).map((o, i) => {
|
|
42
|
+
const e = o.props, r = D(e, O), y = r != null && r.span ? {} : V(d), C = I(e.hidden) ? !!e.hidden : A(e.hidden);
|
|
42
43
|
return {
|
|
43
|
-
key: `${
|
|
44
|
-
node:
|
|
45
|
-
class: C ?
|
|
46
|
-
}),
|
|
47
|
-
default: () => [
|
|
44
|
+
key: `${i}-${$(e.name)}`,
|
|
45
|
+
node: b(v, m(y, r, {
|
|
46
|
+
class: C ? a("col-hidden") : ""
|
|
47
|
+
}), G(o) ? o : {
|
|
48
|
+
default: () => [o]
|
|
48
49
|
})
|
|
49
50
|
};
|
|
50
51
|
}));
|
|
51
|
-
return (
|
|
52
|
-
class: n(
|
|
53
|
-
},
|
|
54
|
-
default:
|
|
52
|
+
return (o, i) => (s(), c(n(F), m({
|
|
53
|
+
class: n(a)()
|
|
54
|
+
}, f), {
|
|
55
|
+
default: x(() => [(s(!0), B(N, null, R(g.value, (e) => (s(), c(j(e.node), {
|
|
55
56
|
key: e.key
|
|
56
57
|
}))), 128))]),
|
|
57
58
|
_: 1
|
|
@@ -59,5 +60,5 @@ const M = /* @__PURE__ */ w({
|
|
|
59
60
|
}
|
|
60
61
|
});
|
|
61
62
|
export {
|
|
62
|
-
|
|
63
|
+
U as default
|
|
63
64
|
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { isVNode as
|
|
2
|
-
import { Col as
|
|
1
|
+
import { isVNode as ne, defineComponent as le, useSlots as re, ref as se, unref as o, shallowRef as V, computed as g, watch as j, cloneVNode as ie, createVNode as n, Fragment as _, openBlock as m, createBlock as y, mergeProps as ue, withCtx as B, resolveDynamicComponent as A, createElementBlock as ce, renderList as pe } from "vue";
|
|
2
|
+
import { Col as R, Flex as M, Space as de, Button as E, Row as fe } from "ant-design-vue";
|
|
3
3
|
import "../ap-form.vue.mjs";
|
|
4
4
|
import "../ap-form-item.vue2.mjs";
|
|
5
5
|
import "../../hooks/index.mjs";
|
|
6
|
-
import { genRealChildren as
|
|
7
|
-
import { DoubleRightOutlined as
|
|
6
|
+
import { genRealChildren as D } from "../ap-form-item-group/helper.mjs";
|
|
7
|
+
import { DoubleRightOutlined as me } from "@ant-design/icons-vue";
|
|
8
8
|
import "../../config-provider/index.mjs";
|
|
9
9
|
import "../style/search-form.css";
|
|
10
|
-
import { isArray as
|
|
11
|
-
import { isDef as
|
|
12
|
-
import { diffFormItem as
|
|
13
|
-
import { useControllableValue as
|
|
14
|
-
import { useNamespace as
|
|
15
|
-
import { useGlobalConfig as
|
|
16
|
-
import { useLocale as
|
|
17
|
-
import
|
|
10
|
+
import { isArray as he, isBoolean as xe, omit as ye } from "lodash-unified";
|
|
11
|
+
import { isDef as $ } from "../../utils/index.mjs";
|
|
12
|
+
import { diffFormItem as Ce } from "./utils.mjs";
|
|
13
|
+
import { useControllableValue as ge } from "../../hooks/useControllableValue.mjs";
|
|
14
|
+
import { useNamespace as _e } from "../../config-provider/hooks/use-namespace.mjs";
|
|
15
|
+
import { useGlobalConfig as Re } from "../../config-provider/hooks/use-global-config.mjs";
|
|
16
|
+
import { useLocale as Se } from "../../config-provider/hooks/use-locale.mjs";
|
|
17
|
+
import L from "../ap-form-item.vue.mjs";
|
|
18
18
|
import Fe from "../ap-form.vue2.mjs";
|
|
19
|
-
function
|
|
20
|
-
return typeof
|
|
19
|
+
function Be(h) {
|
|
20
|
+
return typeof h == "function" || Object.prototype.toString.call(h) === "[object Object]" && !ne(h);
|
|
21
21
|
}
|
|
22
|
-
const i = 24,
|
|
22
|
+
const i = 24, ze = /* @__PURE__ */ le({
|
|
23
23
|
name: "ApFormSearchForm",
|
|
24
24
|
__name: "index",
|
|
25
25
|
props: {
|
|
@@ -98,134 +98,139 @@ const i = 24, qe = /* @__PURE__ */ ae({
|
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
100
|
emits: ["update:collapse"],
|
|
101
|
-
setup(
|
|
102
|
-
expose:
|
|
101
|
+
setup(h, {
|
|
102
|
+
expose: W,
|
|
103
103
|
emit: q
|
|
104
104
|
}) {
|
|
105
|
-
var
|
|
106
|
-
const
|
|
107
|
-
value:
|
|
108
|
-
updateValue:
|
|
109
|
-
} =
|
|
105
|
+
var N;
|
|
106
|
+
const s = re(), a = h, z = q, {
|
|
107
|
+
value: u,
|
|
108
|
+
updateValue: H
|
|
109
|
+
} = ge(a, z, {
|
|
110
110
|
valuePropName: "collapse",
|
|
111
111
|
defaultValuePropName: "defaultCollapse"
|
|
112
112
|
}), {
|
|
113
|
-
b:
|
|
114
|
-
} =
|
|
115
|
-
t:
|
|
116
|
-
} =
|
|
117
|
-
function H() {
|
|
118
|
-
U(!t(f));
|
|
119
|
-
}
|
|
113
|
+
b: U
|
|
114
|
+
} = _e("ap-form-search-form"), G = Re("uiMode"), {
|
|
115
|
+
t: b
|
|
116
|
+
} = Se(), C = se();
|
|
120
117
|
function J() {
|
|
121
|
-
|
|
122
|
-
(a = (e = x.value) == null ? void 0 : e.validateFields()) == null || a.then(o.onSubmit);
|
|
118
|
+
H(!o(u));
|
|
123
119
|
}
|
|
124
120
|
function K() {
|
|
125
|
-
var e,
|
|
126
|
-
|
|
121
|
+
var e, t;
|
|
122
|
+
(t = (e = C.value) == null ? void 0 : e.validateFields()) == null || t.then(a.onSubmit);
|
|
123
|
+
}
|
|
124
|
+
function Q() {
|
|
125
|
+
var e, t, l;
|
|
126
|
+
a.customReset || (t = (e = C.value) == null ? void 0 : e.resetFields) == null || t.call(e), (l = a.onReset) == null || l.call(a);
|
|
127
127
|
}
|
|
128
|
-
let
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}),
|
|
128
|
+
let v = [];
|
|
129
|
+
const S = V(D(s.default())), p = V((N = s.extra) == null ? void 0 : N.call(s)), w = g(() => Math.floor(i / a.countPerRow));
|
|
130
|
+
j(() => s.default(), (e) => {
|
|
131
|
+
v = S.value, S.value = D(e);
|
|
132
|
+
}), j(() => {
|
|
133
133
|
var e;
|
|
134
|
-
return (e =
|
|
134
|
+
return (e = s.extra) == null ? void 0 : e.call(s);
|
|
135
135
|
}, (e) => {
|
|
136
|
-
|
|
136
|
+
p.value = e;
|
|
137
137
|
});
|
|
138
|
-
const
|
|
139
|
-
const e =
|
|
140
|
-
let
|
|
141
|
-
e.forEach((
|
|
142
|
-
const
|
|
143
|
-
|
|
138
|
+
const X = (e) => $(e) ? (he(e) ? e : [e]).join("") : Date.now(), F = g(() => {
|
|
139
|
+
const e = Ce(v, S.value), t = [], l = [], r = o(w);
|
|
140
|
+
let d = 0;
|
|
141
|
+
e.forEach((c) => {
|
|
142
|
+
const f = c.props;
|
|
143
|
+
(xe(f.hidden) ? !!f.hidden : $(f.hidden)) ? t.push(c) : (d += f.span || r, l.push(c));
|
|
144
144
|
});
|
|
145
|
-
const
|
|
146
|
-
let
|
|
147
|
-
const
|
|
148
|
-
const
|
|
149
|
-
if (
|
|
150
|
-
|
|
145
|
+
const k = i - (d + r) % i, Z = d % i < r, ee = k < r ? i : k, I = i - r * (o(p) && !a.extraInAction ? 2 : 1), te = !a.forceExpand && d > I;
|
|
146
|
+
let P = 0, T = 0;
|
|
147
|
+
const oe = l.map((c, f) => {
|
|
148
|
+
const x = c.props, O = x.span || r;
|
|
149
|
+
if (P += O, !a.forceExpand && o(u) && P > I) {
|
|
150
|
+
t.push(ie(c, {
|
|
151
151
|
hidden: !0
|
|
152
152
|
}));
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
155
|
-
return
|
|
156
|
-
node:
|
|
157
|
-
span:
|
|
158
|
-
key: `ApFormSearchFormItem-${
|
|
155
|
+
return T += O, {
|
|
156
|
+
node: c,
|
|
157
|
+
span: x.span || r,
|
|
158
|
+
key: `ApFormSearchFormItem-${f}-${X(x.name)}-${x._signal}`
|
|
159
159
|
};
|
|
160
|
-
}).filter(Boolean),
|
|
160
|
+
}).filter(Boolean), ae = i - T - r;
|
|
161
161
|
return {
|
|
162
|
-
hideNode:
|
|
163
|
-
nodes:
|
|
164
|
-
defaultExtraSpan:
|
|
165
|
-
actualExtraSpan:
|
|
166
|
-
showCollapse:
|
|
162
|
+
hideNode: n(_, null, [t]),
|
|
163
|
+
nodes: oe,
|
|
164
|
+
defaultExtraSpan: ee,
|
|
165
|
+
actualExtraSpan: ae,
|
|
166
|
+
showCollapse: te,
|
|
167
|
+
lastRowOnlyIncludeActionAndExtra: Z
|
|
167
168
|
};
|
|
168
|
-
}),
|
|
169
|
+
}), Y = g(() => {
|
|
169
170
|
let e;
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
const t = o(F), l = n(R, {
|
|
172
|
+
span: o(w),
|
|
173
|
+
key: "actionWrapper"
|
|
173
174
|
}, {
|
|
174
|
-
default: () => [
|
|
175
|
-
default: () => [
|
|
176
|
-
justify: "space-between"
|
|
175
|
+
default: () => [n(L, null, {
|
|
176
|
+
default: () => [n(M, {
|
|
177
|
+
justify: !o(u) && t.lastRowOnlyIncludeActionAndExtra && !(o(p) && a.extraInAction) ? "flex-end" : "space-between"
|
|
177
178
|
}, {
|
|
178
|
-
default: () => [
|
|
179
|
-
default: () => [
|
|
179
|
+
default: () => [n(de, null, {
|
|
180
|
+
default: () => [n(E, {
|
|
180
181
|
type: "primary",
|
|
181
|
-
onClick:
|
|
182
|
-
loading:
|
|
182
|
+
onClick: K,
|
|
183
|
+
loading: a.submitLoading,
|
|
183
184
|
htmlType: "submit"
|
|
184
185
|
}, {
|
|
185
|
-
default: () => [
|
|
186
|
-
}),
|
|
187
|
-
onClick:
|
|
186
|
+
default: () => [a.searchText || b("ap.apForm.search.search")]
|
|
187
|
+
}), n(E, {
|
|
188
|
+
onClick: Q
|
|
188
189
|
}, {
|
|
189
|
-
default: () => [
|
|
190
|
-
}),
|
|
191
|
-
onClick:
|
|
192
|
-
icon:
|
|
190
|
+
default: () => [a.resetText || b("ap.apForm.search.reset")]
|
|
191
|
+
}), t.showCollapse ? n(E, {
|
|
192
|
+
onClick: J,
|
|
193
|
+
icon: n(me, {
|
|
193
194
|
style: G.value === "aplus" ? "color:#B8C3D1" : "color:#BFBFBF",
|
|
194
|
-
rotate:
|
|
195
|
+
rotate: o(u) ? 90 : -90
|
|
195
196
|
}, null)
|
|
196
197
|
}, null) : null]
|
|
197
|
-
}),
|
|
198
|
+
}), a.extraInAction ? o(p) : null]
|
|
198
199
|
})]
|
|
199
200
|
})]
|
|
200
|
-
}), !
|
|
201
|
-
span:
|
|
201
|
+
}), r = !a.extraInAction && o(p) ? n(R, {
|
|
202
|
+
span: o(u) ? t.actualExtraSpan : t.defaultExtraSpan,
|
|
203
|
+
key: "extraNode"
|
|
202
204
|
}, {
|
|
203
|
-
default: () => [
|
|
204
|
-
default: () => [
|
|
205
|
-
justify: !
|
|
206
|
-
},
|
|
205
|
+
default: () => [n(L, null, {
|
|
206
|
+
default: () => [n(M, {
|
|
207
|
+
justify: !o(u) && (t.defaultExtraSpan === i || t.lastRowOnlyIncludeActionAndExtra) ? "start" : "flex-end"
|
|
208
|
+
}, Be(e = o(p)) ? e : {
|
|
207
209
|
default: () => [e]
|
|
208
210
|
})]
|
|
209
211
|
})]
|
|
210
|
-
}) : null
|
|
212
|
+
}) : null, d = n(R, {
|
|
213
|
+
span: t.defaultExtraSpan
|
|
214
|
+
}, null);
|
|
215
|
+
return !o(u) && t.lastRowOnlyIncludeActionAndExtra ? n(_, null, [r || d, l]) : n(_, null, [l, r]);
|
|
211
216
|
});
|
|
212
|
-
return
|
|
213
|
-
apForm: g(() =>
|
|
214
|
-
}), (e,
|
|
215
|
-
class:
|
|
217
|
+
return W({
|
|
218
|
+
apForm: g(() => o(C))
|
|
219
|
+
}), (e, t) => (m(), y(Fe, ue({
|
|
220
|
+
class: o(U)(),
|
|
216
221
|
ref_key: "apForm",
|
|
217
|
-
ref:
|
|
218
|
-
},
|
|
219
|
-
default: B(() => [(
|
|
222
|
+
ref: C
|
|
223
|
+
}, o(ye)(a, ["collapse", "defaultCollapse", "onUpdate:collapse", "searchText", "resetText", "onSubmit", "onReset", "extraInAction", "forceExpand", "countPerRow"])), {
|
|
224
|
+
default: B(() => [(m(), y(A(F.value.hideNode))), n(o(fe), {
|
|
220
225
|
gutter: 16
|
|
221
226
|
}, {
|
|
222
|
-
default: B(() => [(
|
|
223
|
-
key:
|
|
224
|
-
span:
|
|
227
|
+
default: B(() => [(m(!0), ce(_, null, pe(F.value.nodes, (l) => (m(), y(o(R), {
|
|
228
|
+
key: l.key,
|
|
229
|
+
span: l.span
|
|
225
230
|
}, {
|
|
226
|
-
default: B(() => [(
|
|
231
|
+
default: B(() => [(m(), y(A(l.node)))]),
|
|
227
232
|
_: 2
|
|
228
|
-
}, 1032, ["span"]))), 128)), (
|
|
233
|
+
}, 1032, ["span"]))), 128)), (m(), y(A(Y.value)))]),
|
|
229
234
|
_: 1
|
|
230
235
|
})]),
|
|
231
236
|
_: 1
|
|
@@ -233,5 +238,5 @@ const i = 24, qe = /* @__PURE__ */ ae({
|
|
|
233
238
|
}
|
|
234
239
|
});
|
|
235
240
|
export {
|
|
236
|
-
|
|
241
|
+
ze as default
|
|
237
242
|
};
|
|
@@ -4,7 +4,7 @@ import { ColumnType } from 'ant-design-vue/es/table';
|
|
|
4
4
|
import { RowSelectionReturnType } from './hooks/use-table-row-selection';
|
|
5
5
|
import { SpinSize } from 'ant-design-vue/es/spin/Spin';
|
|
6
6
|
import { VueTypeValidableDef } from '../../node_modules/vue-types';
|
|
7
|
-
import { GetPopupContainer, FilterValue, SorterResult, TableCurrentDataSource, TableLocale, CompareFn, ColumnFilterItem, SortOrder } from 'ant-design-vue/es/table/interface';
|
|
7
|
+
import { GetPopupContainer, FilterValue, SorterResult, TableCurrentDataSource, TableLocale, CompareFn, ColumnFilterItem, SortOrder, TableRowSelection } from 'ant-design-vue/es/table/interface';
|
|
8
8
|
import { RenderExpandIcon, PanelRender, TableComponents, TransformCellText, TableLayout, GetRowKey, TableSticky, RowClassName, GetComponentProps, ColumnType, Key, ExpandedRowRender } from 'ant-design-vue/es/vc-table/interface';
|
|
9
9
|
import { TablePaginationConfig } from 'ant-design-vue';
|
|
10
10
|
import { EllipsisConfig } from 'ant-design-vue/es/typography/Base';
|
|
@@ -672,7 +672,9 @@ declare const _default: <RecordType>(__VLS_props: {
|
|
|
672
672
|
onOpenChange: PropType<(vis: boolean) => void>;
|
|
673
673
|
'onUpdate:open': PropType<(vis: boolean) => void>;
|
|
674
674
|
}>> | undefined;
|
|
675
|
-
rowSelection?: true | ApTableRowSelection<RecordType> |
|
|
675
|
+
rowSelection?: true | ApTableRowSelection<RecordType> | ( TableRowSelection<RecordType> & {
|
|
676
|
+
mode?: "base" | undefined;
|
|
677
|
+
}) | undefined;
|
|
676
678
|
rowClassName?: string | RowClassName<RecordType> | undefined;
|
|
677
679
|
showHeader?: boolean | undefined;
|
|
678
680
|
customRow?: GetComponentProps<RecordType> | undefined;
|
|
@@ -1417,7 +1419,9 @@ declare const _default: <RecordType>(__VLS_props: {
|
|
|
1417
1419
|
onOpenChange: PropType<(vis: boolean) => void>;
|
|
1418
1420
|
'onUpdate:open': PropType<(vis: boolean) => void>;
|
|
1419
1421
|
}>> | undefined;
|
|
1420
|
-
rowSelection?: true | ApTableRowSelection<RecordType> |
|
|
1422
|
+
rowSelection?: true | ApTableRowSelection<RecordType> | ( TableRowSelection<RecordType> & {
|
|
1423
|
+
mode?: "base" | undefined;
|
|
1424
|
+
}) | undefined;
|
|
1421
1425
|
rowClassName?: string | RowClassName<RecordType> | undefined;
|
|
1422
1426
|
showHeader?: boolean | undefined;
|
|
1423
1427
|
customRow?: GetComponentProps<RecordType> | undefined;
|
|
@@ -2166,7 +2170,9 @@ declare const _default: <RecordType>(__VLS_props: {
|
|
|
2166
2170
|
onOpenChange: PropType<(vis: boolean) => void>;
|
|
2167
2171
|
'onUpdate:open': PropType<(vis: boolean) => void>;
|
|
2168
2172
|
}>> | undefined;
|
|
2169
|
-
rowSelection?: true | ApTableRowSelection<RecordType> |
|
|
2173
|
+
rowSelection?: true | ApTableRowSelection<RecordType> | ( TableRowSelection<RecordType> & {
|
|
2174
|
+
mode?: "base" | undefined;
|
|
2175
|
+
}) | undefined;
|
|
2170
2176
|
rowClassName?: string | RowClassName<RecordType> | undefined;
|
|
2171
2177
|
showHeader?: boolean | undefined;
|
|
2172
2178
|
customRow?: GetComponentProps<RecordType> | undefined;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as ne, useSlots as se, computed as s, createVNode as d, mergeProps as p, unref as
|
|
1
|
+
import { defineComponent as ne, useSlots as se, computed as s, createVNode as d, mergeProps as p, unref as l, watch as de, openBlock as c, createElementBlock as y, normalizeClass as F, normalizeStyle as T, createSlots as V, withCtx as f, Fragment as ue, renderList as z, createBlock as ie, resolveDynamicComponent as pe, renderSlot as x, createCommentVNode as D, createElementVNode as K, toDisplayString as ce, normalizeProps as fe, guardReactiveProps as me } from "vue";
|
|
2
2
|
import { Typography as ge, Table as ye, Tooltip as be } from "ant-design-vue";
|
|
3
3
|
import { useToken as Se } from "ant-design-vue/es/theme/internal";
|
|
4
4
|
import { ApForm as he } from "../ap-form/index.mjs";
|
|
5
5
|
import { apTableRenderItemMap as we, noRenderAsFormItemValueList as N, apTableFormItemMap as Ce } from "./constants.mjs";
|
|
6
6
|
import "../config-provider/index.mjs";
|
|
7
7
|
import { useTablePaging as Re } from "./hooks/use-table-paging.mjs";
|
|
8
|
-
import { omit as
|
|
8
|
+
import { omit as j, isUndefined as u, isBoolean as Fe } from "lodash-unified";
|
|
9
9
|
import "./style/ap-table.css";
|
|
10
10
|
import { QuestionCircleOutlined as Te } from "@ant-design/icons-vue";
|
|
11
|
-
import { apColumnToColumn as xe, getTableRenderType as ve, getTableRenderProps as Be, getColumnOrder as
|
|
11
|
+
import { apColumnToColumn as xe, getTableRenderType as ve, getTableRenderProps as Be, getColumnOrder as W, updateFormProps as Pe, getFieldProps as Ie, getPlaceholder as ke } from "./utils.mjs";
|
|
12
12
|
import Le from "./hooks/use-table-content-height.mjs";
|
|
13
13
|
import { getRawDisplayValue as Ee } from "../editable-table/utils.mjs";
|
|
14
14
|
import Oe from "./hooks/use-table-row-selection.mjs";
|
|
@@ -97,7 +97,7 @@ const Ke = {
|
|
|
97
97
|
transformCellText: {},
|
|
98
98
|
columns: {},
|
|
99
99
|
rowSelection: {
|
|
100
|
-
type: Boolean
|
|
100
|
+
type: [Boolean, Object]
|
|
101
101
|
},
|
|
102
102
|
card: {
|
|
103
103
|
type: Boolean,
|
|
@@ -133,10 +133,10 @@ const Ke = {
|
|
|
133
133
|
default: !1
|
|
134
134
|
}
|
|
135
135
|
},
|
|
136
|
-
setup(
|
|
136
|
+
setup(_, {
|
|
137
137
|
expose: A
|
|
138
138
|
}) {
|
|
139
|
-
const a =
|
|
139
|
+
const a = _;
|
|
140
140
|
let v = 0;
|
|
141
141
|
const B = se(), [, M] = Se(), {
|
|
142
142
|
t: q
|
|
@@ -150,20 +150,20 @@ const Ke = {
|
|
|
150
150
|
var t;
|
|
151
151
|
let e = ((t = a.columns) == null ? void 0 : t.filter((o) => !o.hideInTable)) || [];
|
|
152
152
|
return e = e.map((o) => ({
|
|
153
|
-
...
|
|
153
|
+
...j(xe(o), ["ellipsis"]),
|
|
154
154
|
customRender({
|
|
155
|
-
value:
|
|
155
|
+
value: r,
|
|
156
156
|
...n
|
|
157
157
|
}) {
|
|
158
158
|
const C = ve(o), O = we[C], le = Be(o, {
|
|
159
|
-
value:
|
|
159
|
+
value: r,
|
|
160
160
|
...n
|
|
161
161
|
});
|
|
162
|
-
let R = oe(o,
|
|
162
|
+
let R = oe(o, r, d(O, p(le, {
|
|
163
163
|
mode: "read"
|
|
164
164
|
}), null));
|
|
165
165
|
return o.customRender && (R = o.customRender({
|
|
166
|
-
value:
|
|
166
|
+
value: r,
|
|
167
167
|
...n,
|
|
168
168
|
column: o,
|
|
169
169
|
originalNode: R
|
|
@@ -172,24 +172,24 @@ const Ke = {
|
|
|
172
172
|
})), e;
|
|
173
173
|
}), P = s(() => {
|
|
174
174
|
var e, t, o;
|
|
175
|
-
return v++, ((o = (t = (e = a.columns) == null ? void 0 : e.filter((
|
|
176
|
-
let C =
|
|
177
|
-
return
|
|
178
|
-
})) == null ? void 0 : o.map((
|
|
179
|
-
const n = Pe(
|
|
175
|
+
return v++, ((o = (t = (e = a.columns) == null ? void 0 : e.filter((r) => !r.hideInSearch && r.dataIndex && (r.valueType || r.customRenderFormItem) && !N.includes(r.valueType))) == null ? void 0 : t.sort((r, n) => {
|
|
176
|
+
let C = W(r.order);
|
|
177
|
+
return W(n.order) - C;
|
|
178
|
+
})) == null ? void 0 : o.map((r) => {
|
|
179
|
+
const n = Pe(r, Ie(r.fieldProps, {}));
|
|
180
180
|
return {
|
|
181
|
-
...
|
|
181
|
+
...r,
|
|
182
182
|
fieldProps: {
|
|
183
|
-
label:
|
|
184
|
-
name:
|
|
183
|
+
label: r.title,
|
|
184
|
+
name: r.dataIndex,
|
|
185
185
|
...n || {},
|
|
186
186
|
// 格式化placeholder
|
|
187
|
-
placeholder: ke(q,
|
|
187
|
+
placeholder: ke(q, r.valueType, n == null ? void 0 : n.placeholder),
|
|
188
188
|
_signal: v
|
|
189
189
|
}
|
|
190
190
|
};
|
|
191
191
|
})) || [];
|
|
192
|
-
}), Q = s(() =>
|
|
192
|
+
}), Q = s(() => l(S).filter((e) => e.sorter === !0).map((e) => e.dataIndex)), U = s(() => l(S).filter((e) => e.filters && !e.onFilter).map((e) => e.dataIndex)), J = s(() => u(a.dataSource) ? g.value.records : a.dataSource), {
|
|
193
193
|
rowSelection: I,
|
|
194
194
|
selectedRows: k,
|
|
195
195
|
...h
|
|
@@ -206,16 +206,16 @@ const Ke = {
|
|
|
206
206
|
data: g
|
|
207
207
|
} = Re({
|
|
208
208
|
async request(e) {
|
|
209
|
-
var o,
|
|
209
|
+
var o, r;
|
|
210
210
|
!I.value.preserveSelectedRowKeys && u(a.dataSource) && h.clearAll();
|
|
211
211
|
const t = await ((o = a.request) == null ? void 0 : o.call(a, e));
|
|
212
|
-
return (
|
|
212
|
+
return (r = a.onLoad) == null || r.call(a, (t == null ? void 0 : t.data) || []), {
|
|
213
213
|
data: (t == null ? void 0 : t.data) || [],
|
|
214
214
|
total: (t == null ? void 0 : t.total) || 0
|
|
215
215
|
};
|
|
216
216
|
},
|
|
217
|
-
filterFields:
|
|
218
|
-
sortFields:
|
|
217
|
+
filterFields: l(U),
|
|
218
|
+
sortFields: l(Q),
|
|
219
219
|
defaultParams: a.params,
|
|
220
220
|
defaultData: a.defaultData,
|
|
221
221
|
manual: a.manual,
|
|
@@ -225,7 +225,7 @@ const Ke = {
|
|
|
225
225
|
}), Y = s(() => {
|
|
226
226
|
var e;
|
|
227
227
|
return a.scroll ? a.scroll : a.adaptive && (g.value.total > 0 || (e = a.dataSource) != null && e.length) ? {
|
|
228
|
-
y:
|
|
228
|
+
y: l($),
|
|
229
229
|
x: "100%"
|
|
230
230
|
} : {
|
|
231
231
|
x: !0
|
|
@@ -237,22 +237,23 @@ const Ke = {
|
|
|
237
237
|
if ((e = a.columns) != null && e.some((t) => t.ellipsis))
|
|
238
238
|
return "fixed";
|
|
239
239
|
}), ee = s(() => {
|
|
240
|
-
|
|
240
|
+
var r;
|
|
241
|
+
const e = l(m), t = u(a.dataSource) ? e : {
|
|
241
242
|
...e,
|
|
242
243
|
dataSource: a.dataSource,
|
|
243
244
|
onChange: a.onChange
|
|
244
|
-
}, o =
|
|
245
|
+
}, o = l(I);
|
|
245
246
|
return {
|
|
246
247
|
...a,
|
|
247
248
|
...t,
|
|
248
|
-
rowSelection: a.rowSelection ? {
|
|
249
|
+
rowSelection: a.rowSelection === !0 || ((r = a.rowSelection) == null ? void 0 : r.mode) === "internal" ? {
|
|
249
250
|
...o,
|
|
250
251
|
// tips 如果是前端分页,则默认会走缓存
|
|
251
252
|
preserveSelectedRowKeys: u(a.dataSource) ? o.preserveSelectedRowKeys : !0
|
|
252
|
-
} :
|
|
253
|
-
loading: u(a.loading) ?
|
|
254
|
-
pagination: a.pagination === !1 ? !1 :
|
|
255
|
-
scroll:
|
|
253
|
+
} : a.rowSelection,
|
|
254
|
+
loading: u(a.loading) ? l(m).loading : a.loading,
|
|
255
|
+
pagination: a.pagination === !1 ? !1 : l(m).pagination,
|
|
256
|
+
scroll: l(Y)
|
|
256
257
|
};
|
|
257
258
|
}), ae = s(() => [i(), a.card ? null : i("wrapper"), a.adaptive ? i("adaptive") : null].filter(Boolean));
|
|
258
259
|
function oe(e, t, o) {
|
|
@@ -270,13 +271,13 @@ const Ke = {
|
|
|
270
271
|
content: e.ellipsis ? Ee(e, t) : o
|
|
271
272
|
}, null) : o;
|
|
272
273
|
}
|
|
273
|
-
de(() =>
|
|
274
|
+
de(() => l(g).loading, (e) => {
|
|
274
275
|
var t;
|
|
275
276
|
(t = a.onLoadingChange) == null || t.call(a, e);
|
|
276
277
|
});
|
|
277
278
|
function te(e) {
|
|
278
|
-
var t, o,
|
|
279
|
-
(
|
|
279
|
+
var t, o, r;
|
|
280
|
+
(r = (o = (t = w.value) == null ? void 0 : t.apForm) == null ? void 0 : o.setFieldsValue) == null || r.call(o, e);
|
|
280
281
|
}
|
|
281
282
|
function re() {
|
|
282
283
|
var e, t, o;
|
|
@@ -287,26 +288,26 @@ const Ke = {
|
|
|
287
288
|
reset: () => E(),
|
|
288
289
|
setSearchFormValues: te,
|
|
289
290
|
getSearchFormValues: re,
|
|
290
|
-
dataSource: s(() =>
|
|
291
|
+
dataSource: s(() => l(g).records),
|
|
291
292
|
rowSelection: {
|
|
292
|
-
selectedRows: s(() =>
|
|
293
|
+
selectedRows: s(() => l(k)),
|
|
293
294
|
...h
|
|
294
295
|
}
|
|
295
296
|
}), (e, t) => (c(), y("div", {
|
|
296
297
|
class: F(ae.value)
|
|
297
|
-
}, [
|
|
298
|
+
}, [l(u)(e.dataSource) && e.searchForm !== !1 && P.value.length > 0 ? (c(), y("div", {
|
|
298
299
|
key: 0,
|
|
299
|
-
class: F(e.card ?
|
|
300
|
+
class: F(e.card ? l(b)("search-wrapper") : null),
|
|
300
301
|
style: T(e.searchFormWrapperStyle)
|
|
301
|
-
}, [d(
|
|
302
|
+
}, [d(l(he).SearchForm, p(e.searchForm || {}, {
|
|
302
303
|
ref_key: "formRef",
|
|
303
304
|
ref: w,
|
|
304
305
|
"custom-reset": "",
|
|
305
|
-
onSubmit:
|
|
306
|
-
onReset:
|
|
307
|
-
"submit-loading":
|
|
306
|
+
onSubmit: l(L),
|
|
307
|
+
onReset: l(E),
|
|
308
|
+
"submit-loading": l(m).loading
|
|
308
309
|
}), V({
|
|
309
|
-
default: f(() => [(c(!0), y(ue, null, z(P.value, (o) => (c(), ie(pe(o.customRenderFormItem ? o.customRenderFormItem(o) :
|
|
310
|
+
default: f(() => [(c(!0), y(ue, null, z(P.value, (o) => (c(), ie(pe(o.customRenderFormItem ? o.customRenderFormItem(o) : l(Ce)[o.valueType || "text"]), p({
|
|
310
311
|
key: o.dataIndex,
|
|
311
312
|
ref_for: !0
|
|
312
313
|
}, o.fieldProps || {}, {
|
|
@@ -320,36 +321,36 @@ const Ke = {
|
|
|
320
321
|
} : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) : D("", !0), K("div", {
|
|
321
322
|
ref_key: "contentRef",
|
|
322
323
|
ref: G,
|
|
323
|
-
class: F([
|
|
324
|
+
class: F([l(b)("table-wrapper"), e.card ? l(b)("table-wrapper-card") : null]),
|
|
324
325
|
style: T(e.tableWrapperStyle)
|
|
325
326
|
}, [x(e.$slots, "title", p({
|
|
326
|
-
selectedRows:
|
|
327
|
-
}, h)), d(
|
|
328
|
-
class:
|
|
327
|
+
selectedRows: l(k)
|
|
328
|
+
}, h)), d(l(ye), p({
|
|
329
|
+
class: l(H) === "admin" ? l(i)("table-admin") : l(i)("table")
|
|
329
330
|
}, ee.value, {
|
|
330
331
|
"table-layout": Z.value,
|
|
331
|
-
onChange:
|
|
332
|
+
onChange: l(X),
|
|
332
333
|
columns: S.value
|
|
333
334
|
}), V({
|
|
334
335
|
headerCell: f(({
|
|
335
336
|
column: o,
|
|
336
|
-
title:
|
|
337
|
-
}) => [o.tooltip ? (c(), y("span", Ke, [K("span", null, ce(
|
|
337
|
+
title: r
|
|
338
|
+
}) => [o.tooltip ? (c(), y("span", Ke, [K("span", null, ce(r), 1), d(l(be), {
|
|
338
339
|
title: o.tooltip,
|
|
339
340
|
placement: "bottom"
|
|
340
341
|
}, {
|
|
341
|
-
default: f(() => [d(
|
|
342
|
+
default: f(() => [d(l(Te), {
|
|
342
343
|
style: T({
|
|
343
344
|
paddingLeft: "4px",
|
|
344
|
-
color:
|
|
345
|
+
color: l(M).colorPrimary
|
|
345
346
|
})
|
|
346
347
|
}, null, 8, ["style"])]),
|
|
347
348
|
_: 2
|
|
348
349
|
}, 1032, ["title"])])) : D("", !0)]),
|
|
349
350
|
_: 2
|
|
350
|
-
}, [z(
|
|
351
|
-
name:
|
|
352
|
-
fn: f((n) => [x(e.$slots,
|
|
351
|
+
}, [z(l(j)(B, ["title", "searchFormExtra"]), (o, r) => ({
|
|
352
|
+
name: r,
|
|
353
|
+
fn: f((n) => [x(e.$slots, r, fe(me(n || {})))])
|
|
353
354
|
}))]), 1040, ["class", "table-layout", "onChange", "columns"])], 6)], 2));
|
|
354
355
|
}
|
|
355
356
|
});
|
|
@@ -9419,7 +9419,7 @@ export declare const apTableRenderItemMap: {
|
|
|
9419
9419
|
default: string;
|
|
9420
9420
|
};
|
|
9421
9421
|
timezone: {
|
|
9422
|
-
type: PropType<"
|
|
9422
|
+
type: PropType<"RJ" | "PR" | "VD" | "CP" | "BS" | "MS" | "SP" | "DB" | "NY" | "KR" | "CG" | "TM" | "DV" | "SU" | "LA" | "SH" | "ALS">;
|
|
9423
9423
|
};
|
|
9424
9424
|
}>> & {
|
|
9425
9425
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
@@ -9624,7 +9624,7 @@ export declare const apTableRenderItemMap: {
|
|
|
9624
9624
|
default: string;
|
|
9625
9625
|
};
|
|
9626
9626
|
timezone: {
|
|
9627
|
-
type: PropType<"
|
|
9627
|
+
type: PropType<"RJ" | "PR" | "VD" | "CP" | "BS" | "MS" | "SP" | "DB" | "NY" | "KR" | "CG" | "TM" | "DV" | "SU" | "LA" | "SH" | "ALS">;
|
|
9628
9628
|
};
|
|
9629
9629
|
}>> & {
|
|
9630
9630
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
@@ -9861,7 +9861,7 @@ export declare const apTableRenderItemMap: {
|
|
|
9861
9861
|
default: string;
|
|
9862
9862
|
};
|
|
9863
9863
|
timezone: {
|
|
9864
|
-
type: PropType<"
|
|
9864
|
+
type: PropType<"RJ" | "PR" | "VD" | "CP" | "BS" | "MS" | "SP" | "DB" | "NY" | "KR" | "CG" | "TM" | "DV" | "SU" | "LA" | "SH" | "ALS">;
|
|
9865
9865
|
};
|
|
9866
9866
|
}>> & {
|
|
9867
9867
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
@@ -10095,7 +10095,7 @@ export declare const apTableRenderItemMap: {
|
|
|
10095
10095
|
default: string;
|
|
10096
10096
|
};
|
|
10097
10097
|
timezone: {
|
|
10098
|
-
type: PropType<"
|
|
10098
|
+
type: PropType<"RJ" | "PR" | "VD" | "CP" | "BS" | "MS" | "SP" | "DB" | "NY" | "KR" | "CG" | "TM" | "DV" | "SU" | "LA" | "SH" | "ALS">;
|
|
10099
10099
|
};
|
|
10100
10100
|
}>> & {
|
|
10101
10101
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
@@ -10363,7 +10363,7 @@ export declare const apTableRenderItemMap: {
|
|
|
10363
10363
|
default: string;
|
|
10364
10364
|
};
|
|
10365
10365
|
timezone: {
|
|
10366
|
-
type: PropType<"
|
|
10366
|
+
type: PropType<"RJ" | "PR" | "VD" | "CP" | "BS" | "MS" | "SP" | "DB" | "NY" | "KR" | "CG" | "TM" | "DV" | "SU" | "LA" | "SH" | "ALS">;
|
|
10367
10367
|
};
|
|
10368
10368
|
}>> & {
|
|
10369
10369
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
@@ -10576,7 +10576,7 @@ export declare const apTableRenderItemMap: {
|
|
|
10576
10576
|
default: string;
|
|
10577
10577
|
};
|
|
10578
10578
|
timezone: {
|
|
10579
|
-
type: PropType<"
|
|
10579
|
+
type: PropType<"RJ" | "PR" | "VD" | "CP" | "BS" | "MS" | "SP" | "DB" | "NY" | "KR" | "CG" | "TM" | "DV" | "SU" | "LA" | "SH" | "ALS">;
|
|
10580
10580
|
};
|
|
10581
10581
|
}>> & {
|
|
10582
10582
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
@@ -10826,7 +10826,7 @@ export declare const apTableRenderItemMap: {
|
|
|
10826
10826
|
default: string;
|
|
10827
10827
|
};
|
|
10828
10828
|
timezone: {
|
|
10829
|
-
type: PropType<"
|
|
10829
|
+
type: PropType<"RJ" | "PR" | "VD" | "CP" | "BS" | "MS" | "SP" | "DB" | "NY" | "KR" | "CG" | "TM" | "DV" | "SU" | "LA" | "SH" | "ALS">;
|
|
10830
10830
|
};
|
|
10831
10831
|
}>> & {
|
|
10832
10832
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
@@ -11073,7 +11073,7 @@ export declare const apTableRenderItemMap: {
|
|
|
11073
11073
|
default: string;
|
|
11074
11074
|
};
|
|
11075
11075
|
timezone: {
|
|
11076
|
-
type: PropType<"
|
|
11076
|
+
type: PropType<"RJ" | "PR" | "VD" | "CP" | "BS" | "MS" | "SP" | "DB" | "NY" | "KR" | "CG" | "TM" | "DV" | "SU" | "LA" | "SH" | "ALS">;
|
|
11077
11077
|
};
|
|
11078
11078
|
}>> & {
|
|
11079
11079
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
@@ -46,7 +46,7 @@ export interface RowSelectionReturnType<RecordType = any> {
|
|
|
46
46
|
*/
|
|
47
47
|
toggleSelect: (item: RecordType) => void;
|
|
48
48
|
}
|
|
49
|
-
type RowSelectionParams<T> = ApTableRowSelection<T> & {
|
|
49
|
+
type RowSelectionParams<T> = Omit<ApTableRowSelection<T>, 'mode'> & {
|
|
50
50
|
/**
|
|
51
51
|
* 数据源(如果是后端分页,则表示当页数据,否则是全量数据)
|
|
52
52
|
*/
|
|
@@ -65,7 +65,9 @@ export type ExtraProColumnType<T> = Omit<ColumnType<T>, 'children' | 'filters' |
|
|
|
65
65
|
multiple?: number;
|
|
66
66
|
};
|
|
67
67
|
};
|
|
68
|
-
export type ApTableRowSelection<RecordType = any> = Omit<TableRowSelection<RecordType>, 'selectedRowKeys' | 'onChange' | 'onSelect' | 'onSelectAll' | 'onSelectInvert' | 'onSelectNone'
|
|
68
|
+
export type ApTableRowSelection<RecordType = any> = Omit<TableRowSelection<RecordType>, 'selectedRowKeys' | 'onChange' | 'onSelect' | 'onSelectAll' | 'onSelectInvert' | 'onSelectNone'> & {
|
|
69
|
+
mode: 'internal';
|
|
70
|
+
};
|
|
69
71
|
export type ApColumnType<RecordType = any, ValueType extends ApTableValueTypes = ApTableValueTypes> = ValueType extends ApTableValueTypes ? ExtraProColumnType<RecordType> & {
|
|
70
72
|
children?: ApColumnType<RecordType, ValueType>[];
|
|
71
73
|
/**
|
|
@@ -151,7 +153,9 @@ export type ApTableProps<RecordType = any, ParamsType = any> = Omit<TableProps<R
|
|
|
151
153
|
/**
|
|
152
154
|
* 行选中配置
|
|
153
155
|
*/
|
|
154
|
-
rowSelection?: true | ApTableRowSelection<RecordType
|
|
156
|
+
rowSelection?: true | ApTableRowSelection<RecordType> | (TableRowSelection<RecordType> & {
|
|
157
|
+
mode?: 'base';
|
|
158
|
+
});
|
|
155
159
|
/**
|
|
156
160
|
* 是否启用卡片样式
|
|
157
161
|
*/
|
|
@@ -15,7 +15,7 @@ const K = { key: 0 }, P = ["onClick"], le = /* @__PURE__ */ z({
|
|
|
15
15
|
tipTitle: { default: "查看详情" },
|
|
16
16
|
mapLabel: {},
|
|
17
17
|
separator: { default: "|" },
|
|
18
|
-
rows: { default:
|
|
18
|
+
rows: { default: 2 }
|
|
19
19
|
},
|
|
20
20
|
emits: ["choose", "expand"],
|
|
21
21
|
setup(g, { expose: b, emit: C }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i=require("ant-design-vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i=require("ant-design-vue"),d=require("lodash-unified"),k=require("../constant.js"),s=require("./helper.js");require("../../config-provider/index.js");require("../style/ap-form-item-group.css");const y=require("../../utils/index.js"),C=require("../../config-provider/hooks/use-namespace.js");function q(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Object]"&&!e.isVNode(o)}const _=e.defineComponent({name:"ApFormItemGroup",__name:"index",props:{align:{},justify:{},prefixCls:{},gutter:{default:16},wrap:{type:Boolean,default:void 0},countPerRow:{default:3}},setup(o){const{b:u}=C.useNamespace("ap-form-item-group"),{countPerRow:p,...f}=o,a=e.useSlots();e.watch(()=>a.default(),n=>{c.value=s.genRealChildren(n)});const c=e.shallowRef(s.genRealChildren(a.default())),m=e.computed(()=>e.unref(c).map((n,l)=>{const t=n.props,r=d.pick(t,k.apFormItemColPropKeys),g=r!=null&&r.span?{}:s.buildColSpan(p),h=d.isBoolean(t.hidden)?!!t.hidden:y.isDef(t.hidden);return{key:`${l}-${s.getStringName(t.name)}`,node:e.createVNode(i.Col,e.mergeProps(g,r,{class:h?u("col-hidden"):""}),q(n)?n:{default:()=>[n]})}}));return(n,l)=>(e.openBlock(),e.createBlock(e.unref(i.Row),e.mergeProps({class:e.unref(u)()},f),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,t=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.node),{key:t.key}))),128))]),_:1},16,["class"]))}});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"),r=require("ant-design-vue");require("../ap-form.vue.js");require("../ap-form-item.vue2.js");require("../../hooks/index.js");const b=require("../ap-form-item-group/helper.js"),J=require("@ant-design/icons-vue");require("../../config-provider/index.js");require("../style/search-form.css");const g=require("lodash-unified"),w=require("../../utils/index.js"),K=require("./utils.js"),Q=require("../../hooks/useControllableValue.js"),X=require("../../config-provider/hooks/use-namespace.js"),Y=require("../../config-provider/hooks/use-global-config.js"),Z=require("../../config-provider/hooks/use-locale.js"),q=require("../ap-form-item.vue.js"),ee=require("../ap-form.vue2.js");function te(m){return typeof m=="function"||Object.prototype.toString.call(m)==="[object Object]"&&!e.isVNode(m)}const s=24,ne=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},onValuesChange:{},onFieldsChange:{},onFinish:{},onFinishFailed:{},onValidate:{},initialValues:{},collapse:{type:Boolean,default:void 0},defaultCollapse:{type:Boolean,default:!1},"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}},emits:["update:collapse"],setup(m,{expose:A,emit:E}){var F;const u=e.useSlots(),a=m,I=E,{value:c,updateValue:P}=Q.useControllableValue(a,I,{valuePropName:"collapse",defaultValuePropName:"defaultCollapse"}),{b:T}=X.useNamespace("ap-form-search-form"),O=Y.useGlobalConfig("uiMode"),{t:y}=Z.useLocale(),x=e.ref();function D(){P(!e.unref(c))}function M(){var t,n;(n=(t=x.value)==null?void 0:t.validateFields())==null||n.then(a.onSubmit)}function j(){var t,n,o;a.customReset||(n=(t=x.value)==null?void 0:t.resetFields)==null||n.call(t),(o=a.onReset)==null||o.call(a)}let N=[];const C=e.shallowRef(b.genRealChildren(u.default())),d=e.shallowRef((F=u.extra)==null?void 0:F.call(u)),B=e.computed(()=>Math.floor(s/a.countPerRow));e.watch(()=>u.default(),t=>{N=C.value,C.value=b.genRealChildren(t)}),e.watch(()=>{var t;return(t=u.extra)==null?void 0:t.call(u)},t=>{d.value=t});const L=t=>w.isDef(t)?(g.isArray(t)?t:[t]).join(""):Date.now(),_=e.computed(()=>{const t=K.diffFormItem(N,C.value),n=[],o=[],l=e.unref(B);let p=0;t.forEach(i=>{const f=i.props;(g.isBoolean(f.hidden)?!!f.hidden:w.isDef(f.hidden))?n.push(i):(p+=f.span||l,o.push(i))});const v=s-(p+l)%s,U=p%s<l,$=v<l?s:v,V=s-l*(e.unref(d)&&!a.extraInAction?2:1),z=!a.forceExpand&&p>V;let R=0,S=0;const G=o.map((i,f)=>{const h=i.props,k=h.span||l;if(R+=k,!a.forceExpand&&e.unref(c)&&R>V){n.push(e.cloneVNode(i,{hidden:!0}));return}return S+=k,{node:i,span:h.span||l,key:`ApFormSearchFormItem-${f}-${L(h.name)}-${h._signal}`}}).filter(Boolean),H=s-S-l;return{hideNode:e.createVNode(e.Fragment,null,[n]),nodes:G,defaultExtraSpan:$,actualExtraSpan:H,showCollapse:z,lastRowOnlyIncludeActionAndExtra:U}}),W=e.computed(()=>{let t;const n=e.unref(_),o=e.createVNode(r.Col,{span:e.unref(B),key:"actionWrapper"},{default:()=>[e.createVNode(q.default,null,{default:()=>[e.createVNode(r.Flex,{justify:!e.unref(c)&&n.lastRowOnlyIncludeActionAndExtra&&!(e.unref(d)&&a.extraInAction)?"flex-end":"space-between"},{default:()=>[e.createVNode(r.Space,null,{default:()=>[e.createVNode(r.Button,{type:"primary",onClick:M,loading:a.submitLoading,htmlType:"submit"},{default:()=>[a.searchText||y("ap.apForm.search.search")]}),e.createVNode(r.Button,{onClick:j},{default:()=>[a.resetText||y("ap.apForm.search.reset")]}),n.showCollapse?e.createVNode(r.Button,{onClick:D,icon:e.createVNode(J.DoubleRightOutlined,{style:O.value==="aplus"?"color:#B8C3D1":"color:#BFBFBF",rotate:e.unref(c)?90:-90},null)},null):null]}),a.extraInAction?e.unref(d):null]})]})]}),l=!a.extraInAction&&e.unref(d)?e.createVNode(r.Col,{span:e.unref(c)?n.actualExtraSpan:n.defaultExtraSpan,key:"extraNode"},{default:()=>[e.createVNode(q.default,null,{default:()=>[e.createVNode(r.Flex,{justify:!e.unref(c)&&(n.defaultExtraSpan===s||n.lastRowOnlyIncludeActionAndExtra)?"start":"flex-end"},te(t=e.unref(d))?t:{default:()=>[t]})]})]}):null,p=e.createVNode(r.Col,{span:n.defaultExtraSpan},null);return!e.unref(c)&&n.lastRowOnlyIncludeActionAndExtra?e.createVNode(e.Fragment,null,[l||p,o]):e.createVNode(e.Fragment,null,[o,l])});return A({apForm:e.computed(()=>e.unref(x))}),(t,n)=>(e.openBlock(),e.createBlock(ee.default,e.mergeProps({class:e.unref(T)(),ref_key:"apForm",ref:x},e.unref(g.omit)(a,["collapse","defaultCollapse","onUpdate:collapse","searchText","resetText","onSubmit","onReset","extraInAction","forceExpand","countPerRow"])),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(_.value.hideNode))),e.createVNode(e.unref(r.Row),{gutter:16},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value.nodes,o=>(e.openBlock(),e.createBlock(e.unref(r.Col),{key:o.key,span:o.span},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.node)))]),_:2},1032,["span"]))),128)),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(W.value)))]),_:1})]),_:1},16,["class"]))}});exports.default=ne;
|
|
@@ -4,7 +4,7 @@ import { ColumnType } from 'ant-design-vue/es/table';
|
|
|
4
4
|
import { RowSelectionReturnType } from './hooks/use-table-row-selection';
|
|
5
5
|
import { SpinSize } from 'ant-design-vue/es/spin/Spin';
|
|
6
6
|
import { VueTypeValidableDef } from '../../node_modules/vue-types';
|
|
7
|
-
import { GetPopupContainer, FilterValue, SorterResult, TableCurrentDataSource, TableLocale, CompareFn, ColumnFilterItem, SortOrder } from 'ant-design-vue/es/table/interface';
|
|
7
|
+
import { GetPopupContainer, FilterValue, SorterResult, TableCurrentDataSource, TableLocale, CompareFn, ColumnFilterItem, SortOrder, TableRowSelection } from 'ant-design-vue/es/table/interface';
|
|
8
8
|
import { RenderExpandIcon, PanelRender, TableComponents, TransformCellText, TableLayout, GetRowKey, TableSticky, RowClassName, GetComponentProps, ColumnType, Key, ExpandedRowRender } from 'ant-design-vue/es/vc-table/interface';
|
|
9
9
|
import { TablePaginationConfig } from 'ant-design-vue';
|
|
10
10
|
import { EllipsisConfig } from 'ant-design-vue/es/typography/Base';
|
|
@@ -672,7 +672,9 @@ declare const _default: <RecordType>(__VLS_props: {
|
|
|
672
672
|
onOpenChange: PropType<(vis: boolean) => void>;
|
|
673
673
|
'onUpdate:open': PropType<(vis: boolean) => void>;
|
|
674
674
|
}>> | undefined;
|
|
675
|
-
rowSelection?: true | ApTableRowSelection<RecordType> |
|
|
675
|
+
rowSelection?: true | ApTableRowSelection<RecordType> | ( TableRowSelection<RecordType> & {
|
|
676
|
+
mode?: "base" | undefined;
|
|
677
|
+
}) | undefined;
|
|
676
678
|
rowClassName?: string | RowClassName<RecordType> | undefined;
|
|
677
679
|
showHeader?: boolean | undefined;
|
|
678
680
|
customRow?: GetComponentProps<RecordType> | undefined;
|
|
@@ -1417,7 +1419,9 @@ declare const _default: <RecordType>(__VLS_props: {
|
|
|
1417
1419
|
onOpenChange: PropType<(vis: boolean) => void>;
|
|
1418
1420
|
'onUpdate:open': PropType<(vis: boolean) => void>;
|
|
1419
1421
|
}>> | undefined;
|
|
1420
|
-
rowSelection?: true | ApTableRowSelection<RecordType> |
|
|
1422
|
+
rowSelection?: true | ApTableRowSelection<RecordType> | ( TableRowSelection<RecordType> & {
|
|
1423
|
+
mode?: "base" | undefined;
|
|
1424
|
+
}) | undefined;
|
|
1421
1425
|
rowClassName?: string | RowClassName<RecordType> | undefined;
|
|
1422
1426
|
showHeader?: boolean | undefined;
|
|
1423
1427
|
customRow?: GetComponentProps<RecordType> | undefined;
|
|
@@ -2166,7 +2170,9 @@ declare const _default: <RecordType>(__VLS_props: {
|
|
|
2166
2170
|
onOpenChange: PropType<(vis: boolean) => void>;
|
|
2167
2171
|
'onUpdate:open': PropType<(vis: boolean) => void>;
|
|
2168
2172
|
}>> | undefined;
|
|
2169
|
-
rowSelection?: true | ApTableRowSelection<RecordType> |
|
|
2173
|
+
rowSelection?: true | ApTableRowSelection<RecordType> | ( TableRowSelection<RecordType> & {
|
|
2174
|
+
mode?: "base" | undefined;
|
|
2175
|
+
}) | undefined;
|
|
2170
2176
|
rowClassName?: string | RowClassName<RecordType> | undefined;
|
|
2171
2177
|
showHeader?: boolean | undefined;
|
|
2172
2178
|
customRow?: GetComponentProps<RecordType> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("ant-design-vue"),H=require("ant-design-vue/es/theme/internal"),G=require("../ap-form/index.js"),p=require("./constants.js");require("../config-provider/index.js");const Q=require("./hooks/use-table-paging.js"),s=require("lodash-unified");require("./style/ap-table.css");const J=require("@ant-design/icons-vue"),u=require("./utils.js"),X=require("./hooks/use-table-content-height.js"),Y=require("../editable-table/utils.js"),Z=require("./hooks/use-table-row-selection.js"),ee=require("../config-provider/hooks/use-locale.js"),te=require("../config-provider/hooks/use-namespace.js"),ae=require("../config-provider/hooks/use-global-config.js"),re={key:0},oe=e.defineComponent({name:"ApTable",__name:"ap-table",props:{dropdownPrefixCls:{},loading:{type:[Boolean,Object],default:void 0},bordered:{type:Boolean,default:!1},locale:{},onChange:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{default:()=>["ascend","descend"]},showSorterTooltip:{type:[Boolean,Object],default:!0},prefixCls:{},rowKey:{default:"key"},tableLayout:{},rowClassName:{},title:{},footer:{},id:{},showHeader:{type:Boolean,default:!0},components:{},customRow:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean],default:!1},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean,default:!1},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean,default:!1},indentSize:{default:15},expandIconColumnIndex:{},showExpandColumn:{type:Boolean,default:!0},expandedRowClassName:{},childrenColumnName:{default:"children"},rowExpandable:{},sticky:{type:[Boolean,Object]},transformCellText:{},columns:{},rowSelection:{type:Boolean},card:{type:Boolean,default:!1},params:{},searchFormRender:{},request:{},onLoad:{},defaultData:{},dataSource:{},onLoadingChange:{},searchForm:{type:[Boolean,Object],default:void 0},beforeSearchSubmit:{},pagination:{type:[Boolean,Object],default:void 0},searchFormWrapperStyle:{},tableWrapperStyle:{},manual:{type:Boolean,default:!1},size:{default:"middle"},adaptive:{type:Boolean,default:!1}},setup(v,{expose:k}){const a=v;let w=0;const C=e.useSlots(),[,q]=H.useToken(),{t:I}=ee.useLocale(),{e:f,b:d}=te.useNamespace("ap-table"),V=ae.useGlobalConfig("uiMode","aplus"),{height:N,contentRef:E}=X.default(),m=e.computed(()=>{var o;let t=((o=a.columns)==null?void 0:o.filter(r=>!r.hideInTable))||[];return t=t.map(r=>({...s.omit(u.apColumnToColumn(r),["ellipsis"]),customRender({value:n,...l}){const S=u.getTableRenderType(r),P=p.apTableRenderItemMap[S],$=u.getTableRenderProps(r,{value:n,...l});let b=A(r,n,e.createVNode(P,e.mergeProps($,{mode:"read"}),null));return r.customRender&&(b=r.customRender({value:n,...l,column:r,originalNode:b})),b}})),t}),R=e.computed(()=>{var t,o,r;return w++,((r=(o=(t=a.columns)==null?void 0:t.filter(n=>!n.hideInSearch&&n.dataIndex&&(n.valueType||n.customRenderFormItem)&&!p.noRenderAsFormItemValueList.includes(n.valueType)))==null?void 0:o.sort((n,l)=>{let S=u.getColumnOrder(n.order);return u.getColumnOrder(l.order)-S}))==null?void 0:r.map(n=>{const l=u.updateFormProps(n,u.getFieldProps(n.fieldProps,{}));return{...n,fieldProps:{label:n.title,name:n.dataIndex,...l||{},placeholder:u.getPlaceholder(I,n.valueType,l==null?void 0:l.placeholder),_signal:w}}}))||[]}),L=e.computed(()=>e.unref(m).filter(t=>t.sorter===!0).map(t=>t.dataIndex)),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("ant-design-vue"),H=require("ant-design-vue/es/theme/internal"),G=require("../ap-form/index.js"),p=require("./constants.js");require("../config-provider/index.js");const Q=require("./hooks/use-table-paging.js"),s=require("lodash-unified");require("./style/ap-table.css");const J=require("@ant-design/icons-vue"),u=require("./utils.js"),X=require("./hooks/use-table-content-height.js"),Y=require("../editable-table/utils.js"),Z=require("./hooks/use-table-row-selection.js"),ee=require("../config-provider/hooks/use-locale.js"),te=require("../config-provider/hooks/use-namespace.js"),ae=require("../config-provider/hooks/use-global-config.js"),re={key:0},oe=e.defineComponent({name:"ApTable",__name:"ap-table",props:{dropdownPrefixCls:{},loading:{type:[Boolean,Object],default:void 0},bordered:{type:Boolean,default:!1},locale:{},onChange:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{default:()=>["ascend","descend"]},showSorterTooltip:{type:[Boolean,Object],default:!0},prefixCls:{},rowKey:{default:"key"},tableLayout:{},rowClassName:{},title:{},footer:{},id:{},showHeader:{type:Boolean,default:!0},components:{},customRow:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean],default:!1},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean,default:!1},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean,default:!1},indentSize:{default:15},expandIconColumnIndex:{},showExpandColumn:{type:Boolean,default:!0},expandedRowClassName:{},childrenColumnName:{default:"children"},rowExpandable:{},sticky:{type:[Boolean,Object]},transformCellText:{},columns:{},rowSelection:{type:[Boolean,Object]},card:{type:Boolean,default:!1},params:{},searchFormRender:{},request:{},onLoad:{},defaultData:{},dataSource:{},onLoadingChange:{},searchForm:{type:[Boolean,Object],default:void 0},beforeSearchSubmit:{},pagination:{type:[Boolean,Object],default:void 0},searchFormWrapperStyle:{},tableWrapperStyle:{},manual:{type:Boolean,default:!1},size:{default:"middle"},adaptive:{type:Boolean,default:!1}},setup(v,{expose:k}){const a=v;let w=0;const C=e.useSlots(),[,q]=H.useToken(),{t:I}=ee.useLocale(),{e:f,b:d}=te.useNamespace("ap-table"),V=ae.useGlobalConfig("uiMode","aplus"),{height:N,contentRef:E}=X.default(),m=e.computed(()=>{var o;let t=((o=a.columns)==null?void 0:o.filter(r=>!r.hideInTable))||[];return t=t.map(r=>({...s.omit(u.apColumnToColumn(r),["ellipsis"]),customRender({value:n,...l}){const S=u.getTableRenderType(r),P=p.apTableRenderItemMap[S],$=u.getTableRenderProps(r,{value:n,...l});let b=A(r,n,e.createVNode(P,e.mergeProps($,{mode:"read"}),null));return r.customRender&&(b=r.customRender({value:n,...l,column:r,originalNode:b})),b}})),t}),R=e.computed(()=>{var t,o,r;return w++,((r=(o=(t=a.columns)==null?void 0:t.filter(n=>!n.hideInSearch&&n.dataIndex&&(n.valueType||n.customRenderFormItem)&&!p.noRenderAsFormItemValueList.includes(n.valueType)))==null?void 0:o.sort((n,l)=>{let S=u.getColumnOrder(n.order);return u.getColumnOrder(l.order)-S}))==null?void 0:r.map(n=>{const l=u.updateFormProps(n,u.getFieldProps(n.fieldProps,{}));return{...n,fieldProps:{label:n.title,name:n.dataIndex,...l||{},placeholder:u.getPlaceholder(I,n.valueType,l==null?void 0:l.placeholder),_signal:w}}}))||[]}),L=e.computed(()=>e.unref(m).filter(t=>t.sorter===!0).map(t=>t.dataIndex)),O=e.computed(()=>e.unref(m).filter(t=>t.filters&&!t.onFilter).map(t=>t.dataIndex)),z=e.computed(()=>s.isUndefined(a.dataSource)?c.value.records:a.dataSource),{rowSelection:F,selectedRows:x,...g}=Z.default({...a.rowSelection===!0?{}:a.rowSelection,rowKey:a.rowKey,dataSource:z}),{formRef:y,submit:T,reset:B,tableProps:i,handleTableChange:D,data:c}=Q.useTablePaging({async request(t){var r,n;!F.value.preserveSelectedRowKeys&&s.isUndefined(a.dataSource)&&g.clearAll();const o=await((r=a.request)==null?void 0:r.call(a,t));return(n=a.onLoad)==null||n.call(a,(o==null?void 0:o.data)||[]),{data:(o==null?void 0:o.data)||[],total:(o==null?void 0:o.total)||0}},filterFields:e.unref(O),sortFields:e.unref(L),defaultParams:a.params,defaultData:a.defaultData,manual:a.manual,defaultCurrent:a.pagination?a.pagination.defaultCurrent:void 0,defaultPageSize:a.pagination?a.pagination.defaultPageSize:void 0,formatParams:a.beforeSearchSubmit}),K=e.computed(()=>{var t;return a.scroll?a.scroll:a.adaptive&&(c.value.total>0||(t=a.dataSource)!=null&&t.length)?{y:e.unref(N),x:"100%"}:{x:!0}}),_=e.computed(()=>{var t;if(a.tableLayout)return a.tableLayout;if((t=a.columns)!=null&&t.some(o=>o.ellipsis))return"fixed"}),j=e.computed(()=>{var n;const t=e.unref(i),o=s.isUndefined(a.dataSource)?t:{...t,dataSource:a.dataSource,onChange:a.onChange},r=e.unref(F);return{...a,...o,rowSelection:a.rowSelection===!0||((n=a.rowSelection)==null?void 0:n.mode)==="internal"?{...r,preserveSelectedRowKeys:s.isUndefined(a.dataSource)?r.preserveSelectedRowKeys:!0}:a.rowSelection,loading:s.isUndefined(a.loading)?e.unref(i).loading:a.loading,pagination:a.pagination===!1?!1:e.unref(i).pagination,scroll:e.unref(K)}}),U=e.computed(()=>[d(),a.card?null:d("wrapper"),a.adaptive?d("adaptive"):null].filter(Boolean));function A(t,o,r){return p.noRenderAsFormItemValueList.includes(t.valueType)?r:t.copyable||t.ellipsis?e.createVNode(h.Typography.Paragraph,{copyable:t.copyable?{text:o,tooltip:!1}:!1,ellipsis:t.ellipsis?s.isBoolean(t.ellipsis)?{tooltip:o}:{...t.ellipsis,tooltip:o}:!1,content:t.ellipsis?Y.getRawDisplayValue(t,o):r},null):r}e.watch(()=>e.unref(c).loading,t=>{var o;(o=a.onLoadingChange)==null||o.call(a,t)});function M(t){var o,r,n;(n=(r=(o=y.value)==null?void 0:o.apForm)==null?void 0:r.setFieldsValue)==null||n.call(r,t)}function W(){var t,o,r;return(r=(o=(t=y.value)==null?void 0:t.apForm)==null?void 0:o.getFieldsValue)==null?void 0:r.call(o,!0)}return k({submit:()=>T(),reset:()=>B(),setSearchFormValues:M,getSearchFormValues:W,dataSource:e.computed(()=>e.unref(c).records),rowSelection:{selectedRows:e.computed(()=>e.unref(x)),...g}}),(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(U.value)},[e.unref(s.isUndefined)(t.dataSource)&&t.searchForm!==!1&&R.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.card?e.unref(f)("search-wrapper"):null),style:e.normalizeStyle(t.searchFormWrapperStyle)},[e.createVNode(e.unref(G.ApForm).SearchForm,e.mergeProps(t.searchForm||{},{ref_key:"formRef",ref:y,"custom-reset":"",onSubmit:e.unref(T),onReset:e.unref(B),"submit-loading":e.unref(i).loading}),e.createSlots({default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,r=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.customRenderFormItem?r.customRenderFormItem(r):e.unref(p.apTableFormItemMap)[r.valueType||"text"]),e.mergeProps({key:r.dataIndex,ref_for:!0},r.fieldProps||{},{span:r.span}),null,16,["span"]))),128))]),_:2},[C.searchFormExtra?{name:"extra",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"searchFormExtra")]),key:"0"}:void 0]),1040,["onSubmit","onReset","submit-loading"])],6)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"contentRef",ref:E,class:e.normalizeClass([e.unref(f)("table-wrapper"),t.card?e.unref(f)("table-wrapper-card"):null]),style:e.normalizeStyle(t.tableWrapperStyle)},[e.renderSlot(t.$slots,"title",e.mergeProps({selectedRows:e.unref(x)},g)),e.createVNode(e.unref(h.Table),e.mergeProps({class:e.unref(V)==="admin"?e.unref(d)("table-admin"):e.unref(d)("table")},j.value,{"table-layout":_.value,onChange:e.unref(D),columns:m.value}),e.createSlots({headerCell:e.withCtx(({column:r,title:n})=>[r.tooltip?(e.openBlock(),e.createElementBlock("span",re,[e.createElementVNode("span",null,e.toDisplayString(n),1),e.createVNode(e.unref(h.Tooltip),{title:r.tooltip,placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(J.QuestionCircleOutlined),{style:e.normalizeStyle({paddingLeft:"4px",color:e.unref(q).colorPrimary})},null,8,["style"])]),_:2},1032,["title"])])):e.createCommentVNode("",!0)]),_:2},[e.renderList(e.unref(s.omit)(C,["title","searchFormExtra"]),(r,n)=>({name:n,fn:e.withCtx(l=>[e.renderSlot(t.$slots,n,e.normalizeProps(e.guardReactiveProps(l||{})))])}))]),1040,["class","table-layout","onChange","columns"])],6)],2))}});exports.default=oe;
|
|
@@ -9419,7 +9419,7 @@ export declare const apTableRenderItemMap: {
|
|
|
9419
9419
|
default: string;
|
|
9420
9420
|
};
|
|
9421
9421
|
timezone: {
|
|
9422
|
-
type: PropType<"
|
|
9422
|
+
type: PropType<"RJ" | "PR" | "VD" | "CP" | "BS" | "MS" | "SP" | "DB" | "NY" | "KR" | "CG" | "TM" | "DV" | "SU" | "LA" | "SH" | "ALS">;
|
|
9423
9423
|
};
|
|
9424
9424
|
}>> & {
|
|
9425
9425
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
@@ -9624,7 +9624,7 @@ export declare const apTableRenderItemMap: {
|
|
|
9624
9624
|
default: string;
|
|
9625
9625
|
};
|
|
9626
9626
|
timezone: {
|
|
9627
|
-
type: PropType<"
|
|
9627
|
+
type: PropType<"RJ" | "PR" | "VD" | "CP" | "BS" | "MS" | "SP" | "DB" | "NY" | "KR" | "CG" | "TM" | "DV" | "SU" | "LA" | "SH" | "ALS">;
|
|
9628
9628
|
};
|
|
9629
9629
|
}>> & {
|
|
9630
9630
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
@@ -9861,7 +9861,7 @@ export declare const apTableRenderItemMap: {
|
|
|
9861
9861
|
default: string;
|
|
9862
9862
|
};
|
|
9863
9863
|
timezone: {
|
|
9864
|
-
type: PropType<"
|
|
9864
|
+
type: PropType<"RJ" | "PR" | "VD" | "CP" | "BS" | "MS" | "SP" | "DB" | "NY" | "KR" | "CG" | "TM" | "DV" | "SU" | "LA" | "SH" | "ALS">;
|
|
9865
9865
|
};
|
|
9866
9866
|
}>> & {
|
|
9867
9867
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
@@ -10095,7 +10095,7 @@ export declare const apTableRenderItemMap: {
|
|
|
10095
10095
|
default: string;
|
|
10096
10096
|
};
|
|
10097
10097
|
timezone: {
|
|
10098
|
-
type: PropType<"
|
|
10098
|
+
type: PropType<"RJ" | "PR" | "VD" | "CP" | "BS" | "MS" | "SP" | "DB" | "NY" | "KR" | "CG" | "TM" | "DV" | "SU" | "LA" | "SH" | "ALS">;
|
|
10099
10099
|
};
|
|
10100
10100
|
}>> & {
|
|
10101
10101
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
@@ -10363,7 +10363,7 @@ export declare const apTableRenderItemMap: {
|
|
|
10363
10363
|
default: string;
|
|
10364
10364
|
};
|
|
10365
10365
|
timezone: {
|
|
10366
|
-
type: PropType<"
|
|
10366
|
+
type: PropType<"RJ" | "PR" | "VD" | "CP" | "BS" | "MS" | "SP" | "DB" | "NY" | "KR" | "CG" | "TM" | "DV" | "SU" | "LA" | "SH" | "ALS">;
|
|
10367
10367
|
};
|
|
10368
10368
|
}>> & {
|
|
10369
10369
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
@@ -10576,7 +10576,7 @@ export declare const apTableRenderItemMap: {
|
|
|
10576
10576
|
default: string;
|
|
10577
10577
|
};
|
|
10578
10578
|
timezone: {
|
|
10579
|
-
type: PropType<"
|
|
10579
|
+
type: PropType<"RJ" | "PR" | "VD" | "CP" | "BS" | "MS" | "SP" | "DB" | "NY" | "KR" | "CG" | "TM" | "DV" | "SU" | "LA" | "SH" | "ALS">;
|
|
10580
10580
|
};
|
|
10581
10581
|
}>> & {
|
|
10582
10582
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
@@ -10826,7 +10826,7 @@ export declare const apTableRenderItemMap: {
|
|
|
10826
10826
|
default: string;
|
|
10827
10827
|
};
|
|
10828
10828
|
timezone: {
|
|
10829
|
-
type: PropType<"
|
|
10829
|
+
type: PropType<"RJ" | "PR" | "VD" | "CP" | "BS" | "MS" | "SP" | "DB" | "NY" | "KR" | "CG" | "TM" | "DV" | "SU" | "LA" | "SH" | "ALS">;
|
|
10830
10830
|
};
|
|
10831
10831
|
}>> & {
|
|
10832
10832
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
@@ -11073,7 +11073,7 @@ export declare const apTableRenderItemMap: {
|
|
|
11073
11073
|
default: string;
|
|
11074
11074
|
};
|
|
11075
11075
|
timezone: {
|
|
11076
|
-
type: PropType<"
|
|
11076
|
+
type: PropType<"RJ" | "PR" | "VD" | "CP" | "BS" | "MS" | "SP" | "DB" | "NY" | "KR" | "CG" | "TM" | "DV" | "SU" | "LA" | "SH" | "ALS">;
|
|
11077
11077
|
};
|
|
11078
11078
|
}>> & {
|
|
11079
11079
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
@@ -46,7 +46,7 @@ export interface RowSelectionReturnType<RecordType = any> {
|
|
|
46
46
|
*/
|
|
47
47
|
toggleSelect: (item: RecordType) => void;
|
|
48
48
|
}
|
|
49
|
-
type RowSelectionParams<T> = ApTableRowSelection<T> & {
|
|
49
|
+
type RowSelectionParams<T> = Omit<ApTableRowSelection<T>, 'mode'> & {
|
|
50
50
|
/**
|
|
51
51
|
* 数据源(如果是后端分页,则表示当页数据,否则是全量数据)
|
|
52
52
|
*/
|
|
@@ -65,7 +65,9 @@ export type ExtraProColumnType<T> = Omit<ColumnType<T>, 'children' | 'filters' |
|
|
|
65
65
|
multiple?: number;
|
|
66
66
|
};
|
|
67
67
|
};
|
|
68
|
-
export type ApTableRowSelection<RecordType = any> = Omit<TableRowSelection<RecordType>, 'selectedRowKeys' | 'onChange' | 'onSelect' | 'onSelectAll' | 'onSelectInvert' | 'onSelectNone'
|
|
68
|
+
export type ApTableRowSelection<RecordType = any> = Omit<TableRowSelection<RecordType>, 'selectedRowKeys' | 'onChange' | 'onSelect' | 'onSelectAll' | 'onSelectInvert' | 'onSelectNone'> & {
|
|
69
|
+
mode: 'internal';
|
|
70
|
+
};
|
|
69
71
|
export type ApColumnType<RecordType = any, ValueType extends ApTableValueTypes = ApTableValueTypes> = ValueType extends ApTableValueTypes ? ExtraProColumnType<RecordType> & {
|
|
70
72
|
children?: ApColumnType<RecordType, ValueType>[];
|
|
71
73
|
/**
|
|
@@ -151,7 +153,9 @@ export type ApTableProps<RecordType = any, ParamsType = any> = Omit<TableProps<R
|
|
|
151
153
|
/**
|
|
152
154
|
* 行选中配置
|
|
153
155
|
*/
|
|
154
|
-
rowSelection?: true | ApTableRowSelection<RecordType
|
|
156
|
+
rowSelection?: true | ApTableRowSelection<RecordType> | (TableRowSelection<RecordType> & {
|
|
157
|
+
mode?: 'base';
|
|
158
|
+
});
|
|
155
159
|
/**
|
|
156
160
|
* 是否启用卡片样式
|
|
157
161
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),b=require("@ant-design/icons-vue"),c=require("ant-design-vue"),B=require("../../ap-action/index.js");require("../../config-provider/index.js");require("./style.css");const E=require("../../config-provider/hooks/use-namespace.js"),N=require("../../config-provider/hooks/use-global-config.js"),z={key:0},V=["onClick"],S=e.defineComponent({__name:"ApExpandAlert",props:{type:{default:"warning"},data:{default:()=>[]},prefix:{default:""},tipTitle:{default:"查看详情"},mapLabel:{},separator:{default:"|"},rows:{default:
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),b=require("@ant-design/icons-vue"),c=require("ant-design-vue"),B=require("../../ap-action/index.js");require("../../config-provider/index.js");require("./style.css");const E=require("../../config-provider/hooks/use-namespace.js"),N=require("../../config-provider/hooks/use-global-config.js"),z={key:0},V=["onClick"],S=e.defineComponent({__name:"ApExpandAlert",props:{type:{default:"warning"},data:{default:()=>[]},prefix:{default:""},tipTitle:{default:"查看详情"},mapLabel:{},separator:{default:"|"},rows:{default:2}},emits:["choose","expand"],setup(p,{expose:d,emit:f}){const m=f,i=p,a=e.ref(""),o=e.ref(null),v=e.computed(()=>({fontWeight:"400",wordBreak:"break-all",overflow:"hidden",display:"-webkit-box",webkitLineClamp:a.value,webkitBoxOrient:"vertical",lineHeight:"22px"}));function k(){a.value==="1"?a.value="":a.value="1",m("expand")}const g=e.computed(()=>a.value==="1"?"展开":"收起"),r=e.ref(!0),u=e.computed(()=>a.value!=="1");function y(t){t?a.value="":a.value="1"}e.watch(()=>i.data,()=>{a.value="",e.nextTick(()=>{if(o.value){const t=Number(o.value.clientHeight),s=Number(parseInt(o.value.style.lineHeight));t<s*Number(i.rows)&&u.value?r.value=!1:r.value=!0}})},{immediate:!0});const{b:C,e:l,m:h}=E.useNamespace("ap-expand-alert"),w=N.useGlobalConfig("uiMode","aplus");return d({setExpand:y}),(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(C)(),`${e.unref(h)(e.unref(w))}`])},[e.createVNode(e.unref(c.Alert),{type:t.type,"show-icon":"",class:e.normalizeClass(e.unref(l)("antAlert"))},{action:e.withCtx(()=>[r.value?(e.openBlock(),e.createBlock(e.unref(B.ApActionItem),{key:0,size:"small",onClick:s[0]||(s[0]=n=>k()),style:{"font-size":"12px","padding-left":"16px"}},{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass(e.unref(l)("expandText"))},e.toDisplayString(g.value),3),e.createVNode(e.unref(b.DownOutlined),{class:e.normalizeClass(u.value?e.unref(l)("expandIcon"):e.unref(l)("collapseIcon"))},null,8,["class"])]),_:1})):e.createCommentVNode("",!0)]),message:e.withCtx(()=>[e.createElementVNode("div",{style:e.normalizeStyle(v.value),class:e.normalizeClass(e.unref(l)("alertContent")),ref_key:"ellipsisBoxRef",ref:o},[e.renderSlot(t.$slots,"default",{},()=>[e.createElementVNode("span",{class:e.normalizeClass(e.unref(l)("prefix"))},e.toDisplayString(t.prefix),3),typeof t.data=="string"?(e.openBlock(),e.createElementBlock("span",z,e.toDisplayString(t.data),1)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.data,(n,x)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[e.createVNode(e.unref(c.Tooltip),{title:t.tipTitle},{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass(e.unref(l)("showItem")),onClick:q=>t.$emit("choose",n)},e.toDisplayString(t.mapLabel?n[t.mapLabel]:n),11,V)]),_:2},1032,["title"]),x!==t.data.length-1?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(l)("spliter"))},e.toDisplayString(t.separator),3)):e.createCommentVNode("",!0)],64))),128))])],6)]),_:3},8,["type","class"])],2))}});exports.default=S;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aplus-frontend/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.39",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"module": "es/index.mjs",
|
|
6
6
|
"files": [
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"lodash-unified": "^1.0.3",
|
|
60
60
|
"sortablejs": "^1.15.2",
|
|
61
61
|
"mime": "^4.0.3",
|
|
62
|
-
"@aplus-frontend/
|
|
63
|
-
"@aplus-frontend/
|
|
62
|
+
"@aplus-frontend/hooks": "1.0.7",
|
|
63
|
+
"@aplus-frontend/utils": "1.0.26"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"ant-design-vue": "^4.2.1",
|