@availity/mui-file-selector 1.3.1 → 1.3.2
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.d.mts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/lib/FileList.tsx +10 -10
- package/src/lib/FileSelector.tsx +5 -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
|
+
## [1.3.2](https://github.com/Availity/element/compare/@availity/mui-file-selector@1.3.1...@availity/mui-file-selector@1.3.2) (2025-03-31)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **mui-file-selector:** check if upload is defined before attempting to render CustomRow ([26d22cc](https://github.com/Availity/element/commit/26d22cc44e18ac9c0fce9ea64c2d8d6c8a4cff47))
|
|
11
|
+
* **mui-file-selector:** update customFileRow type on FileSelector ([8020d04](https://github.com/Availity/element/commit/8020d045d68b744fddd21b8f4953a4fd63c551de))
|
|
12
|
+
|
|
5
13
|
## [1.3.1](https://github.com/Availity/element/compare/@availity/mui-file-selector@1.3.0...@availity/mui-file-selector@1.3.1) (2025-03-27)
|
|
6
14
|
|
|
7
15
|
### Dependency Updates
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { MouseEvent, Dispatch, ChangeEvent, RefObject, ReactNode
|
|
2
|
+
import { MouseEvent, Dispatch, ChangeEvent, RefObject, ReactNode } from 'react';
|
|
3
3
|
import { DropEvent, FileRejection, FileError, DropzoneInputProps } from 'react-dropzone';
|
|
4
4
|
import Upload, { UploadOptions } from '@availity/upload-core';
|
|
5
5
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
@@ -205,7 +205,11 @@ type FileSelectorProps = {
|
|
|
205
205
|
/**
|
|
206
206
|
* Componet to render the File information. This should return a `ListItem`
|
|
207
207
|
*/
|
|
208
|
-
customFileRow?: ElementType<
|
|
208
|
+
customFileRow?: React.ElementType<{
|
|
209
|
+
upload?: Upload;
|
|
210
|
+
options: Options;
|
|
211
|
+
onRemoveFile: (id: string, upload: Upload) => void;
|
|
212
|
+
}>;
|
|
209
213
|
/**
|
|
210
214
|
* Whether to use the cloud upload endpoint
|
|
211
215
|
* When true, uses '/cloud/web/appl/vault/upload/v1/resumable'
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { MouseEvent, Dispatch, ChangeEvent, RefObject, ReactNode
|
|
2
|
+
import { MouseEvent, Dispatch, ChangeEvent, RefObject, ReactNode } from 'react';
|
|
3
3
|
import { DropEvent, FileRejection, FileError, DropzoneInputProps } from 'react-dropzone';
|
|
4
4
|
import Upload, { UploadOptions } from '@availity/upload-core';
|
|
5
5
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
@@ -205,7 +205,11 @@ type FileSelectorProps = {
|
|
|
205
205
|
/**
|
|
206
206
|
* Componet to render the File information. This should return a `ListItem`
|
|
207
207
|
*/
|
|
208
|
-
customFileRow?: ElementType<
|
|
208
|
+
customFileRow?: React.ElementType<{
|
|
209
|
+
upload?: Upload;
|
|
210
|
+
options: Options;
|
|
211
|
+
onRemoveFile: (id: string, upload: Upload) => void;
|
|
212
|
+
}>;
|
|
209
213
|
/**
|
|
210
214
|
* Whether to use the cloud upload endpoint
|
|
211
215
|
* When true, uses '/cloud/web/appl/vault/upload/v1/resumable'
|
package/dist/index.js
CHANGED
|
@@ -692,8 +692,8 @@ var FileRow = ({
|
|
|
692
692
|
}) => {
|
|
693
693
|
const Icon = getFileExtIcon(file.name);
|
|
694
694
|
const { data: upload } = useUploadCore(file, options, queryOptions);
|
|
695
|
-
if (CustomRow) return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CustomRow, { upload, options, onRemoveFile });
|
|
696
695
|
if (!upload) return null;
|
|
696
|
+
if (CustomRow) return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CustomRow, { upload, options, onRemoveFile });
|
|
697
697
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
698
698
|
import_mui_list3.ListItem,
|
|
699
699
|
{
|
package/dist/index.mjs
CHANGED
|
@@ -667,8 +667,8 @@ var FileRow = ({
|
|
|
667
667
|
}) => {
|
|
668
668
|
const Icon = getFileExtIcon(file.name);
|
|
669
669
|
const { data: upload } = useUploadCore(file, options, queryOptions);
|
|
670
|
-
if (CustomRow) return /* @__PURE__ */ jsx11(CustomRow, { upload, options, onRemoveFile });
|
|
671
670
|
if (!upload) return null;
|
|
671
|
+
if (CustomRow) return /* @__PURE__ */ jsx11(CustomRow, { upload, options, onRemoveFile });
|
|
672
672
|
return /* @__PURE__ */ jsxs8(
|
|
673
673
|
ListItem2,
|
|
674
674
|
{
|
package/package.json
CHANGED
package/src/lib/FileList.tsx
CHANGED
|
@@ -53,10 +53,10 @@ export const FileRow = ({
|
|
|
53
53
|
|
|
54
54
|
const { data: upload } = useUploadCore(file, options, queryOptions);
|
|
55
55
|
|
|
56
|
-
if (CustomRow) return <CustomRow upload={upload} options={options} onRemoveFile={onRemoveFile} />;
|
|
57
|
-
|
|
58
56
|
if (!upload) return null;
|
|
59
57
|
|
|
58
|
+
if (CustomRow) return <CustomRow upload={upload} options={options} onRemoveFile={onRemoveFile} />;
|
|
59
|
+
|
|
60
60
|
return (
|
|
61
61
|
<ListItem
|
|
62
62
|
disableGutters
|
|
@@ -74,19 +74,19 @@ export const FileRow = ({
|
|
|
74
74
|
)
|
|
75
75
|
}
|
|
76
76
|
>
|
|
77
|
-
<Grid container spacing={2} alignItems="center" justifyContent="space-between" width="100%"
|
|
78
|
-
<Grid size={{ xs:
|
|
79
|
-
<ListItemIcon sx={{minWidth: '1.5rem'}}>
|
|
77
|
+
<Grid container spacing={2} alignItems="center" justifyContent="space-between" width="100%" flexWrap="wrap">
|
|
78
|
+
<Grid size={{ xs: 'auto' }}>
|
|
79
|
+
<ListItemIcon sx={{ minWidth: '1.5rem' }}>
|
|
80
80
|
<Icon />
|
|
81
81
|
</ListItemIcon>
|
|
82
82
|
</Grid>
|
|
83
|
-
<Grid size={{ xs: 4 }} sx={{minWidth: '8rem'}}>
|
|
84
|
-
<ListItemText sx={{wordBreak: 'break-all'}}>{upload.trimFileName(upload.file.name)}</ListItemText>
|
|
83
|
+
<Grid size={{ xs: 4 }} sx={{ minWidth: '8rem' }}>
|
|
84
|
+
<ListItemText sx={{ wordBreak: 'break-all' }}>{upload.trimFileName(upload.file.name)}</ListItemText>
|
|
85
85
|
</Grid>
|
|
86
|
-
<Grid size={{ xs: 2 }} sx={{minWidth: '3rem'}}>
|
|
87
|
-
<ListItemText sx={{textAlign: 'end'}}>{formatBytes(upload.file.size)}</ListItemText>
|
|
86
|
+
<Grid size={{ xs: 2 }} sx={{ minWidth: '3rem' }}>
|
|
87
|
+
<ListItemText sx={{ textAlign: 'end' }}>{formatBytes(upload.file.size)}</ListItemText>
|
|
88
88
|
</Grid>
|
|
89
|
-
<Grid size={{ xs: 'grow' }} sx={{minWidth: '6rem'}}>
|
|
89
|
+
<Grid size={{ xs: 'grow' }} sx={{ minWidth: '6rem' }}>
|
|
90
90
|
<UploadProgressBar upload={upload} />
|
|
91
91
|
</Grid>
|
|
92
92
|
</Grid>
|
package/src/lib/FileSelector.tsx
CHANGED
|
@@ -66,7 +66,11 @@ export type FileSelectorProps = {
|
|
|
66
66
|
/**
|
|
67
67
|
* Componet to render the File information. This should return a `ListItem`
|
|
68
68
|
*/
|
|
69
|
-
customFileRow?: ElementType<
|
|
69
|
+
customFileRow?: React.ElementType<{
|
|
70
|
+
upload?: Upload;
|
|
71
|
+
options: Options;
|
|
72
|
+
onRemoveFile: (id: string, upload: Upload) => void;
|
|
73
|
+
}>;
|
|
70
74
|
/**
|
|
71
75
|
* Whether to use the cloud upload endpoint
|
|
72
76
|
* When true, uses '/cloud/web/appl/vault/upload/v1/resumable'
|