@aplus-frontend/ui 0.5.8 → 0.5.10
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/index.mjs +109 -107
- package/es/src/ap-descriptions/ap-descriptions.vue.mjs +70 -54
- package/es/src/ap-descriptions/formatter/index.d.ts +2 -1
- package/es/src/ap-descriptions/formatter/index.mjs +92 -76
- package/es/src/ap-descriptions/helper.d.ts +3 -4
- package/es/src/ap-descriptions/helper.mjs +15 -13
- package/es/src/ap-descriptions/interface.d.ts +6 -0
- package/es/src/ap-grid/editable/form-item.vue.mjs +7 -7
- package/es/src/ap-grid/editable/index.vue.mjs +16 -16
- package/es/src/ap-grid/utils/col.mjs +35 -34
- package/es/src/ap-table/ap-table.vue2.mjs +49 -45
- package/es/src/ap-table/components/paragraph-ellipsis/index.vue.d.ts +1 -0
- package/es/src/ap-table/components/paragraph-ellipsis/index.vue2.mjs +33 -33
- package/es/src/business/hooks/index.d.ts +1 -0
- package/es/src/business/hooks/index.mjs +4 -2
- package/es/src/business/hooks/usePageListApGrid.d.ts +34 -0
- package/es/src/business/hooks/usePageListApGrid.mjs +90 -0
- package/es/src/index.mjs +61 -59
- package/lib/index.js +1 -1
- package/lib/src/ap-descriptions/ap-descriptions.vue.js +1 -1
- package/lib/src/ap-descriptions/formatter/index.d.ts +2 -1
- package/lib/src/ap-descriptions/formatter/index.js +1 -1
- package/lib/src/ap-descriptions/helper.d.ts +3 -4
- package/lib/src/ap-descriptions/helper.js +1 -1
- package/lib/src/ap-descriptions/interface.d.ts +6 -0
- package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ap-grid/editable/index.vue.js +1 -1
- package/lib/src/ap-grid/utils/col.js +1 -1
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/components/paragraph-ellipsis/index.vue.d.ts +1 -0
- package/lib/src/ap-table/components/paragraph-ellipsis/index.vue2.js +1 -1
- package/lib/src/business/hooks/index.d.ts +1 -0
- package/lib/src/business/hooks/index.js +1 -1
- package/lib/src/business/hooks/usePageListApGrid.d.ts +34 -0
- package/lib/src/business/hooks/usePageListApGrid.js +1 -0
- package/lib/src/index.js +1 -1
- package/package.json +5 -5
- package/theme/ap-descriptions/ap-descriptions.css +10 -0
- package/theme/ap-descriptions/ap-descriptions.less +13 -0
- package/theme/index.css +10 -0
|
@@ -1,127 +1,143 @@
|
|
|
1
|
-
import { createVNode as
|
|
1
|
+
import { createVNode as p } from "vue";
|
|
2
2
|
import { getTimeFormatToZone as g } from "@aplus-frontend/utils";
|
|
3
|
-
import { merge as
|
|
4
|
-
import { formatString as
|
|
5
|
-
import { toDecimalMark as
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import { isBoolean as h, merge as f, get as l, debounce as Y } from "lodash-unified";
|
|
4
|
+
import { formatString as A } from "./utils.mjs";
|
|
5
|
+
import { toDecimalMark as b } from "@fruits-chain/utils";
|
|
6
|
+
import { TypographyParagraph as M } from "@aplus-frontend/antdv";
|
|
7
|
+
function S({
|
|
8
|
+
value: t
|
|
9
|
+
}, n) {
|
|
10
|
+
if (!n)
|
|
11
|
+
return t;
|
|
12
|
+
const r = {
|
|
13
|
+
...n,
|
|
14
|
+
content: t,
|
|
15
|
+
ellipsis: n.ellipsis ? h(n.ellipsis) ? {
|
|
16
|
+
tooltip: t,
|
|
17
|
+
rows: 1
|
|
18
|
+
} : {
|
|
19
|
+
...n.ellipsis,
|
|
20
|
+
tooltip: t
|
|
21
|
+
} : !1
|
|
22
|
+
};
|
|
23
|
+
return p(M, r, null);
|
|
8
24
|
}
|
|
9
|
-
function
|
|
25
|
+
function D({
|
|
10
26
|
value: t
|
|
11
|
-
},
|
|
12
|
-
var
|
|
27
|
+
}, n) {
|
|
28
|
+
var o;
|
|
13
29
|
const {
|
|
14
|
-
joinSymbol:
|
|
15
|
-
} =
|
|
30
|
+
joinSymbol: r
|
|
31
|
+
} = f({
|
|
16
32
|
joinSymbol: " "
|
|
17
|
-
},
|
|
18
|
-
return (
|
|
33
|
+
}, n);
|
|
34
|
+
return (o = t == null ? void 0 : t.join) == null ? void 0 : o.call(t, r);
|
|
19
35
|
}
|
|
20
36
|
function u({
|
|
21
37
|
value: t
|
|
22
|
-
},
|
|
38
|
+
}, n) {
|
|
23
39
|
const {
|
|
24
|
-
zoneAlias:
|
|
25
|
-
format:
|
|
26
|
-
} =
|
|
40
|
+
zoneAlias: r,
|
|
41
|
+
format: o
|
|
42
|
+
} = f({
|
|
27
43
|
zoneAlias: "LA",
|
|
28
44
|
format: "YYYY-MM-DD HH:mm:ss"
|
|
29
|
-
},
|
|
30
|
-
return g(t,
|
|
45
|
+
}, n);
|
|
46
|
+
return g(t, r, o);
|
|
31
47
|
}
|
|
32
48
|
function y({
|
|
33
49
|
value: t,
|
|
34
|
-
record:
|
|
35
|
-
},
|
|
50
|
+
record: n
|
|
51
|
+
}, r) {
|
|
36
52
|
const {
|
|
37
|
-
fieldList:
|
|
38
|
-
templateString:
|
|
39
|
-
formatter:
|
|
40
|
-
} =
|
|
41
|
-
const
|
|
42
|
-
return
|
|
53
|
+
fieldList: o,
|
|
54
|
+
templateString: e = "{0}",
|
|
55
|
+
formatter: i
|
|
56
|
+
} = r, s = (o == null ? void 0 : o.map((m, c) => {
|
|
57
|
+
const a = l(n, m);
|
|
58
|
+
return i ? i(a, c) : a;
|
|
43
59
|
})) || [];
|
|
44
|
-
return s.length === 0 && s.push(t),
|
|
60
|
+
return s.length === 0 && s.push(t), A(e, s);
|
|
45
61
|
}
|
|
46
|
-
function
|
|
62
|
+
function j({
|
|
47
63
|
value: t,
|
|
48
|
-
record:
|
|
49
|
-
},
|
|
64
|
+
record: n
|
|
65
|
+
}, r) {
|
|
50
66
|
const {
|
|
51
|
-
fieldList:
|
|
52
|
-
format:
|
|
53
|
-
joinSymbol:
|
|
67
|
+
fieldList: o,
|
|
68
|
+
format: e = "YYYY-MM-DD HH:mm:ss",
|
|
69
|
+
joinSymbol: i = "~",
|
|
54
70
|
zoneAlias: s = "LA"
|
|
55
|
-
} =
|
|
71
|
+
} = r, m = Array.isArray(e) ? e : [e, e];
|
|
56
72
|
return y({
|
|
57
73
|
value: t,
|
|
58
|
-
record:
|
|
74
|
+
record: n
|
|
59
75
|
}, {
|
|
60
|
-
fieldList:
|
|
61
|
-
templateString: `{0} ${
|
|
62
|
-
formatter(c,
|
|
76
|
+
fieldList: o,
|
|
77
|
+
templateString: `{0} ${i} {1}`,
|
|
78
|
+
formatter(c, a) {
|
|
63
79
|
return u({
|
|
64
80
|
value: c,
|
|
65
|
-
record:
|
|
81
|
+
record: n
|
|
66
82
|
}, {
|
|
67
|
-
format: a
|
|
83
|
+
format: m[a],
|
|
68
84
|
zoneAlias: s
|
|
69
85
|
});
|
|
70
86
|
}
|
|
71
87
|
});
|
|
72
88
|
}
|
|
73
|
-
function
|
|
89
|
+
function k({
|
|
74
90
|
record: t
|
|
75
|
-
},
|
|
91
|
+
}, n) {
|
|
76
92
|
const {
|
|
77
|
-
urlPath:
|
|
78
|
-
namePath:
|
|
79
|
-
style:
|
|
80
|
-
downloadFile:
|
|
93
|
+
urlPath: r = "url",
|
|
94
|
+
namePath: o = "name",
|
|
95
|
+
style: e,
|
|
96
|
+
downloadFile: i,
|
|
81
97
|
className: s
|
|
82
|
-
} =
|
|
83
|
-
|
|
98
|
+
} = n, m = l(t, o), c = l(t, r), a = Y(() => {
|
|
99
|
+
i == null || i(c, m);
|
|
84
100
|
}, 500);
|
|
85
|
-
return
|
|
86
|
-
style:
|
|
101
|
+
return p("span", {
|
|
102
|
+
style: e,
|
|
87
103
|
class: [s, "ap-descriptions-item-content__link "],
|
|
88
|
-
onClick:
|
|
89
|
-
}, [
|
|
104
|
+
onClick: a
|
|
105
|
+
}, [m]);
|
|
90
106
|
}
|
|
91
|
-
function
|
|
107
|
+
function H({
|
|
92
108
|
value: t
|
|
93
|
-
},
|
|
109
|
+
}, n) {
|
|
94
110
|
const {
|
|
95
|
-
style:
|
|
96
|
-
precision:
|
|
97
|
-
} =
|
|
98
|
-
let
|
|
111
|
+
style: r = {},
|
|
112
|
+
precision: o
|
|
113
|
+
} = n;
|
|
114
|
+
let e = "";
|
|
99
115
|
try {
|
|
100
|
-
|
|
116
|
+
e = b(t, o);
|
|
101
117
|
} catch {
|
|
102
|
-
|
|
118
|
+
e = t;
|
|
103
119
|
}
|
|
104
|
-
return
|
|
105
|
-
style:
|
|
120
|
+
return p("span", {
|
|
121
|
+
style: r,
|
|
106
122
|
class: "ap-descriptions-item-content__number"
|
|
107
|
-
}, [
|
|
123
|
+
}, [e]);
|
|
108
124
|
}
|
|
109
|
-
const
|
|
110
|
-
text:
|
|
111
|
-
array:
|
|
125
|
+
const N = {
|
|
126
|
+
text: S,
|
|
127
|
+
array: D,
|
|
112
128
|
date: u,
|
|
113
|
-
dateRange:
|
|
129
|
+
dateRange: j,
|
|
114
130
|
template: y,
|
|
115
|
-
number:
|
|
116
|
-
attachment:
|
|
131
|
+
number: H,
|
|
132
|
+
attachment: k
|
|
117
133
|
};
|
|
118
134
|
export {
|
|
119
|
-
|
|
120
|
-
|
|
135
|
+
D as array,
|
|
136
|
+
k as attachment,
|
|
121
137
|
u as date,
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
138
|
+
j as dateRange,
|
|
139
|
+
N as formatterMap,
|
|
140
|
+
H as number,
|
|
125
141
|
y as template,
|
|
126
|
-
|
|
142
|
+
S as text
|
|
127
143
|
};
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DescriptionsItemSchema, FormatOptions, TransformOptionType } from './interface';
|
|
2
2
|
import { VNode, VNodeChild, StyleValue } from 'vue';
|
|
3
3
|
import { AttachmentExtraProps } from './formatter';
|
|
4
4
|
export declare function transformValue(data: FormatOptions, opt: TransformOptionType): VNodeChild | VNode;
|
|
5
5
|
/**
|
|
6
6
|
* 根据type判断是否为空
|
|
7
|
-
* @param
|
|
8
|
-
* @param type 类型
|
|
7
|
+
* @param schema 描述
|
|
9
8
|
*/
|
|
10
|
-
export declare function isEmptyWithType(value: unknown,
|
|
9
|
+
export declare function isEmptyWithType(value: unknown, schema: DescriptionsItemSchema): boolean;
|
|
11
10
|
/**
|
|
12
11
|
* 混入附件类型额外属性
|
|
13
12
|
* @param target 原配置
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { isEmpty as o } from "lodash-unified";
|
|
2
2
|
import { formatterMap as f } from "./formatter/index.mjs";
|
|
3
|
-
function
|
|
4
|
-
const
|
|
5
|
-
return
|
|
3
|
+
function i(r, e) {
|
|
4
|
+
const n = f[e.valueType];
|
|
5
|
+
return n ? n(r, e.extraProps || {}) : r.value;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
8
|
-
|
|
7
|
+
function l(r, e) {
|
|
8
|
+
if (e.isShowEmptyPlaceholder === !1)
|
|
9
|
+
return !1;
|
|
10
|
+
switch (e.valueType) {
|
|
9
11
|
case "text":
|
|
10
12
|
case "number":
|
|
11
13
|
case "dateRange":
|
|
@@ -18,17 +20,17 @@ function a(r, n) {
|
|
|
18
20
|
return !r;
|
|
19
21
|
}
|
|
20
22
|
}
|
|
21
|
-
function
|
|
22
|
-
return
|
|
23
|
+
function m(r = {}, e) {
|
|
24
|
+
return e.fromGlobal ? {
|
|
23
25
|
...r,
|
|
24
|
-
downloadFile:
|
|
25
|
-
} : !(r != null && r.downloadFile) &&
|
|
26
|
+
downloadFile: e.fromGlobal
|
|
27
|
+
} : !(r != null && r.downloadFile) && e.fromConfig ? {
|
|
26
28
|
...r,
|
|
27
|
-
downloadFile:
|
|
29
|
+
downloadFile: e.fromConfig
|
|
28
30
|
} : r;
|
|
29
31
|
}
|
|
30
32
|
export {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
l as isEmptyWithType,
|
|
34
|
+
m as mixinsAttachmentExtraProps,
|
|
35
|
+
i as transformValue
|
|
34
36
|
};
|
|
@@ -24,6 +24,12 @@ export interface ItemSchema<T extends Recordable = Recordable> {
|
|
|
24
24
|
customRender?: (record?: T) => VNodeChild | VNode;
|
|
25
25
|
contentSlotName?: string;
|
|
26
26
|
helpMessage?: any;
|
|
27
|
+
visible?: boolean | ((config: {
|
|
28
|
+
record: T;
|
|
29
|
+
schema: DescriptionsItemSchema;
|
|
30
|
+
}) => boolean);
|
|
31
|
+
isShowEmptyPlaceholder?: boolean;
|
|
32
|
+
format?: (text: string, record: T) => string | number;
|
|
27
33
|
}
|
|
28
34
|
/** 空的类型描述类型 */
|
|
29
35
|
export type EmptyItemSchema = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as A, useSlots as P, toRef as H, ref as y, unref as r, watch as W, nextTick as G, createBlock as K, openBlock as M, mergeProps as g, withCtx as C, createVNode as U, createSlots as $, renderList as q, renderSlot as J, normalizeProps as Q, guardReactiveProps as X } from "vue";
|
|
2
2
|
import { ApForm as w } from "../../ap-form/index.mjs";
|
|
3
|
-
import { isArray as Y, isNumber as
|
|
3
|
+
import { isArray as Y, isNumber as d, cloneDeep as f, omit as Z } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import { isDef as m } from "../../utils/index.mjs";
|
|
6
6
|
import { useGetEditableColumns as I } from "../hooks/use-editable-columns.mjs";
|
|
@@ -184,15 +184,15 @@ const he = /* @__PURE__ */ A({
|
|
|
184
184
|
}
|
|
185
185
|
function V(e, o = "suffix") {
|
|
186
186
|
var h;
|
|
187
|
-
const n = ((h = r(u)) == null ? void 0 : h.length) || 0, l =
|
|
187
|
+
const n = ((h = r(u)) == null ? void 0 : h.length) || 0, l = d(e) ? e : e.length;
|
|
188
188
|
if (m(a.maxLength) && n + l > a.maxLength)
|
|
189
189
|
return;
|
|
190
|
-
const s = [...r(u) || []], c =
|
|
190
|
+
const s = [...r(u) || []], c = d(e) ? new Array(e).fill(0).map(() => ({})) : f(e);
|
|
191
191
|
o === "suffix" ? s.push(...c) : s.unshift(...c), t == null || t.setFieldValue(a.name, s);
|
|
192
192
|
}
|
|
193
193
|
function _(e) {
|
|
194
|
-
let o =
|
|
195
|
-
const n =
|
|
194
|
+
let o = f(r(u) || []);
|
|
195
|
+
const n = d(e) ? [e] : e;
|
|
196
196
|
o = o.filter((l, s) => !n.includes(s)), t == null || t.setFieldValue(a.name, o);
|
|
197
197
|
}
|
|
198
198
|
function E() {
|
|
@@ -203,7 +203,7 @@ const he = /* @__PURE__ */ A({
|
|
|
203
203
|
return (o = r(u)) == null ? void 0 : o[e];
|
|
204
204
|
}
|
|
205
205
|
function j(e, o, n = !0) {
|
|
206
|
-
const l =
|
|
206
|
+
const l = f(r(u));
|
|
207
207
|
l[e] && (l[e] = {
|
|
208
208
|
...n ? l[e] : {},
|
|
209
209
|
...o
|
|
@@ -240,7 +240,7 @@ const he = /* @__PURE__ */ A({
|
|
|
240
240
|
ref: p,
|
|
241
241
|
class: r(B)(),
|
|
242
242
|
columns: r(D),
|
|
243
|
-
"data-source":
|
|
243
|
+
"data-source": u.value,
|
|
244
244
|
"search-form": !1
|
|
245
245
|
}), $({
|
|
246
246
|
_: 2
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as M, useSlots as U, ref as w, watch as v, unref as n, createBlock as $, openBlock as q, withCtx as
|
|
2
|
-
import { ApForm as
|
|
3
|
-
import { isEqual as ae, isArray as b, isNumber as
|
|
1
|
+
import { defineComponent as M, useSlots as U, ref as w, watch as v, unref as n, createBlock as $, openBlock as q, withCtx as c, createVNode as R, mergeProps as J, createSlots as Q, renderList as X, renderSlot as Y, normalizeProps as Z, guardReactiveProps as ee } from "vue";
|
|
2
|
+
import { ApForm as p } from "../../ap-form/index.mjs";
|
|
3
|
+
import { isEqual as ae, isArray as b, isNumber as h, cloneDeep as y, omit as te } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import "../../hooks/index.mjs";
|
|
6
6
|
import { isDef as g } from "../../utils/index.mjs";
|
|
@@ -159,15 +159,15 @@ const we = /* @__PURE__ */ M({
|
|
|
159
159
|
} = oe("editable-grid"), _ = S, C = w(), {
|
|
160
160
|
value: s,
|
|
161
161
|
updateValue: L
|
|
162
|
-
} = ne(t, _), u = w(), D = re("valueTypeMap"),
|
|
163
|
-
v(() =>
|
|
162
|
+
} = ne(t, _), u = w(), D = re("valueTypeMap"), m = p.useWatch(t.name, u);
|
|
163
|
+
v(() => m.value, (e) => {
|
|
164
164
|
var a;
|
|
165
165
|
L(e), (a = t.onChange) == null || a.call(t, e);
|
|
166
166
|
}, {
|
|
167
167
|
deep: !0
|
|
168
168
|
}), v(s, (e) => {
|
|
169
169
|
var a;
|
|
170
|
-
e !== n(
|
|
170
|
+
e !== n(m) && (ae(e, n(m)) || (a = u.value) == null || a.setFieldValue(t.name, e));
|
|
171
171
|
}, {
|
|
172
172
|
deep: !0
|
|
173
173
|
});
|
|
@@ -198,16 +198,16 @@ const we = /* @__PURE__ */ M({
|
|
|
198
198
|
}
|
|
199
199
|
function O(e, a = "suffix") {
|
|
200
200
|
var i, f, x;
|
|
201
|
-
const o = ((i = n(s)) == null ? void 0 : i.length) || 0, l =
|
|
201
|
+
const o = ((i = n(s)) == null ? void 0 : i.length) || 0, l = h(e) ? e : e.length;
|
|
202
202
|
if (g(t.maxLength) && o + l > t.maxLength)
|
|
203
203
|
return;
|
|
204
|
-
const r = [...n(s) || []], d =
|
|
204
|
+
const r = [...n(s) || []], d = h(e) ? new Array(e).fill(0).map(() => ({})) : y(e);
|
|
205
205
|
a === "suffix" ? r.push(...d) : r.unshift(...d), (x = (f = u.value) == null ? void 0 : f.setFieldValue) == null || x.call(f, t.name, r);
|
|
206
206
|
}
|
|
207
207
|
function z(e) {
|
|
208
208
|
var l, r;
|
|
209
|
-
let a =
|
|
210
|
-
const o =
|
|
209
|
+
let a = y(n(s) || []);
|
|
210
|
+
const o = h(e) ? [e] : e;
|
|
211
211
|
a = a.filter((d, i) => !o.includes(i)), (r = (l = u.value) == null ? void 0 : l.setFieldValue) == null || r.call(l, t.name, a);
|
|
212
212
|
}
|
|
213
213
|
function P() {
|
|
@@ -223,7 +223,7 @@ const we = /* @__PURE__ */ M({
|
|
|
223
223
|
}
|
|
224
224
|
function W(e, a, o = !0) {
|
|
225
225
|
var r, d;
|
|
226
|
-
const l =
|
|
226
|
+
const l = y(n(s));
|
|
227
227
|
l[e] && (l[e] = {
|
|
228
228
|
...o ? l[e] : {},
|
|
229
229
|
...a
|
|
@@ -250,7 +250,7 @@ const we = /* @__PURE__ */ M({
|
|
|
250
250
|
scrollTo: G,
|
|
251
251
|
clear: K,
|
|
252
252
|
setTableData: H
|
|
253
|
-
}), (e, a) => (q(), $(n(
|
|
253
|
+
}), (e, a) => (q(), $(n(p), {
|
|
254
254
|
ref_key: "formRef",
|
|
255
255
|
ref: u,
|
|
256
256
|
"initial-values": {
|
|
@@ -260,22 +260,22 @@ const we = /* @__PURE__ */ M({
|
|
|
260
260
|
height: "100%"
|
|
261
261
|
}
|
|
262
262
|
}, {
|
|
263
|
-
default:
|
|
263
|
+
default: c(() => [R(n(p).FormItem, {
|
|
264
264
|
name: e.name,
|
|
265
265
|
"no-style": ""
|
|
266
266
|
}, {
|
|
267
|
-
default:
|
|
267
|
+
default: c(() => [R(se, J(n(te)(t, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue"]), {
|
|
268
268
|
ref_key: "tableRef",
|
|
269
269
|
ref: C,
|
|
270
270
|
class: n(V)(),
|
|
271
271
|
columns: n(E),
|
|
272
|
-
"data-source": n(
|
|
272
|
+
"data-source": n(s),
|
|
273
273
|
"search-form": !1
|
|
274
274
|
}), Q({
|
|
275
275
|
_: 2
|
|
276
276
|
}, [X(N, (o, l) => ({
|
|
277
277
|
name: l,
|
|
278
|
-
fn:
|
|
278
|
+
fn: c((r) => [Y(e.$slots, l, Z(ee(r || {})))])
|
|
279
279
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
280
280
|
_: 3
|
|
281
281
|
}, 8, ["name"])]),
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { createVNode as
|
|
2
|
-
import { isUndefined as
|
|
3
|
-
import { valueEnumToArray as
|
|
1
|
+
import { createVNode as v, Fragment as S } from "vue";
|
|
2
|
+
import { isUndefined as $, isArray as M, isString as x, isBoolean as c, isNumber as V, pick as A } from "lodash-unified";
|
|
3
|
+
import { valueEnumToArray as j, objectToString as B, getTableTitle as R, getTableRenderType as N, getTableRenderProps as W, getTableCellRenderNode as _ } from "../../ap-table/utils.mjs";
|
|
4
4
|
import { noRenderAsFormItemValueList as k } from "../../ap-table/constants.mjs";
|
|
5
5
|
import "../../ap-table/components/paragraph-ellipsis/index.vue.mjs";
|
|
6
6
|
import z from "../../ap-table/components/paragraph-ellipsis/index.vue2.mjs";
|
|
7
|
-
function O(e) {
|
|
8
|
-
if (!M(e))
|
|
9
|
-
return S(e) ? e.reduce((r, t) => v(t) ? `${r}.${t}` : `${r}[${t}]`, "") : String(e);
|
|
10
|
-
}
|
|
11
7
|
function b(e) {
|
|
8
|
+
if (!$(e))
|
|
9
|
+
return M(e) ? e.reduce((r, t) => x(t) ? `${r}.${t}` : `${r}[${t}]`, "") : String(e);
|
|
10
|
+
}
|
|
11
|
+
function w(e) {
|
|
12
12
|
if (e)
|
|
13
13
|
return e === !0 ? "left" : e;
|
|
14
14
|
}
|
|
15
15
|
function G(e) {
|
|
16
|
-
return
|
|
16
|
+
return c(e) ? {
|
|
17
17
|
sortable: e
|
|
18
18
|
} : e ? {
|
|
19
19
|
sortable: !0,
|
|
@@ -25,8 +25,8 @@ function G(e) {
|
|
|
25
25
|
}
|
|
26
26
|
function I(e) {
|
|
27
27
|
let r;
|
|
28
|
-
return
|
|
29
|
-
label:
|
|
28
|
+
return c(e.filters) && e.valueEnum ? r = j(e.valueEnum) : r = e.filters, r == null ? void 0 : r.map((t) => ({
|
|
29
|
+
label: x(t.text) ? t.text : "",
|
|
30
30
|
value: t.value
|
|
31
31
|
}));
|
|
32
32
|
}
|
|
@@ -34,12 +34,12 @@ function L(e) {
|
|
|
34
34
|
if (e)
|
|
35
35
|
return (r) => e(r.value, r.row);
|
|
36
36
|
}
|
|
37
|
-
function U(e, r
|
|
38
|
-
return e ?
|
|
39
|
-
tooltip:
|
|
37
|
+
function U(e, r) {
|
|
38
|
+
return e ? V(e) ? {
|
|
39
|
+
tooltip: r,
|
|
40
40
|
rows: e
|
|
41
41
|
} : e === !0 || e === "tooltip" ? {
|
|
42
|
-
tooltip:
|
|
42
|
+
tooltip: r,
|
|
43
43
|
rows: 1
|
|
44
44
|
} : {
|
|
45
45
|
tooltip: null,
|
|
@@ -47,12 +47,13 @@ function U(e, r, t) {
|
|
|
47
47
|
htmlTitle: e === "title" ? r : ""
|
|
48
48
|
} : !1;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function q(e, r, t) {
|
|
51
51
|
if (k.includes(e.valueType))
|
|
52
52
|
return t;
|
|
53
53
|
if (e.copyable || e.ellipsis) {
|
|
54
|
-
const n = U(e.ellipsis, r,
|
|
55
|
-
return
|
|
54
|
+
const n = U(e.ellipsis, r), i = B(r);
|
|
55
|
+
return v(z, {
|
|
56
|
+
rawValue: i,
|
|
56
57
|
copyable: e.copyable,
|
|
57
58
|
ellipsis: n,
|
|
58
59
|
content: t
|
|
@@ -61,33 +62,33 @@ function V(e, r, t) {
|
|
|
61
62
|
return t;
|
|
62
63
|
}
|
|
63
64
|
function y(e, r, t) {
|
|
64
|
-
const n =
|
|
65
|
-
return n.field =
|
|
66
|
-
header: () =>
|
|
65
|
+
const n = A(e, ["width", "minWidth", "align"]);
|
|
66
|
+
return n.field = b(e.dataIndex), n.fixed = w(e.fixed), n.slots = {
|
|
67
|
+
header: () => R(e, t, void 0, r)
|
|
67
68
|
}, n.headerAlign = e.align, n.showOverflow = !1, n.showFooterOverflow = !1, n;
|
|
68
69
|
}
|
|
69
|
-
function
|
|
70
|
-
const i =
|
|
71
|
-
i.field =
|
|
70
|
+
function F(e, r, t, n) {
|
|
71
|
+
const i = A(e, ["width", "minWidth", "align", "resizable"]);
|
|
72
|
+
i.field = b(e.dataIndex), i.fixed = w(e.fixed), i.headerAlign = e.align, i.footerAlign = e.align, i.showOverflow = !1, i.showFooterOverflow = !1, Object.assign(i, G(e.sorter)), i.filters = I(e), i.filterMultiple = e.filterMultiple, i.filterMethod = L(e.onFilter);
|
|
72
73
|
const a = ({
|
|
73
74
|
value: d,
|
|
74
75
|
...l
|
|
75
76
|
}) => {
|
|
76
77
|
var T, o;
|
|
77
|
-
const f =
|
|
78
|
+
const f = N(e), u = W({
|
|
78
79
|
...e,
|
|
79
80
|
valueType: f
|
|
80
81
|
}, {
|
|
81
82
|
value: d,
|
|
82
83
|
...l
|
|
83
|
-
}),
|
|
84
|
+
}), E = _(f, u, l.record, n), h = ((T = e.renderText) == null ? void 0 : T.call(e, {
|
|
84
85
|
value: d,
|
|
85
86
|
...l
|
|
86
|
-
})) || d,
|
|
87
|
+
})) || d, O = e.renderText ? v(S, null, [(o = e.renderText) == null ? void 0 : o.call(e, {
|
|
87
88
|
value: d,
|
|
88
89
|
...l
|
|
89
|
-
})]) :
|
|
90
|
-
let p =
|
|
90
|
+
})]) : E;
|
|
91
|
+
let p = q(e, h, O);
|
|
91
92
|
return e.customRender && (p = e.customRender({
|
|
92
93
|
value: d,
|
|
93
94
|
...l,
|
|
@@ -107,15 +108,15 @@ function x(e, r, t, n) {
|
|
|
107
108
|
column: e
|
|
108
109
|
});
|
|
109
110
|
return i.slots = {
|
|
110
|
-
header: () =>
|
|
111
|
+
header: () => R(e, t, void 0, r),
|
|
111
112
|
default: s,
|
|
112
113
|
footer: s
|
|
113
114
|
}, i;
|
|
114
115
|
}
|
|
115
|
-
function
|
|
116
|
+
function Y(e, r, t, n) {
|
|
116
117
|
var s;
|
|
117
118
|
if (!((s = e.children) != null && s.length))
|
|
118
|
-
return
|
|
119
|
+
return F(e, r, t, n);
|
|
119
120
|
function i(d) {
|
|
120
121
|
return d.map((l) => {
|
|
121
122
|
var f;
|
|
@@ -123,14 +124,14 @@ function X(e, r, t, n) {
|
|
|
123
124
|
const u = y(l, r, t);
|
|
124
125
|
return u.children = i(l.children), u;
|
|
125
126
|
}
|
|
126
|
-
return
|
|
127
|
+
return F(l, r, t, n);
|
|
127
128
|
});
|
|
128
129
|
}
|
|
129
130
|
const a = y(e, r, t);
|
|
130
131
|
return a.children = i(e.children), a;
|
|
131
132
|
}
|
|
132
133
|
export {
|
|
133
|
-
|
|
134
|
+
Y as transformCol,
|
|
134
135
|
y as transformToColGroup,
|
|
135
|
-
|
|
136
|
+
F as transformToColumn
|
|
136
137
|
};
|