@aplus-frontend/ui 6.17.0 → 6.17.1
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.
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { omit as
|
|
2
|
-
import { isDef as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
var
|
|
1
|
+
import { omit as s, isUndefined as d, isFunction as m, isNumber as C } from "lodash-unified";
|
|
2
|
+
import { isDef as g } from "../../utils/index.mjs";
|
|
3
|
+
const y = 20, b = 50, w = (e) => e.some((t) => !!t.html);
|
|
4
|
+
function K(e) {
|
|
5
|
+
var o;
|
|
6
6
|
const t = {
|
|
7
|
-
...
|
|
7
|
+
...s(e, [
|
|
8
8
|
"columns",
|
|
9
9
|
"request",
|
|
10
10
|
"searchForm",
|
|
@@ -18,39 +18,39 @@ function v(e) {
|
|
|
18
18
|
isHover: !0,
|
|
19
19
|
keyField: e.rowKey,
|
|
20
20
|
isCurrent: !!e.rowHighlightable
|
|
21
|
-
}, t.columnConfig = {},
|
|
22
|
-
const
|
|
23
|
-
|
|
21
|
+
}, t.columnConfig = {}, w(e.columns || []) && (t.rowConfig.useKey = !0, t.columnConfig.useKey = !0), e.adaptive && (t.autoResize = !0, t.height = "100%"), e.columnResizable && (t.columnConfig.resizable = !0), e.rowSelection) {
|
|
22
|
+
const r = e.rowSelection === !0 ? {} : e.rowSelection;
|
|
23
|
+
r.type === "radio" ? t.radioConfig = {
|
|
24
24
|
highlight: !0,
|
|
25
|
-
checkMethod({ row:
|
|
26
|
-
return
|
|
25
|
+
checkMethod({ row: i }) {
|
|
26
|
+
return r.disabled ? !r.disabled(i) : !0;
|
|
27
27
|
},
|
|
28
|
-
visibleMethod({ row:
|
|
29
|
-
return
|
|
28
|
+
visibleMethod({ row: i }) {
|
|
29
|
+
return r.shown ? r.shown(i) : !0;
|
|
30
30
|
},
|
|
31
|
-
checkRowKey: (
|
|
32
|
-
reserve:
|
|
31
|
+
checkRowKey: (o = r.defaultSelectedRowKeys) == null ? void 0 : o[0],
|
|
32
|
+
reserve: d(r.preserveSelectedRowKeys) ? !0 : r.preserveSelectedRowKeys
|
|
33
33
|
} : t.checkboxConfig = {
|
|
34
34
|
highlight: !0,
|
|
35
|
-
checkMethod({ row:
|
|
36
|
-
return
|
|
35
|
+
checkMethod({ row: i }) {
|
|
36
|
+
return r.disabled ? !r.disabled(i) : !0;
|
|
37
37
|
},
|
|
38
|
-
visibleMethod({ row:
|
|
39
|
-
return
|
|
38
|
+
visibleMethod({ row: i }) {
|
|
39
|
+
return r.shown ? r.shown(i) : !0;
|
|
40
40
|
},
|
|
41
|
-
reserve:
|
|
42
|
-
range:
|
|
41
|
+
reserve: d(r.preserveSelectedRowKeys) ? !0 : r.preserveSelectedRowKeys,
|
|
42
|
+
range: r.range || !1
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
return t.border = e.bordered === !1 ? "inner" : !0, e.expandable && (t.expandConfig =
|
|
45
|
+
return t.border = e.bordered === !1 ? "inner" : !0, e.expandable && (t.expandConfig = s(e.expandable, [
|
|
46
46
|
"renderContent",
|
|
47
47
|
"width",
|
|
48
48
|
"title"
|
|
49
|
-
])), e.footer && (t.showFooter = !0,
|
|
49
|
+
])), e.footer && (t.showFooter = !0, m(e.footer) ? t.footerMethod = e.footer : t.footerData = e.footer), e.virtual === !1 ? (t.virtualXConfig = {
|
|
50
50
|
enabled: !1
|
|
51
51
|
}, t.virtualYConfig = {
|
|
52
52
|
enabled: !1
|
|
53
|
-
}) : (f(t, "X", e.virtual), f(t, "Y", e.virtual)), t.round =
|
|
53
|
+
}) : (f(t, "X", e.virtual), f(t, "Y", e.virtual)), t.round = g(e.round) ? e.round : !e.card, t.headerCellConfig = {
|
|
54
54
|
height: 36,
|
|
55
55
|
...t.headerCellConfig || {}
|
|
56
56
|
}, t.treeConfig && (t.treeConfig = {
|
|
@@ -59,28 +59,32 @@ function v(e) {
|
|
|
59
59
|
* 使用非树层级列表,配合transform
|
|
60
60
|
*/
|
|
61
61
|
transform: !0
|
|
62
|
-
}), t
|
|
62
|
+
}), t.resizableConfig = {
|
|
63
|
+
minWidth({ cell: r }) {
|
|
64
|
+
return R(r, e.size);
|
|
65
|
+
}
|
|
66
|
+
}, t;
|
|
63
67
|
}
|
|
64
|
-
function f(e, t,
|
|
65
|
-
const
|
|
66
|
-
e[
|
|
67
|
-
enabled:
|
|
68
|
+
function f(e, t, n) {
|
|
69
|
+
const o = t === "X", r = o ? "x" : "y", i = o ? "virtualXConfig" : "virtualYConfig", u = n == null ? void 0 : n[r], c = u !== !1, l = o ? y : b, h = C(u) && u >= 0 ? u : l;
|
|
70
|
+
e[i] = {
|
|
71
|
+
enabled: c,
|
|
68
72
|
gt: h,
|
|
69
|
-
oSize: (
|
|
73
|
+
oSize: (n == null ? void 0 : n.oSize) || 0
|
|
70
74
|
};
|
|
71
75
|
}
|
|
72
|
-
function
|
|
76
|
+
function x(e) {
|
|
73
77
|
return e === !0 ? "left" : e;
|
|
74
78
|
}
|
|
75
|
-
function
|
|
76
|
-
const
|
|
77
|
-
let
|
|
78
|
-
return
|
|
79
|
-
(
|
|
79
|
+
function M(e, t) {
|
|
80
|
+
const n = e === !0 || !e.type ? "checkbox" : e.type, o = e === !0 ? 60 : e.columnWidth || 60;
|
|
81
|
+
let r = e === !0 ? void 0 : x(e.fixed);
|
|
82
|
+
return r || (r === !1 ? r = void 0 : r = t.some(
|
|
83
|
+
(i) => i.fixed === "left" || i.fixed === !0
|
|
80
84
|
) ? "left" : void 0), {
|
|
81
|
-
type:
|
|
82
|
-
width:
|
|
83
|
-
fixed:
|
|
85
|
+
type: n,
|
|
86
|
+
width: o,
|
|
87
|
+
fixed: r
|
|
84
88
|
};
|
|
85
89
|
}
|
|
86
90
|
function k(e) {
|
|
@@ -91,8 +95,22 @@ function k(e) {
|
|
|
91
95
|
width: t
|
|
92
96
|
};
|
|
93
97
|
}
|
|
98
|
+
function a(e) {
|
|
99
|
+
if (!e)
|
|
100
|
+
return 0;
|
|
101
|
+
const t = getComputedStyle(e);
|
|
102
|
+
return e.offsetWidth + (Number.parseFloat(t.marginLeft) || 0) + Number.parseFloat(t.marginRight) || 0;
|
|
103
|
+
}
|
|
104
|
+
function R(e, t) {
|
|
105
|
+
if (!e)
|
|
106
|
+
return "auto";
|
|
107
|
+
const n = getComputedStyle(e);
|
|
108
|
+
let o = t === "medium" ? 12 * 2 : 9 * 2;
|
|
109
|
+
const r = (Number.parseFloat(n.fontSize) || 14) * 1.6;
|
|
110
|
+
return o += r, e.querySelector("span.anticon-question-circle") && (o += 20), o += a(e.querySelector(".vxe-cell--sort")) + a(e.querySelector(".vxe-cell--filter")), Math.ceil(o);
|
|
111
|
+
}
|
|
94
112
|
export {
|
|
95
113
|
k as getRowExpandProps,
|
|
96
|
-
|
|
97
|
-
|
|
114
|
+
M as getRowSelectionProps,
|
|
115
|
+
K as toVxeProps
|
|
98
116
|
};
|
package/es/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "6.17.
|
|
1
|
+
declare const _default: "6.17.1";
|
|
2
2
|
export default _default;
|
package/es/src/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("lodash-unified"),h=require("../../utils/index.js"),g=20,m=50,C=e=>e.some(t=>!!t.html);function y(e){var r;const t={...u.omit(e,["columns","request","searchForm","dataSource","rowKey","value","round"])};if(t.rowConfig={isHover:!0,keyField:e.rowKey,isCurrent:!!e.rowHighlightable},t.columnConfig={},C(e.columns||[])&&(t.rowConfig.useKey=!0,t.columnConfig.useKey=!0),e.adaptive&&(t.autoResize=!0,t.height="100%"),e.columnResizable&&(t.columnConfig.resizable=!0),e.rowSelection){const o=e.rowSelection===!0?{}:e.rowSelection;o.type==="radio"?t.radioConfig={highlight:!0,checkMethod({row:i}){return o.disabled?!o.disabled(i):!0},visibleMethod({row:i}){return o.shown?o.shown(i):!0},checkRowKey:(r=o.defaultSelectedRowKeys)==null?void 0:r[0],reserve:u.isUndefined(o.preserveSelectedRowKeys)?!0:o.preserveSelectedRowKeys}:t.checkboxConfig={highlight:!0,checkMethod({row:i}){return o.disabled?!o.disabled(i):!0},visibleMethod({row:i}){return o.shown?o.shown(i):!0},reserve:u.isUndefined(o.preserveSelectedRowKeys)?!0:o.preserveSelectedRowKeys,range:o.range||!1}}return t.border=e.bordered===!1?"inner":!0,e.expandable&&(t.expandConfig=u.omit(e.expandable,["renderContent","width","title"])),e.footer&&(t.showFooter=!0,u.isFunction(e.footer)?t.footerMethod=e.footer:t.footerData=e.footer),e.virtual===!1?(t.virtualXConfig={enabled:!1},t.virtualYConfig={enabled:!1}):(d(t,"X",e.virtual),d(t,"Y",e.virtual)),t.round=h.isDef(e.round)?e.round:!e.card,t.headerCellConfig={height:36,...t.headerCellConfig||{}},t.treeConfig&&(t.treeConfig={...t.treeConfig||{},transform:!0}),t.resizableConfig={minWidth({cell:o}){return S(o,e.size)}},t}function d(e,t,n){const r=t==="X",o=r?"x":"y",i=r?"virtualXConfig":"virtualYConfig",l=n==null?void 0:n[o],f=l!==!1,s=r?g:m,c=u.isNumber(l)&&l>=0?l:s;e[i]={enabled:f,gt:c,oSize:(n==null?void 0:n.oSize)||0}}function b(e){return e===!0?"left":e}function w(e,t){const n=e===!0||!e.type?"checkbox":e.type,r=e===!0?60:e.columnWidth||60;let o=e===!0?void 0:b(e.fixed);return o||(o===!1?o=void 0:o=t.some(i=>i.fixed==="left"||i.fixed===!0)?"left":void 0),{type:n,width:r,fixed:o}}function x(e){const t=(e==null?void 0:e.width)||"auto";return{type:"expand",title:e==null?void 0:e.title,width:t}}function a(e){if(!e)return 0;const t=getComputedStyle(e);return e.offsetWidth+(Number.parseFloat(t.marginLeft)||0)+Number.parseFloat(t.marginRight)||0}function S(e,t){if(!e)return"auto";const n=getComputedStyle(e);let r=t==="medium"?12*2:9*2;const o=(Number.parseFloat(n.fontSize)||14)*1.6;return r+=o,e.querySelector("span.anticon-question-circle")&&(r+=20),r+=a(e.querySelector(".vxe-cell--sort"))+a(e.querySelector(".vxe-cell--filter")),Math.ceil(r)}exports.getRowExpandProps=x;exports.getRowSelectionProps=w;exports.toVxeProps=y;
|
package/lib/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "6.17.
|
|
1
|
+
declare const _default: "6.17.1";
|
|
2
2
|
export default _default;
|
package/lib/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="6.17.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="6.17.1";exports.default=e;
|