@aplus-frontend/ui 6.41.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 (57) hide show
  1. package/es/src/ap-action/item/index.vue2.mjs +14 -12
  2. package/es/src/ap-action/style/index.d.ts +8 -0
  3. package/es/src/ap-action/style/index.js +61 -0
  4. package/es/src/ap-action/style/index.mjs +74 -0
  5. package/es/src/config-provider/config-provider-props.d.ts +7 -0
  6. package/es/src/config-provider/config-provider-props.mjs +6 -0
  7. package/es/src/config-provider/config-provider.d.ts +7 -0
  8. package/es/src/config-provider/config-provider.mjs +11 -10
  9. package/es/src/config-provider/hooks/use-global-config.d.ts +4 -0
  10. package/es/src/config-provider/hooks/use-global-config.mjs +27 -22
  11. package/es/src/config-provider/hooks/use-token.d.ts +4 -0
  12. package/es/src/config-provider/hooks/use-token.mjs +6 -0
  13. package/es/src/config-provider/index.d.ts +10 -0
  14. package/es/src/design-token/constants.d.ts +2 -0
  15. package/es/src/design-token/constants.mjs +44 -0
  16. package/es/src/design-token/interface.d.ts +123 -0
  17. package/es/src/style/index.d.ts +3 -0
  18. package/es/src/style/index.js +12 -0
  19. package/es/src/style/index.mjs +13 -0
  20. package/es/src/utils/cssinjs/index.d.ts +8 -0
  21. package/es/src/utils/cssinjs/index.mjs +56 -0
  22. package/es/src/version.d.ts +1 -1
  23. package/es/src/version.mjs +1 -1
  24. package/lib/src/ap-action/item/index.vue2.js +1 -1
  25. package/lib/src/ap-action/style/index.cjs +61 -0
  26. package/lib/src/ap-action/style/index.d.ts +8 -0
  27. package/lib/src/ap-action/style/index.js +1 -0
  28. package/lib/src/config-provider/config-provider-props.d.ts +7 -0
  29. package/lib/src/config-provider/config-provider-props.js +1 -1
  30. package/lib/src/config-provider/config-provider.d.ts +7 -0
  31. package/lib/src/config-provider/config-provider.js +1 -1
  32. package/lib/src/config-provider/hooks/use-global-config.d.ts +4 -0
  33. package/lib/src/config-provider/hooks/use-global-config.js +1 -1
  34. package/lib/src/config-provider/hooks/use-token.d.ts +4 -0
  35. package/lib/src/config-provider/hooks/use-token.js +1 -0
  36. package/lib/src/config-provider/index.d.ts +10 -0
  37. package/lib/src/design-token/constants.d.ts +2 -0
  38. package/lib/src/design-token/constants.js +1 -0
  39. package/lib/src/design-token/interface.d.ts +123 -0
  40. package/lib/src/style/index.cjs +12 -0
  41. package/lib/src/style/index.d.ts +3 -0
  42. package/lib/src/style/index.js +1 -0
  43. package/lib/src/utils/cssinjs/index.d.ts +8 -0
  44. package/lib/src/utils/cssinjs/index.js +1 -0
  45. package/lib/src/version.d.ts +1 -1
  46. package/lib/src/version.js +1 -1
  47. package/package.json +3 -1
  48. package/theme/ag-grid/index.css +0 -56
  49. package/theme/ag-grid-modal/index.css +0 -56
  50. package/theme/ap-action/item.css +0 -56
  51. package/theme/ap-action/item.less +1 -58
  52. package/theme/ap-grid/index.css +0 -56
  53. package/theme/ap-table/ap-table.css +0 -56
  54. package/theme/ap-table-modal/index.css +0 -56
  55. package/theme/editable-table/index.css +0 -56
  56. package/theme/index.css +0 -56
  57. 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
+ };
@@ -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>;
@@ -0,0 +1,6 @@
1
+ import { inject as e, ref as n } from "vue";
2
+ const o = Symbol("designTokenContextKey"), r = () => e(o, n({}));
3
+ export {
4
+ o as designTokenContextKey,
5
+ r as useToken
6
+ };
@@ -7,6 +7,7 @@ import { ButtonSize } from '@aplus-frontend/antdv/es/button';
7
7
  import { ThemeConfig, InputConfig, PaginationConfig, FormConfig, SelectConfig, CascaderConfig, DatePickerConfig, RangePickerConfig, TreeSelectConfig, TextAreaConfig, InputNumberConfig, MentionsConfig, TimePickerConfig, CardConfig } from '@aplus-frontend/antdv/es/config-provider/context';
8
8
  import { ApGridRowSelection, AgGridRowSelection, ViewCacheOption } from '..';
9
9
  import { LocaleType } from '../locale';
10
+ import { FullToken } from '../design-token/interface';
10
11
  import { ApiType, ApUploadConfig, ApDescriptionsConfig, ValueTypeRenderConfig, downloadCenterTriggerConfig, ExportField, SearchFormGlobalConfig } from './constants';
11
12
  export * from './config-provider-props';
12
13
  export * from './constants';
@@ -160,6 +161,9 @@ export declare const APConfigProvider: {
160
161
  aplusLocale: {
161
162
  type: PropType<LocaleType>;
162
163
  };
164
+ aplusToken: {
165
+ type: PropType<Partial< FullToken>>;
166
+ };
163
167
  namespace: {
164
168
  type: StringConstructor;
165
169
  };
@@ -392,6 +396,9 @@ export declare const APConfigProvider: {
392
396
  aplusLocale: {
393
397
  type: PropType<LocaleType>;
394
398
  };
399
+ aplusToken: {
400
+ type: PropType<Partial< FullToken>>;
401
+ };
395
402
  namespace: {
396
403
  type: StringConstructor;
397
404
  };
@@ -621,6 +628,9 @@ export declare const APConfigProvider: {
621
628
  aplusLocale: {
622
629
  type: PropType<LocaleType>;
623
630
  };
631
+ aplusToken: {
632
+ type: PropType<Partial< FullToken>>;
633
+ };
624
634
  namespace: {
625
635
  type: StringConstructor;
626
636
  };
@@ -0,0 +1,2 @@
1
+ import { BaseToken } from './interface';
2
+ export declare const defaultToken: BaseToken;
@@ -0,0 +1,44 @@
1
+ const o = {
2
+ borderColorBase: "#dee4ed",
3
+ hoverColorBase: "#66a9ff",
4
+ activeColorBase: "#66a9ff",
5
+ colorPrimary: "#0070ff",
6
+ colorPrimaryDisabled: "#cce2ff",
7
+ colorLink: "#0070ff",
8
+ colorLinkHover: "#66a9ff",
9
+ colorLinkDisabled: "#cce2ff",
10
+ colorSuccess: "#2ed1a3",
11
+ colorSuccessDisabled: "#d5f6ed",
12
+ colorError: "#ff4d4f",
13
+ colorErrorDisabled: "#ffdbdc",
14
+ colorWarn: "#ffa940",
15
+ colorWarnDisabled: "#ffeed9",
16
+ textColor1: "#526a90",
17
+ textColor2: "#182948",
18
+ textColor3: "#8896b0",
19
+ textColor4: "#abb7cc",
20
+ colorBg1: "#e9edf3",
21
+ colorBg2: "#f6f9fa",
22
+ colorBg3: "#f3f5f8",
23
+ colorBgDisabled: "#f2f6f9",
24
+ fontSizeSM: 10,
25
+ fontSize: 12,
26
+ fontSizeLG: 14,
27
+ fontSizeXL: 16,
28
+ lineHeightSM: 16,
29
+ lineHeight: 18,
30
+ lineHeightLG: 22,
31
+ borderRadiusXS: 1,
32
+ borderRadius: 4,
33
+ spaceXXS: 2,
34
+ spaceXS: 4,
35
+ spaceSM: 6,
36
+ space: 8,
37
+ spaceMD: 10,
38
+ spaceLG: 12,
39
+ spaceXL: 16,
40
+ spaceXXL: 24
41
+ };
42
+ export {
43
+ o as defaultToken
44
+ };
@@ -0,0 +1,123 @@
1
+ import { ActionToken } from '../ap-action/style';
2
+ import { Recordable } from '../type';
3
+ import { CSSInterpolation } from '@emotion/serialize';
4
+ export type BaseToken = {
5
+ /**
6
+ * 基础边框色
7
+ */
8
+ borderColorBase: string;
9
+ /**
10
+ * 基础hover色
11
+ */
12
+ hoverColorBase: string;
13
+ /**
14
+ * 基础active色
15
+ */
16
+ activeColorBase: string;
17
+ /**
18
+ * 主色
19
+ */
20
+ colorPrimary: string;
21
+ /**
22
+ * 主色禁用色
23
+ */
24
+ colorPrimaryDisabled: string;
25
+ /**
26
+ * 链接色
27
+ */
28
+ colorLink: string;
29
+ /**
30
+ * 链接色-hover
31
+ */
32
+ colorLinkHover: string;
33
+ /**
34
+ * 链接色-禁用
35
+ */
36
+ colorLinkDisabled: string;
37
+ /**
38
+ * 成功色
39
+ */
40
+ colorSuccess: string;
41
+ /**
42
+ * 成功色-禁用
43
+ */
44
+ colorSuccessDisabled: string;
45
+ /**
46
+ * 失败色
47
+ */
48
+ colorError: string;
49
+ /**
50
+ * 失败色-禁用
51
+ */
52
+ colorErrorDisabled: string;
53
+ /**
54
+ * 警告色
55
+ */
56
+ colorWarn: string;
57
+ /**
58
+ * 警告色-禁用
59
+ */
60
+ colorWarnDisabled: string;
61
+ /**
62
+ * 一级文本色
63
+ */
64
+ textColor1: string;
65
+ /**
66
+ * 二级文本色
67
+ */
68
+ textColor2: string;
69
+ /**
70
+ * 三级文本色
71
+ */
72
+ textColor3: string;
73
+ /**
74
+ * 四级文本色
75
+ */
76
+ textColor4: string;
77
+ /**
78
+ * 一级背景色
79
+ */
80
+ colorBg1: string;
81
+ /**
82
+ * 二级背景色
83
+ */
84
+ colorBg2: string;
85
+ /**
86
+ * 三级背景色
87
+ */
88
+ colorBg3: string;
89
+ /**
90
+ * 背景禁用色
91
+ */
92
+ colorBgDisabled: string;
93
+ fontSizeXL: number;
94
+ fontSizeLG: number;
95
+ fontSize: number;
96
+ fontSizeSM: number;
97
+ lineHeightLG: number;
98
+ lineHeight: number;
99
+ lineHeightSM: number;
100
+ borderRadiusXS: number;
101
+ borderRadius: number;
102
+ spaceXXS: number;
103
+ spaceXS: number;
104
+ spaceSM: number;
105
+ space: number;
106
+ spaceMD: number;
107
+ spaceLG: number;
108
+ spaceXL: number;
109
+ spaceXXL: number;
110
+ };
111
+ export type FullToken = BaseToken & {
112
+ components: {
113
+ ApAction: ActionToken;
114
+ };
115
+ };
116
+ export type TokenWithComponentCls<Token> = Token & {
117
+ componentCls: string;
118
+ };
119
+ export type CssVarToken<Token = Recordable> = {
120
+ [key in keyof Token]: Token[key] | string;
121
+ };
122
+ export type GenStyleFunc<Token> = (token: TokenWithComponentCls<Token>) => CSSInterpolation;
123
+ export type GenStyleCallback<Token> = (token: TokenWithComponentCls<Token>) => CSSInterpolation[];
@@ -0,0 +1,3 @@
1
+ import { CSSProperties } from 'vue';
2
+ import { BaseToken } from '../design-token/interface';
3
+ export declare const resetComponent: (token: BaseToken) => CSSProperties;
@@ -0,0 +1,12 @@
1
+ export const resetComponent = (token) => {
2
+ return {
3
+ boxSizing: 'border-box',
4
+ margin: 0,
5
+ padding: 0,
6
+ color: token.textColor2,
7
+ fontSize: token.fontSize,
8
+ fontFamily: 'inherit',
9
+ lineHeight: token.lineHeight,
10
+ listStyle: 'none'
11
+ };
12
+ };
@@ -0,0 +1,13 @@
1
+ const i = (e) => ({
2
+ boxSizing: "border-box",
3
+ margin: 0,
4
+ padding: 0,
5
+ color: e.textColor2,
6
+ fontSize: e.fontSize,
7
+ fontFamily: "inherit",
8
+ lineHeight: e.lineHeight,
9
+ listStyle: "none"
10
+ });
11
+ export {
12
+ i as resetComponent
13
+ };