@aplus-frontend/ui 0.2.10 → 0.2.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 (145) hide show
  1. package/es/index.mjs +41 -39
  2. package/es/src/ap-form/ap-form.vue.d.ts +4 -0
  3. package/es/src/ap-form/ap-form.vue2.mjs +131 -108
  4. package/es/src/ap-form/drawer-form/index.vue.d.ts +27 -2
  5. package/es/src/ap-form/drawer-form/index.vue.mjs +43 -37
  6. package/es/src/ap-form/interface.d.ts +8 -0
  7. package/es/src/ap-form/modal-form/index.vue.d.ts +27 -2
  8. package/es/src/ap-form/modal-form/index.vue.mjs +26 -20
  9. package/es/src/ap-form/search-form/index.vue.d.ts +27 -2
  10. package/es/src/ap-form/search-form/index.vue.mjs +37 -31
  11. package/es/src/ap-form/utils/params.d.ts +17 -0
  12. package/es/src/ap-form/utils/params.mjs +19 -0
  13. package/es/src/ap-list/index.vue.d.ts +1 -0
  14. package/es/src/ap-list/index.vue.mjs +85 -79
  15. package/es/src/ap-list/interface.d.ts +7 -0
  16. package/es/src/ap-table/hooks/use-table-column-state.mjs +84 -75
  17. package/es/src/ap-table/interface.d.ts +1 -0
  18. package/es/src/business/ap-group-search/ap-group-search.vue.d.ts +3 -1
  19. package/es/src/business/ap-group-search/ap-group-search.vue2.mjs +80 -70
  20. package/es/src/business/ap-group-search/extension-select/index.vue.d.ts +6 -2
  21. package/es/src/business/ap-group-search/extension-select/index.vue2.mjs +44 -34
  22. package/es/src/business/ap-group-search/extension-select/style/css.d.ts +0 -0
  23. package/es/src/business/ap-group-search/extension-select/style/css.js +1 -0
  24. package/es/src/business/ap-group-search/extension-select/style/index.d.ts +0 -0
  25. package/es/src/business/ap-group-search/extension-select/style/index.js +1 -0
  26. package/es/src/business/ap-group-search/images/icon-line-select.vue.mjs +9 -9
  27. package/es/src/business/ap-group-search/index.d.ts +28 -0
  28. package/es/src/business/ap-group-search/popover-select/index.vue.d.ts +6 -2
  29. package/es/src/business/ap-group-search/popover-select/index.vue2.mjs +50 -50
  30. package/es/src/business/ap-group-search/popover-select/style/css.js +1 -1
  31. package/es/src/business/ap-group-search/popover-select/style/index.js +1 -1
  32. package/es/src/business/ap-image/ApImage.vue2.mjs +16 -14
  33. package/es/src/business/ap-summary/ap-summary.vue2.mjs +58 -38
  34. package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.d.ts +50 -0
  35. package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.mjs +227 -0
  36. package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue2.mjs +4 -0
  37. package/es/src/business/ap-upload-file/ap-upload-single/style/css.d.ts +0 -0
  38. package/es/src/business/ap-upload-file/ap-upload-single/style/css.js +1 -0
  39. package/es/src/business/ap-upload-file/ap-upload-single/style/index.d.ts +0 -0
  40. package/es/src/business/ap-upload-file/ap-upload-single/style/index.js +1 -0
  41. package/es/src/business/ap-upload-file/hook/useInjectContext.d.ts +4 -0
  42. package/es/src/business/ap-upload-file/hook/useInjectContext.mjs +9 -0
  43. package/es/src/business/ap-upload-file/hook/useOss.d.ts +8 -0
  44. package/es/src/business/ap-upload-file/hook/useOss.mjs +30 -0
  45. package/es/src/business/ap-upload-file/hook/useProps.d.ts +12 -0
  46. package/es/src/business/ap-upload-file/hook/useProps.mjs +28 -0
  47. package/es/src/business/ap-upload-file/icon/delete-icon.vue.d.ts +3 -0
  48. package/es/src/business/ap-upload-file/icon/delete-icon.vue.mjs +27 -0
  49. package/es/src/business/ap-upload-file/icon/file-icon.vue.d.ts +3 -0
  50. package/es/src/business/ap-upload-file/icon/file-icon.vue.mjs +18 -0
  51. package/es/src/business/ap-upload-file/index.d.ts +3 -0
  52. package/es/src/business/ap-upload-file/index.mjs +2 -0
  53. package/es/src/business/ap-upload-file/interface.d.ts +29 -0
  54. package/es/src/business/ap-upload-file/interface.mjs +1 -0
  55. package/es/src/business/ap-upload-file/utils/accept.d.ts +16 -0
  56. package/es/src/business/ap-upload-file/utils/accept.mjs +55 -0
  57. package/es/src/business/ap-upload-file/utils/fileList.d.ts +5 -0
  58. package/es/src/business/ap-upload-file/utils/fileList.mjs +16 -0
  59. package/es/src/business/ap-upload-file/utils/upload.d.ts +10 -0
  60. package/es/src/business/ap-upload-file/utils/upload.mjs +62 -0
  61. package/es/src/business/index.d.ts +1 -0
  62. package/es/src/business/index.mjs +43 -42
  63. package/es/src/config-provider/config-provider.d.ts +8 -0
  64. package/es/src/config-provider/css-var.d.ts +8 -0
  65. package/es/src/config-provider/css-var.mjs +25 -9
  66. package/es/src/config-provider/index.d.ts +48 -0
  67. package/es/src/index.mjs +33 -31
  68. package/es/src/locale/lang/en.mjs +1 -1
  69. package/es/src/locale/lang/zh-cn.mjs +1 -1
  70. package/es/src/path-map.mjs +3 -1
  71. package/es/src/utils/index.d.ts +12 -0
  72. package/es/src/utils/index.mjs +27 -18
  73. package/lib/index.js +1 -1
  74. package/lib/src/ap-form/ap-form.vue.d.ts +4 -0
  75. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  76. package/lib/src/ap-form/drawer-form/index.vue.d.ts +27 -2
  77. package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
  78. package/lib/src/ap-form/interface.d.ts +8 -0
  79. package/lib/src/ap-form/modal-form/index.vue.d.ts +27 -2
  80. package/lib/src/ap-form/modal-form/index.vue.js +1 -1
  81. package/lib/src/ap-form/search-form/index.vue.d.ts +27 -2
  82. package/lib/src/ap-form/search-form/index.vue.js +1 -1
  83. package/lib/src/ap-form/utils/params.d.ts +17 -0
  84. package/lib/src/ap-form/utils/params.js +1 -0
  85. package/lib/src/ap-list/index.vue.d.ts +1 -0
  86. package/lib/src/ap-list/index.vue.js +1 -1
  87. package/lib/src/ap-list/interface.d.ts +7 -0
  88. package/lib/src/ap-table/hooks/use-table-column-state.js +1 -1
  89. package/lib/src/ap-table/interface.d.ts +1 -0
  90. package/lib/src/business/ap-group-search/ap-group-search.vue.d.ts +3 -1
  91. package/lib/src/business/ap-group-search/ap-group-search.vue2.js +1 -1
  92. package/lib/src/business/ap-group-search/extension-select/index.vue.d.ts +6 -2
  93. package/lib/src/business/ap-group-search/extension-select/index.vue2.js +1 -1
  94. package/lib/src/business/ap-group-search/extension-select/style/css.d.ts +0 -0
  95. package/lib/src/business/ap-group-search/extension-select/style/css.js +1 -0
  96. package/lib/src/business/ap-group-search/extension-select/style/index.d.ts +0 -0
  97. package/lib/src/business/ap-group-search/extension-select/style/index.js +1 -0
  98. package/lib/src/business/ap-group-search/images/icon-line-select.vue.js +1 -1
  99. package/lib/src/business/ap-group-search/index.d.ts +28 -0
  100. package/lib/src/business/ap-group-search/popover-select/index.vue.d.ts +6 -2
  101. package/lib/src/business/ap-group-search/popover-select/index.vue2.js +2 -2
  102. package/lib/src/business/ap-group-search/popover-select/style/css.js +1 -1
  103. package/lib/src/business/ap-group-search/popover-select/style/index.js +1 -1
  104. package/lib/src/business/ap-image/ApImage.vue2.js +1 -1
  105. package/lib/src/business/ap-summary/ap-summary.vue2.js +1 -1
  106. package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.d.ts +50 -0
  107. package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.js +1 -0
  108. package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue2.js +1 -0
  109. package/lib/src/business/ap-upload-file/ap-upload-single/style/css.d.ts +0 -0
  110. package/lib/src/business/ap-upload-file/ap-upload-single/style/css.js +1 -0
  111. package/lib/src/business/ap-upload-file/ap-upload-single/style/index.d.ts +0 -0
  112. package/lib/src/business/ap-upload-file/ap-upload-single/style/index.js +1 -0
  113. package/lib/src/business/ap-upload-file/hook/useInjectContext.d.ts +4 -0
  114. package/lib/src/business/ap-upload-file/hook/useInjectContext.js +1 -0
  115. package/lib/src/business/ap-upload-file/hook/useOss.d.ts +8 -0
  116. package/lib/src/business/ap-upload-file/hook/useOss.js +1 -0
  117. package/lib/src/business/ap-upload-file/hook/useProps.d.ts +12 -0
  118. package/lib/src/business/ap-upload-file/hook/useProps.js +1 -0
  119. package/lib/src/business/ap-upload-file/icon/delete-icon.vue.d.ts +3 -0
  120. package/lib/src/business/ap-upload-file/icon/delete-icon.vue.js +1 -0
  121. package/lib/src/business/ap-upload-file/icon/file-icon.vue.d.ts +3 -0
  122. package/lib/src/business/ap-upload-file/icon/file-icon.vue.js +1 -0
  123. package/lib/src/business/ap-upload-file/index.d.ts +3 -0
  124. package/lib/src/business/ap-upload-file/index.js +1 -0
  125. package/lib/src/business/ap-upload-file/interface.d.ts +29 -0
  126. package/lib/src/business/ap-upload-file/interface.js +1 -0
  127. package/lib/src/business/ap-upload-file/utils/accept.d.ts +16 -0
  128. package/lib/src/business/ap-upload-file/utils/accept.js +1 -0
  129. package/lib/src/business/ap-upload-file/utils/fileList.d.ts +5 -0
  130. package/lib/src/business/ap-upload-file/utils/fileList.js +1 -0
  131. package/lib/src/business/ap-upload-file/utils/upload.d.ts +10 -0
  132. package/lib/src/business/ap-upload-file/utils/upload.js +1 -0
  133. package/lib/src/business/index.d.ts +1 -0
  134. package/lib/src/business/index.js +1 -1
  135. package/lib/src/config-provider/config-provider.d.ts +8 -0
  136. package/lib/src/config-provider/css-var.d.ts +8 -0
  137. package/lib/src/config-provider/css-var.js +1 -1
  138. package/lib/src/config-provider/index.d.ts +48 -0
  139. package/lib/src/index.js +1 -1
  140. package/lib/src/locale/lang/en.js +1 -1
  141. package/lib/src/locale/lang/zh-cn.js +1 -1
  142. package/lib/src/path-map.js +1 -1
  143. package/lib/src/utils/index.d.ts +12 -0
  144. package/lib/src/utils/index.js +1 -1
  145. package/package.json +4 -4
@@ -0,0 +1,30 @@
1
+ import { createOssInstance as i } from "@aplus-frontend/oss";
2
+ let t, o, e;
3
+ function r(n, s, a) {
4
+ t = n, o = s, a && (e = a);
5
+ }
6
+ const c = {
7
+ "zh-cn": "zh_CN",
8
+ en: "en_US"
9
+ };
10
+ function l() {
11
+ return c[o.value] ?? "zh_CN";
12
+ }
13
+ async function g() {
14
+ if (!e)
15
+ throw new Error(`${t("ap.apUpload.pleasePass")}getOssAccess`);
16
+ const n = i();
17
+ return await n.initOssClient({
18
+ getOssAccess: e,
19
+ locale: l(),
20
+ onFailure: (s) => {
21
+ throw new Error(
22
+ typeof (s == null ? void 0 : s.message) == "string" ? s.message : t("ap.apUpload.FailedToObtainOssTemporaryPermissions")
23
+ );
24
+ }
25
+ }), n;
26
+ }
27
+ export {
28
+ g as getOssInstance,
29
+ r as injectHookOss
30
+ };
@@ -0,0 +1,12 @@
1
+ import { ApUploadCustomRequest, ApUploadFile, ApUploadSingleProps } from '../interface';
2
+ import { ComputedRef, VNodeArrayChildren, VNode, RendererNode, RendererElement } from 'vue';
3
+ export declare function useSingleProps(props: ApUploadSingleProps): {
4
+ title: ComputedRef<string | number | true | VNodeArrayChildren | VNode<RendererNode, RendererElement, {
5
+ [key: string]: any;
6
+ }>>;
7
+ subTitle: ComputedRef<string | number | true | VNodeArrayChildren | VNode<RendererNode, RendererElement, {
8
+ [key: string]: any;
9
+ }>>;
10
+ beforeUpload: (file: ApUploadFile, fileList: ApUploadFile[]) => boolean | Promise<boolean>;
11
+ customRequest: ApUploadCustomRequest;
12
+ };
@@ -0,0 +1,28 @@
1
+ import { computed as l } from "vue";
2
+ import { getAcceptText as d } from "../utils/accept.mjs";
3
+ import "../../../config-provider/index.mjs";
4
+ import { uploadBeforeUpload as f, uploadCustomRequest as U } from "../utils/upload.mjs";
5
+ import { useLocale as o } from "../../../config-provider/hooks/use-locale.mjs";
6
+ function z(e) {
7
+ const { t: c } = o(), m = l(
8
+ () => e.title || c("ap.apUpload.clickOrDragUpload")
9
+ ), i = l(
10
+ () => e.subTitle || `${c("ap.apUpload.supportExtension")}:${d(e.accept)},${c(
11
+ "ap.apUpload.maxWarnUploadFileSize",
12
+ {
13
+ maxSize: e.maxSize
14
+ }
15
+ )}`
16
+ );
17
+ function n(t, a) {
18
+ var u;
19
+ return e != null && e.beforeUpload ? (u = e == null ? void 0 : e.beforeUpload) == null ? void 0 : u.call(e, t, a) : f(t, a, e);
20
+ }
21
+ return { title: m, subTitle: i, beforeUpload: n, customRequest: (t) => {
22
+ var a, u;
23
+ e != null && e.customRequest ? (a = e == null ? void 0 : e.customRequest) == null || a.call(e, t) : (u = U) == null || u(t, e);
24
+ } };
25
+ }
26
+ export {
27
+ z as useSingleProps
28
+ };
@@ -0,0 +1,3 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
2
+ declare const _default: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{}>>, {}, {}>;
3
+ export default _default;
@@ -0,0 +1,27 @@
1
+ import { createElementVNode as e, openBlock as o, createElementBlock as t } from "vue";
2
+ import n from "../../../../_virtual/_plugin-vue_export-helper.mjs";
3
+ const l = {}, r = {
4
+ xmlns: "http://www.w3.org/2000/svg",
5
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
6
+ fill: "none",
7
+ version: "1.1",
8
+ viewBox: "0 0 20 20"
9
+ }, L = /* @__PURE__ */ e("g", null, [
10
+ /* @__PURE__ */ e("g", null, [
11
+ /* @__PURE__ */ e("path", {
12
+ d: "M14.2913,4.375L16.875,4.375C17.2202,4.375,17.5,4.65482,17.5,5C17.5,5.34518,17.2202,5.625,16.875,5.625L15.9375,5.625L15.9375,15.625Q15.9375,16.401699999999998,15.3883,16.9508Q14.8392,17.5,14.0625,17.5L5.9375,17.5Q5.16085,17.5,4.61167,16.9508Q4.0625,16.401699999999998,4.0625,15.625L4.0625,5.625L3.125,5.625C2.7798220000000002,5.625,2.5,5.34518,2.5,5C2.5,4.65482,2.7798220000000002,4.375,3.125,4.375L5.70873,4.375C5.71225,4.3689,5.71588,4.3628599999999995,5.719609999999999,4.35687L6.71624,2.75811Q7.26675,1.875,8.307400000000001,1.875L11.6926,1.875Q12.7332,1.875,13.2838,2.75811L14.2802,4.3565000000000005C14.284,4.36261,14.2877,4.36878,14.2913,4.375ZM12.8187,4.375L12.22299,3.41937Q12.03948,3.125,11.6926,3.125L8.307400000000001,3.125Q7.96052,3.125,7.77702,3.41937L7.1813,4.375L12.8187,4.375ZM5.3125,5.625L14.6875,5.625L14.6875,15.625Q14.6875,15.8839,14.5044,16.0669Q14.3214,16.25,14.0625,16.25L5.9375,16.25Q5.6786200000000004,16.25,5.495559999999999,16.0669Q5.3125,15.8839,5.3125,15.625L5.3125,5.625ZM9.375,8.75C9.375,8.40482,9.65482,8.125,10,8.125C10.34518,8.125,10.625,8.40482,10.625,8.75L10.625,13.125C10.625,13.4702,10.34518,13.75,10,13.75C9.65482,13.75,9.375,13.4702,9.375,13.125L9.375,8.75Z",
13
+ "fill-rule": "evenodd",
14
+ fill: "currentColor",
15
+ "fill-opacity": "1"
16
+ })
17
+ ])
18
+ ], -1), c = [
19
+ L
20
+ ];
21
+ function s(i, _) {
22
+ return o(), t("svg", r, c);
23
+ }
24
+ const f = /* @__PURE__ */ n(l, [["render", s]]);
25
+ export {
26
+ f as default
27
+ };
@@ -0,0 +1,3 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
2
+ declare const _default: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{}>>, {}, {}>;
3
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import { createStaticVNode as t, openBlock as o, createElementBlock as i } from "vue";
2
+ import e from "../../../../_virtual/_plugin-vue_export-helper.mjs";
3
+ const s = {}, l = {
4
+ xmlns: "http://www.w3.org/2000/svg",
5
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
6
+ fill: "none",
7
+ version: "1.1",
8
+ viewBox: "0 0 56 56"
9
+ }, r = /* @__PURE__ */ t('<defs><clipPath id="master_svg0_693_19001"><rect x="0" y="0" width="56" height="56" rx="7"></rect></clipPath><linearGradient x1="0.5" y1="0" x2="0.5" y2="0.7987817525863647" id="master_svg1_693_19025"><stop offset="0%" stop-color="#AED1FF" stop-opacity="1"></stop><stop offset="100%" stop-color="#74B1FF" stop-opacity="1"></stop></linearGradient><linearGradient x1="0.5" y1="0" x2="0.5" y2="1" id="master_svg2_693_19014"><stop offset="0.7142857182770967%" stop-color="#DBEBFF" stop-opacity="1"></stop><stop offset="100%" stop-color="#98C5FF" stop-opacity="1"></stop></linearGradient></defs><g clip-path="url(#master_svg0_693_19001)"><g><g><path d="M49.4644,10.22729L35.1706,10.22729C34.2282,10.22729,33.316,9.89456,32.595,9.287759999999999L29.1746,6.4093C28.0931,5.499102,26.7249,5,25.3113,5L5.5,5C3.29086,5,1.5,6.79086,1.5,9L1.5,45L54.4995,45L54.5,15.2852C54.5,12.49165,52.2455,10.22729,49.4644,10.22729Z" fill="url(#master_svg1_693_19025)" fill-opacity="1"></path></g><g><path d="M10.5,13L45.5,13C46.6046,13,47.5,13.895431,47.5,15L47.5,35.9999L8.5,36L8.5,15C8.5,13.895431,9.395431,13,10.5,13" fill="#FFFFFF" fill-opacity="0.30000001192092896"></path></g><g><path d="M8.5,17L47.5,17C48.6046,17,49.5,17.895431,49.5,19L49.5,41.9998L6.5,42L6.5,19C6.5,17.895431,7.395431,17,8.5,17" fill="#F9FCFF" fill-opacity="1"></path></g><g><rect x="14.5" y="21" width="15" height="2" rx="1" fill="#8DBFFF" fill-opacity="0.30000001192092896"></rect></g><g><rect x="14.5" y="27" width="28" height="2" rx="1" fill="#8DBFFF" fill-opacity="0.6000000238418579"></rect></g><g><path d="M1.5,37L1.5,48C1.5,50.2091,3.29086,52,5.5,52L50.5,52C52.7091,52,54.5,50.2091,54.5,48L54.5,37C54.5,35.34315,53.1569,34,51.5,34L4.5,34C2.84315,34,1.5,35.34315,1.5,37Z" fill="url(#master_svg2_693_19014)" fill-opacity="1"></path></g></g></g>', 2), p = [
10
+ r
11
+ ];
12
+ function a(c, _) {
13
+ return o(), i("svg", l, p);
14
+ }
15
+ const n = /* @__PURE__ */ e(s, [["render", a]]);
16
+ export {
17
+ n as default
18
+ };
@@ -0,0 +1,3 @@
1
+ import { default as ApUploadSingle } from './ap-upload-single/ap-upload-single.vue';
2
+ export * from './interface';
3
+ export { ApUploadSingle };
@@ -0,0 +1,2 @@
1
+ import "./interface.mjs";
2
+ import "./ap-upload-single/ap-upload-single.vue2.mjs";
@@ -0,0 +1,29 @@
1
+ import { accessCreate } from '@aplus-frontend/oss';
2
+ import { VNodeChild } from 'vue';
3
+ import { UploadFile, UploadChangeParam, UploadProps } from '@aplus-frontend/antdv';
4
+ export type ApUploadGetOssAccess = () => Promise<accessCreate>;
5
+ type Parameters<T extends (...args: any) => any> = T extends (...args: infer P) => any ? P : never;
6
+ export type ApUploadFile<T = any> = UploadFile<T> & {
7
+ ossDestroy?: () => any;
8
+ [key: string | number | symbol]: any;
9
+ };
10
+ export type ApUploadCustomRequest = (option: Omit<Parameters<Exclude<UploadProps['customRequest'], undefined>>[0], 'file'> & {
11
+ file?: ApUploadFile;
12
+ }, props?: {
13
+ dirName?: string;
14
+ }) => void;
15
+ export type ApUploadBaseProps<T = any> = {
16
+ dirName: string;
17
+ getOssAccess?: ApUploadGetOssAccess;
18
+ fileList?: ApUploadFile<T>[];
19
+ onChange?: (info?: UploadChangeParam<ApUploadFile<T>>) => void;
20
+ maxSize?: number;
21
+ accept?: string;
22
+ beforeUpload?: (file: ApUploadFile<T>, fileList: ApUploadFile<T>[]) => boolean | Promise<boolean>;
23
+ customRequest?: ApUploadCustomRequest;
24
+ };
25
+ export type ApUploadSingleProps<T = any> = ApUploadBaseProps<T> & {
26
+ title?: VNodeChild;
27
+ subTitle?: VNodeChild;
28
+ };
29
+ export {};
@@ -0,0 +1,16 @@
1
+ import { Translator } from '../../../config-provider';
2
+ import { ApUploadFile } from '../interface';
3
+ export declare function injectUtilAccept(tValue: Translator): void;
4
+ /**
5
+ * 校验文件是否满足指定的格式
6
+ * @param file
7
+ * @param accept
8
+ * @returns
9
+ */
10
+ export declare function fileMatchesAccept(file: ApUploadFile, accept: string): boolean;
11
+ /**
12
+ * 根据accept获取支持的后缀名
13
+ * @param accept
14
+ * @returns
15
+ */
16
+ export declare function getAcceptText(accept: string): string;
@@ -0,0 +1,55 @@
1
+ import i from "mime";
2
+ let a;
3
+ function f(e) {
4
+ a = e;
5
+ }
6
+ function T(e, r) {
7
+ var p, o, c, u, l;
8
+ const t = r.split(",").map((n) => n.trim());
9
+ for (const n of t) {
10
+ if (n === "*")
11
+ return !0;
12
+ if (n.endsWith("/*")) {
13
+ const [s] = n.split("/"), [m] = ((p = e == null ? void 0 : e.type) == null ? void 0 : p.split("/")) || [];
14
+ if (s === m)
15
+ return !0;
16
+ } else if (/^\./.test(n)) {
17
+ if (e.type === i.getType(n))
18
+ return !0;
19
+ const s = (o = e.name) == null ? void 0 : o.lastIndexOf(".");
20
+ if (s > -1 && ((c = e.name) == null ? void 0 : c.slice(s)) === n)
21
+ return !0;
22
+ } else {
23
+ if (e.type === n)
24
+ return !0;
25
+ const s = (u = e.name) == null ? void 0 : u.lastIndexOf(".");
26
+ if (s > -1 && [...i.getAllExtensions(n) || []].map(
27
+ (d) => `.${d}`
28
+ ).includes((l = e.name) == null ? void 0 : l.slice(s)))
29
+ return !0;
30
+ }
31
+ }
32
+ return !1;
33
+ }
34
+ function x(e) {
35
+ const r = {
36
+ image: a("ap.apUpload.pictureType"),
37
+ video: a("ap.apUpload.videoType"),
38
+ audio: a("ap.apUpload.audioType"),
39
+ application: a("ap.apUpload.documentType"),
40
+ "*": a("ap.apUpload.allTypes")
41
+ };
42
+ return e.split(",").map((t) => t.trim()).map((t) => {
43
+ if (t === "*")
44
+ return r[t];
45
+ if (t.endsWith("/*")) {
46
+ const [p] = t.split("/");
47
+ return r[p] || p;
48
+ } else return /^\./.test(t) ? t : [...i.getAllExtensions(t) || []].map((p) => `.${p}`).join(",") || t;
49
+ }).join(",");
50
+ }
51
+ export {
52
+ T as fileMatchesAccept,
53
+ x as getAcceptText,
54
+ f as injectUtilAccept
55
+ };
@@ -0,0 +1,5 @@
1
+ import { ApUploadFile } from '../interface';
2
+ export declare function clearSingleFile(file: ApUploadFile, fileList: ApUploadFile[], props?: {
3
+ maxCount?: number;
4
+ }): void;
5
+ export declare function clearAllFile(fileList: ApUploadFile[]): void;
@@ -0,0 +1,16 @@
1
+ function e(t, n, u) {
2
+ var c;
3
+ t.status === "uploading" && ((c = t.ossDestroy) == null || c.call(t));
4
+ const a = n.findIndex((d) => d.uid === t.uid);
5
+ a > -1 && (n.splice(a, 1), u != null && u.maxCount && n.length >= u.maxCount && n.splice(u.maxCount));
6
+ }
7
+ function o(t) {
8
+ t.forEach((n) => {
9
+ var u;
10
+ n.status === "uploading" && ((u = n.ossDestroy) == null || u.call(n));
11
+ }), t.splice(0);
12
+ }
13
+ export {
14
+ o as clearAllFile,
15
+ e as clearSingleFile
16
+ };
@@ -0,0 +1,10 @@
1
+ import { ApUploadCustomRequest, ApUploadFile } from '../interface';
2
+ import { Translator } from '../../../config-provider';
3
+ export declare function injectUtilUpload(tValue: Translator): void;
4
+ export declare function changeFileStatus(file: ApUploadFile, status: ApUploadFile['status'], errMsg: string): void;
5
+ export declare function uploadBeforeUpload(file: ApUploadFile, fileList: ApUploadFile[], props: {
6
+ maxSize?: number;
7
+ maxCount?: number;
8
+ accept?: string;
9
+ }): boolean;
10
+ export declare const uploadCustomRequest: ApUploadCustomRequest;
@@ -0,0 +1,62 @@
1
+ import { message as r } from "@aplus-frontend/antdv";
2
+ import { fileMatchesAccept as g } from "./accept.mjs";
3
+ import { getOssInstance as U } from "../hook/useOss.mjs";
4
+ let u;
5
+ function w(e) {
6
+ u = e;
7
+ }
8
+ function x(e, n, a) {
9
+ e.status = n, e.error = a;
10
+ }
11
+ function z(e, n, a) {
12
+ if (a != null && a.maxCount && a.maxCount > 1 && n.length >= a.maxCount) {
13
+ const t = u("ap.apUpload.maxUploadPicture", {
14
+ maxCount: a.maxCount
15
+ });
16
+ return r.warning(t), x(e, "error", t), !1;
17
+ }
18
+ if (a != null && a.maxSize && ((e == null ? void 0 : e.size) || 0) > (a == null ? void 0 : a.maxSize) * 1024 * 1024) {
19
+ const t = u("ap.apUpload.maxUploadFileSize", {
20
+ maxSize: a == null ? void 0 : a.maxSize
21
+ });
22
+ return r.warning(t), x(e, "error", t), !1;
23
+ }
24
+ if (!g(e, a.accept)) {
25
+ const t = u("ap.apUpload.fileFormatNotSupported");
26
+ return r.warning(t), x(e, "error", t), !1;
27
+ }
28
+ return !0;
29
+ }
30
+ const S = async (e, n) => {
31
+ const { file: a, onError: t, onProgress: i, onSuccess: d } = e;
32
+ try {
33
+ const c = await U(), m = await (c == null ? void 0 : c.put({
34
+ dirName: n == null ? void 0 : n.dirName,
35
+ fileName: a == null ? void 0 : a.name,
36
+ data: a,
37
+ progressCallBack: (l) => {
38
+ i == null || i({
39
+ percent: l
40
+ });
41
+ }
42
+ }));
43
+ if (m.status === 204)
44
+ return;
45
+ if (m.status === 200) {
46
+ const { saveUrl: l } = m;
47
+ d == null || d({
48
+ fileName: a == null ? void 0 : a.name,
49
+ path: l
50
+ });
51
+ } else
52
+ t == null || t((m == null ? void 0 : m.message) || u("ap.apUpload.networkAnomaly"));
53
+ } catch (c) {
54
+ t == null || t(c);
55
+ }
56
+ };
57
+ export {
58
+ x as changeFileStatus,
59
+ w as injectUtilUpload,
60
+ z as uploadBeforeUpload,
61
+ S as uploadCustomRequest
62
+ };
@@ -17,4 +17,5 @@ export * from './hooks/index';
17
17
  export * from './ap-summary';
18
18
  export * from './ap-appendix';
19
19
  export * from './ap-group-search';
20
+ export * from './ap-upload-file';
20
21
  export { ApTransformDataHelper } from '../utils/ap-trans-data';
@@ -1,45 +1,46 @@
1
- import { default as t } from "./ap-table-modal/index.mjs";
2
- import { ApAttachment as A } from "./ap-attachment/index.mjs";
3
- import { ApBatchAction as x } from "./ap-batch-action/index.mjs";
4
- import { ApBatchActionGroup as f } from "./ap-batch-action-group/index.mjs";
5
- import { ApButtonGroup as l } from "./ap-button-group/index.mjs";
6
- import { ApCard as c } from "./ap-card/index.mjs";
7
- import { ApExpandAlert as i } from "./ap-expand-alert/index.mjs";
8
- import { ApExportGroup as G } from "./ap-export-group/index.mjs";
9
- import { ApImage as h } from "./ap-image/index.mjs";
10
- import { ApInputRadio as b } from "./ap-input-radio/index.mjs";
11
- import { ApLabel as E, ApLabelGroup as T } from "./ap-label/index.mjs";
12
- import { ApLadder as I } from "./ap-ladder/index.mjs";
13
- import { ApSelectLayout as v } from "./ap-select-layout/index.mjs";
14
- import { ApStatus as D, ApStatusGroup as H } from "./ap-status/index.mjs";
15
- import { ApTitle as P } from "./ap-title/index.mjs";
1
+ import { default as e } from "./ap-table-modal/index.mjs";
2
+ import { ApAttachment as m } from "./ap-attachment/index.mjs";
3
+ import { ApBatchAction as a } from "./ap-batch-action/index.mjs";
4
+ import { ApBatchActionGroup as u } from "./ap-batch-action-group/index.mjs";
5
+ import { ApButtonGroup as n } from "./ap-button-group/index.mjs";
6
+ import { ApCard as d } from "./ap-card/index.mjs";
7
+ import { ApExpandAlert as S } from "./ap-expand-alert/index.mjs";
8
+ import { ApExportGroup as s } from "./ap-export-group/index.mjs";
9
+ import { ApImage as L } from "./ap-image/index.mjs";
10
+ import { ApInputRadio as B } from "./ap-input-radio/index.mjs";
11
+ import { ApLabel as T, ApLabelGroup as y } from "./ap-label/index.mjs";
12
+ import { ApLadder as g } from "./ap-ladder/index.mjs";
13
+ import { ApSelectLayout as C } from "./ap-select-layout/index.mjs";
14
+ import { ApStatus as H, ApStatusGroup as M } from "./ap-status/index.mjs";
15
+ import { ApTitle as R } from "./ap-title/index.mjs";
16
16
  import "./hooks/index.mjs";
17
- import { ApSummary as j } from "./ap-summary/index.mjs";
18
- import { ApAppendix as q } from "./ap-appendix/index.mjs";
19
- import { ApExtensionSelect as z, ApGroupSearch as F, ApPopoverSelect as J } from "./ap-group-search/index.mjs";
20
- import { ApTransformDataHelper as N } from "../utils/ap-trans-data/index.mjs";
17
+ import { ApSummary as k } from "./ap-summary/index.mjs";
18
+ import { ApAppendix as w } from "./ap-appendix/index.mjs";
19
+ import { ApExtensionSelect as F, ApGroupSearch as J, ApPopoverSelect as K } from "./ap-group-search/index.mjs";
20
+ import "./ap-upload-file/index.mjs";
21
+ import { ApTransformDataHelper as O } from "../utils/ap-trans-data/index.mjs";
21
22
  export {
22
- q as ApAppendix,
23
- A as ApAttachment,
24
- x as ApBatchAction,
25
- f as ApBatchActionGroup,
26
- l as ApButtonGroup,
27
- c as ApCard,
28
- i as ApExpandAlert,
29
- G as ApExportGroup,
30
- z as ApExtensionSelect,
31
- F as ApGroupSearch,
32
- h as ApImage,
33
- b as ApInputRadio,
34
- E as ApLabel,
35
- T as ApLabelGroup,
36
- I as ApLadder,
37
- J as ApPopoverSelect,
38
- v as ApSelectLayout,
39
- D as ApStatus,
40
- H as ApStatusGroup,
41
- j as ApSummary,
42
- t as ApTableModal,
43
- P as ApTitle,
44
- N as ApTransformDataHelper
23
+ w as ApAppendix,
24
+ m as ApAttachment,
25
+ a as ApBatchAction,
26
+ u as ApBatchActionGroup,
27
+ n as ApButtonGroup,
28
+ d as ApCard,
29
+ S as ApExpandAlert,
30
+ s as ApExportGroup,
31
+ F as ApExtensionSelect,
32
+ J as ApGroupSearch,
33
+ L as ApImage,
34
+ B as ApInputRadio,
35
+ T as ApLabel,
36
+ y as ApLabelGroup,
37
+ g as ApLadder,
38
+ K as ApPopoverSelect,
39
+ C as ApSelectLayout,
40
+ H as ApStatus,
41
+ M as ApStatusGroup,
42
+ k as ApSummary,
43
+ e as ApTableModal,
44
+ R as ApTitle,
45
+ O as ApTransformDataHelper
45
46
  };
@@ -436,6 +436,14 @@ export declare const ConfigProvider: DefineComponent<{
436
436
  };
437
437
  };
438
438
  };
439
+ 'ap-upload-single': {
440
+ color: {
441
+ main: string;
442
+ sub: string;
443
+ border: string;
444
+ primary: string;
445
+ };
446
+ };
439
447
  }>;
440
448
  }, {}>;
441
449
  export type ConfigProviderInstance = InstanceType<typeof ConfigProvider>;
@@ -87,6 +87,14 @@ declare const aplusCssVarObj: {
87
87
  };
88
88
  };
89
89
  };
90
+ 'ap-upload-single': {
91
+ color: {
92
+ main: string;
93
+ sub: string;
94
+ border: string;
95
+ primary: string;
96
+ };
97
+ };
90
98
  };
91
99
  export type CssVarType = RecursivePartial<typeof aplusCssVarObj>;
92
100
  export declare function generateCssVar(cssVarRawObj: CssVarType): Record<string, any>;
@@ -85,6 +85,14 @@ const F = {
85
85
  icon: "#ABB7CC"
86
86
  }
87
87
  }
88
+ },
89
+ "ap-upload-single": {
90
+ color: {
91
+ main: "#182948",
92
+ sub: "#ABB7CC",
93
+ border: "#DEE4ED",
94
+ primary: "#0070FF"
95
+ }
88
96
  }
89
97
  }, b = {
90
98
  "ap-form": {
@@ -173,22 +181,30 @@ const F = {
173
181
  icon: "#BFBFBF"
174
182
  }
175
183
  }
184
+ },
185
+ "ap-upload-single": {
186
+ color: {
187
+ main: "#333333",
188
+ sub: "#BFBFBF",
189
+ border: "#D9D9D9",
190
+ primary: "#34b77c"
191
+ }
176
192
  }
177
193
  };
178
- function i(e) {
194
+ function i(t) {
179
195
  const o = {};
180
- function r(a, s) {
181
- const l = Object.keys(a);
182
- for (const c of l) {
183
- const t = a[c], n = [...s, c];
184
- t !== null && typeof t == "object" ? r(t, n) : o[`--${n.join("-")}`] = t;
196
+ function r(a, l) {
197
+ const s = Object.keys(a);
198
+ for (const c of s) {
199
+ const e = a[c], n = [...l, c];
200
+ e !== null && typeof e == "object" ? r(e, n) : o[`--${n.join("-")}`] = e;
185
201
  }
186
202
  }
187
- return r(e, []), o;
203
+ return r(t, []), o;
188
204
  }
189
205
  const d = i(F), p = i(b);
190
- function u(e) {
191
- Object.entries(e).forEach(([o, r]) => {
206
+ function u(t) {
207
+ Object.entries(t).forEach(([o, r]) => {
192
208
  document.documentElement.style.setProperty(o, r);
193
209
  });
194
210
  }
@@ -251,6 +251,14 @@ export declare const APConfigProvider: {
251
251
  };
252
252
  };
253
253
  };
254
+ 'ap-upload-single': {
255
+ color: {
256
+ main: string;
257
+ sub: string;
258
+ border: string;
259
+ primary: string;
260
+ };
261
+ };
254
262
  }>>;
255
263
  default: () => {};
256
264
  };
@@ -487,6 +495,14 @@ export declare const APConfigProvider: {
487
495
  };
488
496
  };
489
497
  };
498
+ 'ap-upload-single': {
499
+ color: {
500
+ main: string;
501
+ sub: string;
502
+ border: string;
503
+ primary: string;
504
+ };
505
+ };
490
506
  }>>;
491
507
  default: () => {};
492
508
  };
@@ -617,6 +633,14 @@ export declare const APConfigProvider: {
617
633
  };
618
634
  };
619
635
  };
636
+ 'ap-upload-single': {
637
+ color: {
638
+ main: string;
639
+ sub: string;
640
+ border: string;
641
+ primary: string;
642
+ };
643
+ };
620
644
  }>;
621
645
  }, true, {}, {}, {
622
646
  P: {};
@@ -858,6 +882,14 @@ export declare const APConfigProvider: {
858
882
  };
859
883
  };
860
884
  };
885
+ 'ap-upload-single': {
886
+ color: {
887
+ main: string;
888
+ sub: string;
889
+ border: string;
890
+ primary: string;
891
+ };
892
+ };
861
893
  }>>;
862
894
  default: () => {};
863
895
  };
@@ -988,6 +1020,14 @@ export declare const APConfigProvider: {
988
1020
  };
989
1021
  };
990
1022
  };
1023
+ 'ap-upload-single': {
1024
+ color: {
1025
+ main: string;
1026
+ sub: string;
1027
+ border: string;
1028
+ primary: string;
1029
+ };
1030
+ };
991
1031
  }>;
992
1032
  }>;
993
1033
  __isFragment?: never;
@@ -1268,6 +1308,14 @@ export declare const APConfigProvider: {
1268
1308
  };
1269
1309
  };
1270
1310
  };
1311
+ 'ap-upload-single': {
1312
+ color: {
1313
+ main: string;
1314
+ sub: string;
1315
+ border: string;
1316
+ primary: string;
1317
+ };
1318
+ };
1271
1319
  }>;
1272
1320
  }, {}, string, {}> & VNodeProps & AllowedComponentProps & ComponentCustomProps & ( Plugin & (new (...args: any[]) => {
1273
1321
  $props: {