@aplus-frontend/ui 0.0.26 → 0.0.28
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-action/group/index.vue.mjs +27 -31
- package/es/src/ap-action/item-dropdown/index.vue.mjs +14 -15
- package/es/src/ap-action/style/item-dropdown.css +2 -0
- package/es/src/ap-form/ap-form-item-group/index.vue.mjs +21 -21
- package/es/src/ap-form/ap-form-item.vue.mjs +72 -64
- package/es/src/ap-form/ap-form.vue.d.ts +13 -3
- package/es/src/ap-form/ap-form.vue2.mjs +91 -70
- package/es/src/ap-form/constant.d.ts +1 -0
- package/es/src/ap-form/constant.mjs +2 -1
- package/es/src/ap-form/context.d.ts +4 -3
- package/es/src/ap-form/hooks/use-watch.mjs +20 -16
- package/es/src/ap-form/interface.d.ts +35 -4
- package/es/src/ap-form/items/checkbox/index.vue.mjs +11 -10
- package/es/src/ap-form/items/date/index.vue.mjs +14 -13
- package/es/src/ap-form/items/date-range/index.vue.mjs +12 -11
- package/es/src/ap-form/items/number/index.vue.mjs +13 -12
- package/es/src/ap-form/items/radio/index.vue.mjs +4 -3
- package/es/src/ap-form/items/select/index.vue.mjs +3 -2
- package/es/src/ap-form/items/switch/index.vue.mjs +9 -8
- package/es/src/ap-form/items/text/index.vue2.mjs +15 -14
- package/es/src/ap-form/items/text/password.vue.mjs +1 -0
- package/es/src/ap-form/items/text-area/index.vue.mjs +7 -6
- package/es/src/ap-form/modal-form/index.vue.d.ts +1 -1
- package/es/src/ap-form/modal-form/index.vue.mjs +3 -3
- package/es/src/ap-table/constants.d.ts +132 -0
- package/es/src/ap-table/style/ap-table.css +11 -8
- package/es/src/business/expandAlert/ApExpandAlert.vue.d.ts +19 -1
- package/es/src/business/expandAlert/ApExpandAlert.vue2.mjs +53 -47
- package/es/src/business/expandAlert/interface.d.ts +4 -0
- package/es/src/business/index.d.ts +38 -7
- package/es/src/business/index.mjs +1 -1
- package/es/src/editable-table/form-item.vue.mjs +72 -74
- package/es/src/editable-table/style/index.css +13 -4
- package/es/src/locale/lang/en.mjs +2 -1
- package/es/src/locale/lang/zh-cn.mjs +2 -1
- package/es/src/theme/ap-action/item-dropdown.css +2 -0
- package/es/src/theme/ap-table/ap-table.css +11 -8
- package/es/src/theme/editable-table/index.css +13 -4
- package/lib/src/ap-action/group/index.vue.js +1 -1
- package/lib/src/ap-action/item-dropdown/index.vue.js +1 -1
- package/lib/src/ap-action/style/item-dropdown.css +2 -0
- package/lib/src/ap-form/ap-form-item-group/index.vue.js +1 -1
- package/lib/src/ap-form/ap-form-item.vue.js +1 -1
- package/lib/src/ap-form/ap-form.vue.d.ts +13 -3
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/constant.d.ts +1 -0
- package/lib/src/ap-form/constant.js +1 -1
- package/lib/src/ap-form/context.d.ts +4 -3
- package/lib/src/ap-form/hooks/use-watch.js +1 -1
- package/lib/src/ap-form/interface.d.ts +35 -4
- package/lib/src/ap-form/items/checkbox/index.vue.js +1 -1
- package/lib/src/ap-form/items/date/index.vue.js +1 -1
- package/lib/src/ap-form/items/date-range/index.vue.js +1 -1
- package/lib/src/ap-form/items/number/index.vue.js +1 -1
- package/lib/src/ap-form/items/radio/index.vue.js +1 -1
- package/lib/src/ap-form/items/select/index.vue.js +1 -1
- package/lib/src/ap-form/items/switch/index.vue.js +1 -1
- package/lib/src/ap-form/items/text/index.vue2.js +1 -1
- package/lib/src/ap-form/items/text/password.vue.js +1 -1
- package/lib/src/ap-form/items/text-area/index.vue.js +1 -1
- package/lib/src/ap-form/modal-form/index.vue.d.ts +1 -1
- package/lib/src/ap-form/modal-form/index.vue.js +1 -1
- package/lib/src/ap-table/constants.d.ts +132 -0
- package/lib/src/ap-table/style/ap-table.css +11 -8
- package/lib/src/business/expandAlert/ApExpandAlert.vue.d.ts +19 -1
- package/lib/src/business/expandAlert/ApExpandAlert.vue2.js +1 -1
- package/lib/src/business/expandAlert/interface.d.ts +4 -0
- package/lib/src/business/index.d.ts +38 -7
- package/lib/src/business/index.js +1 -1
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/style/index.css +13 -4
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/theme/ap-action/item-dropdown.css +2 -0
- package/lib/src/theme/ap-table/ap-table.css +11 -8
- package/lib/src/theme/editable-table/index.css +13 -4
- package/package.json +4 -3
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { ApExpandAlertProps } from './interface';
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @description: 手动调用收起展开
|
|
6
|
+
* @param {boolean} state true 展开 false 收起
|
|
7
|
+
*/
|
|
8
|
+
declare function setExpand(state?: boolean): void;
|
|
4
9
|
declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApExpandAlertProps>, {
|
|
5
10
|
/**
|
|
6
11
|
* Alert类型
|
|
@@ -22,7 +27,14 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
|
|
|
22
27
|
* 分隔符
|
|
23
28
|
*/
|
|
24
29
|
separator: string;
|
|
25
|
-
|
|
30
|
+
/**
|
|
31
|
+
* 内容达到几行显示展开收起
|
|
32
|
+
*/
|
|
33
|
+
rows: number;
|
|
34
|
+
}>, {
|
|
35
|
+
setExpand: typeof setExpand;
|
|
36
|
+
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
37
|
+
expand: (...args: any[]) => void;
|
|
26
38
|
choose: (...args: any[]) => void;
|
|
27
39
|
}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApExpandAlertProps>, {
|
|
28
40
|
/**
|
|
@@ -45,13 +57,19 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
|
|
|
45
57
|
* 分隔符
|
|
46
58
|
*/
|
|
47
59
|
separator: string;
|
|
60
|
+
/**
|
|
61
|
+
* 内容达到几行显示展开收起
|
|
62
|
+
*/
|
|
63
|
+
rows: number;
|
|
48
64
|
}>>> & {
|
|
65
|
+
onExpand?: ((...args: any[]) => any) | undefined;
|
|
49
66
|
onChoose?: ((...args: any[]) => any) | undefined;
|
|
50
67
|
}, {
|
|
51
68
|
type: "success" | "error" | "info" | "warning" | undefined;
|
|
52
69
|
data: string | any[];
|
|
53
70
|
prefix: string;
|
|
54
71
|
separator: string;
|
|
72
|
+
rows: string | number;
|
|
55
73
|
tipTitle: string;
|
|
56
74
|
}, {}>, {
|
|
57
75
|
default?(_: {}): any;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { DownOutlined as
|
|
3
|
-
import { Alert as
|
|
4
|
-
import { ApActionItem as
|
|
1
|
+
import { defineComponent as z, ref as f, computed as v, watch as R, nextTick as S, openBlock as n, createElementBlock as i, normalizeClass as s, unref as t, createVNode as h, withCtx as d, createBlock as V, createElementVNode as c, toDisplayString as r, createCommentVNode as w, normalizeStyle as D, renderSlot as M, Fragment as x, renderList as O } from "vue";
|
|
2
|
+
import { DownOutlined as F } from "@ant-design/icons-vue";
|
|
3
|
+
import { Alert as G, Tooltip as W } from "ant-design-vue";
|
|
4
|
+
import { ApActionItem as j } from "../../ap-action/index.mjs";
|
|
5
5
|
import "../../config-provider/index.mjs";
|
|
6
6
|
import "./style.css";
|
|
7
|
-
import { useNamespace as
|
|
8
|
-
import { useGlobalConfig as
|
|
9
|
-
const
|
|
7
|
+
import { useNamespace as q } from "../../config-provider/hooks/use-namespace.mjs";
|
|
8
|
+
import { useGlobalConfig as J } from "../../config-provider/hooks/use-global-config.mjs";
|
|
9
|
+
const K = { key: 0 }, P = ["onClick"], le = /* @__PURE__ */ z({
|
|
10
10
|
__name: "ApExpandAlert",
|
|
11
11
|
props: {
|
|
12
12
|
type: { default: "warning" },
|
|
@@ -14,32 +14,36 @@ const W = { key: 0 }, j = ["onClick"], _ = /* @__PURE__ */ H({
|
|
|
14
14
|
prefix: { default: "" },
|
|
15
15
|
tipTitle: { default: "查看详情" },
|
|
16
16
|
mapLabel: {},
|
|
17
|
-
separator: { default: "|" }
|
|
17
|
+
separator: { default: "|" },
|
|
18
|
+
rows: { default: 1 }
|
|
18
19
|
},
|
|
19
|
-
emits: ["choose"],
|
|
20
|
-
setup(
|
|
21
|
-
const
|
|
20
|
+
emits: ["choose", "expand"],
|
|
21
|
+
setup(g, { expose: b, emit: C }) {
|
|
22
|
+
const B = C, k = g, a = f(""), p = f(null), E = v(() => ({
|
|
22
23
|
fontWeight: "400",
|
|
23
24
|
wordBreak: "break-all",
|
|
24
25
|
overflow: "hidden",
|
|
25
26
|
display: "-webkit-box",
|
|
26
|
-
webkitLineClamp:
|
|
27
|
+
webkitLineClamp: a.value,
|
|
27
28
|
webkitBoxOrient: "vertical",
|
|
28
29
|
lineHeight: "22px"
|
|
29
30
|
}));
|
|
30
|
-
function
|
|
31
|
-
|
|
31
|
+
function N() {
|
|
32
|
+
a.value === "1" ? a.value = "" : a.value = "1", B("expand");
|
|
32
33
|
}
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
const A = v(() => a.value === "1" ? "展开" : "收起"), m = f(!0), y = v(() => a.value !== "1");
|
|
35
|
+
function T(e) {
|
|
36
|
+
e ? a.value = "" : a.value = "1";
|
|
37
|
+
}
|
|
38
|
+
R(
|
|
39
|
+
() => k.data,
|
|
36
40
|
() => {
|
|
37
|
-
|
|
41
|
+
a.value = "", S(() => {
|
|
38
42
|
if (p.value) {
|
|
39
|
-
const
|
|
43
|
+
const e = Number(p.value.clientHeight), u = Number(
|
|
40
44
|
parseInt(p.value.style.lineHeight)
|
|
41
45
|
);
|
|
42
|
-
|
|
46
|
+
e < u * Number(k.rows) && y.value ? m.value = !1 : m.value = !0;
|
|
43
47
|
}
|
|
44
48
|
});
|
|
45
49
|
},
|
|
@@ -47,58 +51,60 @@ const W = { key: 0 }, j = ["onClick"], _ = /* @__PURE__ */ H({
|
|
|
47
51
|
immediate: !0
|
|
48
52
|
}
|
|
49
53
|
);
|
|
50
|
-
const { b:
|
|
51
|
-
return (
|
|
52
|
-
|
|
54
|
+
const { b: H, e: l, m: I } = q("ap-expand-alert"), L = J("uiMode", "aplus");
|
|
55
|
+
return b({
|
|
56
|
+
setExpand: T
|
|
57
|
+
}), (e, u) => (n(), i("div", {
|
|
58
|
+
class: s([t(H)(), `${t(I)(t(L))}`])
|
|
53
59
|
}, [
|
|
54
|
-
h(
|
|
55
|
-
type:
|
|
60
|
+
h(t(G), {
|
|
61
|
+
type: e.type,
|
|
56
62
|
"show-icon": "",
|
|
57
|
-
class:
|
|
63
|
+
class: s(t(l)("antAlert"))
|
|
58
64
|
}, {
|
|
59
65
|
action: d(() => [
|
|
60
|
-
m.value ? (
|
|
66
|
+
m.value ? (n(), V(t(j), {
|
|
61
67
|
key: 0,
|
|
62
68
|
size: "small",
|
|
63
|
-
onClick: u[0] || (u[0] = (
|
|
69
|
+
onClick: u[0] || (u[0] = (o) => N()),
|
|
64
70
|
style: { "font-size": "12px", "padding-left": "16px" }
|
|
65
71
|
}, {
|
|
66
72
|
default: d(() => [
|
|
67
73
|
c("span", {
|
|
68
|
-
class:
|
|
69
|
-
}, r(
|
|
70
|
-
h(
|
|
71
|
-
class:
|
|
74
|
+
class: s(t(l)("expandText"))
|
|
75
|
+
}, r(A.value), 3),
|
|
76
|
+
h(t(F), {
|
|
77
|
+
class: s(y.value ? t(l)("expandIcon") : t(l)("collapseIcon"))
|
|
72
78
|
}, null, 8, ["class"])
|
|
73
79
|
]),
|
|
74
80
|
_: 1
|
|
75
|
-
})) :
|
|
81
|
+
})) : w("", !0)
|
|
76
82
|
]),
|
|
77
83
|
message: d(() => [
|
|
78
84
|
c("div", {
|
|
79
|
-
style:
|
|
80
|
-
class:
|
|
85
|
+
style: D(E.value),
|
|
86
|
+
class: s(t(l)("alertContent")),
|
|
81
87
|
ref_key: "ellipsisBoxRef",
|
|
82
88
|
ref: p
|
|
83
89
|
}, [
|
|
84
|
-
|
|
90
|
+
M(e.$slots, "default", {}, () => [
|
|
85
91
|
c("span", {
|
|
86
|
-
class:
|
|
87
|
-
}, r(
|
|
88
|
-
typeof
|
|
89
|
-
h(
|
|
92
|
+
class: s(t(l)("prefix"))
|
|
93
|
+
}, r(e.prefix), 3),
|
|
94
|
+
typeof e.data == "string" ? (n(), i("span", K, r(e.data), 1)) : (n(!0), i(x, { key: 1 }, O(e.data, (o, $) => (n(), i(x, { key: o }, [
|
|
95
|
+
h(t(W), { title: e.tipTitle }, {
|
|
90
96
|
default: d(() => [
|
|
91
97
|
c("span", {
|
|
92
|
-
class:
|
|
93
|
-
onClick: (
|
|
94
|
-
}, r(
|
|
98
|
+
class: s(t(l)("showItem")),
|
|
99
|
+
onClick: (Q) => e.$emit("choose", o)
|
|
100
|
+
}, r(e.mapLabel ? o[e.mapLabel] : o), 11, P)
|
|
95
101
|
]),
|
|
96
102
|
_: 2
|
|
97
103
|
}, 1032, ["title"]),
|
|
98
|
-
|
|
104
|
+
$ !== e.data.length - 1 ? (n(), i("span", {
|
|
99
105
|
key: 0,
|
|
100
|
-
class:
|
|
101
|
-
}, r(
|
|
106
|
+
class: s(t(l)("spliter"))
|
|
107
|
+
}, r(e.separator), 3)) : w("", !0)
|
|
102
108
|
], 64))), 128))
|
|
103
109
|
])
|
|
104
110
|
], 6)
|
|
@@ -109,5 +115,5 @@ const W = { key: 0 }, j = ["onClick"], _ = /* @__PURE__ */ H({
|
|
|
109
115
|
}
|
|
110
116
|
});
|
|
111
117
|
export {
|
|
112
|
-
|
|
118
|
+
le as default
|
|
113
119
|
};
|
|
@@ -171,6 +171,11 @@ export declare const ApExpandAlert: {
|
|
|
171
171
|
required: true;
|
|
172
172
|
default: string;
|
|
173
173
|
};
|
|
174
|
+
rows: {
|
|
175
|
+
type: PropType<string | number>;
|
|
176
|
+
required: true;
|
|
177
|
+
default: number;
|
|
178
|
+
};
|
|
174
179
|
tipTitle: {
|
|
175
180
|
type: PropType<string>;
|
|
176
181
|
default: string;
|
|
@@ -179,8 +184,12 @@ export declare const ApExpandAlert: {
|
|
|
179
184
|
type: PropType<string>;
|
|
180
185
|
};
|
|
181
186
|
}>> & {
|
|
187
|
+
onExpand?: ((...args: any[]) => any) | undefined;
|
|
182
188
|
onChoose?: ((...args: any[]) => any) | undefined;
|
|
183
|
-
}, {
|
|
189
|
+
}, {
|
|
190
|
+
setExpand: (state?: boolean | undefined) => void;
|
|
191
|
+
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
192
|
+
expand: (...args: any[]) => void;
|
|
184
193
|
choose: (...args: any[]) => void;
|
|
185
194
|
}, VNodeProps & AllowedComponentProps & ComponentCustomProps & Readonly< ExtractPropTypes<{
|
|
186
195
|
type: {
|
|
@@ -202,6 +211,11 @@ export declare const ApExpandAlert: {
|
|
|
202
211
|
required: true;
|
|
203
212
|
default: string;
|
|
204
213
|
};
|
|
214
|
+
rows: {
|
|
215
|
+
type: PropType<string | number>;
|
|
216
|
+
required: true;
|
|
217
|
+
default: number;
|
|
218
|
+
};
|
|
205
219
|
tipTitle: {
|
|
206
220
|
type: PropType<string>;
|
|
207
221
|
default: string;
|
|
@@ -210,12 +224,14 @@ export declare const ApExpandAlert: {
|
|
|
210
224
|
type: PropType<string>;
|
|
211
225
|
};
|
|
212
226
|
}>> & {
|
|
227
|
+
onExpand?: ((...args: any[]) => any) | undefined;
|
|
213
228
|
onChoose?: ((...args: any[]) => any) | undefined;
|
|
214
229
|
}, {
|
|
215
230
|
type: "success" | "error" | "info" | "warning" | undefined;
|
|
216
231
|
data: string | any[];
|
|
217
232
|
prefix: string;
|
|
218
233
|
separator: string;
|
|
234
|
+
rows: string | number;
|
|
219
235
|
tipTitle: string;
|
|
220
236
|
}, true, {}, {}, {
|
|
221
237
|
P: {};
|
|
@@ -244,6 +260,11 @@ export declare const ApExpandAlert: {
|
|
|
244
260
|
required: true;
|
|
245
261
|
default: string;
|
|
246
262
|
};
|
|
263
|
+
rows: {
|
|
264
|
+
type: PropType<string | number>;
|
|
265
|
+
required: true;
|
|
266
|
+
default: number;
|
|
267
|
+
};
|
|
247
268
|
tipTitle: {
|
|
248
269
|
type: PropType<string>;
|
|
249
270
|
default: string;
|
|
@@ -252,12 +273,16 @@ export declare const ApExpandAlert: {
|
|
|
252
273
|
type: PropType<string>;
|
|
253
274
|
};
|
|
254
275
|
}>> & {
|
|
276
|
+
onExpand?: ((...args: any[]) => any) | undefined;
|
|
255
277
|
onChoose?: ((...args: any[]) => any) | undefined;
|
|
256
|
-
}, {
|
|
278
|
+
}, {
|
|
279
|
+
setExpand: (state?: boolean | undefined) => void;
|
|
280
|
+
}, {}, {}, {}, {
|
|
257
281
|
type: "success" | "error" | "info" | "warning" | undefined;
|
|
258
282
|
data: string | any[];
|
|
259
283
|
prefix: string;
|
|
260
284
|
separator: string;
|
|
285
|
+
rows: string | number;
|
|
261
286
|
tipTitle: string;
|
|
262
287
|
}>;
|
|
263
288
|
__isFragment?: undefined;
|
|
@@ -283,6 +308,11 @@ export declare const ApExpandAlert: {
|
|
|
283
308
|
required: true;
|
|
284
309
|
default: string;
|
|
285
310
|
};
|
|
311
|
+
rows: {
|
|
312
|
+
type: PropType<string | number>;
|
|
313
|
+
required: true;
|
|
314
|
+
default: number;
|
|
315
|
+
};
|
|
286
316
|
tipTitle: {
|
|
287
317
|
type: PropType<string>;
|
|
288
318
|
default: string;
|
|
@@ -291,23 +321,24 @@ export declare const ApExpandAlert: {
|
|
|
291
321
|
type: PropType<string>;
|
|
292
322
|
};
|
|
293
323
|
}>> & {
|
|
324
|
+
onExpand?: ((...args: any[]) => any) | undefined;
|
|
294
325
|
onChoose?: ((...args: any[]) => any) | undefined;
|
|
295
|
-
}, {
|
|
326
|
+
}, {
|
|
327
|
+
setExpand: (state?: boolean | undefined) => void;
|
|
328
|
+
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
329
|
+
expand: (...args: any[]) => void;
|
|
296
330
|
choose: (...args: any[]) => void;
|
|
297
331
|
}, string, {
|
|
298
332
|
type: "success" | "error" | "info" | "warning" | undefined;
|
|
299
333
|
data: string | any[];
|
|
300
334
|
prefix: string;
|
|
301
335
|
separator: string;
|
|
336
|
+
rows: string | number;
|
|
302
337
|
tipTitle: string;
|
|
303
338
|
}, {}, string, {}> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
|
|
304
339
|
$slots: {
|
|
305
340
|
default?(_: {}): any;
|
|
306
341
|
};
|
|
307
|
-
}) & Plugin<any[]> & (new (...args: any[]) => {
|
|
308
|
-
$props: {
|
|
309
|
-
onClick?: (() => void) | undefined;
|
|
310
|
-
};
|
|
311
342
|
});
|
|
312
343
|
export declare const ApLabel: {
|
|
313
344
|
new (...args: any[]): CreateComponentPublicInstance<Readonly< ExtractPropTypes<{
|
|
@@ -9,7 +9,7 @@ import m from "./expandAlert/ApExpandAlert.vue2.mjs";
|
|
|
9
9
|
import r from "./ap-label/ApLabel.vue2.mjs";
|
|
10
10
|
import p from "./ap-status/ApStatus.vue2.mjs";
|
|
11
11
|
import i from "./ap-status/ApStatusGroup.vue2.mjs";
|
|
12
|
-
const x = t(o), S =
|
|
12
|
+
const x = t(o), S = m, b = t(r), d = t(p), h = t(i);
|
|
13
13
|
export {
|
|
14
14
|
S as ApExpandAlert,
|
|
15
15
|
b as ApLabel,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Table as
|
|
3
|
-
import { ApForm as
|
|
4
|
-
import { isNumber as
|
|
1
|
+
import { defineComponent as P, ref as V, unref as o, useSlots as A, watch as O, openBlock as x, createBlock as T, mergeProps as C, withCtx as m, createVNode as K, createSlots as M, createElementBlock as q, Fragment as G, createElementVNode as w, normalizeClass as H, toDisplayString as W, createCommentVNode as I, renderList as U, renderSlot as $, normalizeProps as J, guardReactiveProps as Q } from "vue";
|
|
2
|
+
import { Table as X } from "ant-design-vue";
|
|
3
|
+
import { ApForm as b } from "../ap-form/index.mjs";
|
|
4
|
+
import { isNumber as u, cloneDeep as i, omit as Y } from "lodash-unified";
|
|
5
5
|
import "../config-provider/index.mjs";
|
|
6
|
-
import { useInjectForm as
|
|
6
|
+
import { useInjectForm as Z } from "../ap-form/context.mjs";
|
|
7
7
|
import "./style/index.css";
|
|
8
|
-
import { isDef as
|
|
9
|
-
import
|
|
8
|
+
import { isDef as f } from "../utils/index.mjs";
|
|
9
|
+
import ee from "./hooks/use-get-columns.mjs";
|
|
10
10
|
import { getColumnIsRequired as oe } from "./utils.mjs";
|
|
11
|
-
import { useNamespace as
|
|
12
|
-
import { useGlobalConfig as
|
|
13
|
-
const
|
|
11
|
+
import { useNamespace as te } from "../config-provider/hooks/use-namespace.mjs";
|
|
12
|
+
import { useGlobalConfig as ae } from "../config-provider/hooks/use-global-config.mjs";
|
|
13
|
+
const ge = /* @__PURE__ */ P({
|
|
14
14
|
name: "EditableTableInner",
|
|
15
15
|
__name: "form-item",
|
|
16
16
|
props: {
|
|
@@ -110,95 +110,93 @@ const xe = /* @__PURE__ */ V({
|
|
|
110
110
|
default: () => ({})
|
|
111
111
|
}
|
|
112
112
|
},
|
|
113
|
-
setup(
|
|
114
|
-
expose:
|
|
113
|
+
setup(y, {
|
|
114
|
+
expose: R
|
|
115
115
|
}) {
|
|
116
|
-
var
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
model:
|
|
120
|
-
} =
|
|
121
|
-
|
|
122
|
-
var
|
|
123
|
-
|
|
116
|
+
var c;
|
|
117
|
+
const a = y, {
|
|
118
|
+
internalInstance: l,
|
|
119
|
+
model: B
|
|
120
|
+
} = Z(), r = V(((c = o(B)) == null ? void 0 : c[a.name]) || []), D = A(), F = b.useWatch(a.name);
|
|
121
|
+
O(() => F.value, (e) => {
|
|
122
|
+
var t;
|
|
123
|
+
r.value = e, (t = a.onChange) == null || t.call(a, e);
|
|
124
124
|
});
|
|
125
125
|
const {
|
|
126
|
-
b:
|
|
127
|
-
em:
|
|
128
|
-
} =
|
|
129
|
-
function
|
|
130
|
-
var
|
|
131
|
-
const n = ((
|
|
132
|
-
if (
|
|
126
|
+
b: p,
|
|
127
|
+
em: E
|
|
128
|
+
} = te("editable-table"), L = ae("uiMode", "aplus"), v = ee(a);
|
|
129
|
+
function N(e, t) {
|
|
130
|
+
var s;
|
|
131
|
+
const n = ((s = o(r)) == null ? void 0 : s.length) || 0;
|
|
132
|
+
if (f(a.maxLength) && n >= a.maxLength)
|
|
133
133
|
return;
|
|
134
|
-
const
|
|
135
|
-
|
|
134
|
+
const d = [...o(r) || []];
|
|
135
|
+
f(t) ? d.splice(t, 0, {
|
|
136
136
|
...e || {}
|
|
137
|
-
}) :
|
|
137
|
+
}) : d.push({
|
|
138
138
|
...e || {}
|
|
139
|
-
}),
|
|
139
|
+
}), l == null || l.setFieldValue(a.name, [...o(r) || [], e || {}]);
|
|
140
140
|
}
|
|
141
|
-
function
|
|
142
|
-
var g
|
|
143
|
-
const n = ((g = o(
|
|
144
|
-
if (
|
|
141
|
+
function S(e, t = "suffix") {
|
|
142
|
+
var g;
|
|
143
|
+
const n = ((g = o(r)) == null ? void 0 : g.length) || 0, d = u(e) ? e : e.length;
|
|
144
|
+
if (f(a.maxLength) && n + d > a.maxLength)
|
|
145
145
|
return;
|
|
146
|
-
const
|
|
147
|
-
|
|
146
|
+
const s = [...o(r) || []], h = u(e) ? new Array(e).fill({}) : i(e);
|
|
147
|
+
t === "suffix" ? s.push(...h) : s.unshift(...h), l == null || l.setFieldValue(a.name, s);
|
|
148
148
|
}
|
|
149
|
-
function
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
a = a.filter((u, s) => !n.includes(s)), (r = t == null ? void 0 : t.setFieldValue) == null || r.call(t, l.name, a);
|
|
149
|
+
function k(e) {
|
|
150
|
+
let t = i(o(r) || []);
|
|
151
|
+
const n = u(e) ? [e] : e;
|
|
152
|
+
t = t.filter((d, s) => !n.includes(s)), l == null || l.setFieldValue(a.name, t);
|
|
154
153
|
}
|
|
155
|
-
function
|
|
156
|
-
return o(
|
|
154
|
+
function _() {
|
|
155
|
+
return o(r);
|
|
157
156
|
}
|
|
158
|
-
function
|
|
159
|
-
var
|
|
160
|
-
return (
|
|
157
|
+
function j(e) {
|
|
158
|
+
var t;
|
|
159
|
+
return (t = o(r)) == null ? void 0 : t[e];
|
|
161
160
|
}
|
|
162
|
-
function
|
|
163
|
-
|
|
164
|
-
const n = p(o(d));
|
|
161
|
+
function z(e, t) {
|
|
162
|
+
const n = i(o(r));
|
|
165
163
|
n[e] && (n[e] = {
|
|
166
164
|
...n[e],
|
|
167
|
-
...
|
|
168
|
-
},
|
|
165
|
+
...t
|
|
166
|
+
}, l == null || l.setFieldValue(a.name, [...n]));
|
|
169
167
|
}
|
|
170
|
-
return
|
|
171
|
-
add:
|
|
172
|
-
remove:
|
|
173
|
-
getRowData:
|
|
174
|
-
getRowsData:
|
|
175
|
-
setRowData:
|
|
176
|
-
addMultiple:
|
|
177
|
-
}), (e,
|
|
168
|
+
return R({
|
|
169
|
+
add: N,
|
|
170
|
+
remove: k,
|
|
171
|
+
getRowData: j,
|
|
172
|
+
getRowsData: _,
|
|
173
|
+
setRowData: z,
|
|
174
|
+
addMultiple: S
|
|
175
|
+
}), (e, t) => (x(), T(o(b).FormItem, C(e.formItem, {
|
|
178
176
|
name: e.name,
|
|
179
177
|
label: e.label
|
|
180
178
|
}), {
|
|
181
|
-
default:
|
|
182
|
-
class: [o(
|
|
183
|
-
columns: o(
|
|
184
|
-
"data-source":
|
|
185
|
-
}),
|
|
186
|
-
headerCell:
|
|
179
|
+
default: m(() => [K(o(X), C(o(Y)(a, ["name", "maxLength"]), {
|
|
180
|
+
class: [o(p)(), o(L) === "admin" ? o(p)("admin") : null],
|
|
181
|
+
columns: o(v),
|
|
182
|
+
"data-source": r.value
|
|
183
|
+
}), M({
|
|
184
|
+
headerCell: m(({
|
|
187
185
|
column: n
|
|
188
|
-
}) => [o(oe)(n) ? (
|
|
186
|
+
}) => [o(oe)(n) ? (x(), q(G, {
|
|
189
187
|
key: 0
|
|
190
|
-
}, [
|
|
191
|
-
class:
|
|
192
|
-
}, "*", 2),
|
|
188
|
+
}, [w("span", {
|
|
189
|
+
class: H(o(E)("header-cell", "required"))
|
|
190
|
+
}, "*", 2), w("span", null, W(n.title), 1)], 64)) : I("", !0)]),
|
|
193
191
|
_: 2
|
|
194
|
-
}, [
|
|
195
|
-
name:
|
|
196
|
-
fn:
|
|
192
|
+
}, [U(D, (n, d) => ({
|
|
193
|
+
name: d,
|
|
194
|
+
fn: m((s) => [$(e.$slots, d, J(Q(s || {})))])
|
|
197
195
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
198
196
|
_: 3
|
|
199
197
|
}, 16, ["name", "label"]));
|
|
200
198
|
}
|
|
201
199
|
});
|
|
202
200
|
export {
|
|
203
|
-
|
|
201
|
+
ge as default
|
|
204
202
|
};
|
|
@@ -37,11 +37,20 @@
|
|
|
37
37
|
.aplus-editable-table-admin tr > td.ant-table-cell {
|
|
38
38
|
border-top-color: #E9E9E9;
|
|
39
39
|
}
|
|
40
|
-
.aplus-editable-table .ant-table-middle .ant-table-cell {
|
|
41
|
-
padding: 12px 16px
|
|
40
|
+
.aplus-editable-table .ant-table.ant-table-middle .ant-table-row .ant-table-cell {
|
|
41
|
+
padding: 12px 16px;
|
|
42
42
|
}
|
|
43
|
-
.aplus-editable-table .ant-table-
|
|
44
|
-
padding:
|
|
43
|
+
.aplus-editable-table .ant-table.ant-table-middle .ant-table-thead .ant-table-cell {
|
|
44
|
+
padding: 12px 16px;
|
|
45
|
+
}
|
|
46
|
+
.aplus-editable-table .ant-table.ant-table-small .ant-table-row .ant-table-cell {
|
|
47
|
+
padding: 9px 16px;
|
|
48
|
+
}
|
|
49
|
+
.aplus-editable-table .ant-table.ant-table-small .ant-table-thead .ant-table-cell {
|
|
50
|
+
padding: 9px 16px;
|
|
51
|
+
}
|
|
52
|
+
.aplus-editable-table .ant-table-placeholder .ant-table-expanded-row-fixed::after {
|
|
53
|
+
border-inline-end-width: 0px !important;
|
|
45
54
|
}
|
|
46
55
|
.aplus-editable-table .ant-table-cell .ant-typography {
|
|
47
56
|
margin-bottom: 0;
|
|
@@ -73,17 +73,20 @@
|
|
|
73
73
|
.aplus-ap-table-table-admin tr > td.ant-table-cell {
|
|
74
74
|
border-top-color: #E9E9E9;
|
|
75
75
|
}
|
|
76
|
-
.aplus-ap-table .ant-table-middle .ant-table-cell {
|
|
77
|
-
padding: 12px 16px
|
|
76
|
+
.aplus-ap-table .ant-table.ant-table-middle .ant-table-row .ant-table-cell {
|
|
77
|
+
padding: 12px 16px;
|
|
78
78
|
}
|
|
79
|
-
.aplus-ap-table .ant-table-
|
|
80
|
-
padding:
|
|
79
|
+
.aplus-ap-table .ant-table.ant-table-middle .ant-table-thead .ant-table-cell {
|
|
80
|
+
padding: 12px 16px;
|
|
81
81
|
}
|
|
82
|
-
.aplus-ap-table .ant-table-
|
|
83
|
-
padding:
|
|
82
|
+
.aplus-ap-table .ant-table.ant-table-small .ant-table-row .ant-table-cell {
|
|
83
|
+
padding: 9px 16px;
|
|
84
84
|
}
|
|
85
|
-
.aplus-ap-table .ant-table-small .ant-table-
|
|
86
|
-
padding:
|
|
85
|
+
.aplus-ap-table .ant-table.ant-table-small .ant-table-thead .ant-table-cell {
|
|
86
|
+
padding: 9px 16px;
|
|
87
|
+
}
|
|
88
|
+
.aplus-ap-table .ant-table-placeholder .ant-table-expanded-row-fixed::after {
|
|
89
|
+
border-inline-end-width: 0px !important;
|
|
87
90
|
}
|
|
88
91
|
.aplus-ap-table .ant-table-column-sorters {
|
|
89
92
|
justify-content: unset;
|
|
@@ -37,11 +37,20 @@
|
|
|
37
37
|
.aplus-editable-table-admin tr > td.ant-table-cell {
|
|
38
38
|
border-top-color: #E9E9E9;
|
|
39
39
|
}
|
|
40
|
-
.aplus-editable-table .ant-table-middle .ant-table-cell {
|
|
41
|
-
padding: 12px 16px
|
|
40
|
+
.aplus-editable-table .ant-table.ant-table-middle .ant-table-row .ant-table-cell {
|
|
41
|
+
padding: 12px 16px;
|
|
42
42
|
}
|
|
43
|
-
.aplus-editable-table .ant-table-
|
|
44
|
-
padding:
|
|
43
|
+
.aplus-editable-table .ant-table.ant-table-middle .ant-table-thead .ant-table-cell {
|
|
44
|
+
padding: 12px 16px;
|
|
45
|
+
}
|
|
46
|
+
.aplus-editable-table .ant-table.ant-table-small .ant-table-row .ant-table-cell {
|
|
47
|
+
padding: 9px 16px;
|
|
48
|
+
}
|
|
49
|
+
.aplus-editable-table .ant-table.ant-table-small .ant-table-thead .ant-table-cell {
|
|
50
|
+
padding: 9px 16px;
|
|
51
|
+
}
|
|
52
|
+
.aplus-editable-table .ant-table-placeholder .ant-table-expanded-row-fixed::after {
|
|
53
|
+
border-inline-end-width: 0px !important;
|
|
45
54
|
}
|
|
46
55
|
.aplus-editable-table .ant-table-cell .ant-typography {
|
|
47
56
|
margin-bottom: 0;
|