@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.
- package/dist/Common/ClipboardButton/ClipboardButton.d.ts +10 -0
- package/dist/Common/ClipboardButton/types.d.ts +8 -0
- package/dist/Common/CustomTagSelector/ResizableTagTextArea.d.ts +1 -1
- package/dist/Common/CustomTagSelector/Types.d.ts +1 -0
- package/dist/Common/Helper.d.ts +9 -1
- package/dist/Common/ImageTags.Types.d.ts +0 -1
- package/dist/Common/ImageTags.d.ts +1 -1
- package/dist/Common/Types.d.ts +9 -0
- package/dist/Common/index.d.ts +1 -0
- package/dist/index.js +6755 -6567
- package/package.json +1 -1
- package/src/Assets/Icon/ic-copy.svg +3 -0
- package/src/Common/ClipboardButton/ClipboardButton.tsx +61 -0
- package/src/Common/ClipboardButton/__tests__/ClipboardButton.test.tsx +43 -0
- package/src/Common/ClipboardButton/types.ts +7 -0
- package/src/Common/CustomTagSelector/ResizableTagTextArea.tsx +14 -6
- package/src/Common/CustomTagSelector/Types.ts +1 -0
- package/src/Common/Helper.tsx +132 -19
- package/src/Common/ImageTags.Types.ts +0 -1
- package/src/Common/ImageTags.tsx +14 -1
- package/src/Common/Types.ts +13 -1
- package/src/Common/index.ts +1 -0
|
@@ -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;
|
|
@@ -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;
|
package/dist/Common/Helper.d.ts
CHANGED
|
@@ -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 {};
|
|
@@ -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,
|
|
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;
|
package/dist/Common/Types.d.ts
CHANGED
|
@@ -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 {};
|
package/dist/Common/index.d.ts
CHANGED
|
@@ -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';
|