@aplus-frontend/ui 7.0.1 → 7.1.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 (111) hide show
  1. package/es/src/ap-descriptions/ap-descriptions.vue.mjs +39 -39
  2. package/es/src/ap-descriptions/style/index.mjs +16 -43
  3. package/es/src/ap-download/ap-download.vue.mjs +43 -43
  4. package/es/src/ap-download/hooks/useStyle.d.ts +1 -1
  5. package/es/src/ap-download/hooks/useStyle.mjs +17 -14
  6. package/es/src/ap-download/style/index.mjs +6 -13
  7. package/es/src/ap-form/modal-form/index.vue.mjs +59 -60
  8. package/es/src/ap-form/style/modal-form.mjs +14 -15
  9. package/es/src/ap-form/style/search-form-sorter.mjs +26 -26
  10. package/es/src/ap-form/style/token.d.ts +4 -0
  11. package/es/src/ap-grid/style/index.mjs +3 -3
  12. package/es/src/ap-pro-card/style/statistic.mjs +3 -3
  13. package/es/src/ap-pro-card/style/token.mjs +1 -1
  14. package/es/src/ap-table/style/index.mjs +2 -2
  15. package/es/src/ap-table/style/setting.mjs +2 -2
  16. package/es/src/ap-tag/ap-tag-group.vue.mjs +61 -61
  17. package/es/src/ap-tag/ap-tag.vue.mjs +19 -20
  18. package/es/src/ap-tag/style/group.mjs +2 -8
  19. package/es/src/ap-tag/style/index.mjs +14 -23
  20. package/es/src/ap-upload/apUpload.vue.mjs +39 -39
  21. package/es/src/ap-upload/components/MultipleFile.vue2.mjs +60 -61
  22. package/es/src/ap-upload/components/Picture.vue2.mjs +90 -91
  23. package/es/src/ap-upload/components/SingleFile.vue2.mjs +72 -72
  24. package/es/src/ap-upload/style/multiple-file.mjs +13 -40
  25. package/es/src/ap-upload/style/picture.mjs +12 -30
  26. package/es/src/ap-upload/style/single-file.mjs +5 -16
  27. package/es/src/business/ap-appendix/style/index.mjs +1 -1
  28. package/es/src/business/ap-attachment/ApAttachment.mjs +42 -39
  29. package/es/src/business/ap-copy/style/index.mjs +1 -1
  30. package/es/src/business/ap-expand-alert/ApExpandAlert.vue2.mjs +45 -46
  31. package/es/src/business/ap-ladder/ApLadder.mjs +20 -22
  32. package/es/src/business/ap-ladder/style/index.mjs +9 -34
  33. package/es/src/business/ap-product-info/ApProductInfo.mjs +21 -22
  34. package/es/src/business/ap-product-info/style/index.mjs +8 -24
  35. package/es/src/business/ap-radio-group/style/index.mjs +1 -1
  36. package/es/src/business/ap-size-input/ApSizeInput.mjs +1 -1
  37. package/es/src/business/ap-table-modal/hooks/use-table-modal.mjs +18 -19
  38. package/es/src/business/ap-table-modal/modal-title.vue2.mjs +13 -13
  39. package/es/src/business/ap-title/style/index.mjs +1 -1
  40. package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.mjs +38 -37
  41. package/es/src/business/ap-value-select-card/index.vue2.mjs +36 -37
  42. package/es/src/business/ap-value-select-card/style/index.mjs +7 -29
  43. package/es/src/business/batch-input-group/style/index.mjs +1 -1
  44. package/es/src/check-card/style/index.mjs +31 -31
  45. package/es/src/design-token/constants.mjs +4 -2
  46. package/es/src/design-token/interface.d.ts +36 -39
  47. package/es/src/scroll-bar/style/index.mjs +12 -12
  48. package/es/src/splitter/style/index.mjs +6 -6
  49. package/es/src/style/index.mjs +1 -1
  50. package/es/src/text/style/index.mjs +1 -1
  51. package/es/src/utils/cssinjs/TokenUtil.d.ts +11 -0
  52. package/es/src/utils/cssinjs/TokenUtil.mjs +26 -0
  53. package/es/src/utils/cssinjs/index.mjs +23 -22
  54. package/es/src/version.d.ts +1 -1
  55. package/es/src/version.mjs +1 -1
  56. package/lib/src/ap-descriptions/ap-descriptions.vue.js +1 -1
  57. package/lib/src/ap-descriptions/style/index.js +1 -1
  58. package/lib/src/ap-download/ap-download.vue.js +1 -1
  59. package/lib/src/ap-download/hooks/useStyle.d.ts +1 -1
  60. package/lib/src/ap-download/hooks/useStyle.js +1 -1
  61. package/lib/src/ap-download/style/index.js +1 -1
  62. package/lib/src/ap-form/modal-form/index.vue.js +1 -1
  63. package/lib/src/ap-form/style/modal-form.js +1 -1
  64. package/lib/src/ap-form/style/search-form-sorter.js +1 -1
  65. package/lib/src/ap-form/style/token.d.ts +4 -0
  66. package/lib/src/ap-grid/style/index.js +1 -1
  67. package/lib/src/ap-pro-card/style/statistic.js +1 -1
  68. package/lib/src/ap-pro-card/style/token.js +1 -1
  69. package/lib/src/ap-table/style/index.js +1 -1
  70. package/lib/src/ap-table/style/setting.js +1 -1
  71. package/lib/src/ap-tag/ap-tag-group.vue.js +1 -1
  72. package/lib/src/ap-tag/ap-tag.vue.js +1 -1
  73. package/lib/src/ap-tag/style/group.js +1 -1
  74. package/lib/src/ap-tag/style/index.js +1 -1
  75. package/lib/src/ap-upload/apUpload.vue.js +1 -1
  76. package/lib/src/ap-upload/components/MultipleFile.vue2.js +1 -1
  77. package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
  78. package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
  79. package/lib/src/ap-upload/style/multiple-file.js +1 -1
  80. package/lib/src/ap-upload/style/picture.js +1 -1
  81. package/lib/src/ap-upload/style/single-file.js +1 -1
  82. package/lib/src/business/ap-appendix/style/index.js +1 -1
  83. package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
  84. package/lib/src/business/ap-copy/style/index.js +1 -1
  85. package/lib/src/business/ap-expand-alert/ApExpandAlert.vue2.js +1 -1
  86. package/lib/src/business/ap-ladder/ApLadder.js +1 -1
  87. package/lib/src/business/ap-ladder/style/index.js +1 -1
  88. package/lib/src/business/ap-product-info/ApProductInfo.js +1 -1
  89. package/lib/src/business/ap-product-info/style/index.js +1 -1
  90. package/lib/src/business/ap-radio-group/style/index.js +1 -1
  91. package/lib/src/business/ap-size-input/ApSizeInput.js +1 -1
  92. package/lib/src/business/ap-table-modal/hooks/use-table-modal.js +1 -1
  93. package/lib/src/business/ap-table-modal/modal-title.vue2.js +1 -1
  94. package/lib/src/business/ap-title/style/index.js +1 -1
  95. package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.js +1 -1
  96. package/lib/src/business/ap-value-select-card/index.vue2.js +1 -1
  97. package/lib/src/business/ap-value-select-card/style/index.js +1 -1
  98. package/lib/src/business/batch-input-group/style/index.js +1 -1
  99. package/lib/src/check-card/style/index.js +1 -1
  100. package/lib/src/design-token/constants.js +1 -1
  101. package/lib/src/design-token/interface.d.ts +36 -39
  102. package/lib/src/scroll-bar/style/index.js +1 -1
  103. package/lib/src/splitter/style/index.js +1 -1
  104. package/lib/src/style/index.js +1 -1
  105. package/lib/src/text/style/index.js +1 -1
  106. package/lib/src/utils/cssinjs/TokenUtil.d.ts +11 -0
  107. package/lib/src/utils/cssinjs/TokenUtil.js +1 -0
  108. package/lib/src/utils/cssinjs/index.js +1 -1
  109. package/lib/src/version.d.ts +1 -1
  110. package/lib/src/version.js +1 -1
  111. package/package.json +1 -1
@@ -1,16 +1,16 @@
1
- import { resetComponent as c } from "../../style/index.mjs";
2
- import { genComponentStyleHook as l } from "../../utils/cssinjs/index.mjs";
3
- const a = (e) => {
1
+ import { resetComponent as o } from "../../style/index.mjs";
2
+ import { genComponentStyleHook as t } from "../../utils/cssinjs/index.mjs";
3
+ const s = (e) => {
4
4
  const {
5
- componentCls: r,
6
- checkCardDisabledOutlineColor: d,
7
- checkCardIndicatorSize: i,
8
- checkCardOutlineWidth: o,
9
- checkCardIndicatorOffset: t
10
- } = e;
5
+ componentCls: i,
6
+ checkCardDisabledOutlineColor: c,
7
+ checkCardIndicatorSize: d,
8
+ checkCardOutlineWidth: r,
9
+ checkCardIndicatorOffset: l
10
+ } = e, a = e.calc(d).mul(2).equal();
11
11
  return {
12
- [`${r}`]: {
13
- ...c(e),
12
+ [`${i}`]: {
13
+ ...o(e),
14
14
  borderRadius: e.borderRadius,
15
15
  position: "relative",
16
16
  "&--disabled": {
@@ -20,7 +20,7 @@ const a = (e) => {
20
20
  "&--bordered": {
21
21
  outline: `1px solid ${e.borderColorBase}`
22
22
  },
23
- [`&:hover:not(${r}--disabled)`]: {
23
+ [`&:hover:not(${i}--disabled)`]: {
24
24
  cursor: "pointer",
25
25
  outline: `1px solid ${e.colorPrimary}`
26
26
  },
@@ -33,24 +33,24 @@ const a = (e) => {
33
33
  insetInlineEnd: 0,
34
34
  clipPath: "polygon(100% 0, 100% 100%, 0 0)",
35
35
  background: e.colorPrimary,
36
- borderRadius: `calc(${e.borderRadius} + 2px)`
36
+ borderRadius: e.calc(e.borderRadius).add("2px").equal()
37
37
  },
38
38
  "&--checked": {
39
- outline: `${o} solid ${e.colorPrimary}`,
40
- [`&:hover:not(${r}--disabled)`]: {
41
- outline: `${o} solid ${e.colorPrimary}`
39
+ outline: `${r} solid ${e.colorPrimary}`,
40
+ [`&:hover:not(${i}--disabled)`]: {
41
+ outline: `${r} solid ${e.colorPrimary}`
42
42
  },
43
43
  "&::after": {
44
- width: `calc(${i} * 2)`,
45
- height: `calc(${i} * 2)`,
46
- insetBlockStart: t,
47
- insetInlineEnd: t,
44
+ width: a,
45
+ height: a,
46
+ insetBlockStart: l,
47
+ insetInlineEnd: l,
48
48
  transition: "width 0.3s cubic-bezier(0.645, 0.045, 0.355, 1), height 0.3s cubic-bezier(0.645, 0.045, 0.355, 1), inset 0.3s cubic-bezier(0.645, 0.045, 0.355, 1)"
49
49
  },
50
- [`&${r}--disabled`]: {
51
- outlineColor: d,
50
+ [`&${i}--disabled`]: {
51
+ outlineColor: c,
52
52
  "&::after": {
53
- backgroundColor: d
53
+ backgroundColor: c
54
54
  }
55
55
  }
56
56
  },
@@ -60,8 +60,8 @@ const a = (e) => {
60
60
  "&--small": {
61
61
  padding: `${e.spaceSM} ${e.spaceLG}`
62
62
  },
63
- [`${r}__title`]: {
64
- ...c(e),
63
+ [`${i}__title`]: {
64
+ ...o(e),
65
65
  marginBottom: e.spaceXS,
66
66
  color: "#333",
67
67
  fontWeight: "bold",
@@ -69,14 +69,14 @@ const a = (e) => {
69
69
  color: e.textColor4
70
70
  }
71
71
  },
72
- [`${r}__content`]: {
73
- ...c(e),
72
+ [`${i}__content`]: {
73
+ ...o(e),
74
74
  color: "#333",
75
75
  "&--disabled": {
76
76
  color: e.textColor4
77
77
  }
78
78
  },
79
- [`${r}__checked-icon`]: {
79
+ [`${i}__checked-icon`]: {
80
80
  position: "absolute",
81
81
  top: 0,
82
82
  right: 0,
@@ -84,15 +84,15 @@ const a = (e) => {
84
84
  lineHeight: 1,
85
85
  userSelect: "none",
86
86
  "& > img": {
87
- width: `calc(${i} - ${o})`,
87
+ width: e.calc(d).sub(r).equal(),
88
88
  verticalAlign: "top"
89
89
  }
90
90
  }
91
91
  }
92
92
  };
93
- }, h = l(
93
+ }, h = t(
94
94
  "CheckCard",
95
- (e) => [a(e)],
95
+ (e) => [s(e)],
96
96
  {
97
97
  checkCardDisabledBg: "#F9F9FA",
98
98
  checkCardDisabledOutlineColor: "#E9EDF3",
@@ -13,14 +13,16 @@ const o = {
13
13
  colorErrorDisabled: "#ffdbdc",
14
14
  colorWarn: "#ffa940",
15
15
  colorWarnDisabled: "#ffeed9",
16
- textColor1: "#526a90",
17
- textColor2: "#182948",
16
+ textColor1: "#182948",
17
+ textColor2: "#526a90",
18
18
  textColor3: "#8896b0",
19
19
  textColor4: "#abb7cc",
20
20
  colorBg1: "#e9edf3",
21
21
  colorBg2: "#f6f9fa",
22
22
  colorBg3: "#f3f5f8",
23
23
  colorBgDisabled: "#f2f6f9",
24
+ colorBgLayout: "#f2f6f9",
25
+ colorBgControl: "#F5F9FF",
24
26
  fontSizeSM: 10,
25
27
  fontSize: 12,
26
28
  fontSizeLG: 14,
@@ -12,6 +12,8 @@ import { AgGridToken } from '../ag-grid/style';
12
12
  import { BatchInputGroupToken } from '../business/batch-input-group/style';
13
13
  import { ApRadioGroupToken } from '../business/ap-radio-group/style';
14
14
  import { ApGridToken } from '../ap-grid/style';
15
+ import { TokenUtil } from '../utils/cssinjs/TokenUtil';
16
+ /** 基础token */
15
17
  export type BaseToken = {
16
18
  /**
17
19
  * 基础边框色
@@ -101,6 +103,14 @@ export type BaseToken = {
101
103
  * 背景禁用色
102
104
  */
103
105
  colorBgDisabled: string;
106
+ /**
107
+ * 布局背景色
108
+ */
109
+ colorBgLayout: string;
110
+ /**
111
+ * 控件背景色(一般同主系,但是更浅,适用块选中效果)
112
+ */
113
+ colorBgControl: string;
104
114
  fontSizeXL: number;
105
115
  fontSizeLG: number;
106
116
  fontSize: number;
@@ -127,53 +137,40 @@ export type BaseToken = {
127
137
  */
128
138
  lineClamp: number;
129
139
  };
130
- /**
131
- * 全量token
132
- */
140
+ /** 组件token */
141
+ export type ComponentsToken = {
142
+ ApAction: ActionToken;
143
+ CheckCard: CheckCardToken;
144
+ ApForm: ApFormToken;
145
+ ApList: ApListToken;
146
+ Scrollbar: ScrollbarToken;
147
+ Mask: MaskToken;
148
+ Splitter: SplitterToken;
149
+ ProCard: ProCardToken;
150
+ StatisticsCard: ProCardToken;
151
+ AgGrid: AgGridToken;
152
+ BatchInputGroup: BatchInputGroupToken;
153
+ ApRadioGroup: ApRadioGroupToken;
154
+ ApGrid: ApGridToken;
155
+ };
156
+ /** 全量token */
133
157
  export type FullToken = BaseToken & {
134
- components: {
135
- ApAction: ActionToken;
136
- CheckCard: CheckCardToken;
137
- ApForm: ApFormToken;
138
- ApList: ApListToken;
139
- Scrollbar: ScrollbarToken;
140
- Mask: MaskToken;
141
- Splitter: SplitterToken;
142
- ProCard: ProCardToken;
143
- StatisticsCard: ProCardToken;
144
- AgGrid: AgGridToken;
145
- BatchInputGroup: BatchInputGroupToken;
146
- ApRadioGroup: ApRadioGroupToken;
147
- ApGrid: ApGridToken;
148
- };
158
+ components: ComponentsToken;
149
159
  };
150
- /**
151
- * 上下文token(基础token+部分组件token)
152
- */
160
+ /** 上下文token(基础token+部分组件token) */
153
161
  export type ContextToken = BaseToken & RecursivePartial<{
154
- components: {
155
- ApAction: ActionToken;
156
- CheckCard: CheckCardToken;
157
- ApForm: ApFormToken;
158
- ApList: ApListToken;
159
- Scrollbar: ScrollbarToken;
160
- Mask: MaskToken;
161
- Splitter: SplitterToken;
162
- ProCard: ProCardToken;
163
- StatisticsCard: ProCardToken;
164
- AgGrid: AgGridToken;
165
- BatchInputGroup: BatchInputGroupToken;
166
- ApRadioGroup: ApRadioGroupToken;
167
- ApGrid: ApGridToken;
168
- };
162
+ components: ComponentsToken;
169
163
  }>;
170
164
  export type TokenWithComponentCls<Token> = Token & {
171
165
  componentCls: string;
172
166
  namespace: string;
173
167
  };
168
+ export type TokenWithUtil<Token> = TokenWithComponentCls<Token> & {
169
+ calc: (cssVar: any) => InstanceType<typeof TokenUtil>;
170
+ };
174
171
  export type CssVarToken<Token = Recordable> = {
175
172
  [key in keyof Token]: Token[key] | string;
176
173
  };
177
- export type GenStyleFunc<Token = object> = (token: TokenWithComponentCls<Token & BaseToken>) => CSSInterpolation;
178
- export type StyleMixin<Token = object> = (token: TokenWithComponentCls<Token & BaseToken>) => CSSObject;
179
- export type GenStyleCallback<Token> = (token: TokenWithComponentCls<Token>, rawToken: TokenWithComponentCls<Token>) => CSSInterpolation[];
174
+ export type GenStyleFunc<Token = object> = (token: TokenWithUtil<Token & BaseToken>) => CSSInterpolation;
175
+ export type StyleMixin<Token = object> = (token: TokenWithUtil<Token & BaseToken>) => CSSObject;
176
+ export type GenStyleCallback<Token> = (calc: TokenWithUtil<Token>, rawToken: TokenWithComponentCls<Token>) => CSSInterpolation[];
@@ -1,8 +1,8 @@
1
- import { genComponentStyleHook as a } from "../../utils/cssinjs/index.mjs";
2
- const e = (r) => {
3
- const { componentCls: t, scrollBarTrackWidth: l, scrollBarBarWidth: o } = r;
1
+ import { genComponentStyleHook as t } from "../../utils/cssinjs/index.mjs";
2
+ const c = (r) => {
3
+ const { componentCls: a, scrollBarTrackWidth: l, scrollBarBarWidth: o } = r;
4
4
  return {
5
- [t]: {
5
+ [a]: {
6
6
  position: "relative",
7
7
  "&--horizontal": {
8
8
  width: "100%",
@@ -12,7 +12,7 @@ const e = (r) => {
12
12
  width: l,
13
13
  height: "100%"
14
14
  },
15
- [`${t}__track`]: {
15
+ [`${a}__track`]: {
16
16
  position: "absolute",
17
17
  width: "100%",
18
18
  height: "100%",
@@ -29,7 +29,7 @@ const e = (r) => {
29
29
  backgroundColor: "transparent"
30
30
  }
31
31
  },
32
- [`${t}__bar`]: {
32
+ [`${a}__bar`]: {
33
33
  position: "absolute",
34
34
  borderRadius: o,
35
35
  backgroundColor: r.scrollBarBarColor,
@@ -40,18 +40,18 @@ const e = (r) => {
40
40
  },
41
41
  "&--horizontal": {
42
42
  height: o,
43
- top: `calc(${l} / 2 - ${o} / 2)`
43
+ top: r.calc(l).div(2).sub(r.calc(o).div(2)).equal()
44
44
  },
45
45
  "&--vertical": {
46
46
  width: o,
47
- left: `calc(${l} / 2 - ${o} / 2)`
47
+ left: r.calc(l).div(2).sub(r.calc(o).div(2)).equal()
48
48
  }
49
49
  }
50
50
  }
51
51
  };
52
- }, n = a(
52
+ }, e = t(
53
53
  "Scrollbar",
54
- (r) => [e(r)],
54
+ (r) => [c(r)],
55
55
  {
56
56
  scrollBarBarColor: "#c7c8cc",
57
57
  scrollBarTrackColor: "#F2F2F2",
@@ -61,6 +61,6 @@ const e = (r) => {
61
61
  }
62
62
  );
63
63
  export {
64
- n as default,
65
- e as genScrollbarStyle
64
+ e as default,
65
+ c as genScrollbarStyle
66
66
  };
@@ -19,7 +19,7 @@ const t = () => ({
19
19
  boxSizing: "border-box",
20
20
  margin: 0,
21
21
  padding: 0,
22
- color: r.textColor2,
22
+ color: r.textColor1,
23
23
  fontSize: r.fontSize,
24
24
  lineHeight: r.lineHeight,
25
25
  listStyle: "none",
@@ -79,7 +79,7 @@ const t = () => ({
79
79
  background: "rgba(0,0,0,0.04)",
80
80
  fontSize: r.fontSizeSM,
81
81
  borderRadius: "2px",
82
- color: r.textColor2,
82
+ color: r.textColor1,
83
83
  cursor: "pointer",
84
84
  opacity: 0,
85
85
  display: "flex",
@@ -140,11 +140,11 @@ const t = () => ({
140
140
  height: "24px",
141
141
  "&-start": {
142
142
  left: "auto",
143
- right: `calc(${r.splitterTriggerSize} / 2)`,
143
+ right: r.calc(r.splitterTriggerSize).div(2).equal(),
144
144
  transform: "translateY(-50%)"
145
145
  },
146
146
  "&-end": {
147
- left: `calc(${r.splitterTriggerSize} / 2)`,
147
+ left: r.calc(r.splitterTriggerSize).div(2).equal(),
148
148
  right: "auto",
149
149
  transform: "translateY(-50%)"
150
150
  }
@@ -182,11 +182,11 @@ const t = () => ({
182
182
  width: "24px",
183
183
  "&-start": {
184
184
  top: "auto",
185
- bottom: `calc(${r.splitterTriggerSize} / 2)`,
185
+ bottom: r.calc(r.splitterTriggerSize).div(2).equal(),
186
186
  transform: "translateX(-50%)"
187
187
  },
188
188
  "&-end": {
189
- top: `calc(${r.splitterTriggerSize} / 2)`,
189
+ top: r.calc(r.splitterTriggerSize).div(2).equal(),
190
190
  bottom: "auto",
191
191
  transform: "translateX(-50%)"
192
192
  }
@@ -2,7 +2,7 @@ const o = (r) => ({
2
2
  boxSizing: "border-box",
3
3
  margin: 0,
4
4
  padding: 0,
5
- color: r.textColor2,
5
+ color: r.textColor1,
6
6
  fontSize: r.fontSize,
7
7
  fontFamily: "inherit",
8
8
  lineHeight: r.lineHeight,
@@ -45,7 +45,7 @@ const l = {
45
45
  }
46
46
  },
47
47
  "span.ant-typography": {
48
- color: n.textColor2
48
+ color: n.textColor1
49
49
  },
50
50
  "span.ant-typography.ant-typography-secondary": {
51
51
  color: e
@@ -0,0 +1,11 @@
1
+ export declare class TokenUtil {
2
+ private result;
3
+ private lowPriority?;
4
+ constructor(cssVar: string);
5
+ add(cssVar: string | number | TokenUtil): this;
6
+ sub(cssVar: string | number | TokenUtil): this;
7
+ mul(cssVar: string | number | TokenUtil): this;
8
+ div(cssVar: string | number | TokenUtil): this;
9
+ getResult(): string;
10
+ equal(): string;
11
+ }
@@ -0,0 +1,26 @@
1
+ class s {
2
+ constructor(t) {
3
+ this.result = "", this.result = t;
4
+ }
5
+ add(t) {
6
+ return t instanceof s ? this.result = `${this.result} + ${t.getResult()}` : this.result = `${this.result} + ${t}`, this.lowPriority = !0, this;
7
+ }
8
+ sub(t) {
9
+ return console.log("cssVar", t), t instanceof s ? this.result = `${this.result} - ${t.getResult()}` : this.result = `${this.result} - ${t}`, this.lowPriority = !0, this;
10
+ }
11
+ mul(t) {
12
+ return this.lowPriority && (this.result = `(${this.result})`), t instanceof s ? this.result = `${this.result} * ${t.getResult()}` : this.result = `${this.result} * ${t}`, this.lowPriority = !1, this;
13
+ }
14
+ div(t) {
15
+ return this.lowPriority && (this.result = `(${this.result})`), t instanceof s ? this.result = `${this.result} / ${t.getResult()}` : this.result = `${this.result} / ${t}`, this.lowPriority = !1, this;
16
+ }
17
+ getResult() {
18
+ return this.lowPriority ? `(${this.result})` : this.result;
19
+ }
20
+ equal() {
21
+ return typeof this.lowPriority < "u" ? `calc(${this.result})` : this.result;
22
+ }
23
+ }
24
+ export {
25
+ s as TokenUtil
26
+ };
@@ -1,32 +1,33 @@
1
- import { ref as y, computed as a, watch as f } from "vue";
2
- import { injectGlobal as g, cx as T } from "@emotion/css";
3
- import S from "@emotion/css/create-instance";
4
- import { useToken as b } from "../../config-provider/hooks/use-token.mjs";
1
+ import { ref as T, computed as a, watch as f } from "vue";
2
+ import { injectGlobal as g, cx as S } from "@emotion/css";
3
+ import b from "@emotion/css/create-instance";
4
+ import { useToken as V } from "../../config-provider/hooks/use-token.mjs";
5
5
  import "../../config-provider/index.mjs";
6
- import { camelToKebab as V, generateCssVar as A } from "./utils.mjs";
6
+ import { camelToKebab as w, generateCssVar as A } from "./utils.mjs";
7
7
  import { omit as C, isFunction as h } from "lodash-unified";
8
8
  import { css as j } from "./instance.mjs";
9
- import { downSpecificityPlugin as w } from "./plugin-specificity.mjs";
10
- import { useGlobalConfig as G } from "../../config-provider/hooks/use-global-config.mjs";
11
- const { css: I } = S({
9
+ import { downSpecificityPlugin as G } from "./plugin-specificity.mjs";
10
+ import { TokenUtil as P } from "./TokenUtil.mjs";
11
+ import { useGlobalConfig as x } from "../../config-provider/hooks/use-global-config.mjs";
12
+ const { css: L } = b({
12
13
  key: "css-dev-only",
13
- stylisPlugins: [w]
14
+ stylisPlugins: [G]
14
15
  });
15
- function P(l) {
16
+ function E(l) {
16
17
  const t = {};
17
- for (const o in l)
18
- t[o] = `var(${V(o)})`;
18
+ for (const n in l)
19
+ t[n] = `var(${w(n)})`;
19
20
  return t;
20
21
  }
21
- function J(l, t, o, d) {
22
+ function M(l, t, n, d) {
22
23
  return (s) => {
23
- const p = l.split("."), { token: c, rootCls: u } = b(), k = y(), m = G("namespace"), $ = a(() => ({
24
+ const p = l.split("."), { token: c, rootCls: u } = V(), k = T(), m = x("namespace"), $ = a(() => ({
24
25
  ...C(c.value || {}, "components"),
25
26
  ...c.value.components?.[p[0]] || {}
26
27
  })), i = a(() => {
27
28
  const e = c.value.components?.[p[0]] || {};
28
29
  return {
29
- ...h(o) ? o($.value) : o || {},
30
+ ...h(n) ? n($.value) : n || {},
30
31
  ...e
31
32
  };
32
33
  }), v = a(() => ({
@@ -38,11 +39,11 @@ function J(l, t, o, d) {
38
39
  return f(
39
40
  () => m.value,
40
41
  (e) => {
41
- const n = P(
42
+ const o = E(
42
43
  v.value
43
44
  );
44
- n.componentCls = `.${e}-${s}`, n.namespace = e;
45
- const r = t(n, {
45
+ o.componentCls = `.${e}-${s}`, o.namespace = e, o.calc = (y) => new P(y);
46
+ const r = t(o, {
46
47
  ...v.value,
47
48
  componentCls: `.${e}-${s}`,
48
49
  namespace: e
@@ -52,16 +53,16 @@ function J(l, t, o, d) {
52
53
  { immediate: !0 }
53
54
  ), f(
54
55
  [() => i.value, () => u.value],
55
- ([e, n]) => {
56
+ ([e, o]) => {
56
57
  const r = A(e, d);
57
58
  Object.keys(r).length && j({
58
- [`.${n}.${m.value}-${s}`]: r
59
+ [`.${o}.${m.value}-${s}`]: r
59
60
  });
60
61
  },
61
62
  { deep: !0, immediate: !0 }
62
- ), a(() => T(u.value, k.value));
63
+ ), a(() => S(u.value, k.value));
63
64
  };
64
65
  }
65
66
  export {
66
- J as genComponentStyleHook
67
+ M as genComponentStyleHook
67
68
  };
@@ -1,2 +1,2 @@
1
- declare const _default: "7.0.1";
1
+ declare const _default: "7.1.0";
2
2
  export default _default;
@@ -1,4 +1,4 @@
1
- const e = "7.0.1";
1
+ const e = "7.1.0";
2
2
  export {
3
3
  e as default
4
4
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("@aplus-frontend/antdv"),s=require("./helper.js"),u=require("lodash-unified");require("./help-message/index.vue.js");require("../config-provider/index.js");const C=require("./style/index.js"),a=require("../config-provider/hooks/use-global-config.js"),_=require("../config-provider/hooks/use-namespace.js"),q=require("./help-message/index.vue2.js"),P={key:0},E=e.defineComponent({name:"ApDescriptions",__name:"ap-descriptions",props:{descriptionsProps:{},schemas:{},dataSource:{},style:{type:[Boolean,null,String,Object,Array]},className:{}},setup(p){const n=p,d=a.useGlobalConfig("uiMode","admin"),f=a.useGlobalConfig("apDescriptions"),y=a.useGlobalConfig("downloadCenterTriggerConfig"),{m:b,b:g,be:k}=_.useNamespace("ap-descriptions"),v=C.default("ap-descriptions"),S=(t={})=>{let o="";return n.descriptionsProps?.layout==="vertical"&&(o="start"),{justifyContent:o,...t}},i=t=>{const o=u.get(n.dataSource,t.field);if(t.customRender)return t.customRender(n.dataSource);t.valueType==="attachment"&&(t.extraProps=s.mixinsAttachmentExtraProps(t.extraProps,{fromConfig:f.value?.downloadFile,fromGlobal:y.value?.trigger}));const l=t.format?t.format(o,n.dataSource||{}):o;return s.transformValue({value:l,record:n.dataSource},t)},m=t=>t.valueType==="text"&&!!t.extraProps?.ellipsis,B=t=>{if(t.visible!=null){if(typeof t.visible=="boolean")return t.visible;if(typeof t.visible=="function")return t.visible({record:n.dataSource||{},schema:t})}return!0};return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.className,e.unref(g)(),e.unref(b)(e.unref(d)),e.unref(v)]),style:e.normalizeStyle(t.style)},[e.createVNode(e.unref(r.Descriptions),e.mergeProps(t.descriptionsProps,{"label-style":S({...t.descriptionsProps?.labelStyle||{}})}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.schemas,(l,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:l.field||"empty"+c},[B(l)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[l.valueType==="empty"?(e.openBlock(),e.createBlock(e.unref(r.DescriptionsItem),{key:0,"content-style":l.contentStyle,"label-style":l.labelStyle,span:l.span},null,8,["content-style","label-style","span"])):(e.openBlock(),e.createBlock(e.unref(r.DescriptionsItem),{key:1,class:e.normalizeClass(m(l)?e.unref(k)("item","ellipsis"):""),label:l.label?e.h(e.Fragment,[e.h(q.default,{helpMessage:l.helpMessage,label:l.label})]):null,span:l.span,"content-style":l.contentStyle,"label-style":l.labelStyle},{default:e.withCtx(()=>[e.unref(s.isEmptyWithType)(e.unref(u.get)(t.dataSource,l.field),l)?(e.openBlock(),e.createElementBlock("span",P,"--")):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.contentSlotName?e.renderSlot(t.$slots,l.contentSlotName,{key:0,index:c,item:i(l),record:t.dataSource}):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.h(e.Fragment,[l.prefix,i(l),l.suffix])),{key:1}))],64))]),_:2},1032,["class","label","span","content-style","label-style"]))],64)):e.createCommentVNode("",!0)],64))),128))]),_:3},16,["label-style"])],6))}});exports.default=E;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),o=require("@aplus-frontend/antdv"),s=require("./helper.js"),c=require("lodash-unified");require("./help-message/index.vue.js");require("../config-provider/index.js");const B=require("./style/index.js"),u=require("../config-provider/hooks/use-global-config.js"),m=require("../config-provider/hooks/use-namespace.js"),C=require("./help-message/index.vue2.js"),_={key:0},q=e.defineComponent({name:"ApDescriptions",__name:"ap-descriptions",props:{descriptionsProps:{},schemas:{},dataSource:{},style:{type:[Boolean,null,String,Object,Array]},className:{}},setup(p){const r=p,d=u.useGlobalConfig("apDescriptions"),f=u.useGlobalConfig("downloadCenterTriggerConfig"),{b:y,be:b}=m.useNamespace("ap-descriptions"),g=B.default("ap-descriptions"),k=(t={})=>{let n="";return r.descriptionsProps?.layout==="vertical"&&(n="start"),{justifyContent:n,...t}},a=t=>{const n=c.get(r.dataSource,t.field);if(t.customRender)return t.customRender(r.dataSource);t.valueType==="attachment"&&(t.extraProps=s.mixinsAttachmentExtraProps(t.extraProps,{fromConfig:d.value?.downloadFile,fromGlobal:f.value?.trigger}));const l=t.format?t.format(n,r.dataSource||{}):n;return s.transformValue({value:l,record:r.dataSource},t)},v=t=>t.valueType==="text"&&!!t.extraProps?.ellipsis,S=t=>{if(t.visible!=null){if(typeof t.visible=="boolean")return t.visible;if(typeof t.visible=="function")return t.visible({record:r.dataSource||{},schema:t})}return!0};return(t,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.className,e.unref(y)(),e.unref(g)]),style:e.normalizeStyle(t.style)},[e.createVNode(e.unref(o.Descriptions),e.mergeProps(t.descriptionsProps,{"label-style":k({...t.descriptionsProps?.labelStyle||{}})}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.schemas,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:l.field||"empty"+i},[S(l)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[l.valueType==="empty"?(e.openBlock(),e.createBlock(e.unref(o.DescriptionsItem),{key:0,"content-style":l.contentStyle,"label-style":l.labelStyle,span:l.span},null,8,["content-style","label-style","span"])):(e.openBlock(),e.createBlock(e.unref(o.DescriptionsItem),{key:1,class:e.normalizeClass(v(l)?e.unref(b)("item","ellipsis"):""),label:l.label?e.h(e.Fragment,[e.h(C.default,{helpMessage:l.helpMessage,label:l.label})]):null,span:l.span,"content-style":l.contentStyle,"label-style":l.labelStyle},{default:e.withCtx(()=>[e.unref(s.isEmptyWithType)(e.unref(c.get)(t.dataSource,l.field),l)?(e.openBlock(),e.createElementBlock("span",_,"--")):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.contentSlotName?e.renderSlot(t.$slots,l.contentSlotName,{key:0,index:i,item:a(l),record:t.dataSource}):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.h(e.Fragment,[l.prefix,a(l),l.suffix])),{key:1}))],64))]),_:2},1032,["class","label","span","content-style","label-style"]))],64)):e.createCommentVNode("",!0)],64))),128))]),_:3},16,["label-style"])],6))}});exports.default=q;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../utils/cssinjs/index.js"),n=t=>{const{componentCls:i}=t;return{[i]:{".ant-descriptions":{".ant-descriptions-view table":{tableLayout:"fixed"},"td.ant-descriptions-item":{paddingBlockEnd:"var(--ap-descriptions-item-padding-bottom, 16px)"},"th.ant-descriptions-item":{paddingBlockEnd:"4px"},".ant-descriptions-row:last-child":{".ant-descriptions-item":{paddingBottom:"var(--ap-descriptions-last-row-item-padding-bottom, 0px)"}},".ant-descriptions-item-label::after":{marginInline:"4px 12px"}},[`${i}-item__ellipsis`]:{".ant-descriptions-item-label":{flexShrink:0},".ant-descriptions-item-content":{flexShrink:1,minWidth:0,".ant-typography":{marginBlockEnd:0},".ant-typography-ellipsis":{maxWidth:"100%"}}},[`${i}--item-label`]:{".ant-typography-single-line":{whiteSpace:"normal"}},".ant-descriptions-row":{".ant-descriptions-item-label":{".ant-typography":{color:"inherit"}}},"&--admin":{".ant-descriptions-row":{".ant-descriptions-item-label":{justifyContent:"flex-end",width:"var(--ap-descriptions-item-label-width, auto)",color:"#999",".ap-descriptions-item-content__help":{fontSize:t.fontSizeLG,marginInlineStart:"4px",color:"#999"}},".ant-descriptions-item-content":{color:"#333",".ap-descriptions-item-content__link":{color:"#1890ff",cursor:"pointer"}}}},"&--aplus":{".ant-descriptions-row":{".ant-descriptions-item-label":{justifyContent:"flex-end",width:"var(--ap-descriptions-item-label-width, auto)",color:"#8896B0",".ap-descriptions-item-content__help":{fontSize:t.fontSizeLG,marginInlineStart:"4px",color:"#8896B0"}},".ant-descriptions-item-content":{color:"#182948",".ap-descriptions-item-content__link":{color:"#0070FF",cursor:"pointer"}}}}}}},o=e.genComponentStyleHook("ApDescriptions",t=>[n(t)]);exports.default=o;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../utils/cssinjs/index.js"),n=t=>{const{componentCls:i}=t;return{[i]:{".ant-descriptions":{".ant-descriptions-view table":{tableLayout:"fixed"},"td.ant-descriptions-item":{paddingBlockEnd:"var(--ap-descriptions-item-padding-bottom, 16px)"},"th.ant-descriptions-item":{paddingBlockEnd:"4px"},".ant-descriptions-row:last-child":{".ant-descriptions-item":{paddingBottom:"var(--ap-descriptions-last-row-item-padding-bottom, 0px)"}},".ant-descriptions-item-label::after":{marginInline:"4px 12px"}},[`${i}-item__ellipsis`]:{".ant-descriptions-item-label":{flexShrink:0},".ant-descriptions-item-content":{flexShrink:1,minWidth:0,".ant-typography":{marginBlockEnd:0},".ant-typography-ellipsis":{maxWidth:"100%"}}},[`${i}--item-label`]:{".ant-typography-single-line":{whiteSpace:"normal"}},".ant-descriptions-row":{".ant-descriptions-item-label":{justifyContent:"flex-end",width:"var(--ap-descriptions-item-label-width, auto)",color:t.textColor3,".ap-descriptions-item-content__help":{fontSize:t.fontSizeLG,marginInlineStart:"4px",color:t.textColor3},".ant-typography":{color:"inherit"}},".ant-descriptions-item-content":{color:t.textColor1,".ap-descriptions-item-content__link":{color:t.colorLink,cursor:"pointer"}}}}}},o=e.genComponentStyleHook("ApDescriptions",t=>[n(t)]);exports.default=o;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("@aplus-frontend/antdv"),w=require("@ant-design/icons-vue");require("../config-provider/index.js");const B=require("./hooks/index.js"),u=require("./utils/getFileInfo.js"),O=require("./hooks/useStyle.js"),q=require("lodash-unified"),z=require("../config-provider/hooks/use-locale.js"),a=require("../config-provider/hooks/use-global-config.js"),F={key:0,class:"spin"},S={key:1,class:"icon"},I={class:"text"},L=e.defineComponent({name:"ApDownload",__name:"ap-download",props:{prefixCls:{},type:{default:"link"},htmlType:{},shape:{},size:{default:"middle"},loading:{type:[Boolean,Object]},disabled:{type:Boolean,default:!1},ghost:{type:Boolean},block:{type:Boolean},danger:{type:Boolean},icon:{},href:{},target:{},title:{},onClick:{},onMousedown:{},autoInsertSpace:{type:Boolean},iconPosition:{},color:{},variant:{},text:{},fileName:{},needName:{type:[Boolean,Object]},getOssAccess:{}},emits:["downloadCallback"],setup(p,{emit:f}){const i=f,l=e.ref(!1),{lang:m}=z.useLocale(),g=e.useSlots(),C=e.computed(()=>m.value==="zh-cn"?"zh_CN":"en_US"),y=a.useGlobalConfig("uiMode"),o=p,s=a.useGlobalConfig("apUpload"),c=a.useGlobalConfig("downloadCenterTriggerConfig"),r=e.computed(()=>o.disabled),b=e.computed(()=>o.color?o.color:y.value==="aplus"?"#0070FF":"#1890FF"),N=e.computed(()=>o.size),{getInnerWrapperClass:v}=O.useStyle(b,N,r),k=e.computed(()=>o.getOssAccess||s.value?.getOssAccess),_=async()=>{if(!o.disabled){l.value=!0;try{if(c.value?.trigger){let n=u.getFileInfo(o.needName??s?.value?.needName,o.fileName).map(d=>({objectName:d.path,fileName:d.fileName}));await c.value?.trigger(n),i("downloadCallback",n)}else{const n=await(await B.useOssInit(k.value,e.unref(C))).downloadFile(u.getFileInfo(o.needName??s?.value?.needName,o.fileName));i("downloadCallback",n)}}catch(t){console.error(t)}finally{l.value=!1}}};return(t,n)=>(e.openBlock(),e.createBlock(e.unref(h.Button),e.mergeProps(e.unref(q.omit)(o,["getOssAccess","fileName","needName"]),{type:o.type,size:o.size,disabled:r.value,onClick:_}),{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(v))},[l.value?(e.openBlock(),e.createElementBlock("span",F,[e.createVNode(e.unref(w.LoadingOutlined),{spin:!0})])):e.createCommentVNode("",!0),e.unref(g).icon?(e.openBlock(),e.createElementBlock("span",S,[e.renderSlot(t.$slots,"icon")])):e.createCommentVNode("",!0),e.createElementVNode("span",I,e.toDisplayString(t.text),1)],2)]),_:3},16,["type","size","disabled"]))}});exports.default=L;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),k=require("@aplus-frontend/antdv"),_=require("@ant-design/icons-vue");require("../config-provider/index.js");const h=require("./hooks/index.js"),d=require("./utils/getFileInfo.js"),w=require("./hooks/useStyle.js"),B=require("lodash-unified"),O=require("../config-provider/hooks/use-locale.js"),u=require("../config-provider/hooks/use-global-config.js"),q={key:0,class:"spin"},z={key:1,class:"icon"},S={class:"text"},I=e.defineComponent({name:"ApDownload",__name:"ap-download",props:{prefixCls:{},type:{default:"link"},htmlType:{},shape:{},size:{default:"middle"},loading:{type:[Boolean,Object]},disabled:{type:Boolean,default:!1},ghost:{type:Boolean},block:{type:Boolean},danger:{type:Boolean},icon:{},href:{},target:{},title:{},onClick:{},onMousedown:{},autoInsertSpace:{type:Boolean},iconPosition:{},color:{},variant:{},text:{},fileName:{},needName:{type:[Boolean,Object]},getOssAccess:{}},emits:["downloadCallback"],setup(p,{emit:f}){const l=f,s=e.ref(!1),{lang:m}=O.useLocale(),g=e.useSlots(),C=e.computed(()=>m.value==="zh-cn"?"zh_CN":"en_US"),t=p,a=u.useGlobalConfig("apUpload"),i=u.useGlobalConfig("downloadCenterTriggerConfig"),c=e.computed(()=>t.disabled),y=e.computed(()=>t.size),{getInnerWrapperClass:b}=w.useStyle(y,c),N=e.computed(()=>t.getOssAccess||a.value?.getOssAccess),v=async()=>{if(!t.disabled){s.value=!0;try{if(i.value?.trigger){let n=d.getFileInfo(t.needName??a?.value?.needName,t.fileName).map(r=>({objectName:r.path,fileName:r.fileName}));await i.value?.trigger(n),l("downloadCallback",n)}else{const n=await(await h.useOssInit(N.value,e.unref(C))).downloadFile(d.getFileInfo(t.needName??a?.value?.needName,t.fileName));l("downloadCallback",n)}}catch(o){console.error(o)}finally{s.value=!1}}};return(o,n)=>(e.openBlock(),e.createBlock(e.unref(k.Button),e.mergeProps(e.unref(B.omit)(t,["getOssAccess","fileName","needName"]),{type:t.type,size:t.size,disabled:c.value,onClick:v}),{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(b))},[s.value?(e.openBlock(),e.createElementBlock("span",q,[e.createVNode(e.unref(_.LoadingOutlined),{spin:!0})])):e.createCommentVNode("",!0),e.unref(g).icon?(e.openBlock(),e.createElementBlock("span",z,[e.renderSlot(o.$slots,"icon")])):e.createCommentVNode("",!0),e.createElementVNode("span",S,e.toDisplayString(o.text),1)],2)]),_:3},16,["type","size","disabled"]))}});exports.default=I;
@@ -1,5 +1,5 @@
1
1
  import { ComputedRef } from 'vue';
2
- export declare function useStyle(color: ComputedRef<string>, size: ComputedRef<string>, disabled: ComputedRef<boolean>): {
2
+ export declare function useStyle(size: ComputedRef<string>, disabled: ComputedRef<boolean>): {
3
3
  wrapperStyle: ComputedRef<Record<string, any>>;
4
4
  getWrapperClass: ComputedRef<string[]>;
5
5
  getInnerWrapperClass: ComputedRef<string[]>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),d=require("../utils/getFileInfo.js");require("../../config-provider/index.js");const w=require("../style/index.js"),m=require("../../config-provider/hooks/use-namespace.js"),v=require("../../config-provider/hooks/use-global-config.js");function f(o,t,l){const{b:r,bm:e}=m.useNamespace("ap-download"),u=w.default("ap-download"),s=v.useGlobalConfig("uiMode"),p=n.computed(()=>({"--download-main-color":o.value,"--download-main-color-opacity":d.getHexWithOpacity(o.value,.6)})),i=n.computed(()=>[r("wrapper"),e("wrapper",t.value),u.value].filter(Boolean)),c=n.computed(()=>{const a=[r(),r("inner-wrapper"),e("inner-wrapper",t.value)];return l.value&&(s.value==="aplus"?a.push(e("inner-wrapper","disabled")):a.push(e("inner-wrapper","disabled-admin"))),[...a,u.value]});return{wrapperStyle:p,getWrapperClass:i,getInnerWrapperClass:c}}exports.useStyle=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),i=require("../utils/getFileInfo.js");require("../../config-provider/index.js");const d=require("../style/index.js"),w=require("../../config-provider/hooks/use-token.js"),m=require("../../config-provider/hooks/use-namespace.js");function v(n,l){const{b:e,bm:r}=m.useNamespace("ap-download"),t=d.default("ap-download"),{token:a}=w.useToken(),s=o.computed(()=>({"--download-main-color":a.value?.colorLink,"--download-main-color-opacity":i.getHexWithOpacity(a.value?.colorLink,.6)})),c=o.computed(()=>[e("wrapper"),r("wrapper",n.value),t.value].filter(Boolean)),p=o.computed(()=>{const u=[e(),e("inner-wrapper"),r("inner-wrapper",n.value)];return l.value&&u.push(r("inner-wrapper","disabled")),[...u,t.value]});return{wrapperStyle:s,getWrapperClass:c,getInnerWrapperClass:p}}exports.useStyle=v;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("../../utils/cssinjs/index.js"),i=e=>{const{componentCls:o}=e,n=`${o}-inner-wrapper`;return{[o]:{"&-wrapper":{textWrap:"nowrap",display:"inline-block"}},[n]:{display:"flex",color:"var(--download-main-color)",cursor:"pointer",alignItems:"center",".spin":{marginInlineEnd:"5px"},".icon":{position:"relative",fontSize:e.fontSizeXL,marginInlineEnd:"5px"},".text":{color:"var(--download-main-color)"},"&:hover":{color:"var(--download-main-color-opacity)"},"&--large":{lineHeight:e.lineHeightLG,fontSize:e.fontSizeLG},"&--middle":{lineHeight:e.lineHeight,fontSize:e.fontSize},"&--small":{lineHeight:e.lineHeightSM,fontSize:e.fontSizeSM},"&--disabled":{color:"#8896b0",cursor:"not-allowed","&:hover":{color:"#8896b0"}},"&--disabled-admin":{cursor:"not-allowed",color:"#999","&:hover":{color:"#999"}}}}},r=l.genComponentStyleHook("ApDownload",e=>[i(e)]);exports.default=r;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("../../utils/cssinjs/index.js"),r=e=>{const{componentCls:o,textColor3:n}=e,i=`${o}-inner-wrapper`;return{[o]:{"&-wrapper":{textWrap:"nowrap",display:"inline-block"}},[i]:{display:"flex",color:"var(--download-main-color)",cursor:"pointer",alignItems:"center",".spin":{marginInlineEnd:"5px"},".icon":{position:"relative",fontSize:e.fontSizeXL,marginInlineEnd:"5px"},".text":{color:"var(--download-main-color)"},"&:hover":{color:"var(--download-main-color-opacity)"},"&--large":{lineHeight:e.lineHeightLG,fontSize:e.fontSizeLG},"&--middle":{lineHeight:e.lineHeight,fontSize:e.fontSize},"&--small":{lineHeight:e.lineHeightSM,fontSize:e.fontSizeSM},"&--disabled":{color:n,cursor:"not-allowed","&:hover":{color:n}}}}},t=l.genComponentStyleHook("ApDownload",e=>[r(e)]);exports.default=t;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("@aplus-frontend/antdv");require("../ap-form.vue.js");require("../../hooks/index.js");const S=require("../../utils/slot.js");require("../../config-provider/index.js");const w=require("lodash-unified"),x=require("../style/modal-form.js"),M=require("../../hooks/useControllableValue.js"),R=require("../../config-provider/hooks/use-locale.js"),U=require("../../config-provider/hooks/use-global-config.js"),j=require("../../config-provider/hooks/use-namespace.js"),I=require("../ap-form.vue2.js");function y(s){return typeof s=="function"||Object.prototype.toString.call(s)==="[object Object]"&&!e.isVNode(s)}const O=e.defineComponent({name:"ApFormModalForm",__name:"index",props:{layout:{default:"horizontal"},labelCol:{},wrapperCol:{},colon:{type:Boolean,default:!0},labelAlign:{default:"right"},labelWrap:{type:Boolean},prefixCls:{},requiredMark:{},hideRequiredMark:{type:Boolean,default:!1},rules:{},validateMessages:{},validateOnRuleChange:{type:Boolean,default:!0},scrollToFirstError:{},onSubmit:{},name:{},validateTrigger:{default:"change"},size:{},disabled:{type:Boolean},onFieldsChange:{},onFinishFailed:{},onValidate:{},variant:{},initialValues:{},onValuesChange:{},syncToUrl:{type:[Boolean,Function]},syncToUrlPriority:{type:Boolean},open:{type:Boolean,default:void 0},"onUpdate:open":{},modalProps:{default:()=>({})},title:{},width:{default:800},onFinish:{},submitter:{type:[Boolean,Object],default:()=>({resetButtonProps:!1})},showCancel:{type:Boolean,default:!0},submitTimeout:{}},emits:["update:open"],setup(s,{expose:g,emit:F}){const l=s,d=e.useSlots(),h=F,a=e.ref(),m=e.ref(0),u=e.ref(),n=e.ref(!1),{value:V,updateValue:i}=M.useControllableValue(l,h,{valuePropName:"open",defaultValue:!1,beforeUpdateValue(t){return t&&(m.value+=1),!0}}),{t:c}=R.useLocale(),C=U.useGlobalConfig("uiMode","aplus"),T=x.default("ap-form-modal-form"),{b:B,e:f}=j.useNamespace("ap-form-modal-form");e.watch(()=>a.value,t=>{t&&u.value&&(t.setFieldsValue?.(u.value),u.value=void 0)});const p=S.getSingleVNode(d.trigger),v=p?e.cloneVNode(p,{onClick:()=>{i(!0)}}):null,k=e.computed(()=>{const t=[];if(l.submitter===!1)return null;if(l.showCancel){let o;t.push(e.createVNode(r.Button,{onClick:b,disabled:n.value},y(o=c("ap.common.cancelText"))?o:{default:()=>[o]}))}return l.submitter?.resetButtonProps!==!1&&t.push(e.createVNode(r.Button,e.mergeProps(l.submitter?.resetButtonProps||{},{key:"reset",disabled:n.value,onClick:N,htmlType:"reset"}),{default:()=>[l.submitter?.resetText||c("ap.common.resetText")]})),l.submitter?.submitButtonProps!==!1&&t.push(e.createVNode(r.Button,e.mergeProps({type:"primary",key:"submit",htmlType:"submit"},l.submitter?.submitButtonProps||{},{loading:n.value}),{default:()=>[l.submitter?.submitText||c("ap.common.okText")]})),e.createVNode(r.Flex,{justify:"flex-end",key:e.unref(m),class:[f("footer"),e.unref(C)==="admin"?f("footer-admin"):null]},{default:()=>[d.submitter?d.submitter(t):e.createVNode(r.Space,null,y(t)?t:{default:()=>[t]})]})});function N(){l.submitter!==!1&&(a.value?.resetFields(),l.submitter?.onReset?.())}async function P(t){if(l.submitter!==!1)try{l.submitter?.onSubmit?.(),n.value=!0;const o=l.onFinish?.(t);if(l.submitTimeout&&o instanceof Promise){const _=setTimeout(()=>n.value=!1,l.submitTimeout);o.finally(()=>{clearTimeout(_),n.value=!1})}await o&&i(!1)}finally{n.value=!1}}function b(){e.unref(n)||i(!1)}function q(t){!t&&e.unref(n)||i(t)}return g({resetFields:async()=>{a.value?.resetFields()},clearValidate:t=>{a.value?.clearValidate(t)},validateFields:(t,o)=>a.value?.validateFields(t,o),getFieldsValue:t=>a.value?.getFieldsValue(t),validate:(t,o)=>a.value?.validate(t,o),scrollToField:(t,o={})=>{a.value?.scrollToField(t,o)},setFieldValue:(t,o)=>{a.value?.setFieldValue?.(t,o)},setFieldsValue:t=>{if(!a.value){u.value=t;return}a.value?.setFieldsValue?.(t)},getInternalInstance:t=>a.value?.getInternalInstance(t),getFieldsValueTransformed(t){return a.value?.getFieldsValueTransformed(t)},validateFieldsReturnTransformed(t,o){return a.value?.validateFieldsReturnTransformed(t,o)}}),(t,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(r.Modal),e.mergeProps(t.modalProps,{open:e.unref(V),footer:null,width:t.width,class:[e.unref(B)(),e.unref(T)],"body-style":{padding:"0px !important"},"onUpdate:open":q,onCancel:b}),{title:e.withCtx(()=>[e.renderSlot(t.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(l.title),1)])]),default:e.withCtx(()=>[e.createVNode(I.default,e.mergeProps({ref_key:"formRef",ref:a},e.unref(w.omit)(l,["modalProps","open","onUpdate:open","title","width","onFinish","submitter"]),{onFinish:P}),{default:e.withCtx(()=>[e.createElementVNode("div",{style:e.normalizeStyle(t.modalProps?.bodyStyle),class:e.normalizeClass(e.unref(f)("content"))},[e.renderSlot(t.$slots,"default")],6),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(k.value)))]),_:3},16)]),_:3},16,["open","width","class"]),e.unref(v)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(v)),{key:0})):e.createCommentVNode("",!0)],64))}});exports.default=O;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=require("@aplus-frontend/antdv");require("../ap-form.vue.js");require("../../hooks/index.js");const q=require("../../utils/slot.js");require("../../config-provider/index.js");const S=require("lodash-unified"),w=require("../style/modal-form.js"),x=require("../../hooks/useControllableValue.js"),M=require("../../config-provider/hooks/use-locale.js"),R=require("../../config-provider/hooks/use-namespace.js"),U=require("../ap-form.vue2.js");function y(s){return typeof s=="function"||Object.prototype.toString.call(s)==="[object Object]"&&!e.isVNode(s)}const j=e.defineComponent({name:"ApFormModalForm",__name:"index",props:{layout:{default:"horizontal"},labelCol:{},wrapperCol:{},colon:{type:Boolean,default:!0},labelAlign:{default:"right"},labelWrap:{type:Boolean},prefixCls:{},requiredMark:{},hideRequiredMark:{type:Boolean,default:!1},rules:{},validateMessages:{},validateOnRuleChange:{type:Boolean,default:!0},scrollToFirstError:{},onSubmit:{},name:{},validateTrigger:{default:"change"},size:{},disabled:{type:Boolean},onFieldsChange:{},onFinishFailed:{},onValidate:{},variant:{},initialValues:{},onValuesChange:{},syncToUrl:{type:[Boolean,Function]},syncToUrlPriority:{type:Boolean},open:{type:Boolean,default:void 0},"onUpdate:open":{},modalProps:{default:()=>({})},title:{},width:{default:800},onFinish:{},submitter:{type:[Boolean,Object],default:()=>({resetButtonProps:!1})},showCancel:{type:Boolean,default:!0},submitTimeout:{}},emits:["update:open"],setup(s,{expose:F,emit:g}){const l=s,d=e.useSlots(),h=g,o=e.ref(),f=e.ref(0),u=e.ref(),r=e.ref(!1),{value:V,updateValue:i}=x.useControllableValue(l,h,{valuePropName:"open",defaultValue:!1,beforeUpdateValue(t){return t&&(f.value+=1),!0}}),{t:c}=M.useLocale(),C=w.default("ap-form-modal-form"),{b:T,e:m}=R.useNamespace("ap-form-modal-form");e.watch(()=>o.value,t=>{t&&u.value&&(t.setFieldsValue?.(u.value),u.value=void 0)});const p=q.getSingleVNode(d.trigger),v=p?e.cloneVNode(p,{onClick:()=>{i(!0)}}):null,B=e.computed(()=>{const t=[];if(l.submitter===!1)return null;if(l.showCancel){let a;t.push(e.createVNode(n.Button,{onClick:b,disabled:r.value},y(a=c("ap.common.cancelText"))?a:{default:()=>[a]}))}return l.submitter?.resetButtonProps!==!1&&t.push(e.createVNode(n.Button,e.mergeProps(l.submitter?.resetButtonProps||{},{key:"reset",disabled:r.value,onClick:k,htmlType:"reset"}),{default:()=>[l.submitter?.resetText||c("ap.common.resetText")]})),l.submitter?.submitButtonProps!==!1&&t.push(e.createVNode(n.Button,e.mergeProps({type:"primary",key:"submit",htmlType:"submit"},l.submitter?.submitButtonProps||{},{loading:r.value}),{default:()=>[l.submitter?.submitText||c("ap.common.okText")]})),e.createVNode(n.Flex,{justify:"flex-end",key:e.unref(f),class:[m("footer")]},{default:()=>[d.submitter?d.submitter(t):e.createVNode(n.Space,null,y(t)?t:{default:()=>[t]})]})});function k(){l.submitter!==!1&&(o.value?.resetFields(),l.submitter?.onReset?.())}async function N(t){if(l.submitter!==!1)try{l.submitter?.onSubmit?.(),r.value=!0;const a=l.onFinish?.(t);if(l.submitTimeout&&a instanceof Promise){const _=setTimeout(()=>r.value=!1,l.submitTimeout);a.finally(()=>{clearTimeout(_),r.value=!1})}await a&&i(!1)}finally{r.value=!1}}function b(){e.unref(r)||i(!1)}function P(t){!t&&e.unref(r)||i(t)}return F({resetFields:async()=>{o.value?.resetFields()},clearValidate:t=>{o.value?.clearValidate(t)},validateFields:(t,a)=>o.value?.validateFields(t,a),getFieldsValue:t=>o.value?.getFieldsValue(t),validate:(t,a)=>o.value?.validate(t,a),scrollToField:(t,a={})=>{o.value?.scrollToField(t,a)},setFieldValue:(t,a)=>{o.value?.setFieldValue?.(t,a)},setFieldsValue:t=>{if(!o.value){u.value=t;return}o.value?.setFieldsValue?.(t)},getInternalInstance:t=>o.value?.getInternalInstance(t),getFieldsValueTransformed(t){return o.value?.getFieldsValueTransformed(t)},validateFieldsReturnTransformed(t,a){return o.value?.validateFieldsReturnTransformed(t,a)}}),(t,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(n.Modal),e.mergeProps(t.modalProps,{open:e.unref(V),footer:null,width:t.width,class:[e.unref(T)(),e.unref(C)],"body-style":{padding:"0px !important"},"onUpdate:open":P,onCancel:b}),{title:e.withCtx(()=>[e.renderSlot(t.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(l.title),1)])]),default:e.withCtx(()=>[e.createVNode(U.default,e.mergeProps({ref_key:"formRef",ref:o},e.unref(S.omit)(l,["modalProps","open","onUpdate:open","title","width","onFinish","submitter"]),{onFinish:N}),{default:e.withCtx(()=>[e.createElementVNode("div",{style:e.normalizeStyle(t.modalProps?.bodyStyle),class:e.normalizeClass(e.unref(m)("content"))},[e.renderSlot(t.$slots,"default")],6),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(B.value)))]),_:3},16)]),_:3},16,["open","width","class"]),e.unref(v)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(v)),{key:0})):e.createCommentVNode("",!0)],64))}});exports.default=j;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("../../utils/cssinjs/index.js"),e=o=>{const{componentCls:d,apFormModalCloseSize:a}=o;return{[d]:{".ant-modal-content":{padding:0},".ant-modal-header":{paddingInline:o.apFormModalHeaderPaddingInline,paddingBlock:o.apFormModalHeaderPaddingBlock,borderBottom:"1px solid #E9EDF3",marginBottom:0},[`${d}__content`]:{padding:o.apFormModalContentPadding},[`${d}__footer`]:{padding:o.apFormModalFooterPadding},[`${d}__footer-admin`]:{borderTop:"1px solid #E9EDF3"},".ant-modal-close":{top:`calc(${o.apFormModalHeaderPaddingBlock} - (${a} - 22px) / 2)`,width:a,height:a}}}},l=n.genComponentStyleHook("ApForm.Modal",o=>[e(o)],{apFormModalHeaderPaddingInline:20,apFormModalHeaderPaddingBlock:15,apFormModalContentPadding:"20px 20px 0px",apFormModalFooterPadding:"12px 20px",apFormModalCloseSize:32});exports.default=l;exports.genModalFormStyle=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("../../utils/cssinjs/index.js"),e=o=>{const{componentCls:d,apFormModalCloseSize:a}=o;return{[d]:{".ant-modal-content":{padding:0},".ant-modal-header":{paddingInline:o.apFormModalHeaderPaddingInline,paddingBlock:o.apFormModalHeaderPaddingBlock,borderBottom:"1px solid #E9EDF3",marginBottom:0},[`${d}__content`]:{padding:o.apFormModalContentPadding},[`${d}__footer`]:{padding:o.apFormModalFooterPadding,borderTop:o.apFormModalFooterBorderTop},".ant-modal-close":{top:o.calc(o.apFormModalHeaderPaddingBlock).sub(o.calc(a).sub("22px").div(2)).equal(),width:a,height:a}}}},l=r.genComponentStyleHook("ApForm.Modal",o=>[e(o)],{apFormModalHeaderPaddingInline:20,apFormModalHeaderPaddingBlock:15,apFormModalContentPadding:"20px 20px 0px",apFormModalFooterPadding:"12px 20px",apFormModalCloseSize:32,apFormModalFooterBorderTop:"unset"});exports.default=l;exports.genModalFormStyle=e;