@aplus-frontend/ui 0.5.15 → 0.5.17
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 +41 -39
- package/es/src/ap-grid/index.vue.mjs +109 -108
- package/es/src/ap-grid/interface.d.ts +10 -0
- package/es/src/ap-grid/utils/table.mjs +39 -32
- package/es/src/ap-table/utils.mjs +27 -26
- package/es/src/index.d.ts +1 -0
- package/es/src/index.mjs +239 -236
- package/es/src/mask/index.d.ts +2 -0
- package/es/src/mask/index.mjs +1 -0
- package/es/src/mask/index.vue.d.ts +31 -0
- package/es/src/mask/index.vue.mjs +116 -0
- package/es/src/mask/index.vue2.mjs +4 -0
- package/es/src/mask/interface.d.ts +21 -0
- package/es/src/mask/utils.d.ts +2 -0
- package/es/src/mask/utils.mjs +21 -0
- package/lib/index.js +1 -1
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-grid/interface.d.ts +10 -0
- package/lib/src/ap-grid/utils/table.js +1 -1
- package/lib/src/ap-table/utils.js +1 -1
- package/lib/src/index.d.ts +1 -0
- package/lib/src/index.js +1 -1
- package/lib/src/mask/index.d.ts +2 -0
- package/lib/src/mask/index.js +1 -0
- package/lib/src/mask/index.vue.d.ts +31 -0
- package/lib/src/mask/index.vue.js +1 -0
- package/lib/src/mask/index.vue2.js +1 -0
- package/lib/src/mask/interface.d.ts +21 -0
- package/lib/src/mask/utils.d.ts +2 -0
- package/lib/src/mask/utils.js +6 -0
- package/package.json +3 -3
- package/theme/index.css +54 -0
- package/theme/index.less +1 -0
- package/theme/mask/index.css +54 -0
- package/theme/mask/index.less +28 -0
- package/theme/mixins/animations.css +24 -0
- package/theme/mixins/animations.less +38 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { omit as
|
|
2
|
-
const h =
|
|
3
|
-
function
|
|
4
|
-
var
|
|
1
|
+
import { omit as u, isUndefined as d, isFunction as f, isNumber as c } from "lodash-unified";
|
|
2
|
+
const h = 20, v = 50;
|
|
3
|
+
function y(e) {
|
|
4
|
+
var l, n, i;
|
|
5
5
|
const t = {
|
|
6
|
-
...
|
|
6
|
+
...u(e, [
|
|
7
7
|
"columns",
|
|
8
8
|
"request",
|
|
9
9
|
"searchForm",
|
|
@@ -15,24 +15,31 @@ function R(e) {
|
|
|
15
15
|
if (e.adaptive && (t.autoResize = !0, t.height = "100%"), e.columnResizable && (t.columnConfig ? t.columnConfig.resizable = !0 : t.columnConfig = {
|
|
16
16
|
resizable: !0
|
|
17
17
|
}), e.rowSelection) {
|
|
18
|
-
const
|
|
19
|
-
|
|
18
|
+
const r = e.rowSelection === !0 ? {} : e.rowSelection;
|
|
19
|
+
r.type === "radio" ? t.radioConfig = {
|
|
20
20
|
highlight: !0,
|
|
21
|
-
checkMethod({ row:
|
|
22
|
-
return
|
|
21
|
+
checkMethod({ row: o }) {
|
|
22
|
+
return r.disabled ? !r.disabled(o) : !0;
|
|
23
23
|
},
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
visibleMethod({ row: o }) {
|
|
25
|
+
return r.shown ? r.shown(o) : !0;
|
|
26
|
+
},
|
|
27
|
+
checkRowKey: (l = r.defaultSelectedRowKeys) == null ? void 0 : l[0],
|
|
28
|
+
reserve: d(r.preserveSelectedRowKeys) ? !0 : r.preserveSelectedRowKeys
|
|
26
29
|
} : t.checkboxConfig = {
|
|
27
30
|
highlight: !0,
|
|
28
|
-
checkMethod({ row:
|
|
29
|
-
return
|
|
31
|
+
checkMethod({ row: o }) {
|
|
32
|
+
return r.disabled ? !r.disabled(o) : !0;
|
|
33
|
+
},
|
|
34
|
+
visibleMethod({ row: o }) {
|
|
35
|
+
return r.shown ? r.shown(o) : !0;
|
|
30
36
|
},
|
|
31
|
-
checkRowKeys:
|
|
32
|
-
reserve:
|
|
37
|
+
checkRowKeys: r.defaultSelectedRowKeys,
|
|
38
|
+
reserve: d(r.preserveSelectedRowKeys) ? !0 : r.preserveSelectedRowKeys,
|
|
39
|
+
range: r.range || !1
|
|
33
40
|
};
|
|
34
41
|
}
|
|
35
|
-
return t.border = e.bordered, e.expandable && (t.expandConfig =
|
|
42
|
+
return t.border = e.bordered, e.expandable && (t.expandConfig = u(e.expandable, [
|
|
36
43
|
"renderContent",
|
|
37
44
|
"width",
|
|
38
45
|
"title"
|
|
@@ -40,27 +47,27 @@ function R(e) {
|
|
|
40
47
|
enabled: !1
|
|
41
48
|
}, t.virtualYConfig = {
|
|
42
49
|
enabled: !1
|
|
43
|
-
}) : (
|
|
50
|
+
}) : (s(t, "X", (n = e.virtual) == null ? void 0 : n.x), s(t, "Y", (i = e.virtual) == null ? void 0 : i.y)), t;
|
|
44
51
|
}
|
|
45
|
-
function
|
|
46
|
-
const
|
|
47
|
-
e[
|
|
48
|
-
enabled:
|
|
49
|
-
gt:
|
|
52
|
+
function s(e, t, l) {
|
|
53
|
+
const n = t === "X", i = n ? "virtualXConfig" : "virtualYConfig", r = l !== !1, o = n ? h : v, a = c(l) && l >= 0 ? l : o;
|
|
54
|
+
e[i] = {
|
|
55
|
+
enabled: r,
|
|
56
|
+
gt: a
|
|
50
57
|
};
|
|
51
58
|
}
|
|
52
59
|
function b(e) {
|
|
53
60
|
return e === !0 ? "left" : e;
|
|
54
61
|
}
|
|
55
|
-
function
|
|
56
|
-
const
|
|
57
|
-
let
|
|
58
|
-
return
|
|
59
|
-
(
|
|
62
|
+
function R(e, t) {
|
|
63
|
+
const l = e === !0 || !e.type ? "checkbox" : e.type, n = e === !0 ? 60 : e.columnWidth || 60;
|
|
64
|
+
let i = e === !0 ? void 0 : b(e.fixed);
|
|
65
|
+
return i || (i === !1 ? i = void 0 : i = t.some(
|
|
66
|
+
(r) => r.fixed === "left" || r.fixed === !0
|
|
60
67
|
) ? "left" : void 0), {
|
|
61
|
-
type:
|
|
62
|
-
width:
|
|
63
|
-
fixed:
|
|
68
|
+
type: l,
|
|
69
|
+
width: n,
|
|
70
|
+
fixed: i
|
|
64
71
|
};
|
|
65
72
|
}
|
|
66
73
|
function x(e) {
|
|
@@ -73,6 +80,6 @@ function x(e) {
|
|
|
73
80
|
}
|
|
74
81
|
export {
|
|
75
82
|
x as getRowExpandProps,
|
|
76
|
-
|
|
77
|
-
|
|
83
|
+
R as getRowSelectionProps,
|
|
84
|
+
y as toVxeProps
|
|
78
85
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { isVNode as E, createVNode as l, mergeProps as
|
|
2
|
-
import { isObject as
|
|
3
|
-
import { apTableRenderItemMap as
|
|
1
|
+
import { isVNode as E, createVNode as l, mergeProps as b, cloneVNode as j, Fragment as O } from "vue";
|
|
2
|
+
import { isObject as p, isArray as f, isUndefined as g, isFunction as T, omit as C, isBoolean as F, isString as N, isEqual as S, sortBy as d, isPlainObject as m, every as I, isEmpty as v } from "lodash-unified";
|
|
3
|
+
import { apTableRenderItemMap as P, apTableFormItemMap as V } from "./constants.mjs";
|
|
4
4
|
import { isType as _ } from "@fruits-chain/utils";
|
|
5
5
|
import "../ap-form/index.mjs";
|
|
6
6
|
import { Tooltip as w } from "@aplus-frontend/antdv";
|
|
7
7
|
import { QuestionCircleOutlined as x } from "@ant-design/icons-vue";
|
|
8
8
|
import "./components/dynamic-component/index.vue.mjs";
|
|
9
|
-
import
|
|
9
|
+
import y from "./components/dynamic-component/index.vue2.mjs";
|
|
10
10
|
import A from "../ap-form/item/index.vue.mjs";
|
|
11
11
|
function R(t) {
|
|
12
12
|
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !E(t);
|
|
13
13
|
}
|
|
14
14
|
const q = (t, e, n) => {
|
|
15
15
|
let o = {};
|
|
16
|
-
return
|
|
17
|
-
|
|
16
|
+
return p(t) ? Object.keys(t).forEach((i) => {
|
|
17
|
+
p(t[i]) ? o[i] = q(t[i], e[i], n) : o[i] = n(t[i], e);
|
|
18
18
|
}) : o = n(t, e), o;
|
|
19
19
|
}, k = (t, e) => {
|
|
20
20
|
switch (t) {
|
|
@@ -28,7 +28,7 @@ const q = (t, e, n) => {
|
|
|
28
28
|
}
|
|
29
29
|
case "multiple":
|
|
30
30
|
case "multipleNumber":
|
|
31
|
-
return
|
|
31
|
+
return f(e) ? e : [e];
|
|
32
32
|
case "boolean":
|
|
33
33
|
return e;
|
|
34
34
|
case "object":
|
|
@@ -38,13 +38,13 @@ const q = (t, e, n) => {
|
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
function H(t) {
|
|
41
|
-
return
|
|
41
|
+
return f(t) ? t.join(".") : t;
|
|
42
42
|
}
|
|
43
43
|
function W(t) {
|
|
44
44
|
const e = Object.prototype.toString.call(t).match(/^\[object (.*)\]$/)[1].toLowerCase();
|
|
45
45
|
return e === "string" && typeof t == "object" ? "object" : t === null ? "null" : t === void 0 ? "undefined" : e;
|
|
46
46
|
}
|
|
47
|
-
const $ = (t) => W(t) === "map" ? t : new Map(Object.entries(t || {})),
|
|
47
|
+
const $ = (t) => W(t) === "map" ? t : new Map(Object.entries(t || {})), h = (t) => {
|
|
48
48
|
const e = [], n = $(t);
|
|
49
49
|
return n.forEach((o, i) => {
|
|
50
50
|
const r = n.get(i) || n.get(`${i}`);
|
|
@@ -75,9 +75,9 @@ function tt(t) {
|
|
|
75
75
|
}
|
|
76
76
|
function et(t, e, n, o) {
|
|
77
77
|
var s;
|
|
78
|
-
const i =
|
|
78
|
+
const i = P[t];
|
|
79
79
|
if (i)
|
|
80
|
-
return l(i,
|
|
80
|
+
return l(i, b(e, {
|
|
81
81
|
mode: "read"
|
|
82
82
|
}), null);
|
|
83
83
|
const r = o == null ? void 0 : o[t];
|
|
@@ -86,7 +86,7 @@ function et(t, e, n, o) {
|
|
|
86
86
|
function nt(t, e) {
|
|
87
87
|
if (t.customRenderFormItem)
|
|
88
88
|
return {
|
|
89
|
-
Comp:
|
|
89
|
+
Comp: y,
|
|
90
90
|
render: function(s) {
|
|
91
91
|
const u = s.item.customRenderFormItem(s.item);
|
|
92
92
|
return j(u, {
|
|
@@ -99,7 +99,7 @@ function nt(t, e) {
|
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
101
|
};
|
|
102
|
-
const n =
|
|
102
|
+
const n = V[t.valueType];
|
|
103
103
|
if (n)
|
|
104
104
|
return {
|
|
105
105
|
Comp: n
|
|
@@ -108,7 +108,7 @@ function nt(t, e) {
|
|
|
108
108
|
function i(r) {
|
|
109
109
|
var u;
|
|
110
110
|
const s = (u = o == null ? void 0 : o.renderFormItem) == null ? void 0 : u.call(o, r.item.fieldProps.field);
|
|
111
|
-
return s ? l(A,
|
|
111
|
+
return s ? l(A, b(r.item.fieldProps, {
|
|
112
112
|
hidden: r.hidden,
|
|
113
113
|
class: r.class,
|
|
114
114
|
span: t.span
|
|
@@ -117,7 +117,7 @@ function nt(t, e) {
|
|
|
117
117
|
}) : null;
|
|
118
118
|
}
|
|
119
119
|
return {
|
|
120
|
-
Comp:
|
|
120
|
+
Comp: y,
|
|
121
121
|
render: i
|
|
122
122
|
};
|
|
123
123
|
}
|
|
@@ -136,14 +136,14 @@ function ot(t) {
|
|
|
136
136
|
const e = {
|
|
137
137
|
...t
|
|
138
138
|
};
|
|
139
|
-
return F(t.filters) && t.filters && t.valueEnum && (e.filters =
|
|
139
|
+
return F(t.filters) && t.filters && t.valueEnum && (e.filters = h(t.valueEnum)), e;
|
|
140
140
|
}
|
|
141
141
|
function it(t, e) {
|
|
142
142
|
var o;
|
|
143
143
|
const n = e || {};
|
|
144
144
|
return t.valueEnum && !((o = n.field) != null && o.options) && (n.field = {
|
|
145
145
|
...n.field,
|
|
146
|
-
options:
|
|
146
|
+
options: h(t.valueEnum)
|
|
147
147
|
}), n;
|
|
148
148
|
}
|
|
149
149
|
function st(t) {
|
|
@@ -159,22 +159,23 @@ function ut(t, e, n, o) {
|
|
|
159
159
|
const i = n == null ? void 0 : n({
|
|
160
160
|
title: t.title,
|
|
161
161
|
column: t
|
|
162
|
-
}), r = (i == null ? void 0 : i.filter((
|
|
162
|
+
}), r = (i == null ? void 0 : i.filter((c) => c.type !== Symbol.for("v-cmt"))) || [];
|
|
163
163
|
if (i && r.length > 0)
|
|
164
164
|
return i;
|
|
165
165
|
const u = N(t.title) ? l("span", {
|
|
166
166
|
class: e,
|
|
167
167
|
title: t.title
|
|
168
|
-
}, [t.title]) : t.title,
|
|
169
|
-
return
|
|
168
|
+
}, [t.title]) : t.title, a = t.tooltip ? T(t.tooltip) ? t.tooltip(t) : l(O, null, [t.tooltip]) : null;
|
|
169
|
+
return a ? l("span", {
|
|
170
170
|
style: {
|
|
171
171
|
display: "inline-flex",
|
|
172
172
|
alignItems: "center",
|
|
173
173
|
maxWidth: "100%"
|
|
174
174
|
}
|
|
175
175
|
}, [u, l(w, {
|
|
176
|
-
title:
|
|
177
|
-
placement: "bottom"
|
|
176
|
+
title: a,
|
|
177
|
+
placement: "bottom",
|
|
178
|
+
getPopupContainer: (c) => c.closest(".ant-table") || c.closest(".ant-modal") || document.body
|
|
178
179
|
}, {
|
|
179
180
|
default: () => [l(x, {
|
|
180
181
|
style: {
|
|
@@ -195,9 +196,9 @@ function lt(t, e) {
|
|
|
195
196
|
return o(t), n;
|
|
196
197
|
}
|
|
197
198
|
function ct(t, e) {
|
|
198
|
-
if (
|
|
199
|
-
return S(
|
|
200
|
-
if (
|
|
199
|
+
if (f(t) && f(e))
|
|
200
|
+
return S(d(t), d(e));
|
|
201
|
+
if (m(t) && m(e)) {
|
|
201
202
|
const n = (o) => I(o, (i) => i == null) || v(o);
|
|
202
203
|
if (n(t) && n(e))
|
|
203
204
|
return !0;
|
|
@@ -225,5 +226,5 @@ export {
|
|
|
225
226
|
k as parseFieldValue,
|
|
226
227
|
lt as recursionApColumns,
|
|
227
228
|
it as updateFormProps,
|
|
228
|
-
|
|
229
|
+
h as valueEnumToArray
|
|
229
230
|
};
|
package/es/src/index.d.ts
CHANGED