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

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.
@@ -12,8 +12,6 @@ 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
- /** Only executed if `handleFileSelected` is not provided. Use this if supporting multiple uploads to prevent multiple calls to update the database. */
16
- handleUploadsComplete: HandleUploadsComplete;
17
15
  inputName?: string;
18
16
  isActive?: boolean;
19
17
  isDisabled?: boolean;
@@ -35,6 +33,7 @@ export type FileUploaderProps = {
35
33
  transformThumbnailSrc?: TransformThumbnailSrc;
36
34
  /** If invalid, return the error message to display. */
37
35
  validateFile?: ValidateFile;
36
+ validateSequentially?: boolean;
38
37
  /** The 'link' and 'plain' variants will show the 'button' variant if nothing has been uploaded yet. */
39
38
  variant: FileUploaderVariant;
40
39
  } & Partial<FileUploaderDefaultProps> & (WithDraggableProps | WithoutDraggableProps) & (WithReplaceableProps | WithoutReplaceableProps) & (ImmediatelyUploadProps | DelayUploadProps) & (WithCustomContent | WithoutCustomContent);
@@ -94,10 +93,14 @@ export type TransformThumbnailSrc = (props: {
94
93
  type ImmediatelyUploadProps = {
95
94
  handleFileSelected?: never;
96
95
  handleUploadFile: HandleUploadFile;
96
+ /** Use this if supporting multiple uploads to prevent multiple calls to update the database. */
97
+ handleUploadsComplete: HandleUploadsComplete;
97
98
  };
98
99
  type DelayUploadProps = {
99
100
  handleFileSelected: HandleFileSelected;
100
101
  handleUploadFile?: never;
102
+ /** Use this if supporting multiple uploads to prevent multiple calls to update the database. */
103
+ handleUploadsComplete?: never;
101
104
  };
102
105
  type WithDraggableProps = {
103
106
  SortableDragHandleWrapper: (props: PropsWithChildren<HTMLAttributes<HTMLElement>>) => JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { FileUploaderProps } from '../../file-uploader.types';
2
2
  import { OptionalValues } from '../../../../types/common';
3
- export type GetValidFilesProps = OptionalValues<Required<Pick<FileUploaderProps, 'expectedExtensions' | 'maxFileSizeMB' | 'maxUploadsAllowed' | 'minImageHeight' | 'minImageWidth' | 'onError' | 'onlyUseCustomValidationFn' | 'transformFileName' | 'validateFile'>>> & {
3
+ export type GetValidFilesProps = OptionalValues<Required<Pick<FileUploaderProps, 'expectedExtensions' | 'maxFileSizeMB' | 'maxUploadsAllowed' | 'minImageHeight' | 'minImageWidth' | 'onError' | 'onlyUseCustomValidationFn' | 'transformFileName' | 'validateFile' | 'validateSequentially'>>> & {
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' | 'onValidationCompleted' | 'onValidationStarted' | 'onlyUseCustomValidationFn' | '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' | 'validateSequentially'>>> & {
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' | 'onValidationCompleted' | 'onValidationStarted' | 'onlyUseCustomValidationFn' | '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' | 'validateSequentially'>>> & Partial<Pick<FileUploaderProps, 'maxFileSizeMB' | 'minImageHeight' | 'minImageWidth'>> & {
4
4
  purgeInput: () => void;
5
5
  };
@@ -1,5 +1,4 @@
1
1
  export interface GenerateSkusFromOptionsProps {
2
- loopNum?: number;
3
2
  options: string[][];
4
3
  partialSkus: string[];
5
4
  }