@aplus-frontend/ui 0.1.10 → 0.1.12

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 (39) hide show
  1. package/es/index.mjs +77 -75
  2. package/es/src/ap-download/ap-download.vue.d.ts +2 -2
  3. package/es/src/ap-download/ap-download.vue.mjs +30 -33
  4. package/es/src/ap-download/hooks/useStyle.d.ts +6 -0
  5. package/es/src/ap-download/hooks/useStyle.mjs +22 -0
  6. package/es/src/ap-download/index.mjs +4 -1
  7. package/es/src/ap-download/interface.d.ts +29 -6
  8. package/es/src/ap-download/interface.mjs +4 -1
  9. package/es/src/ap-download/utils/getFileInfo.d.ts +9 -0
  10. package/es/src/ap-download/utils/getFileInfo.mjs +44 -0
  11. package/es/src/ap-upload/apUploadTypes.d.ts +1 -1
  12. package/es/src/business/ap-export-group/ApExportGroup.vue.d.ts +2 -2
  13. package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +61 -63
  14. package/es/src/business/ap-export-group/interface.d.ts +9 -3
  15. package/es/src/business/ap-export-group/interface.mjs +2 -2
  16. package/es/src/business/ap-select-layout/index.css +1 -1
  17. package/es/src/business/index.d.ts +25 -0
  18. package/es/src/index.mjs +72 -70
  19. package/es/src/theme/ap-select-layout/ap-select-layout.css +1 -1
  20. package/lib/index.js +1 -1
  21. package/lib/src/ap-download/ap-download.vue.d.ts +2 -2
  22. package/lib/src/ap-download/ap-download.vue.js +1 -1
  23. package/lib/src/ap-download/hooks/useStyle.d.ts +6 -0
  24. package/lib/src/ap-download/hooks/useStyle.js +1 -0
  25. package/lib/src/ap-download/index.js +1 -1
  26. package/lib/src/ap-download/interface.d.ts +29 -6
  27. package/lib/src/ap-download/interface.js +1 -1
  28. package/lib/src/ap-download/utils/getFileInfo.d.ts +9 -0
  29. package/lib/src/ap-download/utils/getFileInfo.js +1 -0
  30. package/lib/src/ap-upload/apUploadTypes.d.ts +1 -1
  31. package/lib/src/business/ap-export-group/ApExportGroup.vue.d.ts +2 -2
  32. package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
  33. package/lib/src/business/ap-export-group/interface.d.ts +9 -3
  34. package/lib/src/business/ap-export-group/interface.js +1 -1
  35. package/lib/src/business/ap-select-layout/index.css +1 -1
  36. package/lib/src/business/index.d.ts +25 -0
  37. package/lib/src/index.js +1 -1
  38. package/lib/src/theme/ap-select-layout/ap-select-layout.css +1 -1
  39. package/package.json +4 -4
package/es/index.mjs CHANGED
@@ -5,11 +5,11 @@ import { configProviderProps as x } from "./src/config-provider/config-provider-
5
5
  import { configProviderContextKey as u, tableDefaultConfig as n } from "./src/config-provider/constants.mjs";
6
6
  import { keysOf as c, provideGlobalConfig as F, useGlobalConfig as T } from "./src/config-provider/hooks/use-global-config.mjs";
7
7
  import { buildLocaleContext as S, buildTranslator as b, localeContextKey as I, translate as g, useLocale as P } from "./src/config-provider/hooks/use-locale.mjs";
8
- import { defaultNamespace as D, namespaceContextKey as R, useGetDerivedNamespace as v, useNamespace as G } from "./src/config-provider/hooks/use-namespace.mjs";
9
- import { ConfigProvider as B, globalConfigCached as k } from "./src/config-provider/config-provider.mjs";
8
+ import { defaultNamespace as h, namespaceContextKey as R, useGetDerivedNamespace as v, useNamespace as G } from "./src/config-provider/hooks/use-namespace.mjs";
9
+ import { ConfigProvider as w, globalConfigCached as B } from "./src/config-provider/config-provider.mjs";
10
10
  import { APConfigProvider as L } from "./src/config-provider/index.mjs";
11
- import { Scrollbar as E } from "./src/scroll-bar/index.mjs";
12
- import { CollapseContainer as X, ScrollContainer as K } from "./src/container/index.mjs";
11
+ import { Scrollbar as y } from "./src/scroll-bar/index.mjs";
12
+ import { CollapseContainer as K, ScrollContainer as X } from "./src/container/index.mjs";
13
13
  import { IconPicker as O } from "./src/icon-picker/index.mjs";
14
14
  import { default as W } from "./src/locale/lang/zh-cn.mjs";
15
15
  import { default as U } from "./src/locale/lang/en.mjs";
@@ -21,14 +21,14 @@ import { Description as co } from "./src/description/index.mjs";
21
21
  import { useComponentRegister as To } from "./src/pro-form/hooks/use-component-register.mjs";
22
22
  import { useForm as So } from "./src/pro-form/hooks/use-form.mjs";
23
23
  import { isComponentFormSchema as Io, isSlotFormSchema as go } from "./src/pro-form/types/form.mjs";
24
- import { Field as ho } from "./src/pro-form/index.mjs";
24
+ import { Field as Do } from "./src/pro-form/index.mjs";
25
25
  import { default as Ro } from "./src/pro-form/components/api-cascader.vue.mjs";
26
26
  import { default as Go } from "./src/pro-form/components/api-radio-group.vue.mjs";
27
- import { default as Bo } from "./src/pro-form/components/api-select.vue.mjs";
28
- import { default as wo } from "./src/pro-form/components/api-transfer.vue.mjs";
29
- import { default as yo } from "./src/pro-form/components/api-tree.vue.mjs";
30
- import { default as No } from "./src/pro-form/components/radio-button-group.vue.mjs";
31
- import { default as Ko } from "./src/pro-form/pro-form.vue.mjs";
27
+ import { default as wo } from "./src/pro-form/components/api-select.vue.mjs";
28
+ import { default as ko } from "./src/pro-form/components/api-transfer.vue.mjs";
29
+ import { default as No } from "./src/pro-form/components/api-tree.vue.mjs";
30
+ import { default as Eo } from "./src/pro-form/components/radio-button-group.vue.mjs";
31
+ import { default as Xo } from "./src/pro-form/pro-form.vue.mjs";
32
32
  import { default as Oo } from "./src/pro-form/components/api-tree-select.vue.mjs";
33
33
  import { default as Wo } from "./src/pro-form/table-form.vue.mjs";
34
34
  import { default as Uo } from "./src/pro-form/table-form-inner.vue.mjs";
@@ -47,13 +47,13 @@ import { default as Te } from "./src/pro-table/pro-table.vue.mjs";
47
47
  import { default as Se } from "./src/pro-table/components/table-action.vue.mjs";
48
48
  import { default as Ie } from "./src/pro-table/components/edit-table-header-icon.vue.mjs";
49
49
  import { default as Pe } from "./src/pro-table/components/table-image.vue.mjs";
50
- import { useTable as De } from "./src/pro-table/hooks/use-table.mjs";
50
+ import { useTable as he } from "./src/pro-table/hooks/use-table.mjs";
51
51
  import { ApFormItemText as ve } from "./src/ap-form/items/text/index.mjs";
52
52
  import { default as Me } from "./src/ap-form/items/text-area/index.vue.mjs";
53
- import { default as ke } from "./src/ap-form/items/number/index.vue.mjs";
53
+ import { default as Be } from "./src/ap-form/items/number/index.vue.mjs";
54
54
  import { default as Le } from "./src/ap-form/items/date/index.vue.mjs";
55
- import { default as Ee } from "./src/ap-form/items/date-range/index.vue.mjs";
56
- import { default as Xe } from "./src/ap-form/items/radio/index.vue.mjs";
55
+ import { default as ye } from "./src/ap-form/items/date-range/index.vue.mjs";
56
+ import { default as Ke } from "./src/ap-form/items/radio/index.vue.mjs";
57
57
  import { default as Ye } from "./src/ap-form/items/select/index.vue.mjs";
58
58
  import { default as He } from "./src/ap-form/items/switch/index.vue.mjs";
59
59
  import { default as ze } from "./src/ap-form/items/checkbox/index.vue.mjs";
@@ -74,13 +74,13 @@ import { default as Tr } from "./src/ap-field/switch/index.vue.mjs";
74
74
  import { default as Sr } from "./src/ap-field/text-area/index.vue.mjs";
75
75
  import { default as Ir } from "./src/ap-field/date-range/index.vue.mjs";
76
76
  import { default as Pr } from "./src/ap-field/select/index.vue.mjs";
77
- import { default as Dr } from "./src/ap-field/text/password.vue.mjs";
77
+ import { default as hr } from "./src/ap-field/text/password.vue.mjs";
78
78
  import { default as vr } from "./src/ap-field/slider/index.vue.mjs";
79
79
  import { default as Mr } from "./src/ap-field/segmented/index.vue.mjs";
80
- import { default as kr } from "./src/ap-field/rate/index.vue.mjs";
81
- import { adminToken as Lr, aplusToken as yr } from "./src/design-token/index.mjs";
82
- import { ApActionItem as Nr } from "./src/ap-action/index.mjs";
83
- import { default as Kr } from "./src/ap-action/item-modal/index.vue.mjs";
80
+ import { default as Br } from "./src/ap-field/rate/index.vue.mjs";
81
+ import { adminToken as Lr, aplusToken as Nr } from "./src/design-token/index.mjs";
82
+ import { ApActionItem as Er } from "./src/ap-action/index.mjs";
83
+ import { default as Xr } from "./src/ap-action/item-modal/index.vue.mjs";
84
84
  import { default as Or } from "./src/ap-action/item-popconfirm/index.vue.mjs";
85
85
  import { default as Wr } from "./src/ap-action/item-dropdown/index.vue.mjs";
86
86
  import { default as Ur } from "./src/ap-action/group/index.vue.mjs";
@@ -96,19 +96,20 @@ import { default as st } from "./src/ap-tag/ap-tag-group.vue.mjs";
96
96
  import { default as xt } from "./src/ap-layout/ap-info-layout/ap-info-layout.vue.mjs";
97
97
  import { NeedNameKeyDefault as ut } from "./src/ap-upload/apUploadTypes.mjs";
98
98
  import { default as At } from "./src/ap-upload/apUpload.vue.mjs";
99
- import { default as Ft } from "./src/ap-download/ap-download.vue.mjs";
100
- import { CheckCard as Ct } from "./src/check-card/index.mjs";
101
- import { default as bt } from "./src/check-card/group.vue.mjs";
102
- import { ApModal as gt } from "./src/ap-modal/index.mjs";
103
- import { default as ht } from "./src/ap-list/index.vue.mjs";
104
- import { ApBatchAction as Rt, ApExpandAlert as vt, ApExportGroup as Gt, ApInputRadio as Mt, ApLabel as Bt, ApLabelGroup as kt, ApSelectLayout as wt, ApStatus as Lt, ApStatusGroup as yt, ApTitle as Et } from "./src/business/index.mjs";
105
- import { useTablePaging as Xt } from "./src/ap-table/hooks/use-table-paging.mjs";
106
- import { default as Yt } from "./src/ap-table/ap-table.vue.mjs";
107
- import { default as Ht } from "./src/editable-table/index.vue.mjs";
108
- import { default as zt } from "./src/editable-table/form-item.vue.mjs";
109
- import { default as Vt } from "./src/ap-descriptions/ap-descriptions.vue.mjs";
110
- import { useMessage as jt } from "./src/hooks/useMessage.mjs";
111
- import { useControllableValue as Jt } from "./src/hooks/useControllableValue.mjs";
99
+ import { ApDownLoadNeedNameKeyDefault as Ft } from "./src/ap-download/interface.mjs";
100
+ import { default as Ct } from "./src/ap-download/ap-download.vue.mjs";
101
+ import { CheckCard as bt } from "./src/check-card/index.mjs";
102
+ import { default as gt } from "./src/check-card/group.vue.mjs";
103
+ import { ApModal as Dt } from "./src/ap-modal/index.mjs";
104
+ import { default as Rt } from "./src/ap-list/index.vue.mjs";
105
+ import { ApBatchAction as Gt, ApExpandAlert as Mt, ApExportGroup as wt, ApInputRadio as Bt, ApLabel as kt, ApLabelGroup as Lt, ApSelectLayout as Nt, ApStatus as yt, ApStatusGroup as Et, ApTitle as Kt } from "./src/business/index.mjs";
106
+ import { useTablePaging as Yt } from "./src/ap-table/hooks/use-table-paging.mjs";
107
+ import { default as Ht } from "./src/ap-table/ap-table.vue.mjs";
108
+ import { default as zt } from "./src/editable-table/index.vue.mjs";
109
+ import { default as Vt } from "./src/editable-table/form-item.vue.mjs";
110
+ import { default as jt } from "./src/ap-descriptions/ap-descriptions.vue.mjs";
111
+ import { useMessage as Jt } from "./src/hooks/useMessage.mjs";
112
+ import { useControllableValue as Zt } from "./src/hooks/useControllableValue.mjs";
112
113
  const p = {
113
114
  install: (r) => {
114
115
  for (const t in e) {
@@ -120,25 +121,26 @@ const p = {
120
121
  export {
121
122
  L as APConfigProvider,
122
123
  Ur as ApActionGroup,
123
- Nr as ApActionItem,
124
+ Er as ApActionItem,
124
125
  Wr as ApActionItemDropdown,
125
- Kr as ApActionItemModal,
126
+ Xr as ApActionItemModal,
126
127
  Or as ApActionItemPopconfirm,
127
- Rt as ApBatchAction,
128
+ Gt as ApBatchAction,
128
129
  Qr as ApCustomColumn,
129
130
  _r as ApCustomSelect,
130
- Vt as ApDescriptions,
131
- Ft as ApDownload,
132
- vt as ApExpandAlert,
133
- Gt as ApExportGroup,
131
+ jt as ApDescriptions,
132
+ Ft as ApDownLoadNeedNameKeyDefault,
133
+ Ct as ApDownload,
134
+ Mt as ApExpandAlert,
135
+ wt as ApExportGroup,
134
136
  fr as ApField,
135
137
  dr as ApFieldCheckbox,
136
138
  ir as ApFieldDate,
137
139
  Ir as ApFieldDateRange,
138
140
  nr as ApFieldNumber,
139
- Dr as ApFieldPassword,
141
+ hr as ApFieldPassword,
140
142
  cr as ApFieldRadio,
141
- kr as ApFieldRate,
143
+ Br as ApFieldRate,
142
144
  Mr as ApFieldSegmented,
143
145
  Pr as ApFieldSelect,
144
146
  vr as ApFieldSlider,
@@ -149,10 +151,10 @@ export {
149
151
  Je as ApFormItem,
150
152
  ze as ApFormItemCheckbox,
151
153
  Le as ApFormItemDate,
152
- Ee as ApFormItemDateRange,
154
+ ye as ApFormItemDateRange,
153
155
  Ze as ApFormItemGroup,
154
- ke as ApFormItemNumber,
155
- Xe as ApFormItemRadio,
156
+ Be as ApFormItemNumber,
157
+ Ke as ApFormItemRadio,
156
158
  Ye as ApFormItemSelect,
157
159
  He as ApFormItemSwitch,
158
160
  ve as ApFormItemText,
@@ -162,35 +164,35 @@ export {
162
164
  ar as ApFormModalForm,
163
165
  rr as ApFormSearchForm,
164
166
  xt as ApInfoLayout,
165
- Mt as ApInputRadio,
166
- Bt as ApLabel,
167
- kt as ApLabelGroup,
168
- ht as ApList,
169
- gt as ApModal,
170
- wt as ApSelectLayout,
171
- Lt as ApStatus,
172
- yt as ApStatusGroup,
173
- Yt as ApTable,
167
+ Bt as ApInputRadio,
168
+ kt as ApLabel,
169
+ Lt as ApLabelGroup,
170
+ Rt as ApList,
171
+ Dt as ApModal,
172
+ Nt as ApSelectLayout,
173
+ yt as ApStatus,
174
+ Et as ApStatusGroup,
175
+ Ht as ApTable,
174
176
  mt as ApTag,
175
177
  st as ApTagGroup,
176
- Et as ApTitle,
178
+ Kt as ApTitle,
177
179
  At as ApUpload,
178
180
  Ro as ApiCascader,
179
181
  Go as ApiRadioGroup,
180
- Bo as ApiSelect,
181
- wo as ApiTransfer,
182
- yo as ApiTree,
182
+ wo as ApiSelect,
183
+ ko as ApiTransfer,
184
+ No as ApiTree,
183
185
  Oo as ApiTreeSelect,
184
186
  Qo as BaseButton,
185
187
  fe as BaseModal,
186
188
  $ as BasicArrow,
187
189
  j as BasicHelp,
188
190
  q as BasicTitle,
189
- Ct as CheckCard,
190
- bt as CheckCardGroup,
191
- X as CollapseContainer,
191
+ bt as CheckCard,
192
+ gt as CheckCardGroup,
193
+ K as CollapseContainer,
192
194
  Q as CollapseTransition,
193
- B as ConfigProvider,
195
+ w as ConfigProvider,
194
196
  xe as CountdownButton,
195
197
  ie as CountdownInput,
196
198
  le as CropperAvatar,
@@ -199,30 +201,30 @@ export {
199
201
  et as DictCode,
200
202
  ce as Dropdown,
201
203
  Ie as EditTableHeaderIcon,
202
- Ht as EditableTable,
203
- zt as EditableTableFormItem,
204
+ zt as EditableTable,
205
+ Vt as EditableTableFormItem,
204
206
  _ as ExpandTransition,
205
207
  oo as ExpandXTransition,
206
208
  eo as FadeTransition,
207
- ho as Field,
209
+ Do as Field,
208
210
  l as Icon,
209
211
  O as IconPicker,
210
212
  $o as ModalButton,
211
213
  ut as NeedNameKeyDefault,
212
214
  qo as PopConfirmButton,
213
- Ko as ProForm,
215
+ Xo as ProForm,
214
216
  Te as ProTable,
215
217
  Wo as ProTableForm,
216
218
  Uo as ProTableFormInner,
217
- No as RadioButtonGroup,
219
+ Eo as RadioButtonGroup,
218
220
  ro as ScaleRotateTransition,
219
221
  to as ScaleTransition,
220
- K as ScrollContainer,
222
+ X as ScrollContainer,
221
223
  ao as ScrollXReverseTransition,
222
224
  po as ScrollXTransition,
223
225
  fo as ScrollYReverseTransition,
224
226
  mo as ScrollYTransition,
225
- E as Scrollbar,
227
+ y as Scrollbar,
226
228
  lo as SlideXReverseTransition,
227
229
  so as SlideXTransition,
228
230
  xo as SlideYReverseTransition,
@@ -233,7 +235,7 @@ export {
233
235
  Pe as TableImg,
234
236
  pt as WorkOrderModal,
235
237
  Lr as adminToken,
236
- yr as aplusToken,
238
+ Nr as aplusToken,
237
239
  S as buildLocaleContext,
238
240
  b as buildTranslator,
239
241
  u as configProviderContextKey,
@@ -241,10 +243,10 @@ export {
241
243
  ne as createPrompt,
242
244
  tt as createWorkOrderModal,
243
245
  p as default,
244
- D as defaultNamespace,
246
+ h as defaultNamespace,
245
247
  U as en,
246
248
  $r as generateTableList,
247
- k as globalConfigCached,
249
+ B as globalConfigCached,
248
250
  Io as isComponentFormSchema,
249
251
  go as isSlotFormSchema,
250
252
  c as keysOf,
@@ -255,18 +257,18 @@ export {
255
257
  g as translate,
256
258
  qr as useCacheColumnSetting,
257
259
  To as useComponentRegister,
258
- Jt as useControllableValue,
260
+ Zt as useControllableValue,
259
261
  no as useDescription,
260
262
  So as useForm,
261
263
  v as useGetDerivedNamespace,
262
264
  T as useGlobalConfig,
263
265
  P as useLocale,
264
- jt as useMessage,
266
+ Jt as useMessage,
265
267
  te as useModal,
266
268
  ee as useModalContext,
267
269
  ae as useModalInner,
268
270
  G as useNamespace,
269
- De as useTable,
270
- Xt as useTablePaging,
271
+ he as useTable,
272
+ Yt as useTablePaging,
271
273
  W as zhCn
272
274
  };
@@ -3,11 +3,11 @@ import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes,
3
3
  declare function __VLS_template(): {
4
4
  icon?(_: {}): any;
5
5
  };
6
- declare const __VLS_component: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<ApDownLoadProps>, {
6
+ declare const __VLS_component: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<ApDownLoadProps<Record<string, string>>>, {
7
7
  size: string;
8
8
  color: string;
9
9
  disabled: boolean;
10
- }>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<ApDownLoadProps>, {
10
+ }>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<ApDownLoadProps<Record<string, string>>>, {
11
11
  size: string;
12
12
  color: string;
13
13
  disabled: boolean;
@@ -1,11 +1,12 @@
1
- import { defineComponent as y, computed as n, unref as z, openBlock as v, createElementBlock as I, normalizeStyle as N, normalizeClass as i, createElementVNode as s, renderSlot as B, toDisplayString as O } from "vue";
1
+ import { defineComponent as g, computed as a, unref as s, openBlock as _, createElementBlock as C, normalizeStyle as y, normalizeClass as n, createElementVNode as t, renderSlot as w, toDisplayString as z } from "vue";
2
2
  import "../config-provider/index.mjs";
3
- import { useOssInit as k } from "./hooks/index.mjs";
3
+ import { useOssInit as N } from "./hooks/index.mjs";
4
4
  import "./style/ap-download.css";
5
- import { useLocale as A } from "../config-provider/hooks/use-locale.mjs";
6
- import { useGlobalConfig as F } from "../config-provider/hooks/use-global-config.mjs";
7
- import { useNamespace as M } from "../config-provider/hooks/use-namespace.mjs";
8
- const W = { class: "icon" }, D = { class: "text" }, j = /* @__PURE__ */ y({
5
+ import { getFileInfo as O } from "./utils/getFileInfo.mjs";
6
+ import { useStyle as S } from "./hooks/useStyle.mjs";
7
+ import { useLocale as b } from "../config-provider/hooks/use-locale.mjs";
8
+ import { useGlobalConfig as h } from "../config-provider/hooks/use-global-config.mjs";
9
+ const A = { class: "icon" }, B = { class: "text" }, W = /* @__PURE__ */ g({
9
10
  name: "ApDownload",
10
11
  __name: "ap-download",
11
12
  props: {
@@ -14,43 +15,39 @@ const W = { class: "icon" }, D = { class: "text" }, j = /* @__PURE__ */ y({
14
15
  size: { default: "middle" },
15
16
  disabled: { type: Boolean, default: !1 },
16
17
  fileName: {},
18
+ needName: { type: [Boolean, Object] },
17
19
  getOssAccess: {}
18
20
  },
19
21
  setup(l) {
20
- const { lang: p } = A(), c = n(() => p.value === "zh-cn" ? "zh_CN" : "en_US"), t = l, d = F("uiMode"), { b: r, bm: a } = M("ap-download");
21
- function u(e, o) {
22
- e.length === 4 && (e = `#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`);
23
- const S = parseInt(e.slice(1, 3), 16), $ = parseInt(e.slice(3, 5), 16), _ = parseInt(e.slice(5, 7), 16), b = Math.round(o * 255).toString(16).padStart(2, "0");
24
- return `#${S.toString(16).padStart(2, "0")}${$.toString(16).padStart(2, "0")}${_.toString(16).padStart(2, "0")}${b}`;
25
- }
26
- const m = n(() => ({
27
- "--download-main-color": t.color,
28
- "--download-main-color-opacity": u(t.color, 0.6)
29
- })), f = n(() => [r("wrapper"), a("wrapper", t.size)].filter(Boolean)), g = n(() => {
30
- const e = [r("inner-wrapper"), a("inner-wrapper", t.size)];
31
- return t.disabled && (d.value === "aplus" ? e.push(a("inner-wrapper", "disabled")) : e.push(a("inner-wrapper", "disabled-admin"))), e;
32
- }), w = async () => {
33
- t.disabled || await (await k(
34
- t.getOssAccess,
35
- z(c)
36
- )).downloadFile(t.fileName);
22
+ const { lang: r } = b(), c = a(() => r.value === "zh-cn" ? "zh_CN" : "en_US"), e = l, i = h("apUpload"), { wrapperStyle: p, getWrapperClass: d, getInnerWrapperClass: m } = S(
23
+ e.color,
24
+ e.size,
25
+ e.disabled
26
+ ), f = a(() => {
27
+ var o;
28
+ return e.getOssAccess || ((o = i.value) == null ? void 0 : o.getOssAccess);
29
+ }), u = async () => {
30
+ e.disabled || await (await N(
31
+ f.value,
32
+ s(c)
33
+ )).downloadFile(O(e.needName, e.fileName));
37
34
  };
38
- return (e, o) => (v(), I("span", {
39
- style: N(m.value),
40
- class: i(f.value),
41
- onClick: w
35
+ return (o, F) => (_(), C("span", {
36
+ style: y(s(p)),
37
+ class: n(s(d)),
38
+ onClick: u
42
39
  }, [
43
- s("span", {
44
- class: i(g.value)
40
+ t("span", {
41
+ class: n(s(m))
45
42
  }, [
46
- s("span", W, [
47
- B(e.$slots, "icon")
43
+ t("span", A, [
44
+ w(o.$slots, "icon")
48
45
  ]),
49
- s("span", D, O(e.text), 1)
46
+ t("span", B, z(o.text), 1)
50
47
  ], 2)
51
48
  ], 6));
52
49
  }
53
50
  });
54
51
  export {
55
- j as default
52
+ W as default
56
53
  };
@@ -0,0 +1,6 @@
1
+ import { ComputedRef } from 'vue';
2
+ export declare function useStyle(color: string, size: string, disabled: boolean): {
3
+ wrapperStyle: ComputedRef<Record<string, any>>;
4
+ getWrapperClass: ComputedRef<string[]>;
5
+ getInnerWrapperClass: ComputedRef<string[]>;
6
+ };
@@ -0,0 +1,22 @@
1
+ import { computed as o } from "vue";
2
+ import { getHexWithOpacity as u } from "../utils/getFileInfo.mjs";
3
+ import "../../config-provider/index.mjs";
4
+ import { useNamespace as d } from "../../config-provider/hooks/use-namespace.mjs";
5
+ import { useGlobalConfig as c } from "../../config-provider/hooks/use-global-config.mjs";
6
+ function h(p, n, t) {
7
+ const { b: a, bm: r } = d("ap-download"), i = c("uiMode"), s = o(() => ({
8
+ "--download-main-color": p,
9
+ "--download-main-color-opacity": u(p, 0.6)
10
+ })), l = o(() => [a("wrapper"), r("wrapper", n)].filter(Boolean)), m = o(() => {
11
+ const e = [a("inner-wrapper"), r("inner-wrapper", n)];
12
+ return t && (i.value === "aplus" ? e.push(r("inner-wrapper", "disabled")) : e.push(r("inner-wrapper", "disabled-admin"))), e;
13
+ });
14
+ return {
15
+ wrapperStyle: s,
16
+ getWrapperClass: l,
17
+ getInnerWrapperClass: m
18
+ };
19
+ }
20
+ export {
21
+ h as useStyle
22
+ };
@@ -1,2 +1,5 @@
1
1
  import "./ap-download.vue2.mjs";
2
- import "./interface.mjs";
2
+ import { ApDownLoadNeedNameKeyDefault as m } from "./interface.mjs";
3
+ export {
4
+ m as ApDownLoadNeedNameKeyDefault
5
+ };
@@ -1,5 +1,9 @@
1
1
  import { accessCreate } from '@aplus-frontend/oss';
2
- export interface ApDownLoadProps {
2
+ /**
3
+ * 类型转换为单例和数组
4
+ */
5
+ type TypeToSingleAndArray<Type = any> = Type extends any ? Type | Type[] : never;
6
+ export interface ApDownLoadProps<FileNameType extends Record<string, string> = Record<string, string>> {
3
7
  /**
4
8
  * 标签内容
5
9
  */
@@ -17,9 +21,28 @@ export interface ApDownLoadProps {
17
21
  * @default false
18
22
  */
19
23
  disabled?: boolean;
20
- fileName: Array<string> | string | Array<{
21
- path: string;
22
- fileName: string;
23
- }>;
24
- getOssAccess: () => Promise<accessCreate>;
24
+ fileName: TypeToSingleAndArray<string | FileNameType>;
25
+ /**
26
+ * 是否需要fileName别名
27
+ * 默认false
28
+ * 可以传配置项nameKey,pathKey
29
+ * 默认为name,path
30
+ */
31
+ needName?: ApDownLoadNeedNameModel;
32
+ getOssAccess?: () => Promise<accessCreate>;
33
+ }
34
+ /**
35
+ * 别名配置项
36
+ */
37
+ export type ApDownLoadNeedNameModel = boolean | {
38
+ nameKey?: string;
39
+ pathKey?: string;
40
+ };
41
+ /**
42
+ * 别名默认值
43
+ */
44
+ export declare enum ApDownLoadNeedNameKeyDefault {
45
+ nameKey = "name",
46
+ pathKey = "path"
25
47
  }
48
+ export {};
@@ -1 +1,4 @@
1
-
1
+ var t = /* @__PURE__ */ ((r) => (r.nameKey = "name", r.pathKey = "path", r))(t || {});
2
+ export {
3
+ t as ApDownLoadNeedNameKeyDefault
4
+ };
@@ -0,0 +1,9 @@
1
+ import { ApDownLoadNeedNameModel } from '../interface';
2
+ /**
3
+ * 根据needName将fileName转换为OSS下载格式
4
+ */
5
+ export declare function getFileInfo(needName?: ApDownLoadNeedNameModel, fileName?: any): any;
6
+ /**
7
+ * 根据hexColor颜色和opacity透明度计算rgba颜色数值,返回
8
+ */
9
+ export declare function getHexWithOpacity(hexColor: string, opacity: number): string;
@@ -0,0 +1,44 @@
1
+ import { ApDownLoadNeedNameKeyDefault as y } from "../interface.mjs";
2
+ function K(t, r) {
3
+ if (t === !0) {
4
+ if (typeof r == "string")
5
+ return r;
6
+ if (Array.isArray(r))
7
+ return r.map((p) => ({
8
+ path: p == null ? void 0 : p[y.pathKey],
9
+ fileName: p == null ? void 0 : p[y.nameKey]
10
+ }));
11
+ if (typeof r == "object")
12
+ return [
13
+ {
14
+ path: r == null ? void 0 : r[y.pathKey],
15
+ fileName: r == null ? void 0 : r[y.nameKey]
16
+ }
17
+ ];
18
+ } else if (typeof t == "object") {
19
+ if (typeof r == "string")
20
+ return r;
21
+ if (Array.isArray(r))
22
+ return r.map((p) => ({
23
+ path: p == null ? void 0 : p[(t == null ? void 0 : t.pathKey) || y.pathKey],
24
+ fileName: p == null ? void 0 : p[(t == null ? void 0 : t.nameKey) || y.nameKey]
25
+ }));
26
+ if (typeof r == "object")
27
+ return [
28
+ {
29
+ path: r == null ? void 0 : r[(t == null ? void 0 : t.pathKey) || y.pathKey],
30
+ fileName: r == null ? void 0 : r[(t == null ? void 0 : t.nameKey) || y.nameKey]
31
+ }
32
+ ];
33
+ } else
34
+ return r;
35
+ }
36
+ function g(t, r) {
37
+ t.length === 4 && (t = `#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`);
38
+ const p = parseInt(t.slice(1, 3), 16), s = parseInt(t.slice(3, 5), 16), n = parseInt(t.slice(5, 7), 16), u = Math.round(r * 255).toString(16).padStart(2, "0");
39
+ return `#${p.toString(16).padStart(2, "0")}${s.toString(16).padStart(2, "0")}${n.toString(16).padStart(2, "0")}${u}`;
40
+ }
41
+ export {
42
+ K as getFileInfo,
43
+ g as getHexWithOpacity
44
+ };
@@ -3,7 +3,7 @@ export type FileUploadType = 'picture' | 'singleFile' | 'multipleFile';
3
3
  /**
4
4
  * 是否需要返回图片名称
5
5
  */
6
- export type NeedNameModel = boolean & {
6
+ export type NeedNameModel = boolean | {
7
7
  nameKey?: string;
8
8
  pathKey?: string;
9
9
  };
@@ -1,6 +1,6 @@
1
- import { Props } from './interface';
1
+ import { ApExportGroupProps } from './interface';
2
2
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
3
- declare const _default: DefineComponent<__VLS_TypePropsToOption<Props>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_TypePropsToOption<Props>>>, {}, {}>;
3
+ declare const _default: DefineComponent<__VLS_TypePropsToOption<ApExportGroupProps>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_TypePropsToOption<ApExportGroupProps>>>, {}, {}>;
4
4
  export default _default;
5
5
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
6
6
  type __VLS_TypePropsToOption<T> = {