@aplus-frontend/ui 7.0.0 → 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 (156) hide show
  1. package/es/index.mjs +108 -106
  2. package/es/src/ag-grid/style/custom-header.mjs +1 -1
  3. package/es/src/ag-grid/style/index.mjs +0 -1
  4. package/es/src/ap-action/item-dropdown/index.vue.mjs +12 -12
  5. package/es/src/ap-descriptions/ap-descriptions.vue.mjs +39 -39
  6. package/es/src/ap-descriptions/style/index.mjs +16 -43
  7. package/es/src/ap-download/ap-download.vue.mjs +43 -43
  8. package/es/src/ap-download/hooks/useStyle.d.ts +1 -1
  9. package/es/src/ap-download/hooks/useStyle.mjs +17 -14
  10. package/es/src/ap-download/style/index.mjs +6 -13
  11. package/es/src/ap-form/modal-form/index.vue.mjs +59 -60
  12. package/es/src/ap-form/style/item.mjs +5 -4
  13. package/es/src/ap-form/style/modal-form.mjs +11 -12
  14. package/es/src/ap-form/style/search-form-sorter.mjs +31 -27
  15. package/es/src/ap-form/style/token.d.ts +8 -0
  16. package/es/src/ap-grid/style/index.mjs +3 -3
  17. package/es/src/ap-pro-card/style/statistic.mjs +3 -3
  18. package/es/src/ap-pro-card/style/token.mjs +1 -1
  19. package/es/src/ap-table/style/index.mjs +2 -2
  20. package/es/src/ap-table/style/setting.mjs +2 -2
  21. package/es/src/ap-tag/ap-tag-group.vue.mjs +61 -61
  22. package/es/src/ap-tag/ap-tag.vue.mjs +19 -20
  23. package/es/src/ap-tag/style/group.mjs +2 -8
  24. package/es/src/ap-tag/style/index.mjs +14 -23
  25. package/es/src/ap-upload/apUpload.vue.mjs +42 -41
  26. package/es/src/ap-upload/components/MultipleFile.vue2.mjs +60 -61
  27. package/es/src/ap-upload/components/Picture.vue2.mjs +90 -91
  28. package/es/src/ap-upload/components/SingleFile.vue2.mjs +72 -72
  29. package/es/src/ap-upload/style/multiple-file.mjs +13 -40
  30. package/es/src/ap-upload/style/picture.mjs +12 -30
  31. package/es/src/ap-upload/style/single-file.mjs +5 -16
  32. package/es/src/business/ag-grid-modal/interface.d.ts +1 -1
  33. package/es/src/business/ag-grid-modal/wrapper/index.vue.d.ts +6 -2
  34. package/es/src/business/ag-grid-modal/wrapper/index.vue2.mjs +29 -12
  35. package/es/src/business/ap-appendix/style/index.mjs +1 -1
  36. package/es/src/business/ap-attachment/ApAttachment.mjs +42 -39
  37. package/es/src/business/ap-copy/style/index.mjs +1 -1
  38. package/es/src/business/ap-expand-alert/ApExpandAlert.vue2.mjs +45 -46
  39. package/es/src/business/ap-ladder/ApLadder.mjs +20 -22
  40. package/es/src/business/ap-ladder/style/index.mjs +11 -39
  41. package/es/src/business/ap-product-info/ApProductInfo.mjs +21 -22
  42. package/es/src/business/ap-product-info/style/index.mjs +8 -24
  43. package/es/src/business/ap-radio-group/style/index.mjs +1 -1
  44. package/es/src/business/ap-size-input/ApSizeInput.d.ts +20 -4
  45. package/es/src/business/ap-size-input/ApSizeInput.mjs +37 -40
  46. package/es/src/business/ap-size-input/constans.d.ts +10 -2
  47. package/es/src/business/ap-size-input/constans.mjs +9 -1
  48. package/es/src/business/ap-size-input/form-item.vue.d.ts +13 -0
  49. package/es/src/business/ap-size-input/form-item.vue.mjs +65 -0
  50. package/es/src/business/ap-size-input/form-item.vue2.mjs +4 -0
  51. package/es/src/business/ap-size-input/index.d.ts +33 -8
  52. package/es/src/business/ap-size-input/index.mjs +3 -2
  53. package/es/src/business/ap-size-input/interface.d.ts +7 -0
  54. package/es/src/business/ap-size-input/style/index.mjs +2 -1
  55. package/es/src/business/ap-table-modal/hooks/use-table-modal.mjs +18 -19
  56. package/es/src/business/ap-table-modal/modal-title.vue2.mjs +13 -13
  57. package/es/src/business/ap-title/style/index.mjs +1 -1
  58. package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.mjs +38 -37
  59. package/es/src/business/ap-value-select-card/index.vue2.mjs +36 -37
  60. package/es/src/business/ap-value-select-card/style/index.mjs +7 -29
  61. package/es/src/business/ap-view/components/menu-list-content.vue2.mjs +61 -64
  62. package/es/src/business/ap-view/style/index.mjs +1 -1
  63. package/es/src/business/batch-input-group/style/index.mjs +1 -1
  64. package/es/src/check-card/style/index.mjs +46 -51
  65. package/es/src/config-provider/hooks/use-token.d.ts +2 -2
  66. package/es/src/design-token/constants.mjs +4 -2
  67. package/es/src/design-token/interface.d.ts +39 -19
  68. package/es/src/index.mjs +95 -93
  69. package/es/src/scroll-bar/style/index.mjs +12 -12
  70. package/es/src/splitter/style/index.mjs +6 -6
  71. package/es/src/style/index.mjs +1 -1
  72. package/es/src/text/style/index.mjs +1 -1
  73. package/es/src/utils/cssinjs/TokenUtil.d.ts +11 -0
  74. package/es/src/utils/cssinjs/TokenUtil.mjs +26 -0
  75. package/es/src/utils/cssinjs/index.d.ts +1 -1
  76. package/es/src/utils/cssinjs/index.mjs +51 -50
  77. package/es/src/version.d.ts +1 -1
  78. package/es/src/version.mjs +1 -1
  79. package/lib/index.js +1 -1
  80. package/lib/src/ag-grid/style/custom-header.js +1 -1
  81. package/lib/src/ap-action/item-dropdown/index.vue.js +1 -1
  82. package/lib/src/ap-descriptions/ap-descriptions.vue.js +1 -1
  83. package/lib/src/ap-descriptions/style/index.js +1 -1
  84. package/lib/src/ap-download/ap-download.vue.js +1 -1
  85. package/lib/src/ap-download/hooks/useStyle.d.ts +1 -1
  86. package/lib/src/ap-download/hooks/useStyle.js +1 -1
  87. package/lib/src/ap-download/style/index.js +1 -1
  88. package/lib/src/ap-form/modal-form/index.vue.js +1 -1
  89. package/lib/src/ap-form/style/item.js +1 -1
  90. package/lib/src/ap-form/style/modal-form.js +1 -1
  91. package/lib/src/ap-form/style/search-form-sorter.js +1 -1
  92. package/lib/src/ap-form/style/token.d.ts +8 -0
  93. package/lib/src/ap-grid/style/index.js +1 -1
  94. package/lib/src/ap-pro-card/style/statistic.js +1 -1
  95. package/lib/src/ap-pro-card/style/token.js +1 -1
  96. package/lib/src/ap-table/style/index.js +1 -1
  97. package/lib/src/ap-table/style/setting.js +1 -1
  98. package/lib/src/ap-tag/ap-tag-group.vue.js +1 -1
  99. package/lib/src/ap-tag/ap-tag.vue.js +1 -1
  100. package/lib/src/ap-tag/style/group.js +1 -1
  101. package/lib/src/ap-tag/style/index.js +1 -1
  102. package/lib/src/ap-upload/apUpload.vue.js +1 -1
  103. package/lib/src/ap-upload/components/MultipleFile.vue2.js +1 -1
  104. package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
  105. package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
  106. package/lib/src/ap-upload/style/multiple-file.js +1 -1
  107. package/lib/src/ap-upload/style/picture.js +1 -1
  108. package/lib/src/ap-upload/style/single-file.js +1 -1
  109. package/lib/src/business/ag-grid-modal/interface.d.ts +1 -1
  110. package/lib/src/business/ag-grid-modal/wrapper/index.vue.d.ts +6 -2
  111. package/lib/src/business/ag-grid-modal/wrapper/index.vue2.js +1 -1
  112. package/lib/src/business/ap-appendix/style/index.js +1 -1
  113. package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
  114. package/lib/src/business/ap-copy/style/index.js +1 -1
  115. package/lib/src/business/ap-expand-alert/ApExpandAlert.vue2.js +1 -1
  116. package/lib/src/business/ap-ladder/ApLadder.js +1 -1
  117. package/lib/src/business/ap-ladder/style/index.js +1 -1
  118. package/lib/src/business/ap-product-info/ApProductInfo.js +1 -1
  119. package/lib/src/business/ap-product-info/style/index.js +1 -1
  120. package/lib/src/business/ap-radio-group/style/index.js +1 -1
  121. package/lib/src/business/ap-size-input/ApSizeInput.d.ts +20 -4
  122. package/lib/src/business/ap-size-input/ApSizeInput.js +1 -1
  123. package/lib/src/business/ap-size-input/constans.d.ts +10 -2
  124. package/lib/src/business/ap-size-input/constans.js +1 -1
  125. package/lib/src/business/ap-size-input/form-item.vue.d.ts +13 -0
  126. package/lib/src/business/ap-size-input/form-item.vue.js +1 -0
  127. package/lib/src/business/ap-size-input/form-item.vue2.js +1 -0
  128. package/lib/src/business/ap-size-input/index.d.ts +33 -8
  129. package/lib/src/business/ap-size-input/index.js +1 -1
  130. package/lib/src/business/ap-size-input/interface.d.ts +7 -0
  131. package/lib/src/business/ap-size-input/style/index.js +1 -1
  132. package/lib/src/business/ap-table-modal/hooks/use-table-modal.js +1 -1
  133. package/lib/src/business/ap-table-modal/modal-title.vue2.js +1 -1
  134. package/lib/src/business/ap-title/style/index.js +1 -1
  135. package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.js +1 -1
  136. package/lib/src/business/ap-value-select-card/index.vue2.js +1 -1
  137. package/lib/src/business/ap-value-select-card/style/index.js +1 -1
  138. package/lib/src/business/ap-view/components/menu-list-content.vue2.js +1 -1
  139. package/lib/src/business/ap-view/style/index.js +1 -1
  140. package/lib/src/business/batch-input-group/style/index.js +1 -1
  141. package/lib/src/check-card/style/index.js +1 -1
  142. package/lib/src/config-provider/hooks/use-token.d.ts +2 -2
  143. package/lib/src/design-token/constants.js +1 -1
  144. package/lib/src/design-token/interface.d.ts +39 -19
  145. package/lib/src/index.js +1 -1
  146. package/lib/src/scroll-bar/style/index.js +1 -1
  147. package/lib/src/splitter/style/index.js +1 -1
  148. package/lib/src/style/index.js +1 -1
  149. package/lib/src/text/style/index.js +1 -1
  150. package/lib/src/utils/cssinjs/TokenUtil.d.ts +11 -0
  151. package/lib/src/utils/cssinjs/TokenUtil.js +1 -0
  152. package/lib/src/utils/cssinjs/index.d.ts +1 -1
  153. package/lib/src/utils/cssinjs/index.js +1 -1
  154. package/lib/src/version.d.ts +1 -1
  155. package/lib/src/version.js +1 -1
  156. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
- const a = (t) => {
2
- const { componentCls: l } = t, o = `${l}-multiple-file`;
1
+ const a = (l) => {
2
+ const { componentCls: o } = l;
3
3
  return {
4
- [o]: {
4
+ [`${o}-multiple-file`]: {
5
5
  ".multiple-file-context": {
6
6
  display: "flex",
7
7
  alignItems: "center",
@@ -10,22 +10,22 @@ const a = (t) => {
10
10
  alignItems: "center",
11
11
  padding: "7px 12px",
12
12
  transition: "all 0.3s",
13
- border: "1px solid #dee4ed",
13
+ border: `1px solid ${l.borderColorBase}`,
14
14
  borderRadius: "4px",
15
- color: "#182948",
15
+ color: l.textColor1,
16
16
  "&:hover": {
17
- borderColor: "#0070ff",
18
- color: "#0070ff"
17
+ borderColor: l.colorPrimary,
18
+ color: l.colorPrimary
19
19
  }
20
20
  },
21
21
  ".sub-title": {
22
22
  paddingLeft: "16px",
23
- color: "#8896b0",
24
- fontSize: t.fontSize
23
+ color: l.textColor3,
24
+ fontSize: l.fontSize
25
25
  }
26
26
  },
27
27
  ".ant-upload-wrapper .ant-upload-list .ant-upload-list-item:hover": {
28
- backgroundColor: "rgb(245 249 250)",
28
+ backgroundColor: l.colorBgLayout,
29
29
  ".ant-upload-list-item-actions .ant-upload-list-item-action:focus": {
30
30
  opacity: 1
31
31
  }
@@ -39,7 +39,7 @@ const a = (t) => {
39
39
  opacity: 0
40
40
  },
41
41
  ".ant-upload-text-icon": {
42
- color: "#abb7cc"
42
+ color: l.textColor4
43
43
  },
44
44
  ".ant-upload-wrapper .ant-upload-list .ant-upload-list-item-error": {
45
45
  ".ant-upload-list-item-name": {
@@ -53,37 +53,10 @@ const a = (t) => {
53
53
  }
54
54
  },
55
55
  ".ant-upload-list-item-done": {
56
- color: "#0070ff"
56
+ color: l.colorLink
57
57
  },
58
58
  ".ant-upload-list-item-undefined": {
59
- color: "#0070ff"
60
- }
61
- },
62
- [`${o}-admin`]: {
63
- ".multiple-file-context": {
64
- ".file-btn": {
65
- border: "1px solid #d9d9d9",
66
- color: "#333333",
67
- "&:hover": {
68
- borderColor: "#34b77c",
69
- color: "#34b77c"
70
- }
71
- },
72
- ".sub-title": {
73
- color: "#999"
74
- }
75
- },
76
- ".ant-upload-wrapper .ant-upload-list .ant-upload-list-item:hover": {
77
- background: "#fafafa"
78
- },
79
- ".ant-upload-text-icon": {
80
- color: "#bfbfbf"
81
- },
82
- ".ant-upload-list-item-done": {
83
- color: "#1890ff"
84
- },
85
- ".ant-upload-list-item-undefined": {
86
- color: "#1890ff"
59
+ color: l.colorLink
87
60
  }
88
61
  }
89
62
  };
@@ -1,7 +1,7 @@
1
- const i = (e) => {
2
- const { componentCls: o } = e, t = `${o}-picture`;
1
+ const r = (t) => {
2
+ const { componentCls: e } = t;
3
3
  return {
4
- [t]: {
4
+ [`${e}-picture`]: {
5
5
  ".picture-context": {
6
6
  display: "grid",
7
7
  gap: "16px",
@@ -15,23 +15,23 @@ const i = (e) => {
15
15
  width: "100px",
16
16
  overflow: "hidden",
17
17
  transition: "all 0.2s",
18
- border: "1px dashed #dee4ed",
18
+ border: `1px dashed ${t.borderColorBase}`,
19
19
  borderRadius: "4px",
20
- background: "#f2f6f9",
21
- color: "#abb7cc",
20
+ background: t.colorBgLayout,
21
+ color: t.textColor4,
22
22
  fontSize: "16px",
23
23
  cursor: "pointer",
24
24
  aspectRatio: "1 / 1",
25
- "& > * + *": { marginTop: "4px", fontSize: e.fontSize },
25
+ "& > * + *": { marginTop: "4px", fontSize: t.fontSize },
26
26
  "&:hover": {
27
- border: "1px dashed #0070ff"
27
+ border: `1px dashed ${t.colorPrimary}`
28
28
  }
29
29
  },
30
30
  ".picture-item": {
31
31
  width: "100px",
32
32
  padding: "8px",
33
33
  overflow: "hidden",
34
- border: "1px solid #dee4ed",
34
+ border: `1px solid ${t.borderColorBase}`,
35
35
  borderRadius: "4px",
36
36
  background: "#fff",
37
37
  aspectRatio: "1 / 1",
@@ -58,7 +58,7 @@ const i = (e) => {
58
58
  borderRadius: "2px",
59
59
  background: "rgb(0 0 0 / 50%)",
60
60
  color: "#fff",
61
- fontSize: e.fontSize,
61
+ fontSize: t.fontSize,
62
62
  ".picture-item-close": {
63
63
  display: "flex",
64
64
  position: "absolute",
@@ -91,30 +91,12 @@ const i = (e) => {
91
91
  },
92
92
  ".picture-title": {
93
93
  marginTop: "8px",
94
- color: "#8896b0",
94
+ color: t.textColor3,
95
95
  fontSize: "12px"
96
96
  }
97
- },
98
- [`${t}-admin`]: {
99
- ".picture-context": {
100
- ".picture-upload": {
101
- border: "1px dashed #d9d9d9",
102
- background: "#fafafa",
103
- color: "#bfbfbf",
104
- "&:hover": {
105
- border: "1px dashed #34b77c"
106
- }
107
- },
108
- ".picture-item": {
109
- border: "1px solid #d9d9d9"
110
- }
111
- },
112
- ".picture-title": {
113
- color: "#999"
114
- }
115
97
  }
116
98
  };
117
99
  };
118
100
  export {
119
- i as pictureStyle
101
+ r as pictureStyle
120
102
  };
@@ -1,4 +1,4 @@
1
- const n = (e) => {
1
+ const r = (e) => {
2
2
  const { componentCls: i } = e, t = `${i}-single-file`;
3
3
  return {
4
4
  [t]: {
@@ -9,7 +9,7 @@ const n = (e) => {
9
9
  height: "200px",
10
10
  overflow: "hidden",
11
11
  transition: "all 0.3s",
12
- border: "1px dashed #dee4ed",
12
+ border: `1px dashed ${e.borderColorBase}`,
13
13
  borderRadius: "4px",
14
14
  background: "#f2f6f9",
15
15
  userSelect: "none",
@@ -26,13 +26,13 @@ const n = (e) => {
26
26
  },
27
27
  ".state-un-title": {
28
28
  marginTop: "10px",
29
- color: "#182948",
29
+ color: e.textColor1,
30
30
  fontSize: e.fontSizeLG,
31
31
  lineHeight: e.lineHeightLG
32
32
  },
33
33
  ".state-un-subtitle": {
34
34
  marginTop: "4px",
35
- color: "#abb7cc",
35
+ color: e.textColor4,
36
36
  fontSize: "12px",
37
37
  lineHeight: "18px"
38
38
  }
@@ -89,20 +89,9 @@ const n = (e) => {
89
89
  border: "1px dashed #0070ff",
90
90
  background: "rgb(0 112 255 / 10%)"
91
91
  }
92
- },
93
- [`${t}-admin`]: {
94
- border: "1px dashed #D9D9D9",
95
- ".state-un": {
96
- ".state-un-title": {
97
- color: "#333"
98
- },
99
- ".state-un-subtitle": {
100
- color: "#BFBFBF"
101
- }
102
- }
103
92
  }
104
93
  };
105
94
  };
106
95
  export {
107
- n as singleFileStyle
96
+ r as singleFileStyle
108
97
  };
@@ -77,7 +77,7 @@ export interface AgGridSelectModalProps<RowType = any> extends AgGridModalBasicP
77
77
  /** 设置是否是复杂布局 */
78
78
  modalLayout?: ModalLayoutConfig<RowType>;
79
79
  /** ag-grid 额外配置 */
80
- gridProps?: Omit<AgGridProps<RowType>, 'rowHeight' | 'rowSelection' | 'rowKey'>;
80
+ gridProps?: Omit<AgGridProps<RowType>, 'rowSelection' | 'rowKey'>;
81
81
  }
82
82
  export interface SelectModalReturnType<T = any> {
83
83
  /** 打开弹框 */
@@ -7,13 +7,17 @@ declare function __VLS_template(): {
7
7
  slots: {
8
8
  default?(_: {}): any;
9
9
  };
10
- refs: {};
10
+ refs: {
11
+ wrapperContainer: HTMLDivElement;
12
+ };
11
13
  rootEl: HTMLDivElement;
12
14
  };
13
15
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
14
16
  declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
15
17
  rowHeight: number;
16
- }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
18
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {
19
+ wrapperContainer: HTMLDivElement;
20
+ }, HTMLDivElement>;
17
21
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
18
22
  export default _default;
19
23
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -1,25 +1,42 @@
1
- import { defineComponent as c, computed as t, createElementBlock as u, openBlock as s, normalizeStyle as d, unref as m, renderSlot as p } from "vue";
2
- import { LARGER_HEIGHT as f, SMALL_HEIGHT as o } from "../constants.mjs";
3
- import { useAgGridModalInject as h } from "../hooks/use-ag-grid-instance.mjs";
4
- const v = /* @__PURE__ */ c({
1
+ import { defineComponent as p, useTemplateRef as f, computed as g, ref as h, watch as d, onMounted as m, createElementBlock as H, openBlock as v, normalizeStyle as _, unref as y, renderSlot as w } from "vue";
2
+ import { SMALL_HEIGHT as l, LARGER_HEIGHT as S } from "../constants.mjs";
3
+ import { useAgGridModalInject as L } from "../hooks/use-ag-grid-instance.mjs";
4
+ const G = /* @__PURE__ */ p({
5
5
  __name: "index",
6
6
  props: {
7
- rowHeight: { default: 40 }
7
+ rowHeight: { default: 32 }
8
8
  },
9
- setup(r) {
10
- const n = r, i = h(), l = t(() => i?.dataSourceLength?.value || 0), a = t(() => l.value * n.rowHeight > 400 ? f : o);
11
- return (e, g) => (s(), u("div", {
12
- style: d({
13
- minHeight: m(o),
9
+ setup(c) {
10
+ const s = c, t = f("wrapperContainer"), u = L(), r = g(
11
+ () => u?.dataSourceLength?.value || 0
12
+ ), a = h(l), i = () => {
13
+ const e = t.value?.clientHeight, o = t.value?.querySelector(
14
+ ".ag-body.ag-layout-normal"
15
+ )?.clientHeight;
16
+ let n = 0;
17
+ !e || !o ? n = 0 : n = e - o, r.value * s.rowHeight > 480 - n && (a.value = S);
18
+ };
19
+ return d(
20
+ () => r.value,
21
+ () => {
22
+ i();
23
+ }
24
+ ), m(() => {
25
+ i();
26
+ }), (e, o) => (v(), H("div", {
27
+ ref_key: "wrapperContainer",
28
+ ref: t,
29
+ style: _({
30
+ minHeight: y(l),
14
31
  height: a.value,
15
32
  display: "flex",
16
33
  flexDirection: "column"
17
34
  })
18
35
  }, [
19
- p(e.$slots, "default")
36
+ w(e.$slots, "default")
20
37
  ], 4));
21
38
  }
22
39
  });
23
40
  export {
24
- v as default
41
+ G as default
25
42
  };
@@ -51,7 +51,7 @@ const r = (o) => {
51
51
  ".ant-typography": {
52
52
  fontSize: o.fontSize,
53
53
  lineHeight: o.lineHeight,
54
- color: o.textColor2,
54
+ color: o.textColor1,
55
55
  transition: "color 0.2s"
56
56
  }
57
57
  },
@@ -1,71 +1,74 @@
1
- import { defineComponent as W, ref as x, useSlots as _, computed as n, cloneVNode as j, toRaw as h, unref as K, createVNode as t, createTextVNode as R } from "vue";
1
+ import { defineComponent as W, ref as k, useSlots as _, computed as o, cloneVNode as j, toRaw as h, unref as K, createVNode as t, createTextVNode as R } from "vue";
2
2
  import { Tooltip as B, Popover as G } from "@aplus-frontend/antdv";
3
3
  import "../../config-provider/index.mjs";
4
4
  import { ApAttachmentProps as H } from "./constans.mjs";
5
- import { getHexWithOpacity as q, getFileInfo as O } from "../../ap-download/utils/getFileInfo.mjs";
6
- import { useOssInit as D } from "../../ap-download/hooks/index.mjs";
7
- import { debounce as E, isArray as J } from "lodash-unified";
5
+ import { getHexWithOpacity as M, getFileInfo as F } from "../../ap-download/utils/getFileInfo.mjs";
6
+ import { useOssInit as q } from "../../ap-download/hooks/index.mjs";
7
+ import { debounce as D, isArray as E } from "lodash-unified";
8
8
  import { LoadingOutlined as g } from "@ant-design/icons-vue";
9
- import { warning as Q } from "../../utils/warning.mjs";
10
- import X from "./style/index.mjs";
9
+ import { warning as J } from "../../utils/warning.mjs";
10
+ import Q from "./style/index.mjs";
11
+ import { useToken as X } from "../../config-provider/hooks/use-token.mjs";
11
12
  import { useNamespace as Y } from "../../config-provider/hooks/use-namespace.mjs";
12
- import { useGlobalConfig as p } from "../../config-provider/hooks/use-global-config.mjs";
13
+ import { useGlobalConfig as T } from "../../config-provider/hooks/use-global-config.mjs";
13
14
  import { useLocale as Z } from "../../config-provider/hooks/use-locale.mjs";
14
- const de = /* @__PURE__ */ W({
15
+ const fe = /* @__PURE__ */ W({
15
16
  name: "ApAttachment",
16
17
  props: H(),
17
18
  setup(e, {
18
- emit: C
19
+ emit: p
19
20
  }) {
20
21
  const {
21
- b: T,
22
+ b: x,
22
23
  e: a
23
- } = Y("ap-attachment"), L = X("ap-attachment"), k = p("uiMode"), N = p("apUpload"), w = p("downloadCenterTriggerConfig"), {
24
- lang: P,
24
+ } = Y("ap-attachment"), L = Q("ap-attachment"), C = T("apUpload"), N = T("downloadCenterTriggerConfig"), {
25
+ token: w
26
+ } = X(), {
27
+ lang: O,
25
28
  t: m
26
- } = Z(), i = x(!1), c = x(""), d = _(), I = n(() => P.value === "zh-cn" ? "zh_CN" : "en_US"), s = n(() => e.needName ?? N?.value?.needName), f = n(() => e.attachmentList.length === 1), y = n(() => s.value ? e.attachmentList.length > 0 && s.value && s.value?.nameKey ? e.attachmentList[0][s.value.nameKey] : "" : e.attachmentList.length > 0 ? e.attachmentList[0].fileName : ""), S = n(() => f.value ? y.value : m("ap.apAttachment.downloadall")), A = n(() => e.color ? e.color : k.value === "aplus" ? "#0070FF" : "#1890FF"), F = n(() => ({
27
- "--download-main-color": A.value,
28
- "--download-main-color-opacity": q(A.value, 0.6)
29
- })), V = n(() => e.getOssAccess || N.value?.getOssAccess), z = n(() => {
29
+ } = Z(), i = k(!1), c = k(""), d = _(), P = o(() => O.value === "zh-cn" ? "zh_CN" : "en_US"), s = o(() => e.needName ?? C?.value?.needName), f = o(() => e.attachmentList.length === 1), y = o(() => s.value ? e.attachmentList.length > 0 && s.value && s.value?.nameKey ? e.attachmentList[0][s.value.nameKey] : "" : e.attachmentList.length > 0 ? e.attachmentList[0].fileName : ""), I = o(() => f.value ? y.value : m("ap.apAttachment.downloadall")), A = o(() => ({
30
+ "--download-main-color": w.value?.colorLink,
31
+ "--download-main-color-opacity": M(w.value?.colorLink, 0.6)
32
+ })), S = o(() => e.getOssAccess || C.value?.getOssAccess), V = o(() => {
30
33
  const l = d.default ? d.default()[0] : null;
31
34
  return l ? j(l, {
32
35
  style: {
33
36
  "font-size": "16px"
34
37
  }
35
38
  }) : null;
36
- }), v = E(async (l, u) => {
39
+ }), v = D(async (l, r) => {
37
40
  if (!e.disabled) {
38
- i.value = !0, u && (c.value = u);
41
+ i.value = !0, r && (c.value = r);
39
42
  try {
40
- const o = J(h(l)) ? h(l) : [h(l)];
41
- if (w.value?.trigger) {
42
- const r = O(s.value, o).map((b) => ({
43
+ const n = E(h(l)) ? h(l) : [h(l)];
44
+ if (N.value?.trigger) {
45
+ const u = F(s.value, n).map((b) => ({
43
46
  objectName: b.path,
44
47
  fileName: b.fileName
45
48
  }));
46
- w.value?.trigger(r), C("downloadCallback", r);
49
+ N.value?.trigger(u), p("downloadCallback", u);
47
50
  } else {
48
- const r = await (await D(V.value, K(I))).downloadFile(O(e.needName, o));
49
- C("downloadCallback", r);
51
+ const u = await (await q(S.value, K(P))).downloadFile(F(e.needName, n));
52
+ p("downloadCallback", u);
50
53
  }
51
- } catch (o) {
52
- Q(!1, o);
54
+ } catch (n) {
55
+ J(!1, n);
53
56
  } finally {
54
57
  i.value = !1, c.value = "";
55
58
  }
56
59
  }
57
- }, 500), M = (l) => l && l.length > 0 ? t("ul", {
60
+ }, 500), z = (l) => l && l.length > 0 ? t("ul", {
58
61
  class: [a("file-list"), L.value],
59
- style: F.value
60
- }, [l.map((u, o) => t("li", {
61
- key: o,
62
+ style: A.value
63
+ }, [l.map((r, n) => t("li", {
64
+ key: n,
62
65
  class: [a("file-item")],
63
- onClick: () => v(u, o + 1)
64
- }, [i.value && c.value === o + 1 ? t("span", {
66
+ onClick: () => v(r, n + 1)
67
+ }, [i.value && c.value === n + 1 ? t("span", {
65
68
  class: [a("spin")]
66
69
  }, [t(g, {
67
70
  spin: !0
68
- }, null)]) : null, u.fileName])), t("li", {
71
+ }, null)]) : null, r.fileName])), t("li", {
69
72
  class: [a("download-all")],
70
73
  onClick: () => v(e.attachmentList, "all")
71
74
  }, [i.value && c.value === "all" ? t("span", {
@@ -74,10 +77,10 @@ const de = /* @__PURE__ */ W({
74
77
  spin: !0
75
78
  }, null)]) : null, m("ap.apAttachment.downloadall")])]) : null;
76
79
  return () => e.attachmentList?.length > 0 && t("div", {
77
- class: [T(), L.value],
78
- style: [F.value]
80
+ class: [x(), L.value],
81
+ style: [A.value]
79
82
  }, [t(B, {
80
- title: S.value,
83
+ title: I.value,
81
84
  placement: e.textToolTipPlacement,
82
85
  color: e.toolTipBgColor
83
86
  }, {
@@ -90,14 +93,14 @@ const de = /* @__PURE__ */ W({
90
93
  spin: !0
91
94
  }, null)]) : null, d.default ? t("div", {
92
95
  class: [a("text-render")]
93
- }, [z.value, R(" ")]) : null, t("div", {
96
+ }, [V.value, R(" ")]) : null, t("div", {
94
97
  class: [a("text-inner")],
95
98
  style: {
96
99
  "max-width": e.maxWidth ? e.maxWidth + "px" : "auto"
97
100
  }
98
101
  }, [y.value])])]
99
102
  }), t(G, {
100
- content: M(e.attachmentList),
103
+ content: z(e.attachmentList),
101
104
  placement: e.fileMorePopoverPlacement,
102
105
  color: "#fff"
103
106
  }, {
@@ -108,5 +111,5 @@ const de = /* @__PURE__ */ W({
108
111
  }
109
112
  });
110
113
  export {
111
- de as default
114
+ fe as default
112
115
  };
@@ -23,7 +23,7 @@ const r = (o) => {
23
23
  lineHeight: "18px"
24
24
  },
25
25
  [`${t}--text-major`]: {
26
- color: o.textColor2
26
+ color: o.textColor1
27
27
  },
28
28
  [`${t}--text-minor`]: {
29
29
  color: o.textColor3