@lion/ui
Version:
A package of extendable web components
258 lines • 8.23 kB
TypeScript
declare const LionInputFile_base: typeof LionField & import("@open-wc/dedupe-mixin").Constructor<import("../../localize/types/LocalizeMixinTypes.js").LocalizeMixinHost> & Pick<typeof import("../../localize/types/LocalizeMixinTypes.js").LocalizeMixinHost, "prototype" | "localizeNamespaces" | "waitForLocalizeNamespaces"> & Pick<typeof import("lit").LitElement, typeof Symbol.metadata | "prototype" | "_$litElement$" | "enabledWarnings" | "enableWarning" | "disableWarning" | "addInitializer" | "_initializers" | "elementProperties" | "properties" | "elementStyles" | "styles" | "observedAttributes" | "createProperty" | "getPropertyOptions" | "shadowRootOptions"> & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/lit-element.js").ScopedElementsHost> & import("../../core/src/types.js").ScopedElementsHostV2Constructor;
/**
* LionInputFile: A file input component
* This component allows users to select files, displays selected files, and handles file uploads.
*
* @slot file-select-button - [private] The button to open the file dialog
* @slot selected-file-list - [private] The list of selected files
*
* @customElement lion-input-file
*/
export class LionInputFile extends LionInputFile_base {
static get scopedElements(): {
'lion-selected-file-list': typeof LionSelectedFileList;
};
static get properties(): {
accept: {
type: StringConstructor;
};
multiple: {
type: BooleanConstructor;
reflect: boolean;
};
buttonLabel: {
type: StringConstructor;
attribute: string;
};
maxFileSize: {
type: NumberConstructor;
attribute: string;
};
enableDropZone: {
type: BooleanConstructor;
attribute: string;
};
uploadOnSelect: {
type: BooleanConstructor;
attribute: string;
};
isDragging: {
type: BooleanConstructor;
attribute: string;
reflect: boolean;
};
uploadResponse: {
type: ArrayConstructor;
state: boolean;
};
_selectedFilesMetaData: {
type: ArrayConstructor;
state: boolean;
};
};
static localizeNamespaces: import("../../localize/types/LocalizeMixinTypes.js").NamespaceObject[];
static get validationTypes(): string[];
static get styles(): (import("lit").CSSResult | import("lit").CSSResultArray)[];
/**
* @configure SlotMixin
*/
get slots(): {
input: () => import("lit-html").TemplateResult<1>;
'file-select-button': () => import("lit-html").TemplateResult<1>;
after: () => import("lit-html").TemplateResult<1>;
'selected-file-list': () => {
template: import("lit-html").TemplateResult<1>;
renderAsDirectHostChild: boolean;
};
};
/**
* @type {HTMLInputElement}
* @protected
*/
protected get _inputNode(): HTMLInputElement;
/**
* @protected
*/
protected get _buttonNode(): Element | null;
/**
* @param {string} newValue
*/
set buttonLabel(arg: string);
/**
* The label of the button
* @type {string}
*/
get buttonLabel(): string;
/** @type {string} */
__buttonLabel: string | undefined;
/**
* @protected
* @configure FocusMixin
*/
protected get _focusableNode(): Element | null;
/**
* @protected
*/
protected get _isDragAndDropSupported(): boolean;
type: string;
/**
* @protected
* @type {InputFile[]}
*/
protected _selectedFilesMetaData: InputFile[];
/**
* @type {UploadResponse[]}
*/
uploadResponse: UploadResponse[];
/**
* @private
*/
private __initialUploadResponse;
uploadOnSelect: boolean;
multiple: boolean;
enableDropZone: boolean;
maxFileSize: number;
accept: string;
_initialButtonLabel: string;
/**
* @type {InputFile[]}
*/
modelValue: InputFile[];
/**
* @param {CustomEvent} ev
* @protected
*/
protected _onRemoveFile(ev: CustomEvent): void;
/** @private */
private __duplicateFileNamesValidator;
/**
* @private
* @type {FileList | null}
*/
private __previouslyParsedFiles;
/**
* @protected
* @type {LionSelectedFileList}
*/
protected get _fileListNode(): LionSelectedFileList;
connectedCallback(): void;
disconnectedCallback(): void;
get _acceptCriteria(): {
allowedFileTypes: string[];
allowedFileExtensions: string[];
maxFileSize: number;
};
/**
* @override ValidateMixin: override to hide the IsAcceptedFile feedback at component level as they are displayed at each file level in file list
* @param {string} type could be 'error', 'warning', 'info', 'success' or any other custom
* @param {object} meta meta info (interaction states etc)
* @protected
*/
protected override _showFeedbackConditionFor(type: string, meta: object): false;
/**
* @configure FormatMixin
* @returns {InputFile[]} parsedValue
*/
parser(): InputFile[];
/**
* @configure FormatMixin
* @param {InputFile[]} v - modelValue: File[]
* @returns {string} formattedValue
*/
formatter(v: InputFile[]): string;
/** @private */
private __setupDragDropEventListeners;
isDragging: boolean | undefined;
/**
* @param {import('lit').PropertyValues } changedProperties
*/
updated(changedProperties: import('lit').PropertyValues): void;
/**
* @private
* @param {InputFile[]} fileList
*/
private __computeNewAddedFiles;
/**
* @param {DragEvent} ev
* @protected
*/
protected _processDroppedFiles(ev: DragEvent): void;
/**
* Clear _inputNode.value to make sure onChange is called even for duplicate files
* @param {Event} ev
* @protected
*/
protected _onClick(ev: Event): void;
/**
* @protected
*/
protected __syncAriaLabelledByAttributesToButton(): void;
/**
* @protected
*/
protected __syncAriaDescribedByAttributesToButton(): void;
/**
* @private
*/
private __setupFileValidators;
/**
* Runs on drag or change event
*
* @param {InputFile[]} selectedFiles
* @protected
*/
protected _processFiles(selectedFiles: InputFile[]): void;
/**
* @param {InputFile[]} newFiles
* @protected
*/
protected _dispatchFileListChangeEvent(newFiles: InputFile[]): void;
/**
* @protected
*/
protected _handleErrors(): void;
_prevHasErrors: boolean | undefined;
/**
* @param {InputFile} fileObj
* @protected
*/
protected _handleErroredFiles(fileObj: InputFile): void;
/**
* Description for screen readers connected to the button about how many files have been updated
* @protected
*/
protected _updateUploadButtonDescription(): void;
/**
* @private
* @param {InputFile} removedFile
*/
private __removeFileFromList;
/**
* @param {InputFile} removedFile
* @protected
*/
protected _removeFile(removedFile: InputFile): void;
/**
* Helper method for the mutually exclusive Required Validator
* @override ValidateMixin
*/
override _isEmpty(): boolean;
/**
* @return {TemplateResult}
* @protected
*/
protected _dropZoneTemplate(): TemplateResult;
/**
* @param {MouseEvent} ev
*/
__openDialogOnBtnClick(ev: MouseEvent): void;
}
export type TemplateResult = import('lit').TemplateResult;
export type RenderOptions = import('lit').RenderOptions;
export type InputFile = import('../types/input-file.js').InputFile;
export type SystemFile = import('../types/input-file.js').SystemFile;
export type UploadResponse = import('../types/input-file.js').UploadResponse;
import { LionField } from "../../../exports/form-core.js";
import { LionSelectedFileList } from "./LionSelectedFileList.js";
export {};
//# sourceMappingURL=LionInputFile.d.ts.map