@nokecy/qc-ui 1.1.78 → 1.1.79
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.
- package/dist/cjs/attachment/AttachmentFileButton.d.ts +4 -0
- package/dist/cjs/attachment/AttachmentFileButton.js +86 -0
- package/dist/cjs/attachment/AttachmentImageUpload.d.ts +16 -0
- package/dist/cjs/attachment/AttachmentImageUpload.js +206 -0
- package/dist/cjs/attachment/AttachmentPanel.d.ts +8 -0
- package/dist/cjs/attachment/AttachmentPanel.js +63 -0
- package/dist/cjs/attachment/AttachmentVideoUpload.d.ts +13 -0
- package/dist/cjs/attachment/AttachmentVideoUpload.js +88 -0
- package/dist/cjs/attachment/ChunkedDragger.d.ts +14 -0
- package/dist/cjs/attachment/ChunkedDragger.js +160 -0
- package/dist/cjs/attachment/attachmentList.d.ts +91 -0
- package/dist/cjs/attachment/attachmentList.js +214 -0
- package/dist/cjs/attachment/chunkUpload.d.ts +26 -0
- package/dist/cjs/attachment/chunkUpload.js +276 -0
- package/dist/cjs/attachment/env.d.ts +41 -0
- package/dist/cjs/attachment/env.js +41 -0
- package/dist/cjs/attachment/index.d.ts +20 -0
- package/dist/cjs/attachment/index.js +92 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +12 -0
- package/dist/esm/attachment/AttachmentFileButton.d.ts +4 -0
- package/dist/esm/attachment/AttachmentFileButton.js +77 -0
- package/dist/esm/attachment/AttachmentImageUpload.d.ts +16 -0
- package/dist/esm/attachment/AttachmentImageUpload.js +199 -0
- package/dist/esm/attachment/AttachmentPanel.d.ts +8 -0
- package/dist/esm/attachment/AttachmentPanel.js +52 -0
- package/dist/esm/attachment/AttachmentVideoUpload.d.ts +13 -0
- package/dist/esm/attachment/AttachmentVideoUpload.js +82 -0
- package/dist/esm/attachment/ChunkedDragger.d.ts +14 -0
- package/dist/esm/attachment/ChunkedDragger.js +153 -0
- package/dist/esm/attachment/attachmentList.d.ts +91 -0
- package/dist/esm/attachment/attachmentList.js +207 -0
- package/dist/esm/attachment/chunkUpload.d.ts +26 -0
- package/dist/esm/attachment/chunkUpload.js +272 -0
- package/dist/esm/attachment/env.d.ts +41 -0
- package/dist/esm/attachment/env.js +35 -0
- package/dist/esm/attachment/index.d.ts +20 -0
- package/dist/esm/attachment/index.js +14 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/umd/qc-ui.min.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
/**
|
|
8
|
+
* 附件上传的宿主环境:后端地址、传输层与接口路径。
|
|
9
|
+
* qc-ui 不依赖具体的 HTTP 库,宿主把自己的 POST 实现与地址前缀注入进来。
|
|
10
|
+
*
|
|
11
|
+
* @author nokecy
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/** 附件服务的接口路径(相对于 `serverUrl()`)。`validate` 沿用后端的拼写 `valiate`。 */
|
|
15
|
+
|
|
16
|
+
export var defaultAttachmentEndpoints = {
|
|
17
|
+
upload: '/api/attachmentManage/temp-blob/upload',
|
|
18
|
+
validate: '/api/attachmentManage/temp-blob/valiate',
|
|
19
|
+
uploadVideoChunk: '/api/attachmentManage/temp-blob/upload-video-chunk',
|
|
20
|
+
confirmVideo: '/api/attachmentManage/temp-blob/confirm-video',
|
|
21
|
+
downloadByBlobName: '/api/attachmentManage/blob/by-blob-name/'
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** `post` 的第三个参数,约定与 axios 一致。 */
|
|
25
|
+
|
|
26
|
+
/** 宿主注入的环境。 */
|
|
27
|
+
|
|
28
|
+
export var resolveEndpoints = function resolveEndpoints(env) {
|
|
29
|
+
return _objectSpread(_objectSpread({}, defaultAttachmentEndpoints), env.endpoints);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** 按 blobName 拼出下载地址。 */
|
|
33
|
+
export var getBlobDownloadUrl = function getBlobDownloadUrl(env, blobName) {
|
|
34
|
+
return "".concat(env.serverUrl()).concat(resolveEndpoints(env).downloadByBlobName).concat(blobName);
|
|
35
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 附件上传:拖拽上传(普通文件断点续传 / 视频分块)、附件列表、图片墙。
|
|
3
|
+
* 传输层与接口路径由宿主通过 `env` 注入。
|
|
4
|
+
*
|
|
5
|
+
* @author nokecy
|
|
6
|
+
*/
|
|
7
|
+
export { default as AttachmentPanel } from './AttachmentPanel';
|
|
8
|
+
export type { AttachmentPanelProps } from './AttachmentPanel';
|
|
9
|
+
export { default as AttachmentFileButton } from './AttachmentFileButton';
|
|
10
|
+
export { default as AttachmentImageUpload } from './AttachmentImageUpload';
|
|
11
|
+
export type { AttachmentImageUploadProps } from './AttachmentImageUpload';
|
|
12
|
+
export { default as AttachmentVideoUpload } from './AttachmentVideoUpload';
|
|
13
|
+
export type { AttachmentVideoUploadProps } from './AttachmentVideoUpload';
|
|
14
|
+
export { default as ChunkedDragger } from './ChunkedDragger';
|
|
15
|
+
export type { ChunkedDraggerProps } from './ChunkedDragger';
|
|
16
|
+
export { formatAttachmentDate } from './attachmentList';
|
|
17
|
+
export type { AttachmentListProps } from './attachmentList';
|
|
18
|
+
export { defaultAttachmentEndpoints, getBlobDownloadUrl, resolveEndpoints } from './env';
|
|
19
|
+
export type { AttachmentEndpoints, AttachmentEnv, AttachmentPostConfig } from './env';
|
|
20
|
+
export { CHUNK_SIZE, createFileProtocol, createVideoProtocol, splitFile } from './chunkUpload';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 附件上传:拖拽上传(普通文件断点续传 / 视频分块)、附件列表、图片墙。
|
|
3
|
+
* 传输层与接口路径由宿主通过 `env` 注入。
|
|
4
|
+
*
|
|
5
|
+
* @author nokecy
|
|
6
|
+
*/
|
|
7
|
+
export { default as AttachmentPanel } from "./AttachmentPanel";
|
|
8
|
+
export { default as AttachmentFileButton } from "./AttachmentFileButton";
|
|
9
|
+
export { default as AttachmentImageUpload } from "./AttachmentImageUpload";
|
|
10
|
+
export { default as AttachmentVideoUpload } from "./AttachmentVideoUpload";
|
|
11
|
+
export { default as ChunkedDragger } from "./ChunkedDragger";
|
|
12
|
+
export { formatAttachmentDate } from "./attachmentList";
|
|
13
|
+
export { defaultAttachmentEndpoints, getBlobDownloadUrl, resolveEndpoints } from "./env";
|
|
14
|
+
export { CHUNK_SIZE, createFileProtocol, createVideoProtocol, splitFile } from "./chunkUpload";
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ export type { CentralizedColumnScheme, QueryScheme, SchemeStorageAdapter, Scheme
|
|
|
33
33
|
export * from './adapters';
|
|
34
34
|
export * from "./readPretty";
|
|
35
35
|
export * from "./standardList";
|
|
36
|
+
export * from "./attachment";
|
|
36
37
|
export { createEntitySelect } from "./entitySelect";
|
|
37
38
|
export { default as ExportButton, buildExportUrl, DEFAULT_EXPORT_TEMPLATE_API, resolveExportAction, resolveExportError, resolveFileName } from "./exportButton";
|
|
38
39
|
export type { ExportButtonProps, ExportTemplateApi, ExportTemplateOption } from "./exportButton";
|
package/dist/esm/index.js
CHANGED
|
@@ -44,6 +44,7 @@ useSchemeManager, useGridSchemes, LocalStorageSchemeAdapter, BackendApiSchemeAda
|
|
|
44
44
|
export * from "./adapters";
|
|
45
45
|
export * from "./readPretty";
|
|
46
46
|
export * from "./standardList";
|
|
47
|
+
export * from "./attachment";
|
|
47
48
|
export { createEntitySelect } from "./entitySelect";
|
|
48
49
|
export { default as ExportButton, buildExportUrl, DEFAULT_EXPORT_TEMPLATE_API, resolveExportAction, resolveExportError, resolveFileName } from "./exportButton";
|
|
49
50
|
export { saveAs } from "./utils/download";
|