@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.
Files changed (77) hide show
  1. package/es/src/ag-grid/editable/form-item.vue.mjs +1 -0
  2. package/es/src/ag-grid/editable/index.vue.mjs +1 -0
  3. package/es/src/ag-grid/editable/interface.d.ts +1 -0
  4. package/es/src/ag-grid/hooks/use-columns-def.mjs +27 -26
  5. package/es/src/ag-grid/hooks/use-editable-columns.mjs +65 -59
  6. package/es/src/ag-grid/index.vue.mjs +38 -33
  7. package/es/src/ag-grid/interface.d.ts +12 -1
  8. package/es/src/ag-grid/theme.d.ts +2 -1
  9. package/es/src/ag-grid/theme.mjs +12 -11
  10. package/es/src/ap-action/item/index.vue2.mjs +14 -12
  11. package/es/src/ap-action/style/index.d.ts +8 -0
  12. package/es/src/ap-action/style/index.js +61 -0
  13. package/es/src/ap-action/style/index.mjs +74 -0
  14. package/es/src/ap-grid/utils/col.mjs +91 -82
  15. package/es/src/config-provider/config-provider-props.d.ts +7 -0
  16. package/es/src/config-provider/config-provider-props.mjs +6 -0
  17. package/es/src/config-provider/config-provider.d.ts +7 -0
  18. package/es/src/config-provider/config-provider.mjs +11 -10
  19. package/es/src/config-provider/hooks/use-global-config.d.ts +4 -0
  20. package/es/src/config-provider/hooks/use-global-config.mjs +27 -22
  21. package/es/src/config-provider/hooks/use-token.d.ts +4 -0
  22. package/es/src/config-provider/hooks/use-token.mjs +6 -0
  23. package/es/src/config-provider/index.d.ts +10 -0
  24. package/es/src/design-token/constants.d.ts +2 -0
  25. package/es/src/design-token/constants.mjs +44 -0
  26. package/es/src/design-token/interface.d.ts +123 -0
  27. package/es/src/style/index.d.ts +3 -0
  28. package/es/src/style/index.js +12 -0
  29. package/es/src/style/index.mjs +13 -0
  30. package/es/src/utils/cssinjs/index.d.ts +8 -0
  31. package/es/src/utils/cssinjs/index.mjs +56 -0
  32. package/es/src/version.d.ts +1 -1
  33. package/es/src/version.mjs +1 -1
  34. package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
  35. package/lib/src/ag-grid/editable/index.vue.js +1 -1
  36. package/lib/src/ag-grid/editable/interface.d.ts +1 -0
  37. package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
  38. package/lib/src/ag-grid/hooks/use-editable-columns.js +1 -1
  39. package/lib/src/ag-grid/index.vue.js +1 -1
  40. package/lib/src/ag-grid/interface.d.ts +12 -1
  41. package/lib/src/ag-grid/theme.d.ts +2 -1
  42. package/lib/src/ag-grid/theme.js +1 -1
  43. package/lib/src/ap-action/item/index.vue2.js +1 -1
  44. package/lib/src/ap-action/style/index.cjs +61 -0
  45. package/lib/src/ap-action/style/index.d.ts +8 -0
  46. package/lib/src/ap-action/style/index.js +1 -0
  47. package/lib/src/ap-grid/utils/col.js +1 -1
  48. package/lib/src/config-provider/config-provider-props.d.ts +7 -0
  49. package/lib/src/config-provider/config-provider-props.js +1 -1
  50. package/lib/src/config-provider/config-provider.d.ts +7 -0
  51. package/lib/src/config-provider/config-provider.js +1 -1
  52. package/lib/src/config-provider/hooks/use-global-config.d.ts +4 -0
  53. package/lib/src/config-provider/hooks/use-global-config.js +1 -1
  54. package/lib/src/config-provider/hooks/use-token.d.ts +4 -0
  55. package/lib/src/config-provider/hooks/use-token.js +1 -0
  56. package/lib/src/config-provider/index.d.ts +10 -0
  57. package/lib/src/design-token/constants.d.ts +2 -0
  58. package/lib/src/design-token/constants.js +1 -0
  59. package/lib/src/design-token/interface.d.ts +123 -0
  60. package/lib/src/style/index.cjs +12 -0
  61. package/lib/src/style/index.d.ts +3 -0
  62. package/lib/src/style/index.js +1 -0
  63. package/lib/src/utils/cssinjs/index.d.ts +8 -0
  64. package/lib/src/utils/cssinjs/index.js +1 -0
  65. package/lib/src/version.d.ts +1 -1
  66. package/lib/src/version.js +1 -1
  67. package/package.json +3 -1
  68. package/theme/ag-grid/index.css +0 -56
  69. package/theme/ag-grid-modal/index.css +0 -56
  70. package/theme/ap-action/item.css +0 -56
  71. package/theme/ap-action/item.less +1 -58
  72. package/theme/ap-grid/index.css +0 -56
  73. package/theme/ap-table/ap-table.css +0 -56
  74. package/theme/ap-table-modal/index.css +0 -56
  75. package/theme/editable-table/index.css +0 -56
  76. package/theme/index.css +0 -56
  77. package/theme/index.less +1 -1
@@ -1,9 +1,10 @@
1
- import { defineComponent as B, useSlots as h, createPropsRestProxy as A, ref as F, 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 N, createVNode as L, withCtx as P, resolveDynamicComponent as k, isVNode as S, toDisplayString as V } from "vue";
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 { useNamespace as D } from "../../config-provider/hooks/use-namespace.mjs";
6
- const I = { key: 1 }, q = /* @__PURE__ */ B({
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 = h(), r = A(o, ["color", "disabled", "visible", "loading", "iconFirst", "icon", "tooltip"]), { b: v, m: l, e: b } = D("action-item"), c = F(!1), d = u(() => o.iconFirst && (o.icon || s.icon));
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)), C = u(() => [
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, T) => y(e.$slots, "trigger", {
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: C.value,
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: N(n(b)("icon-wrapper"))
52
+ class: S(n(b)("icon-wrapper"))
51
53
  }, [
52
- L(n(w), g({
54
+ I(n(w), g({
53
55
  title: d.value ? e.text : null
54
56
  }, e.tooltip), {
55
- default: P(() => [
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
- S(e.text) ? (t(), m(k(e.text), { key: 0 })) : (t(), f("span", I, V(e.text || ""), 1))
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
- q as default
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 o, Fragment as p } from "vue";
2
- import { isArray as c, isUndefined as N, isString as b, isBoolean as F, isNumber as E, pick as x } from "lodash-unified";
3
- import { valueEnumToArray as O, objectToString as $, getTableTitle as v, getTableRenderType as w, getTableRenderProps as S, getTableCellRenderNode as V } from "../../ap-table/utils.mjs";
4
- import { noRenderAsFormItemValueList as B } from "../../ap-table/constants.mjs";
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 M from "../../ap-table/components/paragraph-ellipsis/index.vue2.mjs";
7
- function h(e, r) {
8
- if (r)
9
- return c(r) ? r.reduce((t, l) => t?.[l], e) : e?.[r];
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 A(e) {
12
- if (!N(e))
13
- return c(e) ? e.reduce((r, t) => b(t) ? `${r}${r ? "." : ""}${t}` : `${r}[${t}]`, "") : String(e);
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 R(e) {
15
+ function A(e) {
16
16
  if (e)
17
17
  return e === !0 ? "left" : e;
18
18
  }
19
- function j(e) {
20
- return F(e) ? {
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 q(e) {
31
- let r;
32
- return F(e.filters) && e.valueEnum ? r = O(e.valueEnum) : r = e.filters, r?.map((t) => ({
33
- label: b(t.text) ? t.text : "",
34
- value: t.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 (r) => e(r.value, r.row);
39
+ return (t) => e(t.value, t.row);
40
40
  }
41
- function _(e, r) {
42
- return e ? E(e) ? {
43
- tooltip: r,
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: r,
46
+ tooltip: t,
47
47
  rows: 1
48
48
  } : {
49
49
  tooltip: null,
50
50
  rows: 1,
51
- htmlTitle: e === "title" ? r : ""
51
+ htmlTitle: e === "title" ? t : ""
52
52
  } : !1;
53
53
  }
54
- function k(e, r, t) {
55
- if (B.includes(e.valueType))
56
- return t;
54
+ function z(e, t, r) {
55
+ if (_.includes(e.valueType))
56
+ return r;
57
57
  if (e.copyable || e.ellipsis) {
58
- const l = _(e.ellipsis, r), i = $(r);
59
- return o(M, {
58
+ const n = k(e.ellipsis, t), i = $(t);
59
+ return u(j, {
60
60
  rawValue: i,
61
61
  copyable: e.copyable,
62
- ellipsis: l,
63
- content: t
62
+ ellipsis: n,
63
+ content: r
64
64
  }, null);
65
65
  }
66
- return t;
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 T(e, r, t) {
69
- const l = x(e, ["width", "minWidth", "align"]);
70
- return l.field = A(e.dataIndex), l.fixed = R(e.fixed), l.slots = {
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 z = ({
78
+ const G = ({
75
79
  value: e,
76
- ...r
77
- }, t, l, i = !0) => {
78
- const s = w(t), d = S({
79
- ...t,
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
- ...r
84
- }), n = V(s, d, r.record, l), a = t.renderText?.({
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
- ...r
90
- })]) : n;
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
- ...r,
95
- column: t,
96
- originalNode: f,
97
- originalText: a
98
- })), o(p, null, [f]);
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, r, t, l) {
101
- const i = x(e, ["width", "minWidth", "align", "resizable", "className", "headerClassName", "footerClassName", "treeNode"]);
102
- i.field = A(e.dataIndex), i.fixed = R(e.fixed), i.headerAlign = e.align, i.footerAlign = e.align, i.showOverflow = !1, i.showFooterOverflow = !1, Object.assign(i, j(e.sorter)), i.filters = q(e), i.filterMultiple = e.filterMultiple, i.filterMethod = W(e.onFilter);
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: n
106
- }) => z({
107
- value: h(d, e.dataIndex),
108
- text: h(d, e.dataIndex),
114
+ rowIndex: l
115
+ }) => G({
116
+ value: T(d, e.dataIndex),
117
+ text: T(d, e.dataIndex),
109
118
  record: d,
110
- index: n,
111
- renderIndex: n,
119
+ index: l,
120
+ renderIndex: l,
112
121
  column: e
113
- }, e, l);
122
+ }, e, n);
114
123
  return i.slots = {
115
- header: () => v(e, t, void 0, r),
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 J(e, r, t, l) {
129
+ function X(e, t, r, n) {
121
130
  if (!e.children?.length)
122
- return y(e, r, t, l);
131
+ return y(e, t, r, n);
123
132
  function i(d) {
124
- return d.map((n) => {
125
- if (n.children?.length) {
126
- const a = T(n, r, t);
127
- return a.children = i(n.children), a;
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(n, r, t, l);
138
+ return y(l, t, r, n);
130
139
  });
131
140
  }
132
- const s = T(e, r, t);
141
+ const s = c(e, t, r);
133
142
  return s.children = i(e.children), s;
134
143
  }
135
144
  export {
136
- z as contentCustom,
137
- A as dataIndexToField,
138
- h as getValueByDataIndex,
139
- J as transformCol,
140
- R as transformFixed,
141
- T as transformToColGroup,
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
  };
@@ -13,6 +13,12 @@ const t = () => ({
13
13
  aplusLocale: {
14
14
  type: Object
15
15
  },
16
+ /**
17
+ * APlus-UI 自己的token
18
+ */
19
+ aplusToken: {
20
+ type: Object
21
+ },
16
22
  namespace: {
17
23
  type: String
18
24
  },
@@ -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 w } from "@aplus-frontend/antdv";
3
- import { useGlobalConfig as D, provideGlobalConfig as F } from "./hooks/use-global-config.mjs";
4
- import { configProviderProps as U } from "./config-provider-props.mjs";
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 b, DEFAULT_UIMODE as E } from "./constants.mjs";
7
- function N(e) {
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: U(),
12
+ props: F(),
13
13
  setup(e, {
14
14
  slots: f
15
15
  }) {
16
- const t = D();
16
+ const t = w();
17
17
  let r = !0;
18
- const m = o(() => e.namespace !== void 0 ? e.namespace : t.value?.namespace || b), d = o(() => e.uiMode !== void 0 ? e.uiMode : t.value?.uiMode || E), g = o(() => e.apGrid !== void 0 ? e.apGrid : t.value?.apGrid), v = o(() => e.agGrid !== void 0 ? e.agGrid : t.value?.agGrid), C = o(() => ({
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 = F(C);
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(w, n.value, N(i = A(f, "default", {
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 p, getCurrentInstance as a, inject as m, computed as s, provide as d, unref as g } from "vue";
2
- import { configProviderContextKey as v } from "../constants.mjs";
3
- import { localeContextKey as C } from "./use-locale.mjs";
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
- const l = (e) => Object.keys(e), f = p();
6
- function x(e, o = void 0) {
7
- const t = a() ? m(v, f) : f;
8
- return e ? s(() => t.value?.[e] ?? o) : t;
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 O = (e, o, t = !1) => {
11
- const r = !!a(), n = r ? x() : void 0, c = o?.provide ?? (r ? d : void 0);
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 i = s(() => {
15
- const u = g(e);
16
- return n?.value ? b(n.value, u) : u;
17
+ const r = f(() => {
18
+ const u = C(e);
19
+ return n?.value ? j(n.value, u) : u;
17
20
  });
18
- return c(v, i), c(y, i.value.namespace), c(
19
- C,
20
- s(() => i.value.aplusLocale)
21
- ), (t || !f.value) && (f.value = i.value), i;
22
- }, b = (e, o) => {
23
- const t = [.../* @__PURE__ */ new Set([...l(e), ...l(o)])], r = {};
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
- r[n] = o[n] !== void 0 ? o[n] : e[n];
26
- return r;
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
- O as provideGlobalConfig,
31
- x as useGlobalConfig
35
+ P as provideGlobalConfig,
36
+ b as useGlobalConfig
32
37
  };
@@ -0,0 +1,4 @@
1
+ import { InjectionKey, Ref } from 'vue';
2
+ import { FullToken } from '../../design-token/interface';
3
+ export declare const designTokenContextKey: InjectionKey<Ref<Partial<FullToken>>>;
4
+ export declare const useToken: () => Ref<FullToken>;