@aplus-frontend/ui 6.40.0 → 7.0.0-beta.0
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/ag-grid/editable/form-item.vue.mjs +1 -0
- package/es/src/ag-grid/editable/index.vue.mjs +1 -0
- package/es/src/ag-grid/editable/interface.d.ts +1 -0
- package/es/src/ag-grid/hooks/use-columns-def.mjs +27 -26
- package/es/src/ag-grid/hooks/use-editable-columns.mjs +65 -59
- package/es/src/ag-grid/index.vue.mjs +38 -33
- package/es/src/ag-grid/interface.d.ts +12 -1
- package/es/src/ag-grid/theme.d.ts +2 -1
- package/es/src/ag-grid/theme.mjs +12 -11
- package/es/src/ap-action/item/index.vue2.mjs +14 -12
- package/es/src/ap-action/style/index.d.ts +8 -0
- package/es/src/ap-action/style/index.js +61 -0
- package/es/src/ap-action/style/index.mjs +74 -0
- package/es/src/ap-grid/utils/col.mjs +91 -82
- package/es/src/config-provider/config-provider-props.d.ts +7 -0
- package/es/src/config-provider/config-provider-props.mjs +6 -0
- package/es/src/config-provider/config-provider.d.ts +7 -0
- package/es/src/config-provider/config-provider.mjs +11 -10
- package/es/src/config-provider/hooks/use-global-config.d.ts +4 -0
- package/es/src/config-provider/hooks/use-global-config.mjs +27 -22
- package/es/src/config-provider/hooks/use-token.d.ts +4 -0
- package/es/src/config-provider/hooks/use-token.mjs +6 -0
- package/es/src/config-provider/index.d.ts +10 -0
- package/es/src/design-token/constants.d.ts +2 -0
- package/es/src/design-token/constants.mjs +44 -0
- package/es/src/design-token/interface.d.ts +123 -0
- package/es/src/style/index.d.ts +3 -0
- package/es/src/style/index.js +12 -0
- package/es/src/style/index.mjs +13 -0
- package/es/src/utils/cssinjs/index.d.ts +8 -0
- package/es/src/utils/cssinjs/index.mjs +56 -0
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ag-grid/editable/index.vue.js +1 -1
- package/lib/src/ag-grid/editable/interface.d.ts +1 -0
- package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
- package/lib/src/ag-grid/hooks/use-editable-columns.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +12 -1
- package/lib/src/ag-grid/theme.d.ts +2 -1
- package/lib/src/ag-grid/theme.js +1 -1
- package/lib/src/ap-action/item/index.vue2.js +1 -1
- package/lib/src/ap-action/style/index.cjs +61 -0
- package/lib/src/ap-action/style/index.d.ts +8 -0
- package/lib/src/ap-action/style/index.js +1 -0
- package/lib/src/ap-grid/utils/col.js +1 -1
- package/lib/src/config-provider/config-provider-props.d.ts +7 -0
- package/lib/src/config-provider/config-provider-props.js +1 -1
- package/lib/src/config-provider/config-provider.d.ts +7 -0
- package/lib/src/config-provider/config-provider.js +1 -1
- package/lib/src/config-provider/hooks/use-global-config.d.ts +4 -0
- package/lib/src/config-provider/hooks/use-global-config.js +1 -1
- package/lib/src/config-provider/hooks/use-token.d.ts +4 -0
- package/lib/src/config-provider/hooks/use-token.js +1 -0
- package/lib/src/config-provider/index.d.ts +10 -0
- package/lib/src/design-token/constants.d.ts +2 -0
- package/lib/src/design-token/constants.js +1 -0
- package/lib/src/design-token/interface.d.ts +123 -0
- package/lib/src/style/index.cjs +12 -0
- package/lib/src/style/index.d.ts +3 -0
- package/lib/src/style/index.js +1 -0
- package/lib/src/utils/cssinjs/index.d.ts +8 -0
- package/lib/src/utils/cssinjs/index.js +1 -0
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +3 -1
- package/theme/ag-grid/index.css +0 -56
- package/theme/ag-grid-modal/index.css +0 -56
- package/theme/ap-action/item.css +0 -56
- package/theme/ap-action/item.less +1 -58
- package/theme/ap-grid/index.css +0 -56
- package/theme/ap-table/ap-table.css +0 -56
- package/theme/ap-table-modal/index.css +0 -56
- package/theme/editable-table/index.css +0 -56
- package/theme/index.css +0 -56
- package/theme/index.less +1 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as h, useSlots as A, createPropsRestProxy as F, ref as N, computed as u, unref as n, renderSlot as y, createElementBlock as f, createCommentVNode as a, openBlock as t, mergeProps as g, createBlock as m, normalizeClass as S, createVNode as I, withCtx as L, resolveDynamicComponent as k, isVNode as P, toDisplayString as V } from "vue";
|
|
2
2
|
import "../../config-provider/index.mjs";
|
|
3
3
|
import $ from "@aplus-frontend/antdv/es/button/LoadingIcon";
|
|
4
4
|
import { Tooltip as w } from "@aplus-frontend/antdv";
|
|
5
|
-
import
|
|
6
|
-
|
|
5
|
+
import D from "../style/index.mjs";
|
|
6
|
+
import { useNamespace as T } from "../../config-provider/hooks/use-namespace.mjs";
|
|
7
|
+
const x = { key: 1 }, J = /* @__PURE__ */ h({
|
|
7
8
|
name: "ApActionItem",
|
|
8
9
|
__name: "index",
|
|
9
10
|
props: {
|
|
@@ -19,24 +20,25 @@ const I = { key: 1 }, q = /* @__PURE__ */ B({
|
|
|
19
20
|
tooltip: { default: () => ({}) }
|
|
20
21
|
},
|
|
21
22
|
setup(o) {
|
|
22
|
-
const s =
|
|
23
|
+
const s = A(), r = F(o, ["color", "disabled", "visible", "loading", "iconFirst", "icon", "tooltip"]), { b: v, m: l, e: b } = T("action-item"), c = N(!1), d = u(() => o.iconFirst && (o.icon || s.icon)), C = D("action");
|
|
23
24
|
function p(e) {
|
|
24
25
|
n(i) || o.disabled || (r.onClick?.(e), r.onAction && (c.value = !0, r.onAction(e).finally(() => c.value = !1)));
|
|
25
26
|
}
|
|
26
|
-
const i = u(() => o.loading || n(c)),
|
|
27
|
+
const i = u(() => o.loading || n(c)), B = u(() => [
|
|
28
|
+
C.value,
|
|
27
29
|
v(),
|
|
28
30
|
l(o.color),
|
|
29
31
|
d.value ? l("icon-first") : null,
|
|
30
32
|
o.disabled ? l("disabled") : null,
|
|
31
33
|
i.value ? l("loading") : null
|
|
32
34
|
].filter(Boolean));
|
|
33
|
-
return (e,
|
|
35
|
+
return (e, z) => y(e.$slots, "trigger", {
|
|
34
36
|
loading: i.value,
|
|
35
37
|
disabled: e.disabled,
|
|
36
38
|
onClick: p
|
|
37
39
|
}, () => [
|
|
38
40
|
e.visible ? (t(), f("span", g({ key: 0 }, e.$attrs, {
|
|
39
|
-
class:
|
|
41
|
+
class: B.value,
|
|
40
42
|
onClick: p
|
|
41
43
|
}), [
|
|
42
44
|
i.value ? (t(), m(n($), {
|
|
@@ -47,24 +49,24 @@ const I = { key: 1 }, q = /* @__PURE__ */ B({
|
|
|
47
49
|
})) : a("", !0),
|
|
48
50
|
e.icon || s.icon ? (t(), f("span", {
|
|
49
51
|
key: 1,
|
|
50
|
-
class:
|
|
52
|
+
class: S(n(b)("icon-wrapper"))
|
|
51
53
|
}, [
|
|
52
|
-
|
|
54
|
+
I(n(w), g({
|
|
53
55
|
title: d.value ? e.text : null
|
|
54
56
|
}, e.tooltip), {
|
|
55
|
-
default:
|
|
57
|
+
default: L(() => [
|
|
56
58
|
(t(), m(k(e.icon || s.icon)))
|
|
57
59
|
]),
|
|
58
60
|
_: 1
|
|
59
61
|
}, 16, ["title"])
|
|
60
62
|
], 2)) : a("", !0),
|
|
61
63
|
d.value ? a("", !0) : y(e.$slots, "default", { key: 2 }, () => [
|
|
62
|
-
|
|
64
|
+
P(e.text) ? (t(), m(k(e.text), { key: 0 })) : (t(), f("span", x, V(e.text || ""), 1))
|
|
63
65
|
])
|
|
64
66
|
], 16)) : a("", !0)
|
|
65
67
|
]);
|
|
66
68
|
}
|
|
67
69
|
});
|
|
68
70
|
export {
|
|
69
|
-
|
|
71
|
+
J as default
|
|
70
72
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseToken, GenStyleFunc } from '../../design-token/interface';
|
|
2
|
+
import { Ref } from 'vue';
|
|
3
|
+
export type ActionToken = {
|
|
4
|
+
loadingOpacity: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const genActionItemStyle: GenStyleFunc<BaseToken & ActionToken>;
|
|
7
|
+
declare const _default: (prefixCls: string) => Ref<string | undefined, string | undefined>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { resetComponent } from '~/style';
|
|
2
|
+
import { genComponentStyleHook } from '~/utils/cssinjs';
|
|
3
|
+
export const genActionItemStyle = (token) => {
|
|
4
|
+
const { loadingOpacity, colorLink, colorLinkHover, colorSuccess, colorError, colorWarn, componentCls } = token;
|
|
5
|
+
return {
|
|
6
|
+
[`${componentCls}-item`]: {
|
|
7
|
+
display: 'inline-block',
|
|
8
|
+
cursor: 'pointer',
|
|
9
|
+
...resetComponent(token),
|
|
10
|
+
'&--primary': {
|
|
11
|
+
color: colorLink,
|
|
12
|
+
[`&:not(${componentCls}-item--disabled):hover`]: {
|
|
13
|
+
color: colorLinkHover
|
|
14
|
+
},
|
|
15
|
+
[`&${componentCls}-item--disabled`]: {
|
|
16
|
+
color: token.colorLinkDisabled
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
'&--success': {
|
|
20
|
+
color: colorSuccess,
|
|
21
|
+
[`&${componentCls}-item--disabled`]: {
|
|
22
|
+
color: token.colorSuccessDisabled
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
'&--error': {
|
|
26
|
+
color: colorError,
|
|
27
|
+
[`&${componentCls}-item--disabled`]: {
|
|
28
|
+
color: token.colorErrorDisabled
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
'&--warn': {
|
|
32
|
+
color: colorWarn,
|
|
33
|
+
[`&${componentCls}-item--disabled`]: {
|
|
34
|
+
color: token.colorWarnDisabled
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
'&--loading': {
|
|
38
|
+
opacity: loadingOpacity,
|
|
39
|
+
transition: 'opacity 0.2s',
|
|
40
|
+
cursor: 'default',
|
|
41
|
+
'.btn-loading-icon': {
|
|
42
|
+
marginRight: token.spaceXS
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
'&--disabled': {
|
|
46
|
+
cursor: 'not-allowed'
|
|
47
|
+
},
|
|
48
|
+
[`${componentCls}-item__icon-wrapper`]: {
|
|
49
|
+
paddingRight: token.spaceXS
|
|
50
|
+
},
|
|
51
|
+
'&--icon-first': {
|
|
52
|
+
[`${componentCls}-item__icon-wrapper`]: {
|
|
53
|
+
paddingRight: 0
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
export default genComponentStyleHook('ApAction', (token) => {
|
|
60
|
+
return [genActionItemStyle(token)];
|
|
61
|
+
}, { loadingOpacity: 0.35 });
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { resetComponent as n } from "../../style/index.mjs";
|
|
2
|
+
import { genComponentStyleHook as s } from "../../utils/cssinjs/index.mjs";
|
|
3
|
+
const d = (o) => {
|
|
4
|
+
const {
|
|
5
|
+
loadingOpacity: i,
|
|
6
|
+
colorLink: c,
|
|
7
|
+
colorLinkHover: l,
|
|
8
|
+
colorSuccess: e,
|
|
9
|
+
colorError: a,
|
|
10
|
+
colorWarn: t,
|
|
11
|
+
componentCls: r
|
|
12
|
+
} = o;
|
|
13
|
+
return {
|
|
14
|
+
[`${r}-item`]: {
|
|
15
|
+
display: "inline-block",
|
|
16
|
+
cursor: "pointer",
|
|
17
|
+
...n(o),
|
|
18
|
+
"&--primary": {
|
|
19
|
+
color: c,
|
|
20
|
+
[`&:not(${r}-item--disabled):hover`]: {
|
|
21
|
+
color: l
|
|
22
|
+
},
|
|
23
|
+
[`&${r}-item--disabled`]: {
|
|
24
|
+
color: o.colorLinkDisabled
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"&--success": {
|
|
28
|
+
color: e,
|
|
29
|
+
[`&${r}-item--disabled`]: {
|
|
30
|
+
color: o.colorSuccessDisabled
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"&--error": {
|
|
34
|
+
color: a,
|
|
35
|
+
[`&${r}-item--disabled`]: {
|
|
36
|
+
color: o.colorErrorDisabled
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"&--warn": {
|
|
40
|
+
color: t,
|
|
41
|
+
[`&${r}-item--disabled`]: {
|
|
42
|
+
color: o.colorWarnDisabled
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"&--loading": {
|
|
46
|
+
opacity: i,
|
|
47
|
+
transition: "opacity 0.2s",
|
|
48
|
+
cursor: "default",
|
|
49
|
+
".btn-loading-icon": {
|
|
50
|
+
marginRight: o.spaceXS
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"&--disabled": {
|
|
54
|
+
cursor: "not-allowed"
|
|
55
|
+
},
|
|
56
|
+
[`${r}-item__icon-wrapper`]: {
|
|
57
|
+
paddingRight: o.spaceXS
|
|
58
|
+
},
|
|
59
|
+
"&--icon-first": {
|
|
60
|
+
[`${r}-item__icon-wrapper`]: {
|
|
61
|
+
paddingRight: 0
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}, b = s(
|
|
67
|
+
"ApAction",
|
|
68
|
+
(o) => [d(o)],
|
|
69
|
+
{ loadingOpacity: 0.35 }
|
|
70
|
+
);
|
|
71
|
+
export {
|
|
72
|
+
b as default,
|
|
73
|
+
d as genActionItemStyle
|
|
74
|
+
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { createVNode as
|
|
2
|
-
import { isArray as
|
|
3
|
-
import { valueEnumToArray as
|
|
4
|
-
import { noRenderAsFormItemValueList as
|
|
1
|
+
import { createVNode as u, Fragment as h } from "vue";
|
|
2
|
+
import { isArray as b, isUndefined as E, isString as o, isBoolean as x, isNumber as O, pick as F } from "lodash-unified";
|
|
3
|
+
import { valueEnumToArray as S, objectToString as $, getTableTitle as R, getTableRenderType as V, getTableRenderProps as B, getTableCellRenderNode as M } from "../../ap-table/utils.mjs";
|
|
4
|
+
import { noRenderAsFormItemValueList as _ } from "../../ap-table/constants.mjs";
|
|
5
5
|
import "../../ap-table/components/paragraph-ellipsis/index.vue.mjs";
|
|
6
|
-
import
|
|
7
|
-
function
|
|
8
|
-
if (
|
|
9
|
-
return
|
|
6
|
+
import j from "../../ap-table/components/paragraph-ellipsis/index.vue2.mjs";
|
|
7
|
+
function T(e, t) {
|
|
8
|
+
if (t)
|
|
9
|
+
return b(t) ? t.reduce((r, n) => r?.[n], e) : e?.[t];
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
if (!
|
|
13
|
-
return
|
|
11
|
+
function v(e) {
|
|
12
|
+
if (!E(e))
|
|
13
|
+
return b(e) ? e.reduce((t, r) => o(r) ? `${t}${t ? "." : ""}${r}` : `${t}[${r}]`, "") : String(e);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function A(e) {
|
|
16
16
|
if (e)
|
|
17
17
|
return e === !0 ? "left" : e;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
return
|
|
19
|
+
function q(e) {
|
|
20
|
+
return x(e) ? {
|
|
21
21
|
sortable: e
|
|
22
22
|
} : e ? {
|
|
23
23
|
sortable: !0,
|
|
@@ -27,117 +27,126 @@ function j(e) {
|
|
|
27
27
|
sortable: !1
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
let
|
|
32
|
-
return
|
|
33
|
-
label:
|
|
34
|
-
value:
|
|
30
|
+
function I(e) {
|
|
31
|
+
let t;
|
|
32
|
+
return x(e.filters) && e.valueEnum ? t = S(e.valueEnum) : t = e.filters, t?.map((r) => ({
|
|
33
|
+
label: o(r.text) ? r.text : "",
|
|
34
|
+
value: r.value
|
|
35
35
|
}));
|
|
36
36
|
}
|
|
37
37
|
function W(e) {
|
|
38
38
|
if (e)
|
|
39
|
-
return (
|
|
39
|
+
return (t) => e(t.value, t.row);
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
return e ?
|
|
43
|
-
tooltip:
|
|
41
|
+
function k(e, t) {
|
|
42
|
+
return e ? O(e) ? {
|
|
43
|
+
tooltip: t,
|
|
44
44
|
rows: e
|
|
45
45
|
} : e === !0 || e === "tooltip" ? {
|
|
46
|
-
tooltip:
|
|
46
|
+
tooltip: t,
|
|
47
47
|
rows: 1
|
|
48
48
|
} : {
|
|
49
49
|
tooltip: null,
|
|
50
50
|
rows: 1,
|
|
51
|
-
htmlTitle: e === "title" ?
|
|
51
|
+
htmlTitle: e === "title" ? t : ""
|
|
52
52
|
} : !1;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
if (
|
|
56
|
-
return
|
|
54
|
+
function z(e, t, r) {
|
|
55
|
+
if (_.includes(e.valueType))
|
|
56
|
+
return r;
|
|
57
57
|
if (e.copyable || e.ellipsis) {
|
|
58
|
-
const
|
|
59
|
-
return
|
|
58
|
+
const n = k(e.ellipsis, t), i = $(t);
|
|
59
|
+
return u(j, {
|
|
60
60
|
rawValue: i,
|
|
61
61
|
copyable: e.copyable,
|
|
62
|
-
ellipsis:
|
|
63
|
-
content:
|
|
62
|
+
ellipsis: n,
|
|
63
|
+
content: r
|
|
64
64
|
}, null);
|
|
65
65
|
}
|
|
66
|
-
return
|
|
66
|
+
return r;
|
|
67
|
+
}
|
|
68
|
+
function c(e, t, r) {
|
|
69
|
+
const n = F(e, ["width", "minWidth", "align"]);
|
|
70
|
+
return n.field = v(e.dataIndex), n.fixed = A(e.fixed), n.slots = {
|
|
71
|
+
header: () => R(e, r, void 0, t)
|
|
72
|
+
}, n.headerAlign = e.align, n.showOverflow = !1, n.showFooterOverflow = !1, n;
|
|
67
73
|
}
|
|
68
|
-
function
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
header: () => v(e, t, void 0, r)
|
|
72
|
-
}, l.headerAlign = e.align, l.showOverflow = !1, l.showFooterOverflow = !1, l;
|
|
74
|
+
function D(e, t, r) {
|
|
75
|
+
if (r)
|
|
76
|
+
return o(r) ? e[r] : r(e, t);
|
|
73
77
|
}
|
|
74
|
-
const
|
|
78
|
+
const G = ({
|
|
75
79
|
value: e,
|
|
76
|
-
...
|
|
77
|
-
},
|
|
78
|
-
const s =
|
|
79
|
-
...
|
|
80
|
+
...t
|
|
81
|
+
}, r, n, i = !0) => {
|
|
82
|
+
const s = V(r), d = B({
|
|
83
|
+
...r,
|
|
80
84
|
valueType: s
|
|
81
85
|
}, {
|
|
82
86
|
value: e,
|
|
83
|
-
...
|
|
84
|
-
}),
|
|
85
|
-
value: e,
|
|
86
|
-
...r
|
|
87
|
-
}) || e, u = t.renderText ? o(p, null, [t.renderText?.({
|
|
87
|
+
...t
|
|
88
|
+
}), l = M(s, d, t.record, n), a = r.renderText?.({
|
|
88
89
|
value: e,
|
|
89
|
-
...
|
|
90
|
-
})
|
|
91
|
-
let f = i ? k(t, a, u) : u;
|
|
92
|
-
return t.customRender && (f = t.customRender({
|
|
90
|
+
...t
|
|
91
|
+
}) || e, p = r.renderText ? u(h, null, [r.renderText?.({
|
|
93
92
|
value: e,
|
|
94
|
-
...
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
93
|
+
...t
|
|
94
|
+
})]) : l;
|
|
95
|
+
let f = i ? z(r, a, p) : p;
|
|
96
|
+
if (r.customRender) {
|
|
97
|
+
const N = r._path || [], w = D(t.record, t.rowIndex, t.params.rowKey);
|
|
98
|
+
f = r.customRender({
|
|
99
|
+
value: e,
|
|
100
|
+
...t,
|
|
101
|
+
column: r,
|
|
102
|
+
originalNode: f,
|
|
103
|
+
originalText: a,
|
|
104
|
+
path: [...N, String(w)]
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
return u(h, null, [f]);
|
|
99
108
|
};
|
|
100
|
-
function y(e,
|
|
101
|
-
const i =
|
|
102
|
-
i.field =
|
|
109
|
+
function y(e, t, r, n) {
|
|
110
|
+
const i = F(e, ["width", "minWidth", "align", "resizable", "className", "headerClassName", "footerClassName", "treeNode"]);
|
|
111
|
+
i.field = v(e.dataIndex), i.fixed = A(e.fixed), i.headerAlign = e.align, i.footerAlign = e.align, i.showOverflow = !1, i.showFooterOverflow = !1, Object.assign(i, q(e.sorter)), i.filters = I(e), i.filterMultiple = e.filterMultiple, i.filterMethod = W(e.onFilter);
|
|
103
112
|
const s = ({
|
|
104
113
|
row: d,
|
|
105
|
-
rowIndex:
|
|
106
|
-
}) =>
|
|
107
|
-
value:
|
|
108
|
-
text:
|
|
114
|
+
rowIndex: l
|
|
115
|
+
}) => G({
|
|
116
|
+
value: T(d, e.dataIndex),
|
|
117
|
+
text: T(d, e.dataIndex),
|
|
109
118
|
record: d,
|
|
110
|
-
index:
|
|
111
|
-
renderIndex:
|
|
119
|
+
index: l,
|
|
120
|
+
renderIndex: l,
|
|
112
121
|
column: e
|
|
113
|
-
}, e,
|
|
122
|
+
}, e, n);
|
|
114
123
|
return i.slots = {
|
|
115
|
-
header: () =>
|
|
124
|
+
header: () => R(e, r, void 0, t),
|
|
116
125
|
default: s,
|
|
117
126
|
footer: s
|
|
118
127
|
}, e.html && (delete i.slots.default, delete i.slots.footer, i.type = "html"), e.seq && (i.type = "seq", i.slots = {}), i;
|
|
119
128
|
}
|
|
120
|
-
function
|
|
129
|
+
function X(e, t, r, n) {
|
|
121
130
|
if (!e.children?.length)
|
|
122
|
-
return y(e,
|
|
131
|
+
return y(e, t, r, n);
|
|
123
132
|
function i(d) {
|
|
124
|
-
return d.map((
|
|
125
|
-
if (
|
|
126
|
-
const a =
|
|
127
|
-
return a.children = i(
|
|
133
|
+
return d.map((l) => {
|
|
134
|
+
if (l.children?.length) {
|
|
135
|
+
const a = c(l, t, r);
|
|
136
|
+
return a.children = i(l.children), a;
|
|
128
137
|
}
|
|
129
|
-
return y(
|
|
138
|
+
return y(l, t, r, n);
|
|
130
139
|
});
|
|
131
140
|
}
|
|
132
|
-
const s =
|
|
141
|
+
const s = c(e, t, r);
|
|
133
142
|
return s.children = i(e.children), s;
|
|
134
143
|
}
|
|
135
144
|
export {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
145
|
+
G as contentCustom,
|
|
146
|
+
v as dataIndexToField,
|
|
147
|
+
T as getValueByDataIndex,
|
|
148
|
+
X as transformCol,
|
|
149
|
+
A as transformFixed,
|
|
150
|
+
c as transformToColGroup,
|
|
142
151
|
y as transformToColumn
|
|
143
152
|
};
|
|
@@ -4,6 +4,7 @@ import { ApiType, ApUploadConfig, ApDescriptionsConfig, ValueTypeRenderConfig, d
|
|
|
4
4
|
import { ApGridProps } from '../ap-grid';
|
|
5
5
|
import { AgGridProps } from '../ag-grid';
|
|
6
6
|
import { ViewCacheOption } from '../business';
|
|
7
|
+
import { FullToken } from '../design-token/interface';
|
|
7
8
|
import { default as __DTS_DEFAULT_0__ } from '@aplus-frontend/antdv/es/config-provider/renderEmpty';
|
|
8
9
|
import { TransformCellTextProps } from '@aplus-frontend/antdv/es/table/interface';
|
|
9
10
|
import { CSPConfig } from '@aplus-frontend/antdv/es/config-provider';
|
|
@@ -156,6 +157,12 @@ export declare const configProviderProps: () => {
|
|
|
156
157
|
aplusLocale: {
|
|
157
158
|
type: PropType<LocaleType>;
|
|
158
159
|
};
|
|
160
|
+
/**
|
|
161
|
+
* APlus-UI 自己的token
|
|
162
|
+
*/
|
|
163
|
+
aplusToken: {
|
|
164
|
+
type: PropType<Partial<FullToken>>;
|
|
165
|
+
};
|
|
159
166
|
namespace: {
|
|
160
167
|
type: StringConstructor;
|
|
161
168
|
};
|
|
@@ -8,6 +8,7 @@ import { ButtonSize } from '@aplus-frontend/antdv/es/button';
|
|
|
8
8
|
import { ThemeConfig, InputConfig, PaginationConfig, FormConfig, SelectConfig, CascaderConfig, DatePickerConfig, RangePickerConfig, TreeSelectConfig, TextAreaConfig, InputNumberConfig, MentionsConfig, TimePickerConfig, CardConfig } from '@aplus-frontend/antdv/es/config-provider/context';
|
|
9
9
|
import { ApGridRowSelection, AgGridRowSelection, ViewCacheOption } from '..';
|
|
10
10
|
import { LocaleType } from '../locale';
|
|
11
|
+
import { FullToken } from '../design-token/interface';
|
|
11
12
|
import { ApiType, ApUploadConfig, ApDescriptionsConfig, ValueTypeRenderConfig, downloadCenterTriggerConfig, ExportField, SearchFormGlobalConfig } from './constants';
|
|
12
13
|
export declare const globalConfigCached: Ref<ConfigProviderProps>;
|
|
13
14
|
export declare const ConfigProvider: DefineComponent<ExtractPropTypes<{
|
|
@@ -155,6 +156,9 @@ export declare const ConfigProvider: DefineComponent<ExtractPropTypes<{
|
|
|
155
156
|
aplusLocale: {
|
|
156
157
|
type: PropType<LocaleType>;
|
|
157
158
|
};
|
|
159
|
+
aplusToken: {
|
|
160
|
+
type: PropType<Partial< FullToken>>;
|
|
161
|
+
};
|
|
158
162
|
namespace: {
|
|
159
163
|
type: StringConstructor;
|
|
160
164
|
};
|
|
@@ -341,6 +345,9 @@ export declare const ConfigProvider: DefineComponent<ExtractPropTypes<{
|
|
|
341
345
|
aplusLocale: {
|
|
342
346
|
type: PropType<LocaleType>;
|
|
343
347
|
};
|
|
348
|
+
aplusToken: {
|
|
349
|
+
type: PropType<Partial< FullToken>>;
|
|
350
|
+
};
|
|
344
351
|
namespace: {
|
|
345
352
|
type: StringConstructor;
|
|
346
353
|
};
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { isVNode as p, ref as G, defineComponent as M, computed as o, unref as a, watch as u, onActivated as P, createVNode as h, renderSlot as A } from "vue";
|
|
2
|
-
import { ConfigProvider as
|
|
3
|
-
import { useGlobalConfig as
|
|
4
|
-
import { configProviderProps as
|
|
2
|
+
import { ConfigProvider as T } from "@aplus-frontend/antdv";
|
|
3
|
+
import { useGlobalConfig as w, provideGlobalConfig as D } from "./hooks/use-global-config.mjs";
|
|
4
|
+
import { configProviderProps as F } from "./config-provider-props.mjs";
|
|
5
5
|
import { mergeAntdProviderConfigWithCache as l, mergeAntdProvideConfig as c } from "../utils/config-provider-preset.mjs";
|
|
6
|
-
import { DEFAULT_NAMESPACE as
|
|
7
|
-
function
|
|
6
|
+
import { DEFAULT_NAMESPACE as U, DEFAULT_UIMODE as b } from "./constants.mjs";
|
|
7
|
+
function E(e) {
|
|
8
8
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !p(e);
|
|
9
9
|
}
|
|
10
10
|
const n = G({}), j = /* @__PURE__ */ M({
|
|
11
11
|
name: "AplusConfigProvider",
|
|
12
|
-
props:
|
|
12
|
+
props: F(),
|
|
13
13
|
setup(e, {
|
|
14
14
|
slots: f
|
|
15
15
|
}) {
|
|
16
|
-
const t =
|
|
16
|
+
const t = w();
|
|
17
17
|
let r = !0;
|
|
18
|
-
const m = o(() => e.namespace !== void 0 ? e.namespace : t.value?.namespace ||
|
|
18
|
+
const m = o(() => e.namespace !== void 0 ? e.namespace : t.value?.namespace || U), d = o(() => e.uiMode !== void 0 ? e.uiMode : t.value?.uiMode || b), g = o(() => e.apGrid !== void 0 ? e.apGrid : t.value?.apGrid), v = o(() => e.agGrid !== void 0 ? e.agGrid : t.value?.agGrid), C = o(() => ({
|
|
19
19
|
namespace: a(m),
|
|
20
20
|
aplusLocale: e.aplusLocale,
|
|
21
|
+
aplusToken: e.aplusToken,
|
|
21
22
|
api: e.api,
|
|
22
23
|
uiMode: a(d),
|
|
23
24
|
apUpload: e.apUpload,
|
|
@@ -30,7 +31,7 @@ const n = G({}), j = /* @__PURE__ */ M({
|
|
|
30
31
|
searchForm: e.searchForm,
|
|
31
32
|
apGrid: a(g),
|
|
32
33
|
agGrid: a(v)
|
|
33
|
-
})), s =
|
|
34
|
+
})), s = D(C);
|
|
34
35
|
return u(() => e, (i) => {
|
|
35
36
|
n.value = l(c(i), n.value);
|
|
36
37
|
}, {
|
|
@@ -48,7 +49,7 @@ const n = G({}), j = /* @__PURE__ */ M({
|
|
|
48
49
|
immediate: !0
|
|
49
50
|
}), () => {
|
|
50
51
|
let i;
|
|
51
|
-
return h(
|
|
52
|
+
return h(T, n.value, E(i = A(f, "default", {
|
|
52
53
|
config: s?.value
|
|
53
54
|
})) ? i : {
|
|
54
55
|
default: () => [i]
|
|
@@ -9,6 +9,7 @@ import { ButtonSize } from '@aplus-frontend/antdv/es/button';
|
|
|
9
9
|
import { ThemeConfig, InputConfig, PaginationConfig, FormConfig, SelectConfig, CascaderConfig, DatePickerConfig, RangePickerConfig, TreeSelectConfig, TextAreaConfig, InputNumberConfig, MentionsConfig, TimePickerConfig, CardConfig } from '@aplus-frontend/antdv/es/config-provider/context';
|
|
10
10
|
import { ApGridRowSelection, AgGridRowSelection, ViewCacheOption } from '../..';
|
|
11
11
|
import { LocaleType } from '../../locale';
|
|
12
|
+
import { FullToken } from '../../design-token/interface';
|
|
12
13
|
import { ApiType, ApUploadConfig, ApDescriptionsConfig, ValueTypeRenderConfig, downloadCenterTriggerConfig, ExportField, SearchFormGlobalConfig } from '..';
|
|
13
14
|
export declare const keysOf: <T extends Record<string, any>>(arr: T) => Array<keyof T>;
|
|
14
15
|
export declare function useGlobalConfig<K extends keyof ConfigProviderContext, D extends ConfigProviderContext[K]>(key: K, defaultValue?: D): Ref<Exclude<ConfigProviderContext[K], undefined> | D>;
|
|
@@ -158,6 +159,9 @@ export declare const provideGlobalConfig: (config: MaybeRef<ConfigProviderContex
|
|
|
158
159
|
aplusLocale: {
|
|
159
160
|
type: PropType<LocaleType>;
|
|
160
161
|
};
|
|
162
|
+
aplusToken: {
|
|
163
|
+
type: PropType<Partial< FullToken>>;
|
|
164
|
+
};
|
|
161
165
|
namespace: {
|
|
162
166
|
type: StringConstructor;
|
|
163
167
|
};
|
|
@@ -1,32 +1,37 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { configProviderContextKey as
|
|
3
|
-
import { localeContextKey as
|
|
1
|
+
import { ref as v, getCurrentInstance as a, inject as d, computed as f, provide as g, unref as C } from "vue";
|
|
2
|
+
import { configProviderContextKey as m } from "../constants.mjs";
|
|
3
|
+
import { localeContextKey as k } from "./use-locale.mjs";
|
|
4
4
|
import { namespaceContextKey as y } from "./use-namespace.mjs";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
import { designTokenContextKey as x } from "./use-token.mjs";
|
|
6
|
+
import { merge as K } from "lodash-unified";
|
|
7
|
+
import { defaultToken as T } from "../../design-token/constants.mjs";
|
|
8
|
+
const l = (e) => Object.keys(e), s = v();
|
|
9
|
+
function b(e, o = void 0) {
|
|
10
|
+
const t = a() ? d(m, s) : s;
|
|
11
|
+
return e ? f(() => t.value?.[e] ?? o) : t;
|
|
9
12
|
}
|
|
10
|
-
const
|
|
11
|
-
const
|
|
13
|
+
const P = (e, o, t = !1) => {
|
|
14
|
+
const i = !!a(), n = i ? b() : void 0, c = o?.provide ?? (i ? g : void 0);
|
|
12
15
|
if (!c)
|
|
13
16
|
return;
|
|
14
|
-
const
|
|
15
|
-
const u =
|
|
16
|
-
return n?.value ?
|
|
17
|
+
const r = f(() => {
|
|
18
|
+
const u = C(e);
|
|
19
|
+
return n?.value ? j(n.value, u) : u;
|
|
17
20
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
c(m, r), c(y, r.value.namespace);
|
|
22
|
+
const p = f(() => ({ ...K(T, r.value.aplusToken || {}) }));
|
|
23
|
+
return c(x, p), c(
|
|
24
|
+
k,
|
|
25
|
+
f(() => r.value.aplusLocale)
|
|
26
|
+
), (t || !s.value) && (s.value = r.value), r;
|
|
27
|
+
}, j = (e, o) => {
|
|
28
|
+
const t = [.../* @__PURE__ */ new Set([...l(e), ...l(o)])], i = {};
|
|
24
29
|
for (const n of t)
|
|
25
|
-
|
|
26
|
-
return
|
|
30
|
+
i[n] = o[n] !== void 0 ? o[n] : e[n];
|
|
31
|
+
return i;
|
|
27
32
|
};
|
|
28
33
|
export {
|
|
29
34
|
l as keysOf,
|
|
30
|
-
|
|
31
|
-
|
|
35
|
+
P as provideGlobalConfig,
|
|
36
|
+
b as useGlobalConfig
|
|
32
37
|
};
|