@availity/mui-file-selector 0.2.4 → 0.2.5
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/CHANGELOG.md +8 -0
- package/dist/index.js +26 -3
- package/dist/index.mjs +26 -3
- package/package.json +2 -2
- package/src/lib/useUploadCore.tsx +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.2.5](https://github.com/Availity/element/compare/@availity/mui-file-selector@0.2.4...@availity/mui-file-selector@0.2.5) (2025-01-07)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* bump upload-core ([60dc9a3](https://github.com/Availity/element/commit/60dc9a38f27aa93098d593efcd20026b39a2b7d7))
|
|
11
|
+
* generate id before starting ([3514684](https://github.com/Availity/element/commit/3514684dfb9ca218d8d320c43235d4a0866d31a4))
|
|
12
|
+
|
|
5
13
|
## [0.2.4](https://github.com/Availity/element/compare/@availity/mui-file-selector@0.2.3...@availity/mui-file-selector@0.2.4) (2025-01-06)
|
|
6
14
|
|
|
7
15
|
### Dependency Updates
|
package/dist/index.js
CHANGED
|
@@ -55,6 +55,26 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
55
55
|
mod
|
|
56
56
|
));
|
|
57
57
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
58
|
+
var __async = (__this, __arguments, generator) => {
|
|
59
|
+
return new Promise((resolve, reject) => {
|
|
60
|
+
var fulfilled = (value) => {
|
|
61
|
+
try {
|
|
62
|
+
step(generator.next(value));
|
|
63
|
+
} catch (e) {
|
|
64
|
+
reject(e);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
var rejected = (value) => {
|
|
68
|
+
try {
|
|
69
|
+
step(generator.throw(value));
|
|
70
|
+
} catch (e) {
|
|
71
|
+
reject(e);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
75
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
76
|
+
});
|
|
77
|
+
};
|
|
58
78
|
|
|
59
79
|
// src/index.ts
|
|
60
80
|
var src_exports = {};
|
|
@@ -359,9 +379,12 @@ var getFileExtIcon = (fileName) => {
|
|
|
359
379
|
var import_react_query = require("@tanstack/react-query");
|
|
360
380
|
var import_upload_core = __toESM(require("@availity/upload-core"));
|
|
361
381
|
function startUpload(file, options) {
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
382
|
+
return __async(this, null, function* () {
|
|
383
|
+
const upload = new import_upload_core.default(file, options);
|
|
384
|
+
yield upload.generateId();
|
|
385
|
+
upload.start();
|
|
386
|
+
return upload;
|
|
387
|
+
});
|
|
365
388
|
}
|
|
366
389
|
function useUploadCore(file, options) {
|
|
367
390
|
const isQueryEnabled = !!file;
|
package/dist/index.mjs
CHANGED
|
@@ -29,6 +29,26 @@ var __objRest = (source, exclude) => {
|
|
|
29
29
|
}
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
|
+
var __async = (__this, __arguments, generator) => {
|
|
33
|
+
return new Promise((resolve, reject) => {
|
|
34
|
+
var fulfilled = (value) => {
|
|
35
|
+
try {
|
|
36
|
+
step(generator.next(value));
|
|
37
|
+
} catch (e) {
|
|
38
|
+
reject(e);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
var rejected = (value) => {
|
|
42
|
+
try {
|
|
43
|
+
step(generator.throw(value));
|
|
44
|
+
} catch (e) {
|
|
45
|
+
reject(e);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
49
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
50
|
+
});
|
|
51
|
+
};
|
|
32
52
|
|
|
33
53
|
// src/lib/FileSelector.tsx
|
|
34
54
|
import { useState as useState2 } from "react";
|
|
@@ -336,9 +356,12 @@ var getFileExtIcon = (fileName) => {
|
|
|
336
356
|
import { useQuery } from "@tanstack/react-query";
|
|
337
357
|
import Upload from "@availity/upload-core";
|
|
338
358
|
function startUpload(file, options) {
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
359
|
+
return __async(this, null, function* () {
|
|
360
|
+
const upload = new Upload(file, options);
|
|
361
|
+
yield upload.generateId();
|
|
362
|
+
upload.start();
|
|
363
|
+
return upload;
|
|
364
|
+
});
|
|
342
365
|
}
|
|
343
366
|
function useUploadCore(file, options) {
|
|
344
367
|
const isQueryEnabled = !!file;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@availity/mui-file-selector",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "Availity MUI file-selector Component - part of the @availity/element design system",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@availity/mui-list": "^0.2.4",
|
|
43
43
|
"@availity/mui-progress": "^0.4.3",
|
|
44
44
|
"@availity/mui-typography": "^0.2.1",
|
|
45
|
-
"@availity/upload-core": "7.0.0-alpha.
|
|
45
|
+
"@availity/upload-core": "7.0.0-alpha.6",
|
|
46
46
|
"@tanstack/react-query": "^4.36.1",
|
|
47
47
|
"react-dropzone": "^11.7.1",
|
|
48
48
|
"react-hook-form": "^7.51.3",
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { useQuery } from '@tanstack/react-query';
|
|
2
2
|
import Upload, { UploadOptions } from '@availity/upload-core';
|
|
3
3
|
|
|
4
|
-
function startUpload(file: File, options: UploadOptions) {
|
|
4
|
+
async function startUpload(file: File, options: UploadOptions) {
|
|
5
5
|
const upload = new Upload(file, options);
|
|
6
6
|
|
|
7
|
+
await upload.generateId();
|
|
8
|
+
|
|
7
9
|
upload.start();
|
|
8
10
|
|
|
9
11
|
return upload;
|