@availity/mui-file-selector 1.9.1 → 2.0.0
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 +29 -0
- package/dist/index.d.mts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/package.json +16 -16
- package/src/lib/FileList.tsx +1 -1
- package/src/lib/FileList2.tsx +1 -1
- package/src/lib/FilePickerBtn.tsx +1 -1
- package/src/lib/FileSelector.stories.tsx +1 -2
- package/src/lib/FileSelector.tsx +4 -4
- package/src/lib/FileSelector2.stories.tsx +0 -1
- package/src/lib/FileSelector2.tsx +3 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [2.0.0](https://github.com/Availity/element/compare/@availity/mui-file-selector@1.9.1...@availity/mui-file-selector@2.0.0) (2025-11-17)
|
|
6
|
+
|
|
7
|
+
### Dependency Updates
|
|
8
|
+
|
|
9
|
+
* `mui-paper` updated to version `1.9.1`
|
|
10
|
+
* `mui-alert` updated to version `1.9.1`
|
|
11
|
+
* `mui-button` updated to version `1.9.1`
|
|
12
|
+
* `mui-divider` updated to version `1.9.1`
|
|
13
|
+
* `mui-form-utils` updated to version `1.9.1`
|
|
14
|
+
* `mui-icon` updated to version `1.9.1`
|
|
15
|
+
* `mui-layout` updated to version `1.9.1`
|
|
16
|
+
* `mui-list` updated to version `1.9.1`
|
|
17
|
+
* `mui-progress` updated to version `1.9.1`
|
|
18
|
+
* `mui-typography` updated to version `1.9.1`
|
|
19
|
+
* `mui-dialog` updated to version `1.9.1`
|
|
20
|
+
* `mui-textfield` updated to version `1.9.1`
|
|
21
|
+
|
|
22
|
+
### ⚠ BREAKING CHANGES
|
|
23
|
+
|
|
24
|
+
* **mui-file-selector:** use cloud upload endpoint by default
|
|
25
|
+
* @mui/material upgraded to v7
|
|
26
|
+
* @mui/x-* upgraded to v8
|
|
27
|
+
* react upgraded to v19
|
|
28
|
+
|
|
29
|
+
### Features
|
|
30
|
+
|
|
31
|
+
* **mui-file-selector:** set isCloud to true by default ([8d5c45a](https://github.com/Availity/element/commit/8d5c45ae3a55865ef4b943d3e7f2dff2a61c868d))
|
|
32
|
+
* upgrade material and react dependencies ([51602a4](https://github.com/Availity/element/commit/51602a48c5304db6f61e2c7e772c9a3a4aa3f65c))
|
|
33
|
+
|
|
5
34
|
## [1.9.1](https://github.com/Availity/element/compare/@availity/mui-file-selector@1.9.0...@availity/mui-file-selector@1.9.1) (2025-10-30)
|
|
6
35
|
|
|
7
36
|
### Dependency Updates
|
package/dist/index.d.mts
CHANGED
|
@@ -176,7 +176,7 @@ type FileListProps = {
|
|
|
176
176
|
*/
|
|
177
177
|
files: File[];
|
|
178
178
|
} & Omit<FileRowProps, 'file'>;
|
|
179
|
-
declare const FileList: ({ files, options, onRemoveFile, queryOptions, customFileRow, disableRemove, }: FileListProps) => JSX.Element | null;
|
|
179
|
+
declare const FileList: ({ files, options, onRemoveFile, queryOptions, customFileRow, disableRemove, }: FileListProps) => React.JSX.Element | null;
|
|
180
180
|
|
|
181
181
|
type FileRow2Props = Omit<FileRowProps, 'file' | 'queryOptions'> & {
|
|
182
182
|
/**
|
|
@@ -206,7 +206,7 @@ type FileList2Props = Omit<FileListProps, 'files'> & {
|
|
|
206
206
|
*
|
|
207
207
|
* `<FileList2 />` replaces the `files` prop with the `uploads` prop.
|
|
208
208
|
*/
|
|
209
|
-
declare const FileList2: ({ uploads, options, onRemoveFile, customFileRow, disableRemove, }: FileList2Props) => JSX.Element | null;
|
|
209
|
+
declare const FileList2: ({ uploads, options, onRemoveFile, customFileRow, disableRemove, }: FileList2Props) => React.JSX.Element | null;
|
|
210
210
|
|
|
211
211
|
type FilePickerBtnProps = {
|
|
212
212
|
/**
|
|
@@ -225,7 +225,7 @@ type FilePickerBtnProps = {
|
|
|
225
225
|
* Additional props to customize the underlying input element.
|
|
226
226
|
*/
|
|
227
227
|
inputProps?: DropzoneInputProps & {
|
|
228
|
-
ref?: RefObject<HTMLInputElement>;
|
|
228
|
+
ref?: RefObject<HTMLInputElement | null>;
|
|
229
229
|
};
|
|
230
230
|
/**
|
|
231
231
|
* Maximum allowed size per file in bytes. Files exceeding this size will be rejected.
|
|
@@ -304,6 +304,7 @@ type FileSelectorProps = {
|
|
|
304
304
|
/**
|
|
305
305
|
* Whether to use the cloud upload endpoint
|
|
306
306
|
* When true, uses '/cloud/web/appl/vault/upload/v1/resumable'
|
|
307
|
+
* @default true
|
|
307
308
|
*/
|
|
308
309
|
isCloud?: boolean;
|
|
309
310
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -176,7 +176,7 @@ type FileListProps = {
|
|
|
176
176
|
*/
|
|
177
177
|
files: File[];
|
|
178
178
|
} & Omit<FileRowProps, 'file'>;
|
|
179
|
-
declare const FileList: ({ files, options, onRemoveFile, queryOptions, customFileRow, disableRemove, }: FileListProps) => JSX.Element | null;
|
|
179
|
+
declare const FileList: ({ files, options, onRemoveFile, queryOptions, customFileRow, disableRemove, }: FileListProps) => React.JSX.Element | null;
|
|
180
180
|
|
|
181
181
|
type FileRow2Props = Omit<FileRowProps, 'file' | 'queryOptions'> & {
|
|
182
182
|
/**
|
|
@@ -206,7 +206,7 @@ type FileList2Props = Omit<FileListProps, 'files'> & {
|
|
|
206
206
|
*
|
|
207
207
|
* `<FileList2 />` replaces the `files` prop with the `uploads` prop.
|
|
208
208
|
*/
|
|
209
|
-
declare const FileList2: ({ uploads, options, onRemoveFile, customFileRow, disableRemove, }: FileList2Props) => JSX.Element | null;
|
|
209
|
+
declare const FileList2: ({ uploads, options, onRemoveFile, customFileRow, disableRemove, }: FileList2Props) => React.JSX.Element | null;
|
|
210
210
|
|
|
211
211
|
type FilePickerBtnProps = {
|
|
212
212
|
/**
|
|
@@ -225,7 +225,7 @@ type FilePickerBtnProps = {
|
|
|
225
225
|
* Additional props to customize the underlying input element.
|
|
226
226
|
*/
|
|
227
227
|
inputProps?: DropzoneInputProps & {
|
|
228
|
-
ref?: RefObject<HTMLInputElement>;
|
|
228
|
+
ref?: RefObject<HTMLInputElement | null>;
|
|
229
229
|
};
|
|
230
230
|
/**
|
|
231
231
|
* Maximum allowed size per file in bytes. Files exceeding this size will be rejected.
|
|
@@ -304,6 +304,7 @@ type FileSelectorProps = {
|
|
|
304
304
|
/**
|
|
305
305
|
* Whether to use the cloud upload endpoint
|
|
306
306
|
* When true, uses '/cloud/web/appl/vault/upload/v1/resumable'
|
|
307
|
+
* @default true
|
|
307
308
|
*/
|
|
308
309
|
isCloud?: boolean;
|
|
309
310
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1267,7 +1267,7 @@ var FileSelector = ({
|
|
|
1267
1267
|
disabled = false,
|
|
1268
1268
|
enableDropArea = true,
|
|
1269
1269
|
endpoint,
|
|
1270
|
-
isCloud,
|
|
1270
|
+
isCloud = true,
|
|
1271
1271
|
label = "Upload file",
|
|
1272
1272
|
maxFiles,
|
|
1273
1273
|
maxSize,
|
|
@@ -1294,7 +1294,7 @@ var FileSelector = ({
|
|
|
1294
1294
|
allowedFileNameCharacters
|
|
1295
1295
|
});
|
|
1296
1296
|
if (endpoint) options.endpoint = endpoint;
|
|
1297
|
-
if (isCloud) options.endpoint = CLOUD_URL;
|
|
1297
|
+
else if (isCloud) options.endpoint = CLOUD_URL;
|
|
1298
1298
|
const handleOnRemoveFile = (uploadId, upload) => {
|
|
1299
1299
|
const prevFiles = formMethods.getValues(name);
|
|
1300
1300
|
const newFiles = prevFiles.filter((file) => file.name !== upload.file.name);
|
|
@@ -1452,7 +1452,7 @@ var FileSelector2 = ({
|
|
|
1452
1452
|
disabled = false,
|
|
1453
1453
|
enableDropArea = true,
|
|
1454
1454
|
endpoint,
|
|
1455
|
-
isCloud,
|
|
1455
|
+
isCloud = true,
|
|
1456
1456
|
label = "Upload file",
|
|
1457
1457
|
maxFiles,
|
|
1458
1458
|
maxSize,
|
|
@@ -1477,7 +1477,7 @@ var FileSelector2 = ({
|
|
|
1477
1477
|
allowedFileNameCharacters
|
|
1478
1478
|
});
|
|
1479
1479
|
if (endpoint) options.endpoint = endpoint;
|
|
1480
|
-
if (isCloud) options.endpoint = CLOUD_URL;
|
|
1480
|
+
else if (isCloud) options.endpoint = CLOUD_URL;
|
|
1481
1481
|
const handleOnRemoveFile = (uploadId, upload) => {
|
|
1482
1482
|
const prevFiles = formMethods.getValues(name);
|
|
1483
1483
|
const newFiles = prevFiles.filter((prev) => prev.file.name !== upload.file.name);
|
package/dist/index.mjs
CHANGED
|
@@ -1232,7 +1232,7 @@ var FileSelector = ({
|
|
|
1232
1232
|
disabled = false,
|
|
1233
1233
|
enableDropArea = true,
|
|
1234
1234
|
endpoint,
|
|
1235
|
-
isCloud,
|
|
1235
|
+
isCloud = true,
|
|
1236
1236
|
label = "Upload file",
|
|
1237
1237
|
maxFiles,
|
|
1238
1238
|
maxSize,
|
|
@@ -1259,7 +1259,7 @@ var FileSelector = ({
|
|
|
1259
1259
|
allowedFileNameCharacters
|
|
1260
1260
|
});
|
|
1261
1261
|
if (endpoint) options.endpoint = endpoint;
|
|
1262
|
-
if (isCloud) options.endpoint = CLOUD_URL;
|
|
1262
|
+
else if (isCloud) options.endpoint = CLOUD_URL;
|
|
1263
1263
|
const handleOnRemoveFile = (uploadId, upload) => {
|
|
1264
1264
|
const prevFiles = formMethods.getValues(name);
|
|
1265
1265
|
const newFiles = prevFiles.filter((file) => file.name !== upload.file.name);
|
|
@@ -1417,7 +1417,7 @@ var FileSelector2 = ({
|
|
|
1417
1417
|
disabled = false,
|
|
1418
1418
|
enableDropArea = true,
|
|
1419
1419
|
endpoint,
|
|
1420
|
-
isCloud,
|
|
1420
|
+
isCloud = true,
|
|
1421
1421
|
label = "Upload file",
|
|
1422
1422
|
maxFiles,
|
|
1423
1423
|
maxSize,
|
|
@@ -1442,7 +1442,7 @@ var FileSelector2 = ({
|
|
|
1442
1442
|
allowedFileNameCharacters
|
|
1443
1443
|
});
|
|
1444
1444
|
if (endpoint) options.endpoint = endpoint;
|
|
1445
|
-
if (isCloud) options.endpoint = CLOUD_URL;
|
|
1445
|
+
else if (isCloud) options.endpoint = CLOUD_URL;
|
|
1446
1446
|
const handleOnRemoveFile = (uploadId, upload) => {
|
|
1447
1447
|
const prevFiles = formMethods.getValues(name);
|
|
1448
1448
|
const newFiles = prevFiles.filter((prev) => prev.file.name !== upload.file.name);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@availity/mui-file-selector",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Availity MUI file-selector Component - part of the @availity/element design system",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -41,15 +41,15 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@availity/api-axios": "^11.0.0",
|
|
44
|
-
"@availity/mui-alert": "^
|
|
45
|
-
"@availity/mui-button": "^
|
|
46
|
-
"@availity/mui-divider": "^
|
|
47
|
-
"@availity/mui-form-utils": "^
|
|
48
|
-
"@availity/mui-icon": "^
|
|
49
|
-
"@availity/mui-layout": "^
|
|
50
|
-
"@availity/mui-list": "^
|
|
51
|
-
"@availity/mui-progress": "^
|
|
52
|
-
"@availity/mui-typography": "^
|
|
44
|
+
"@availity/mui-alert": "^2.0.0",
|
|
45
|
+
"@availity/mui-button": "^2.0.0",
|
|
46
|
+
"@availity/mui-divider": "^2.0.0",
|
|
47
|
+
"@availity/mui-form-utils": "^2.0.0",
|
|
48
|
+
"@availity/mui-icon": "^2.0.0",
|
|
49
|
+
"@availity/mui-layout": "^2.0.0",
|
|
50
|
+
"@availity/mui-list": "^2.0.0",
|
|
51
|
+
"@availity/mui-progress": "^2.0.0",
|
|
52
|
+
"@availity/mui-typography": "^2.0.0",
|
|
53
53
|
"@availity/upload-core": "^8.0.0",
|
|
54
54
|
"@tanstack/react-query": "^4.36.1",
|
|
55
55
|
"react-dropzone": "^11.7.1",
|
|
@@ -58,16 +58,16 @@
|
|
|
58
58
|
"uuid": "^9.0.1"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@availity/mui-paper": "^
|
|
62
|
-
"@mui/material": "^
|
|
63
|
-
"react": "
|
|
64
|
-
"react-dom": "
|
|
61
|
+
"@availity/mui-paper": "^2.0.0",
|
|
62
|
+
"@mui/material": "^7.3.4",
|
|
63
|
+
"react": "19.2.0",
|
|
64
|
+
"react-dom": "19.2.0",
|
|
65
65
|
"tsup": "^8.4.0",
|
|
66
66
|
"typescript": "^5.4.5"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@mui/material": "^
|
|
70
|
-
"react": ">=
|
|
69
|
+
"@mui/material": "^7.0.0",
|
|
70
|
+
"react": ">=17.0.0"
|
|
71
71
|
},
|
|
72
72
|
"publishConfig": {
|
|
73
73
|
"access": "public"
|
package/src/lib/FileList.tsx
CHANGED
package/src/lib/FileList2.tsx
CHANGED
|
@@ -20,7 +20,7 @@ export type FilePickerBtnProps = {
|
|
|
20
20
|
/**
|
|
21
21
|
* Additional props to customize the underlying input element.
|
|
22
22
|
*/
|
|
23
|
-
inputProps?: DropzoneInputProps & { ref?: RefObject<HTMLInputElement> };
|
|
23
|
+
inputProps?: DropzoneInputProps & { ref?: RefObject<HTMLInputElement | null> };
|
|
24
24
|
/**
|
|
25
25
|
* Maximum allowed size per file in bytes. Files exceeding this size will be rejected.
|
|
26
26
|
*/
|
|
@@ -17,7 +17,7 @@ const meta: Meta<typeof FileSelector> = {
|
|
|
17
17
|
component: FileSelector,
|
|
18
18
|
tags: ['autodocs'],
|
|
19
19
|
decorators: [
|
|
20
|
-
(Story: () => JSX.Element) => (
|
|
20
|
+
(Story: () => React.JSX.Element) => (
|
|
21
21
|
<QueryClientProvider
|
|
22
22
|
client={
|
|
23
23
|
new QueryClient({
|
|
@@ -45,7 +45,6 @@ const meta: Meta<typeof FileSelector> = {
|
|
|
45
45
|
maxFiles: 2,
|
|
46
46
|
maxSize: 1 * 1024 * 1024, // 1MB
|
|
47
47
|
enableDropArea: true,
|
|
48
|
-
isCloud: true,
|
|
49
48
|
multiple: true,
|
|
50
49
|
},
|
|
51
50
|
argTypes: {
|
package/src/lib/FileSelector.tsx
CHANGED
|
@@ -87,6 +87,7 @@ export type FileSelectorProps = {
|
|
|
87
87
|
/**
|
|
88
88
|
* Whether to use the cloud upload endpoint
|
|
89
89
|
* When true, uses '/cloud/web/appl/vault/upload/v1/resumable'
|
|
90
|
+
* @default true
|
|
90
91
|
*/
|
|
91
92
|
isCloud?: boolean;
|
|
92
93
|
/**
|
|
@@ -163,7 +164,7 @@ export const FileSelector = ({
|
|
|
163
164
|
disabled = false,
|
|
164
165
|
enableDropArea = true,
|
|
165
166
|
endpoint,
|
|
166
|
-
isCloud,
|
|
167
|
+
isCloud = true,
|
|
167
168
|
label = 'Upload file',
|
|
168
169
|
maxFiles,
|
|
169
170
|
maxSize,
|
|
@@ -193,10 +194,9 @@ export const FileSelector = ({
|
|
|
193
194
|
allowedFileNameCharacters,
|
|
194
195
|
};
|
|
195
196
|
|
|
196
|
-
// Endpoint is set by default in upload-core so check if it exists before passing `undefined`
|
|
197
|
+
// Endpoint is set by default in upload-core so check if it exists or using cloud url before passing `undefined`
|
|
197
198
|
if (endpoint) options.endpoint = endpoint;
|
|
198
|
-
|
|
199
|
-
if (isCloud) options.endpoint = CLOUD_URL;
|
|
199
|
+
else if (isCloud) options.endpoint = CLOUD_URL;
|
|
200
200
|
|
|
201
201
|
const handleOnRemoveFile = (uploadId: string, upload: Upload) => {
|
|
202
202
|
const prevFiles: File[] = formMethods.getValues(name);
|
|
@@ -44,7 +44,7 @@ export const FileSelector2 = ({
|
|
|
44
44
|
disabled = false,
|
|
45
45
|
enableDropArea = true,
|
|
46
46
|
endpoint,
|
|
47
|
-
isCloud,
|
|
47
|
+
isCloud = true,
|
|
48
48
|
label = 'Upload file',
|
|
49
49
|
maxFiles,
|
|
50
50
|
maxSize,
|
|
@@ -72,10 +72,9 @@ export const FileSelector2 = ({
|
|
|
72
72
|
allowedFileNameCharacters,
|
|
73
73
|
};
|
|
74
74
|
|
|
75
|
-
// Endpoint is set by default in upload-core so check if it exists before passing `undefined`
|
|
75
|
+
// Endpoint is set by default in upload-core so check if it exists or using cloud url before passing `undefined`
|
|
76
76
|
if (endpoint) options.endpoint = endpoint;
|
|
77
|
-
|
|
78
|
-
if (isCloud) options.endpoint = CLOUD_URL;
|
|
77
|
+
else if (isCloud) options.endpoint = CLOUD_URL;
|
|
79
78
|
|
|
80
79
|
const handleOnRemoveFile = (uploadId: string, upload: Upload) => {
|
|
81
80
|
const prevFiles: Upload[] = formMethods.getValues(name);
|