@devtron-labs/devtron-fe-common-lib 0.0.30-beta1 → 0.0.31-beta1

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.
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import ClipboardProps from './types';
3
+ /**
4
+ * @param content - Content to be copied
5
+ * @param copiedTippyText - Text to be shown in the tippy when the content is copied
6
+ * @param duration - Duration for which the tippy should be shown
7
+ * @param trigger - To trigger the copy action, if set to true the content will be copied, use case being triggering the copy action from outside the component
8
+ * @param setTrigger - Callback function to set the trigger
9
+ */
10
+ export default function ClipboardButton({ content, copiedTippyText, duration, trigger, setTrigger }: ClipboardProps): JSX.Element;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ export default interface ClipboardProps {
3
+ content: string;
4
+ copiedTippyText: string;
5
+ duration: number;
6
+ trigger: boolean;
7
+ setTrigger: React.Dispatch<React.SetStateAction<boolean>>;
8
+ }
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  import { ResizableTagTextAreaProps } from './Types';
3
- export declare function ResizableTagTextArea({ className, minHeight, maxHeight, value, onChange, onBlur, onFocus, placeholder, tabIndex, refVar, dependentRef, dataTestId, }: ResizableTagTextAreaProps): JSX.Element;
3
+ export declare function ResizableTagTextArea({ className, minHeight, maxHeight, value, onChange, onBlur, onFocus, placeholder, tabIndex, refVar, dependentRef, dataTestId, handleKeyDown, }: ResizableTagTextAreaProps): JSX.Element;
@@ -64,4 +64,5 @@ export interface ResizableTagTextAreaProps {
64
64
  refVar?: React.MutableRefObject<HTMLTextAreaElement>;
65
65
  dependentRef?: React.MutableRefObject<HTMLTextAreaElement>;
66
66
  dataTestId?: string;
67
+ handleKeyDown?: any;
67
68
  }
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { UseSearchString } from './Types';
2
+ import { AsyncOptions, UseSearchString } from './Types';
3
3
  export declare function showError(serverError: any, showToastOnUnknownError?: boolean, hideAccessError?: boolean): void;
4
4
  interface ConditionalWrapper<T> {
5
5
  condition: boolean;
@@ -43,4 +43,12 @@ export declare function CustomInput({ name, value, error, onChange, onBlur, onFo
43
43
  export declare function handleUTCTime(ts: string, isRelativeTime?: boolean): string;
44
44
  export declare function useSearchString(): UseSearchString;
45
45
  export declare const closeOnEscKeyPressed: (e: any, actionClose: () => void) => void;
46
+ /**
47
+ * It will copy the passed content to clipboard and invoke the callback function, in case of error it will show the toast message.
48
+ * On HTTP system clipboard is not supported, so it will use the unsecureCopyToClipboard function
49
+ * @param str
50
+ * @param callback
51
+ */
52
+ export declare function copyToClipboard(str: any, callback?: typeof noop): void;
53
+ export declare function useAsync<T>(func: (...rest: any[]) => Promise<T>, dependencyArray?: any[], shouldRun?: boolean, options?: AsyncOptions): [boolean, T, any | null, () => void, React.Dispatch<any>, any[]];
46
54
  export {};
@@ -24,7 +24,6 @@ export interface ImageTaggingContainerType {
24
24
  setTagsEditable?: (tagsEditable: boolean) => void;
25
25
  toggleCardMode?: (id: number) => void;
26
26
  hideHardDelete?: boolean;
27
- isSuperAdmin?: boolean;
28
27
  }
29
28
  export interface ImageButtonType {
30
29
  text: string;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { ImageButtonType, ImageTaggingContainerType } from './ImageTags.Types';
3
- export declare const ImageTagsContainer: ({ ciPipelineId, artifactId, imageComment, imageReleaseTags, updateCurrentAppMaterial, appReleaseTagNames, setAppReleaseTagNames, tagsEditable, setTagsEditable, toggleCardMode, hideHardDelete, forceReInit, isSuperAdmin }: ImageTaggingContainerType) => JSX.Element;
3
+ export declare const ImageTagsContainer: ({ ciPipelineId, artifactId, imageComment, imageReleaseTags, updateCurrentAppMaterial, appReleaseTagNames, setAppReleaseTagNames, tagsEditable, setTagsEditable, toggleCardMode, hideHardDelete, forceReInit, }: ImageTaggingContainerType) => JSX.Element;
4
4
  export declare const ImageTagButton: ({ text, isSoftDeleted, isEditing, onSoftDeleteClick, onHardDeleteClick, tagId, softDeleteTags, isSuperAdmin, duplicateTag, hideHardDelete, }: ImageButtonType) => JSX.Element;
@@ -361,4 +361,13 @@ export interface ResizableTextareaProps {
361
361
  name?: string;
362
362
  dataTestId?: string;
363
363
  }
364
+ export interface AsyncState<T> {
365
+ loading: boolean;
366
+ result: T;
367
+ error: null;
368
+ dependencies: any[];
369
+ }
370
+ export interface AsyncOptions {
371
+ resetOnChange: boolean;
372
+ }
364
373
  export {};
@@ -37,3 +37,4 @@ export * from './ImageTags.Types';
37
37
  export * from './ResizableTextarea';
38
38
  export { default as DebouncedSearch } from './DebouncedSearch/DebouncedSearch';
39
39
  export { default as Grid } from './Grid/Grid';
40
+ export { default as ClipboardButton } from './ClipboardButton/ClipboardButton';