@aplus-frontend/ui 7.0.0-beta.2 → 7.0.0-beta.3

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 (143) hide show
  1. package/es/index.mjs +216 -218
  2. package/es/src/ag-grid/editable/form-item.vue.mjs +68 -63
  3. package/es/src/ag-grid/editable/index.vue.mjs +66 -61
  4. package/es/src/ag-grid/editable/interface.d.ts +3 -1
  5. package/es/src/ag-grid/hooks/use-editable-form-item-api.mjs +65 -63
  6. package/es/src/ag-grid/style/index.d.ts +28 -1
  7. package/es/src/ag-grid/style/index.mjs +56 -43
  8. package/es/src/ag-grid/theme.mjs +12 -11
  9. package/es/src/ap-action/item/index.vue2.mjs +14 -12
  10. package/es/src/ap-action/style/dropdown-item.mjs +4 -4
  11. package/es/src/ap-action/style/index.d.ts +5 -2
  12. package/es/src/ap-action/style/index.mjs +29 -23
  13. package/es/src/ap-button/ap-button.vue.mjs +45 -49
  14. package/es/src/ap-button/style/index.mjs +5 -4
  15. package/es/src/ap-download/hooks/useStyle.mjs +9 -9
  16. package/es/src/ap-form/style/item.d.ts +1 -2
  17. package/es/src/ap-form/style/item.mjs +12 -16
  18. package/es/src/ap-form/style/modal-form.d.ts +2 -1
  19. package/es/src/ap-form/style/modal-form.mjs +26 -13
  20. package/es/src/ap-form/style/search-form-sorter.d.ts +2 -1
  21. package/es/src/ap-form/style/search-form-sorter.mjs +20 -13
  22. package/es/src/ap-form/style/token.d.ts +25 -1
  23. package/es/src/ap-grid/hooks/use-table-style.mjs +1 -1
  24. package/es/src/ap-grid/index.vue.mjs +2 -2
  25. package/es/src/ap-grid/style/index.d.ts +4 -1
  26. package/es/src/ap-grid/style/index.mjs +10 -7
  27. package/es/src/ap-table/ap-table.vue2.mjs +2 -2
  28. package/es/src/ap-table/utils.mjs +14 -11
  29. package/es/src/ap-tag/ap-tag.vue.mjs +7 -6
  30. package/es/src/business/ap-appendix/style/index.d.ts +3 -2
  31. package/es/src/business/ap-appendix/style/index.mjs +19 -16
  32. package/es/src/business/ap-appendix/style/token.d.ts +4 -0
  33. package/es/src/business/ap-appendix/style/token.mjs +6 -0
  34. package/es/src/business/ap-attachment/ApAttachment.mjs +73 -73
  35. package/es/src/business/ap-attachment/style/index.mjs +1 -0
  36. package/es/src/business/ap-batch-action/style/index.mjs +3 -3
  37. package/es/src/business/ap-radio-group/style/index.mjs +3 -3
  38. package/es/src/business/ap-view/style/index.mjs +18 -21
  39. package/es/src/business/batch-input-group/style/index.d.ts +3 -0
  40. package/es/src/business/batch-input-group/style/index.mjs +9 -5
  41. package/es/src/check-card/style/index.mjs +37 -31
  42. package/es/src/config-provider/config-provider.d.ts +1 -2
  43. package/es/src/config-provider/hooks/use-global-config.d.ts +1 -2
  44. package/es/src/config-provider/hooks/use-global-config.mjs +42 -33
  45. package/es/src/config-provider/hooks/use-token.d.ts +7 -2
  46. package/es/src/config-provider/hooks/use-token.mjs +6 -3
  47. package/es/src/config-provider/index.d.ts +1 -2
  48. package/es/src/design-token/constants.d.ts +1 -6
  49. package/es/src/design-token/constants.mjs +2 -100
  50. package/es/src/design-token/index.d.ts +1 -1
  51. package/es/src/design-token/index.mjs +5 -6
  52. package/es/src/design-token/interface.d.ts +9 -1
  53. package/es/src/design-token/interface.mjs +1 -0
  54. package/es/src/full-screen/index.vue.mjs +31 -30
  55. package/es/src/index.mjs +196 -198
  56. package/es/src/mask/style/index.mjs +2 -2
  57. package/es/src/scroll-bar/style/index.mjs +17 -17
  58. package/es/src/splitter/style/index.d.ts +9 -1
  59. package/es/src/splitter/style/index.mjs +1 -2
  60. package/es/src/text/style/index.d.ts +4 -1
  61. package/es/src/text/style/index.mjs +22 -18
  62. package/es/src/utils/cssinjs/index.d.ts +1 -5
  63. package/es/src/utils/cssinjs/index.mjs +49 -39
  64. package/es/src/utils/cssinjs/instance.mjs +7 -7
  65. package/es/src/utils/cssinjs/plugin-append-cssvar.d.ts +6 -0
  66. package/es/src/utils/cssinjs/plugin-append-cssvar.mjs +6 -0
  67. package/es/src/utils/cssinjs/utils.d.ts +6 -0
  68. package/es/src/utils/cssinjs/utils.mjs +15 -0
  69. package/es/src/version.d.ts +1 -1
  70. package/es/src/version.mjs +1 -1
  71. package/lib/index.js +1 -1
  72. package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
  73. package/lib/src/ag-grid/editable/index.vue.js +1 -1
  74. package/lib/src/ag-grid/editable/interface.d.ts +3 -1
  75. package/lib/src/ag-grid/hooks/use-editable-form-item-api.js +1 -1
  76. package/lib/src/ag-grid/style/index.d.ts +28 -1
  77. package/lib/src/ag-grid/style/index.js +1 -1
  78. package/lib/src/ag-grid/theme.js +1 -1
  79. package/lib/src/ap-action/item/index.vue2.js +1 -1
  80. package/lib/src/ap-action/style/dropdown-item.js +1 -1
  81. package/lib/src/ap-action/style/index.d.ts +5 -2
  82. package/lib/src/ap-action/style/index.js +1 -1
  83. package/lib/src/ap-button/ap-button.vue.js +1 -1
  84. package/lib/src/ap-button/style/index.js +1 -1
  85. package/lib/src/ap-download/hooks/useStyle.js +1 -1
  86. package/lib/src/ap-form/style/item.d.ts +1 -2
  87. package/lib/src/ap-form/style/item.js +1 -1
  88. package/lib/src/ap-form/style/modal-form.d.ts +2 -1
  89. package/lib/src/ap-form/style/modal-form.js +1 -1
  90. package/lib/src/ap-form/style/search-form-sorter.d.ts +2 -1
  91. package/lib/src/ap-form/style/search-form-sorter.js +1 -1
  92. package/lib/src/ap-form/style/token.d.ts +25 -1
  93. package/lib/src/ap-grid/hooks/use-table-style.js +1 -1
  94. package/lib/src/ap-grid/index.vue.js +1 -1
  95. package/lib/src/ap-grid/style/index.d.ts +4 -1
  96. package/lib/src/ap-grid/style/index.js +1 -1
  97. package/lib/src/ap-table/ap-table.vue2.js +1 -1
  98. package/lib/src/ap-table/utils.js +1 -1
  99. package/lib/src/ap-tag/ap-tag.vue.js +1 -1
  100. package/lib/src/business/ap-appendix/style/index.d.ts +3 -2
  101. package/lib/src/business/ap-appendix/style/index.js +1 -1
  102. package/lib/src/business/ap-appendix/style/token.d.ts +4 -0
  103. package/lib/src/business/ap-appendix/style/token.js +1 -0
  104. package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
  105. package/lib/src/business/ap-attachment/style/index.js +1 -1
  106. package/lib/src/business/ap-batch-action/style/index.js +1 -1
  107. package/lib/src/business/ap-radio-group/style/index.js +1 -1
  108. package/lib/src/business/ap-view/style/index.js +1 -1
  109. package/lib/src/business/batch-input-group/style/index.d.ts +3 -0
  110. package/lib/src/business/batch-input-group/style/index.js +1 -1
  111. package/lib/src/check-card/style/index.js +1 -1
  112. package/lib/src/config-provider/config-provider.d.ts +1 -2
  113. package/lib/src/config-provider/hooks/use-global-config.d.ts +1 -2
  114. package/lib/src/config-provider/hooks/use-global-config.js +1 -1
  115. package/lib/src/config-provider/hooks/use-token.d.ts +7 -2
  116. package/lib/src/config-provider/hooks/use-token.js +1 -1
  117. package/lib/src/config-provider/index.d.ts +1 -2
  118. package/lib/src/design-token/constants.d.ts +1 -6
  119. package/lib/src/design-token/constants.js +1 -1
  120. package/lib/src/design-token/index.d.ts +1 -1
  121. package/lib/src/design-token/index.js +1 -1
  122. package/lib/src/design-token/interface.d.ts +9 -1
  123. package/lib/src/design-token/interface.js +1 -0
  124. package/lib/src/full-screen/index.vue.js +1 -1
  125. package/lib/src/index.js +1 -1
  126. package/lib/src/mask/style/index.js +2 -2
  127. package/lib/src/scroll-bar/style/index.js +1 -1
  128. package/lib/src/splitter/style/index.d.ts +9 -1
  129. package/lib/src/splitter/style/index.js +1 -1
  130. package/lib/src/text/style/index.d.ts +4 -1
  131. package/lib/src/text/style/index.js +1 -1
  132. package/lib/src/utils/cssinjs/index.d.ts +1 -5
  133. package/lib/src/utils/cssinjs/index.js +1 -1
  134. package/lib/src/utils/cssinjs/instance.js +1 -1
  135. package/lib/src/utils/cssinjs/plugin-append-cssvar.d.ts +6 -0
  136. package/lib/src/utils/cssinjs/plugin-append-cssvar.js +1 -0
  137. package/lib/src/utils/cssinjs/utils.d.ts +6 -0
  138. package/lib/src/utils/cssinjs/utils.js +1 -0
  139. package/lib/src/version.d.ts +1 -1
  140. package/lib/src/version.js +1 -1
  141. package/package.json +1 -1
  142. package/es/src/utils/cssinjs/plugin-specificity.mjs +0 -13
  143. package/lib/src/utils/cssinjs/plugin-specificity.js +0 -1
@@ -1,38 +1,45 @@
1
1
  import { genSettingTriggerBtnStyle as l } from "../../ap-table/style/index.mjs";
2
- import { multiRows as a, resetScrollbar as t } from "../../style/index.mjs";
2
+ import { multiRows as a, resetScrollbar as d } from "../../style/index.mjs";
3
3
  import { genComponentStyleHook as r } from "../../utils/cssinjs/index.mjs";
4
- const n = (e) => {
5
- const { componentCls: i } = e;
4
+ const t = {
5
+ agGridSearchFormWrapperMarginBlockEnd: 10,
6
+ agGridCellPaddingBlockMedium: 9,
7
+ agGridCellPaddingBlockMini: 6,
8
+ agGridLineClamp: 2,
9
+ agGridEllipsisTooltipMaxWidth: 300,
10
+ agGridEllipsisTooltipPadding: "6px 8px"
11
+ }, n = (i) => {
12
+ const { componentCls: e } = i;
6
13
  return {
7
- [i]: {
8
- ...t(e),
14
+ [e]: {
15
+ ...d(i),
9
16
  "&-adaptive": {
10
17
  height: "100%",
11
18
  display: "flex",
12
19
  flexDirection: "column",
13
- [`${i}-grid-wrapper`]: {
20
+ [`${e}-grid-wrapper`]: {
14
21
  minHeight: 0,
15
22
  flex: 1,
16
23
  position: "relative"
17
24
  }
18
25
  },
19
26
  "&-wrapper": {
20
- padding: e.space,
21
- paddingBlockEnd: e.spaceLG,
27
+ padding: i.space,
28
+ paddingBlockEnd: i.spaceLG,
22
29
  backgroundColor: "#fff",
23
30
  // 如果渲染了分页器,则取消容器的底部边距,防止双重边距
24
31
  "&:has(ul.ant-pagination)": {
25
32
  paddingBottom: 0
26
33
  }
27
34
  },
28
- [`${i}__search-wrapper`]: {
29
- padding: e.space,
35
+ [`${e}__search-wrapper`]: {
36
+ padding: i.space,
30
37
  paddingBlockEnd: 0,
31
38
  backgroundColor: "#fff",
32
- borderRadius: e.borderRadius,
33
- marginBlockEnd: "10px"
39
+ borderRadius: i.borderRadius,
40
+ marginBlockEnd: i.agGridSearchFormWrapperMarginBlockEnd
34
41
  },
35
- [`${i}__table-wrapper`]: {
42
+ [`${e}__table-wrapper`]: {
36
43
  flex: 1,
37
44
  minHeight: 0,
38
45
  maxHeight: "100%",
@@ -40,17 +47,17 @@ const n = (e) => {
40
47
  display: "flex",
41
48
  flexDirection: "column"
42
49
  },
43
- [`${i}__table-wrapper-card`]: {
44
- padding: e.space,
45
- paddingBlockEnd: e.spaceLG,
46
- borderRadius: e.borderRadius,
50
+ [`${e}__table-wrapper-card`]: {
51
+ padding: i.space,
52
+ paddingBlockEnd: i.spaceLG,
53
+ borderRadius: i.borderRadius,
47
54
  backgroundColor: "#fff",
48
55
  "&:has(ul.ant-pagination)": {
49
56
  paddingBlockEnd: 0
50
57
  }
51
58
  },
52
- [`${i}-pagination`]: {
53
- marginBlock: e.space,
59
+ [`${e}-pagination`]: {
60
+ marginBlock: i.space,
54
61
  display: "flex",
55
62
  flexWrap: "wrap",
56
63
  alignItems: "center",
@@ -58,12 +65,12 @@ const n = (e) => {
58
65
  ".ant-pagination-total-text": {
59
66
  flex: 1,
60
67
  height: "unset",
61
- lineHeight: e.lineHeight,
68
+ lineHeight: i.lineHeight,
62
69
  display: "flex",
63
70
  alignItems: "center"
64
71
  }
65
72
  },
66
- [`${i}__table-loading-wrapper`]: {
73
+ [`${e}__table-loading-wrapper`]: {
67
74
  position: "absolute",
68
75
  top: 0,
69
76
  left: 0,
@@ -75,38 +82,38 @@ const n = (e) => {
75
82
  alignItems: "center",
76
83
  backgroundColor: "hsla(0,0%,100%,.5)"
77
84
  },
78
- [`${i}-table-header`]: {
85
+ [`${e}-table-header`]: {
79
86
  "&__title": {
80
- ...a(e),
87
+ ...a(i),
81
88
  fontWeight: 700,
82
- textAlign: "right",
89
+ // textAlign: 'right',
83
90
  "&--single": {
84
91
  flex: "unset"
85
92
  }
86
93
  }
87
94
  },
88
- ...l(e),
89
- [`${i}__cell--left`]: {
95
+ ...l(i),
96
+ [`${e}__cell--left`]: {
90
97
  textAlign: "left"
91
98
  },
92
- [`${i}__cell--center`]: {
99
+ [`${e}__cell--center`]: {
93
100
  textAlign: "center"
94
101
  },
95
- [`${i}__cell--right`]: {
102
+ [`${e}__cell--right`]: {
96
103
  textAlign: "right"
97
104
  },
98
- [`${i}__cell--multiline`]: {
105
+ [`${e}__cell--multiline`]: {
99
106
  ".ag-cell-value": {
100
107
  display: "-webkit-box",
101
108
  "-webkit-box-orient": "vertical",
102
- "-webkit-line-clamp": "var(--ag-grid-line-clamp)",
109
+ "-webkit-line-clamp": i.agGridLineClamp,
103
110
  wordBreak: "break-all"
104
111
  }
105
112
  },
106
113
  "&-size-mini": {
107
114
  ".ag-cell": {
108
- lineHeight: e.lineHeight,
109
- paddingBlock: "6px",
115
+ lineHeight: i.lineHeight,
116
+ paddingBlock: i.agGridCellPaddingBlockMini,
110
117
  width: "100%",
111
118
  display: "flex",
112
119
  alignItems: "center",
@@ -117,8 +124,8 @@ const n = (e) => {
117
124
  },
118
125
  "&-size-medium": {
119
126
  ".ag-cell": {
120
- lineHeight: e.lineHeight,
121
- paddingBlock: "9px",
127
+ lineHeight: i.lineHeight,
128
+ paddingBlock: i.agGridCellPaddingBlockMedium,
122
129
  display: "flex",
123
130
  alignItems: "center",
124
131
  "& > div": {
@@ -126,13 +133,13 @@ const n = (e) => {
126
133
  }
127
134
  }
128
135
  },
129
- [`${i}__tooltip`]: {
130
- fontSize: e.fontSize,
131
- maxWidth: "300px",
136
+ [`${e}__tooltip`]: {
137
+ fontSize: i.fontSize,
138
+ maxWidth: i.agGridEllipsisTooltipMaxWidth,
132
139
  wordBreak: "break-all",
133
140
  backgroundColor: "#fff",
134
- padding: "6px 8px",
135
- borderRadius: "4px",
141
+ padding: i.agGridEllipsisTooltipPadding,
142
+ borderRadius: i.borderRadius,
136
143
  boxShadow: "0 6px 16px 0 rgba(0, 0, 0, 0.08),0 3px 6px -4px rgba(0, 0, 0, 0.12),0 9px 28px 8px rgba(0, 0, 0, 0.05)"
137
144
  },
138
145
  ".ag-unselectable": {
@@ -144,10 +151,16 @@ const n = (e) => {
144
151
  }
145
152
  }
146
153
  };
147
- }, o = r("AgGrid", (e) => [
148
- n(e)
149
- ]);
154
+ }, s = r(
155
+ "AgGrid",
156
+ (i) => [n(i)],
157
+ t,
158
+ {
159
+ skipUnit: ["agGridLineClamp"]
160
+ }
161
+ );
150
162
  export {
151
- o as default,
163
+ s as default,
164
+ t as defaultToken,
152
165
  n as genAgGridStyle
153
166
  };
@@ -1,10 +1,11 @@
1
- import { useToken as n } from "@aplus-frontend/antdv/es/theme/internal";
1
+ import { useToken as l } from "@aplus-frontend/antdv/es/theme/internal";
2
2
  import { themeQuartz as c } from "ag-grid-community";
3
- import { computed as l } from "vue";
4
- const h = (o, r, a) => {
5
- const [, t] = n();
6
- return l(() => {
7
- const d = o.value === "mini", e = t.value;
3
+ import { computed as i } from "vue";
4
+ import { useToken as u } from "../config-provider/hooks/use-token.mjs";
5
+ const B = (r, a, t) => {
6
+ const [, n] = l(), { token: o } = u();
7
+ return i(() => {
8
+ const d = r.value === "mini", e = n.value;
8
9
  return c.withParams({
9
10
  headerHeight: "36px",
10
11
  headerFontSize: "12px",
@@ -15,17 +16,17 @@ const h = (o, r, a) => {
15
16
  headerRowBorder: { color: e.colorBorderSecondary },
16
17
  selectedRowBackgroundColor: e.controlItemBgActive,
17
18
  checkboxCheckedBackgroundColor: e.colorPrimary,
18
- rowHoverColor: "var(--ap-color-bg-2)",
19
- headerBackgroundColor: "var(--ap-table-header-bg)",
19
+ rowHoverColor: o.value.colorBg2,
20
+ headerBackgroundColor: o.value.tableHeaderBg,
20
21
  headerColumnResizeHandleHeight: "50%",
21
22
  headerColumnResizeHandleWidth: "1px",
22
23
  wrapperBorderRadius: "4px",
23
- ...a.value || {},
24
- rowHeight: r.value,
24
+ ...t.value || {},
25
+ rowHeight: a.value,
25
26
  spacing: d ? "5px" : "6.5px"
26
27
  });
27
28
  });
28
29
  };
29
30
  export {
30
- h as useTheme
31
+ B as useTheme
31
32
  };
@@ -1,10 +1,10 @@
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";
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 V, withCtx as I, createElementVNode as L, resolveDynamicComponent as k, isVNode as P, toDisplayString as $ } from "vue";
2
2
  import "../../config-provider/index.mjs";
3
- import $ from "@aplus-frontend/antdv/es/button/LoadingIcon";
4
- import { Tooltip as w } from "@aplus-frontend/antdv";
5
- import D from "../style/index.mjs";
3
+ import w from "@aplus-frontend/antdv/es/button/LoadingIcon";
4
+ import { Tooltip as D } from "@aplus-frontend/antdv";
5
+ import E from "../style/index.mjs";
6
6
  import { useNamespace as T } from "../../config-provider/hooks/use-namespace.mjs";
7
- const x = { key: 1 }, J = /* @__PURE__ */ h({
7
+ const x = { key: 1 }, K = /* @__PURE__ */ h({
8
8
  name: "ApActionItem",
9
9
  __name: "index",
10
10
  props: {
@@ -20,7 +20,7 @@ const x = { key: 1 }, J = /* @__PURE__ */ h({
20
20
  tooltip: { default: () => ({}) }
21
21
  },
22
22
  setup(o) {
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
+ 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 = E("action-item");
24
24
  function p(e) {
25
25
  n(i) || o.disabled || (r.onClick?.(e), r.onAction && (c.value = !0, r.onAction(e).finally(() => c.value = !1)));
26
26
  }
@@ -41,7 +41,7 @@ const x = { key: 1 }, J = /* @__PURE__ */ h({
41
41
  class: B.value,
42
42
  onClick: p
43
43
  }), [
44
- i.value ? (t(), m(n($), {
44
+ i.value ? (t(), m(n(w), {
45
45
  key: 0,
46
46
  "prefix-cls": "btn",
47
47
  "exist-icon": !1,
@@ -51,22 +51,24 @@ const x = { key: 1 }, J = /* @__PURE__ */ h({
51
51
  key: 1,
52
52
  class: S(n(b)("icon-wrapper"))
53
53
  }, [
54
- I(n(w), g({
54
+ V(n(D), g({
55
55
  title: d.value ? e.text : null
56
56
  }, e.tooltip), {
57
- default: L(() => [
58
- (t(), m(k(e.icon || s.icon)))
57
+ default: I(() => [
58
+ L("span", null, [
59
+ (t(), m(k(e.icon || s.icon)))
60
+ ])
59
61
  ]),
60
62
  _: 1
61
63
  }, 16, ["title"])
62
64
  ], 2)) : a("", !0),
63
65
  d.value ? a("", !0) : y(e.$slots, "default", { key: 2 }, () => [
64
- P(e.text) ? (t(), m(k(e.text), { key: 0 })) : (t(), f("span", x, V(e.text || ""), 1))
66
+ P(e.text) ? (t(), m(k(e.text), { key: 0 })) : (t(), f("span", x, $(e.text || ""), 1))
65
67
  ])
66
68
  ], 16)) : a("", !0)
67
69
  ]);
68
70
  }
69
71
  });
70
72
  export {
71
- J as default
73
+ K as default
72
74
  };
@@ -1,8 +1,8 @@
1
1
  import { genComponentStyleHook as i } from "../../utils/cssinjs/index.mjs";
2
2
  const c = (e) => {
3
- const { componentCls: o, namespace: n } = e, t = `.${n}-action-item`;
3
+ const { componentCls: n, namespace: o } = e, t = `.${o}-action-item`;
4
4
  return {
5
- [o]: {
5
+ [n]: {
6
6
  display: "inline-flex",
7
7
  flexDirection: "row",
8
8
  alignItems: "center",
@@ -12,8 +12,8 @@ const c = (e) => {
12
12
  width: "100%"
13
13
  }
14
14
  },
15
- [`${o}__icon`]: {
16
- color: e.colorPrimary,
15
+ [`${n}__icon`]: {
16
+ color: e.colorLink,
17
17
  marginLeft: e.spaceXXS,
18
18
  fontSize: e.fontSize,
19
19
  display: "inline-flex"
@@ -1,8 +1,11 @@
1
- import { BaseToken, GenStyleFunc } from '../../design-token/interface';
1
+ import { GenStyleFunc } from '../../design-token/interface';
2
2
  import { Ref } from 'vue';
3
3
  export type ActionToken = {
4
+ /**
5
+ * 加载中时的组件透明度
6
+ */
4
7
  loadingOpacity: number;
5
8
  };
6
- export declare const genActionItemStyle: GenStyleFunc<BaseToken & ActionToken>;
9
+ export declare const genActionItemStyle: GenStyleFunc<ActionToken>;
7
10
  declare const _default: (prefixCls: string) => Ref<string | undefined, string | undefined>;
8
11
  export default _default;
@@ -1,44 +1,44 @@
1
- import { resetComponent as n } from "../../style/index.mjs";
2
- import { genComponentStyleHook as s } from "../../utils/cssinjs/index.mjs";
3
- const d = (o) => {
1
+ import { resetComponent as e } from "../../style/index.mjs";
2
+ import { genComponentStyleHook as d } from "../../utils/cssinjs/index.mjs";
3
+ const t = (o) => {
4
4
  const {
5
5
  loadingOpacity: i,
6
6
  colorLink: c,
7
7
  colorLinkHover: l,
8
- colorSuccess: e,
9
- colorError: a,
10
- colorWarn: t,
8
+ colorSuccess: a,
9
+ colorError: n,
10
+ colorWarn: s,
11
11
  componentCls: r
12
12
  } = o;
13
13
  return {
14
- [`${r}-item`]: {
14
+ [r]: {
15
15
  display: "inline-block",
16
16
  cursor: "pointer",
17
- ...n(o),
17
+ ...e(o),
18
18
  "&--primary": {
19
19
  color: c,
20
- [`&:not(${r}-item--disabled):hover`]: {
20
+ [`&:not(${r}--disabled):hover`]: {
21
21
  color: l
22
22
  },
23
- [`&${r}-item--disabled`]: {
23
+ [`&${r}--disabled`]: {
24
24
  color: o.colorLinkDisabled
25
25
  }
26
26
  },
27
27
  "&--success": {
28
- color: e,
29
- [`&${r}-item--disabled`]: {
28
+ color: a,
29
+ [`&${r}--disabled`]: {
30
30
  color: o.colorSuccessDisabled
31
31
  }
32
32
  },
33
33
  "&--error": {
34
- color: a,
35
- [`&${r}-item--disabled`]: {
34
+ color: n,
35
+ [`&${r}--disabled`]: {
36
36
  color: o.colorErrorDisabled
37
37
  }
38
38
  },
39
39
  "&--warn": {
40
- color: t,
41
- [`&${r}-item--disabled`]: {
40
+ color: s,
41
+ [`&${r}--disabled`]: {
42
42
  color: o.colorWarnDisabled
43
43
  }
44
44
  },
@@ -48,27 +48,33 @@ const d = (o) => {
48
48
  cursor: "default",
49
49
  ".btn-loading-icon": {
50
50
  marginRight: o.spaceXS
51
+ },
52
+ [`&${r}--disabled`]: {
53
+ opacity: 1
51
54
  }
52
55
  },
53
56
  "&--disabled": {
54
57
  cursor: "not-allowed"
55
58
  },
56
- [`${r}-item__icon-wrapper`]: {
59
+ [`${r}__icon-wrapper`]: {
57
60
  paddingRight: o.spaceXS
58
61
  },
59
62
  "&--icon-first": {
60
- [`${r}-item__icon-wrapper`]: {
63
+ [`${r}__icon-wrapper`]: {
61
64
  paddingRight: 0
62
65
  }
63
66
  }
64
67
  }
65
68
  };
66
- }, b = s(
69
+ }, g = d(
67
70
  "ApAction",
68
- (o) => [d(o)],
69
- { loadingOpacity: 0.35 }
71
+ (o) => [t(o)],
72
+ { loadingOpacity: 0.35 },
73
+ {
74
+ skipUnit: ["loadingOpacity"]
75
+ }
70
76
  );
71
77
  export {
72
- b as default,
73
- d as genActionItemStyle
78
+ g as default,
79
+ t as genActionItemStyle
74
80
  };
@@ -1,13 +1,12 @@
1
- import { defineComponent as z, useSlots as L, ref as w, computed as t, createBlock as M, openBlock as P, unref as n, mergeProps as S, createSlots as T, renderList as _, withCtx as $, renderSlot as x, normalizeProps as N, guardReactiveProps as A } from "vue";
2
- import { Button as D } from "@aplus-frontend/antdv";
3
- import { wait as F } from "@aplus-frontend/utils";
1
+ import { defineComponent as B, useSlots as W, ref as z, computed as o, createBlock as L, openBlock as w, unref as n, mergeProps as P, createSlots as S, renderList as T, withCtx as _, renderSlot as $, normalizeProps as x, guardReactiveProps as M } from "vue";
2
+ import { Button as N } from "@aplus-frontend/antdv";
3
+ import { wait as A } from "@aplus-frontend/utils";
4
4
  import "../config-provider/index.mjs";
5
- import { omit as I } from "lodash-unified";
6
- import { transferOpacityColor as O, isAsynchronous as j } from "./utils/index.mjs";
7
- import G from "./style/index.mjs";
5
+ import { omit as D } from "lodash-unified";
6
+ import { transferOpacityColor as I, isAsynchronous as O } from "./utils/index.mjs";
7
+ import j from "./style/index.mjs";
8
8
  import { useNamespace as R } from "../config-provider/hooks/use-namespace.mjs";
9
- import { useGlobalConfig as q } from "../config-provider/hooks/use-global-config.mjs";
10
- const E = 72, H = 300, eo = /* @__PURE__ */ z({
9
+ const q = 72, E = 300, X = /* @__PURE__ */ B({
11
10
  __name: "ap-button",
12
11
  props: {
13
12
  prefixCls: {},
@@ -34,71 +33,68 @@ const E = 72, H = 300, eo = /* @__PURE__ */ z({
34
33
  lazy: { type: [Boolean, Number], default: !0 },
35
34
  onClick: {}
36
35
  },
37
- setup(m) {
38
- const y = L(), o = m, l = {
39
- aplus: "#0070FF",
40
- admin: "#34b77c"
41
- }, { b: i } = R("ap-action-button"), b = G("ap-action-button"), h = q("uiMode"), r = w(!1), v = t(
42
- () => o.borderLinkColor || l[h.value] || l.aplus
43
- ), s = t(
44
- () => o.type === "borderLink" && !o.disabled ? v.value : void 0
45
- ), u = t(
46
- () => O(s.value)
47
- ), g = t(() => o.minWidth === !0 ? `${E}px` : typeof o.minWidth == "number" ? `${o.minWidth}px` : typeof o.minWidth == "string" ? o.minWidth : void 0), k = t(
48
- () => (o.type === "borderLink" ? "default" : o.type) || "default"
49
- ), c = t(() => o.loading ?? r.value ?? !1), p = t(() => o.lazy === !0 ? H : typeof o.lazy == "number" && o.lazy >= 0 ? o.lazy : 0);
50
- function C() {
51
- const e = I(o, [
36
+ setup(f) {
37
+ const m = W(), e = f, { b: l } = R("ap-action-button"), y = j("ap-action-button"), r = z(!1), b = o(
38
+ () => e.borderLinkColor || "var(--ap-button-border-link-color)"
39
+ ), i = o(
40
+ () => e.type === "borderLink" && !e.disabled ? b.value : void 0
41
+ ), s = o(
42
+ () => I(i.value)
43
+ ), h = o(() => e.minWidth === !0 ? `${q}px` : typeof e.minWidth == "number" ? `${e.minWidth}px` : typeof e.minWidth == "string" ? e.minWidth : void 0), v = o(
44
+ () => (e.type === "borderLink" ? "default" : e.type) || "default"
45
+ ), u = o(() => e.loading ?? r.value ?? !1), c = o(() => e.lazy === !0 ? E : typeof e.lazy == "number" && e.lazy >= 0 ? e.lazy : 0);
46
+ function k() {
47
+ const t = D(e, [
52
48
  "type",
53
49
  "borderLinkColor",
54
50
  "minWidth",
55
51
  "onClick",
56
52
  "loading"
57
53
  ]);
58
- return e ? {
59
- ...e,
60
- type: k.value,
61
- onclick: B
54
+ return t ? {
55
+ ...t,
56
+ type: v.value,
57
+ onclick: g
62
58
  } : {};
63
59
  }
64
- async function B() {
65
- if (c.value) return;
66
- const e = j(o.onClick), d = Date.now();
60
+ async function g() {
61
+ if (u.value) return;
62
+ const t = O(e.onClick), d = Date.now();
67
63
  try {
68
- e && (r.value = !0, await e);
64
+ t && (r.value = !0, await t);
69
65
  } finally {
70
- if (e) {
66
+ if (t) {
71
67
  const a = Date.now() - d;
72
- a < p.value && await F(p.value - a), r.value = !1;
68
+ a < c.value && await A(c.value - a), r.value = !1;
73
69
  }
74
70
  }
75
71
  }
76
- return (e, d) => (P(), M(n(D), S({
72
+ return (t, d) => (w(), L(n(N), P({
77
73
  class: {
78
- [n(i)()]: !0,
79
- [`${n(i)()}-border-link`]: u.value,
80
- [`${n(b)}`]: !0
74
+ [n(l)()]: !0,
75
+ [`${n(l)()}-border-link`]: s.value,
76
+ [`${n(y)}`]: !0
81
77
  }
82
78
  }, {
83
- ...e.$attrs,
84
- ...C()
79
+ ...t.$attrs,
80
+ ...k()
85
81
  }, {
86
82
  style: {
87
- color: s.value,
88
- minWidth: g.value,
89
- "--button-border-color": u.value
83
+ color: i.value,
84
+ minWidth: h.value,
85
+ "--button-border-color": s.value
90
86
  },
91
- loading: c.value
92
- }), T({ _: 2 }, [
93
- _(y, (a, f) => ({
94
- name: f,
95
- fn: $((W) => [
96
- x(e.$slots, f, N(A(W || {})))
87
+ loading: u.value
88
+ }), S({ _: 2 }, [
89
+ T(m, (a, p) => ({
90
+ name: p,
91
+ fn: _((C) => [
92
+ $(t.$slots, p, x(M(C || {})))
97
93
  ])
98
94
  }))
99
95
  ]), 1040, ["class", "style", "loading"]));
100
96
  }
101
97
  });
102
98
  export {
103
- eo as default
99
+ X as default
104
100
  };
@@ -1,8 +1,9 @@
1
- import { genComponentStyleHook as n } from "../../utils/cssinjs/index.mjs";
2
- const r = (o) => {
1
+ import { genComponentStyleHook as r } from "../../utils/cssinjs/index.mjs";
2
+ const n = (o) => {
3
3
  const { componentCls: t } = o;
4
4
  return {
5
5
  [t]: {
6
+ "--ap-button-border-link-color": o.colorPrimary,
6
7
  "&-border-link": {
7
8
  ".ant-btn&:not(:disabled):hover,&:not(:disabled):active,&:not(:disabled):focus": {
8
9
  borderColor: "var(--button-border-color)",
@@ -11,8 +12,8 @@ const r = (o) => {
11
12
  }
12
13
  }
13
14
  };
14
- }, l = n("ApButton", (o) => [
15
- r(o)
15
+ }, l = r("ApButton", (o) => [
16
+ n(o)
16
17
  ]);
17
18
  export {
18
19
  l as default
@@ -1,18 +1,18 @@
1
- import { computed as a } from "vue";
1
+ import { computed as o } from "vue";
2
2
  import { getHexWithOpacity as m } from "../utils/getFileInfo.mjs";
3
3
  import "../../config-provider/index.mjs";
4
4
  import c from "../style/index.mjs";
5
5
  import { useNamespace as w } from "../../config-provider/hooks/use-namespace.mjs";
6
6
  import { useGlobalConfig as f } from "../../config-provider/hooks/use-global-config.mjs";
7
- function S(o, p, l) {
8
- const { b: n, bm: e } = w("ap-download"), t = c("ap-download"), i = f("uiMode"), s = a(() => ({
9
- "--download-main-color": o.value,
10
- "--download-main-color-opacity": m(o.value, 0.6)
11
- })), u = a(() => [n("wrapper"), e("wrapper", p.value), t.value].filter(
7
+ function S(p, n, l) {
8
+ const { b: r, bm: e } = w("ap-download"), t = c("ap-download"), i = f("uiMode"), s = o(() => ({
9
+ "--download-main-color": p.value,
10
+ "--download-main-color-opacity": m(p.value, 0.6)
11
+ })), u = o(() => [r("wrapper"), e("wrapper", n.value), t.value].filter(
12
12
  Boolean
13
- )), d = a(() => {
14
- const r = [n("inner-wrapper"), e("inner-wrapper", p.value)];
15
- return l.value && (i.value === "aplus" ? r.push(e("inner-wrapper", "disabled")) : r.push(e("inner-wrapper", "disabled-admin"))), [...r, t.value];
13
+ )), d = o(() => {
14
+ const a = [r(), r("inner-wrapper"), e("inner-wrapper", n.value)];
15
+ return l.value && (i.value === "aplus" ? a.push(e("inner-wrapper", "disabled")) : a.push(e("inner-wrapper", "disabled-admin"))), [...a, t.value];
16
16
  });
17
17
  return {
18
18
  wrapperStyle: s,
@@ -1,6 +1,5 @@
1
1
  import { GenStyleFunc } from '../../design-token/interface';
2
- import { ApFormToken } from './token';
3
2
  import { Ref } from 'vue';
4
- export declare const genApFormItemStyle: GenStyleFunc<ApFormToken>;
3
+ export declare const genApFormItemStyle: GenStyleFunc;
5
4
  declare const _default: (prefixCls: string) => Ref<string | undefined, string | undefined>;
6
5
  export default _default;