Fix/input file types (#2021)
* fix: lion-selected-filelist, restored composed: true and bubbles: true for 'file-remove-requested' event, otherwise removing files for subclassers won't work * chore: exported correct types for lion-input-file * fix: fixed type errors
This commit is contained in:
parent
91b582d8c9
commit
0745ce8526
4 changed files with 11 additions and 9 deletions
|
|
@ -427,13 +427,15 @@ export class LionInputFile extends ScopedElementsMixin(LocalizeMixin(LionField))
|
||||||
// eslint-disable-next-line no-param-reassign
|
// eslint-disable-next-line no-param-reassign
|
||||||
file.validationFeedback = [
|
file.validationFeedback = [
|
||||||
{
|
{
|
||||||
type: response.errorMessage?.length > 0 ? 'error' : 'success',
|
type:
|
||||||
message: response.errorMessage,
|
typeof response.errorMessage === 'string' && response.errorMessage?.length > 0
|
||||||
|
? 'error'
|
||||||
|
: 'success',
|
||||||
|
message: response.errorMessage ?? '',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// this._selectedFilesMetaData = [...this._selectedFilesMetaData];
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { FeedbackMessage } from "../../form-core/types/validate/ValidateMixinTypes.js";
|
import { FeedbackMessage } from "../../form-core/types/validate/ValidateMixinTypes.js";
|
||||||
|
|
||||||
type FileBasics = {
|
export type FileBasics = {
|
||||||
name: string;
|
name: string;
|
||||||
/** size in bytes */
|
/** size in bytes */
|
||||||
size: number;
|
size: number;
|
||||||
|
|
@ -10,7 +10,7 @@ type FileBasics = {
|
||||||
|
|
||||||
export type InputFile = {
|
export type InputFile = {
|
||||||
downloadUrl?: string;
|
downloadUrl?: string;
|
||||||
errorMessage?: FeedbackMessage.message;
|
errorMessage?: FeedbackMessage["message"];
|
||||||
failedProp?: Array<string|number>;
|
failedProp?: Array<string|number>;
|
||||||
response?: UploadResponse;
|
response?: UploadResponse;
|
||||||
systemFile: Partial<SystemFile>;
|
systemFile: Partial<SystemFile>;
|
||||||
|
|
@ -19,7 +19,7 @@ export type InputFile = {
|
||||||
|
|
||||||
export type SystemFile = {
|
export type SystemFile = {
|
||||||
downloadUrl?: string;
|
downloadUrl?: string;
|
||||||
errorMessage?: FeedbackMessage.message;
|
errorMessage?: FeedbackMessage["message"];
|
||||||
failedProp?: Array<string|number>;
|
failedProp?: Array<string|number>;
|
||||||
response?: UploadResponse;
|
response?: UploadResponse;
|
||||||
} & FileBasics & Partial<File>;
|
} & FileBasics & Partial<File>;
|
||||||
|
|
@ -27,6 +27,6 @@ export type SystemFile = {
|
||||||
|
|
||||||
export type UploadResponse = {
|
export type UploadResponse = {
|
||||||
downloadUrl?: string;
|
downloadUrl?: string;
|
||||||
errorMessage?: FeedbackMessage.message;
|
errorMessage?: FeedbackMessage["message"];
|
||||||
id?: string;
|
id?: string;
|
||||||
} & Partial<FileBasics>;
|
} & Partial<FileBasics>;
|
||||||
|
|
@ -14,5 +14,4 @@ export { FormRegistrarHost } from '../../components/form-core/types/registration
|
||||||
export { ElementWithParentFormGroup } from '../../components/form-core/types/registration/FormRegistrarMixinTypes.js';
|
export { ElementWithParentFormGroup } from '../../components/form-core/types/registration/FormRegistrarMixinTypes.js';
|
||||||
export { FormRegistrarPortalHost } from '../../components/form-core/types/registration/FormRegistrarPortalMixinTypes.js';
|
export { FormRegistrarPortalHost } from '../../components/form-core/types/registration/FormRegistrarPortalMixinTypes.js';
|
||||||
export { SyncUpdatableHost } from '../../components/form-core/types/utils/SyncUpdatableMixinTypes.js';
|
export { SyncUpdatableHost } from '../../components/form-core/types/utils/SyncUpdatableMixinTypes.js';
|
||||||
export { ValidateHost } from '../../components/form-core/types/validate/ValidateMixinTypes.js';
|
export { ValidateHost, ValidationType, FeedbackMessage } from '../../components/form-core/types/validate/ValidateMixinTypes.js';
|
||||||
export { ValidationType } from '../../components/form-core/types/validate/ValidateMixinTypes.js';
|
|
||||||
|
|
|
||||||
1
packages/ui/exports/types/input-file.ts
Normal file
1
packages/ui/exports/types/input-file.ts
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
export { InputFile, SystemFile } from '../../components/input-file/types/input-file.js'
|
||||||
Loading…
Reference in a new issue