gantri-components 2.148.0 → 2.149.1-beta.1

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.
@@ -1,6 +1,6 @@
1
1
  import { OptionalValues } from '../../../../../../types/common';
2
2
  import { DeleteFile, FileUploaderProps } from '../../../../file-uploader.types';
3
- export type ThumbnailRenderProps = OptionalValues<Required<Pick<FileUploaderProps, 'SortableDragHandleWrapper' | 'enableCopyUrl' | 'fileUrl' | 'isDisabled' | 'isDraggable' | 'isReplaceable' | 'onClick' | 'thumbnailSize' | 'transformThumbnailSrc'>>> & {
3
+ export type ThumbnailRenderProps = OptionalValues<Required<Pick<FileUploaderProps, 'enableCopyUrl' | 'fileUrl' | 'handleRecoverFile' | 'isDisabled' | 'isDraggable' | 'isReplaceable' | 'onClick' | 'SortableDragHandleWrapper' | 'thumbnailSize' | 'transformThumbnailSrc'>>> & {
4
4
  deleteFile: DeleteFile;
5
5
  handleOpenFileSelect: () => void;
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import { FileUploaderProps, DeleteFile } from '../../file-uploader.types';
2
2
  import { OptionalValues } from '../../../../types/common';
3
- export type FileUploaderThumbnailVariantProps = OptionalValues<Required<Pick<FileUploaderProps, 'SortableDragHandleWrapper' | 'disabledDescription' | 'enableCopyUrl' | 'fileUrl' | 'isActive' | 'isDisabled' | 'isDraggable' | 'isReplaceable' | 'onClick' | 'processing' | 'thumbnailSize' | 'transformThumbnailSrc'>>> & {
3
+ export type FileUploaderThumbnailVariantProps = OptionalValues<Required<Pick<FileUploaderProps, 'disabledDescription' | 'enableCopyUrl' | 'fileUrl' | 'handleRecoverFile' | 'isActive' | 'isDisabled' | 'isDraggable' | 'isReplaceable' | 'onClick' | 'processing' | 'SortableDragHandleWrapper' | 'thumbnailSize' | 'transformThumbnailSrc'>>> & {
4
4
  deleteFile: DeleteFile;
5
5
  handleOpenFileSelect: () => void;
6
6
  isDraggingOver: boolean;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { IconRecoverFilePropsDef } from './icon-recover.types';
3
+ export declare const IconRecoverFile: (props: IconRecoverFilePropsDef) => React.JSX.Element;
@@ -0,0 +1,7 @@
1
+ export type HandleRecoverFileDef = (fileUrl: string) => Promise<void>;
2
+ export interface IconRecoverFilePropsDef {
3
+ fileUrl: string | undefined;
4
+ handleRecoverFile: HandleRecoverFileDef | undefined;
5
+ isDisabled: boolean | undefined;
6
+ thumbnailUrl: string | undefined;
7
+ }
@@ -0,0 +1 @@
1
+ export * from './icon-recover';
@@ -12,6 +12,8 @@ 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
+ /** Provides a method for potential file recovery. */
16
+ handleRecoverFile?: (fileUrl: string) => Promise<void>;
15
17
  inputName?: string;
16
18
  isActive?: boolean;
17
19
  isDisabled?: boolean;
@@ -73,7 +75,8 @@ export interface SelectedFileDetails {
73
75
  /** If invalid, return the error message to display. */
74
76
  export type ValidateFile = (file: SelectedFileDetails) => Promise<string | undefined | void> | string | undefined | void;
75
77
  export type HandleFileSelected = (validFile: SelectedFileDetails) => Promise<any>;
76
- export type FileUploaderCustomContent = (props: {
78
+ export type FileUploaderCustomContent = (props: FileUploaderCustomContentPropsDef) => JSX.Element;
79
+ export interface FileUploaderCustomContentPropsDef {
77
80
  IconCopyUrl: () => JSX.Element;
78
81
  IconDelete: () => JSX.Element;
79
82
  IconDrag: () => JSX.Element;
@@ -85,7 +88,7 @@ export type FileUploaderCustomContent = (props: {
85
88
  isDisabled: boolean | undefined;
86
89
  isDraggingOver: boolean;
87
90
  processing: boolean;
88
- }) => JSX.Element;
91
+ }
89
92
  export type OnFileUploaderError = (props: {
90
93
  error: unknown;
91
94
  fallbackMessage: string;