gantri-components 2.133.0-beta.5 → 2.133.0-beta.7

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.
@@ -2,6 +2,6 @@
2
2
  import { OptionalValues } from '../../types/common';
3
3
  export declare const StyledFileInput: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, OptionalValues<{
4
4
  $fileUrl: string;
5
- $isDisabled: boolean;
6
5
  $isDropZone: boolean;
6
+ disabled: boolean;
7
7
  }, undefined>>> & string;
@@ -12,7 +12,7 @@ export type FileUploaderProps = {
12
12
  fileUrl: string;
13
13
  /** This function should delete the record from the database, ***then*** delete the file. */
14
14
  handleDeleteFile: HandleDeleteFile;
15
- /** Provide this if supporting multiple uploads to prevent multiple calls to update the database. */
15
+ /** Only executed if `handleFileSelected` is not provided. Use this if supporting multiple uploads to prevent multiple calls to update the database. */
16
16
  handleUploadsComplete: HandleUploadsComplete;
17
17
  inputName?: string;
18
18
  isActive?: boolean;
@@ -24,6 +24,9 @@ export type FileUploaderProps = {
24
24
  onBlur?: FocusEventHandler<HTMLInputElement>;
25
25
  onClick?: BoxProps['onClick'];
26
26
  onError: OnFileUploaderError;
27
+ onValidationCompleted?: () => void;
28
+ onValidationStarted?: () => void;
29
+ onlyUseCustomValidationFn?: boolean;
27
30
  /** Used to show loading indicator for `'thumbnail'` variant. For the `'button'` variant, it can be passed here or as part of `buttonProps`. */
28
31
  processing: boolean;
29
32
  purifyFileName?: boolean;
@@ -1,5 +1,5 @@
1
1
  import { FileUploaderProps } from '../../file-uploader.types';
2
2
  import { OptionalValues } from '../../../../types/common';
3
- export type GetValidFilesProps = OptionalValues<Pick<FileUploaderProps, 'expectedExtensions' | 'maxFileSizeMB' | 'maxUploadsAllowed' | 'minImageHeight' | 'minImageWidth' | 'onError' | 'transformFileName' | 'validateFile'>> & {
3
+ export type GetValidFilesProps = OptionalValues<Required<Pick<FileUploaderProps, 'expectedExtensions' | 'maxFileSizeMB' | 'maxUploadsAllowed' | 'minImageHeight' | 'minImageWidth' | 'onError' | 'onlyUseCustomValidationFn' | 'transformFileName' | 'validateFile'>>> & {
4
4
  files: File[];
5
5
  };
@@ -1,7 +1,7 @@
1
1
  import { Dispatch, SetStateAction } from 'react';
2
2
  import { SelectedFileDetails, FileUploaderProps } from '../../../../file-uploader.types';
3
3
  import { OptionalValues } from '../../../../../../types/common';
4
- export type UseHandleSelectedFilesProps = OptionalValues<Required<Pick<FileUploaderProps, 'expectedExtensions' | 'fileUrl' | 'handleFileSelected' | 'handleUploadsComplete' | 'isUploaderOnly' | 'maxFileSizeMB' | 'maxUploadsAllowed' | 'minImageHeight' | 'minImageWidth' | 'onError' | 'transformFileName' | 'validateFile'>>> & {
4
+ export type UseHandleSelectedFilesProps = OptionalValues<Required<Pick<FileUploaderProps, 'expectedExtensions' | 'fileUrl' | 'handleFileSelected' | 'handleUploadsComplete' | 'isUploaderOnly' | 'maxFileSizeMB' | 'maxUploadsAllowed' | 'minImageHeight' | 'minImageWidth' | 'onError' | 'onValidationCompleted' | 'onValidationStarted' | 'onlyUseCustomValidationFn' | 'transformFileName' | 'validateFile'>>> & {
5
5
  purgeInput: () => void;
6
6
  setFileName: Dispatch<SetStateAction<string>>;
7
7
  setFileUrl: Dispatch<SetStateAction<string>>;
@@ -1,5 +1,5 @@
1
1
  import { FileUploaderProps } from '../../file-uploader.types';
2
2
  import { OptionalValues } from '../../../../types/common';
3
- export type UseUploadActionsProps = OptionalValues<Required<Pick<FileUploaderProps, 'expectedExtensions' | 'fileName' | 'fileUrl' | 'handleDeleteFile' | 'handleFileSelected' | 'handleUploadsComplete' | 'handleUploadFile' | 'isUploaderOnly' | 'maxUploadsAllowed' | 'onError' | 'purifyFileName' | 'transformFileName' | 'validateFile'>>> & Partial<Pick<FileUploaderProps, 'maxFileSizeMB' | 'minImageHeight' | 'minImageWidth'>> & {
3
+ export type UseUploadActionsProps = OptionalValues<Required<Pick<FileUploaderProps, 'expectedExtensions' | 'fileName' | 'fileUrl' | 'handleDeleteFile' | 'handleFileSelected' | 'handleUploadsComplete' | 'handleUploadFile' | 'isUploaderOnly' | 'maxUploadsAllowed' | 'onError' | 'onValidationCompleted' | 'onValidationStarted' | 'onlyUseCustomValidationFn' | 'purifyFileName' | 'transformFileName' | 'validateFile'>>> & Partial<Pick<FileUploaderProps, 'maxFileSizeMB' | 'minImageHeight' | 'minImageWidth'>> & {
4
4
  purgeInput: () => void;
5
5
  };