@devtron-labs/devtron-fe-common-lib 1.19.0-pre-1 → 1.19.0-pre-3
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/{@code-editor-CIqjdv0K.js → @code-editor-zWRUZR9s.js} +7402 -7295
- package/dist/{@common-rjsf-RBW8IyBR.js → @common-rjsf-DRKnGkfJ.js} +1 -1
- package/dist/Common/Hooks/UseRegisterShortcut/index.d.ts +1 -0
- package/dist/Common/Hooks/UseRegisterShortcut/utils.d.ts +1 -1
- package/dist/Common/InteractiveCellText/InteractiveCellText.d.ts +27 -0
- package/dist/Common/InteractiveCellText/index.d.ts +2 -0
- package/dist/Common/InteractiveCellText/types.d.ts +10 -0
- package/dist/Common/index.d.ts +1 -0
- package/dist/Shared/Components/Icon/Icon.d.ts +4 -0
- package/dist/Shared/Components/Table/TableContent.d.ts +1 -1
- package/dist/Shared/Components/Table/types.d.ts +8 -4
- package/dist/Shared/Components/Table/utils.d.ts +1 -1
- package/dist/Shared/Services/ToastManager/ToastContent.d.ts +2 -1
- package/dist/Shared/Services/ToastManager/constants.d.ts +2 -2
- package/dist/Shared/Services/ToastManager/toastManager.service.d.ts +1 -1
- package/dist/Shared/Services/ToastManager/types.d.ts +23 -3
- package/dist/assets/@code-editor.css +1 -1
- package/dist/assets/ic-diff-added.6ef6f938.svg +3 -0
- package/dist/assets/ic-diff-deleted.54eb24dd.svg +3 -0
- package/dist/assets/ic-diff-updated.294b925e.svg +4 -0
- package/dist/assets/ic-input.57281408.svg +3 -0
- package/dist/index.js +618 -617
- package/package.json +1 -1
@@ -1,7 +1,7 @@
|
|
1
1
|
import { j as n, au as T, aw as J, av as K } from "./@vendor-3ORIJA0h.js";
|
2
2
|
import V, { useState as q, useEffect as Y, forwardRef as G, useMemo as E } from "react";
|
3
3
|
import z, { getDefaultRegistry as Q } from "@rjsf/core";
|
4
|
-
import { T as O, j as F, c as w, b as N, S as X, i as Z, g as ee, a as te, d as R, e as ne } from "./@code-editor-
|
4
|
+
import { T as O, j as F, c as w, b as N, S as X, i as Z, g as ee, a as te, d as R, e as ne } from "./@code-editor-zWRUZR9s.js";
|
5
5
|
import { getUiOptions as B, getTemplate as $, getSubmitButtonOptions as re, ADDITIONAL_PROPERTY_FLAG as L, errorId as se, englishStringTranslator as ae, TranslatableString as oe, titleId as le, canExpand as ie, deepEquals as ce } from "@rjsf/utils";
|
6
6
|
import { ReactComponent as de } from "./assets/ic-add.cfaa779b.svg";
|
7
7
|
import { ReactComponent as ue } from "./assets/ic-warning.ecf7ff97.svg";
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { ShortcutType } from './types';
|
2
2
|
export declare const preprocessKeys: (keys: ShortcutType["keys"]) => {
|
3
|
-
keys: ("N" | "R" | "Enter" | "/" | "
|
3
|
+
keys: ("N" | "R" | "Enter" | "/" | "Alt" | "F" | "E" | "K" | "X" | "A" | "S" | "Home" | "End" | "." | "Space" | "Control" | "Shift" | "Meta" | "Escape" | "ArrowLeft" | "ArrowRight" | "ArrowUp" | "ArrowDown" | "PageUp" | "PageDown" | "Backspace" | "Delete")[];
|
4
4
|
id: string;
|
5
5
|
};
|
6
6
|
export declare const verifyCallbackStack: (stack: ShortcutType["callbackStack"]) => void;
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { InteractiveCellTextProps } from './types';
|
2
|
+
/**
|
3
|
+
* A reusable component for rendering text within a tooltip. The text can be interactive (clickable) or static.
|
4
|
+
*
|
5
|
+
* @param {Object} props - The props for the component.
|
6
|
+
* @param {string} props.text - The text to display inside the component. Defaults to `'-'` if not provided.
|
7
|
+
* @param {function} [props.onClickHandler] - Optional click handler function. If provided, the text will be rendered as a button.
|
8
|
+
* @param {string} [props.dataTestId] - Optional test ID for the component, useful for testing purposes.
|
9
|
+
* @param {string} [props.rootClassName] - Additional CSS class names to apply to the root element.
|
10
|
+
* @param {boolean} [props.interactive=false] - Whether the tooltip content is interactive.
|
11
|
+
* @param {number} [props.fontSize=13] - Font size for the text. Defaults to `13`.
|
12
|
+
* @param {React.ReactNode} [props.tippyContent=null] - Custom content for the tooltip. If not provided, `text` will be used.
|
13
|
+
* @returns {JSX.Element} The rendered `InteractiveCellText` component.
|
14
|
+
*
|
15
|
+
* @example
|
16
|
+
* // Example usage:
|
17
|
+
* <InteractiveCellText
|
18
|
+
* text="Click me"
|
19
|
+
* onClickHandler={() => alert('Clicked!')}
|
20
|
+
* dataTestId="interactive-cell"
|
21
|
+
* rootClassName="custom-class"
|
22
|
+
* interactive={true}
|
23
|
+
* fontSize={14}
|
24
|
+
* tippyContent="Tooltip content"
|
25
|
+
* />
|
26
|
+
*/
|
27
|
+
export declare const InteractiveCellText: ({ text, onClickHandler, dataTestId, rootClassName, interactive, fontSize, tippyContent, }: InteractiveCellTextProps) => JSX.Element;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { TippyCustomizedProps } from '../Types';
|
2
|
+
export interface InteractiveCellTextProps {
|
3
|
+
text: string;
|
4
|
+
onClickHandler?: () => void;
|
5
|
+
dataTestId?: string;
|
6
|
+
rootClassName?: string;
|
7
|
+
interactive?: boolean;
|
8
|
+
fontSize?: number;
|
9
|
+
tippyContent?: TippyCustomizedProps<false>['additionalContent'];
|
10
|
+
}
|
package/dist/Common/index.d.ts
CHANGED
@@ -25,6 +25,7 @@ export * from './Helper';
|
|
25
25
|
export * from './Hooks';
|
26
26
|
export * from './ImageTags';
|
27
27
|
export * from './ImageTags.Types';
|
28
|
+
export * from './InteractiveCellText';
|
28
29
|
export * from './Markdown';
|
29
30
|
export * from './Modals/Modal';
|
30
31
|
export * from './Modals/VisibleModal';
|
@@ -67,6 +67,9 @@ export declare const iconMap: {
|
|
67
67
|
'ic-devtron-header-logo': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
68
68
|
'ic-devtron-job': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
69
69
|
'ic-devtron': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
70
|
+
'ic-diff-added': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
71
|
+
'ic-diff-deleted': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
72
|
+
'ic-diff-updated': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
70
73
|
'ic-disconnect': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
71
74
|
'ic-discord-fill': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
72
75
|
'ic-dockerhub': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
@@ -124,6 +127,7 @@ export declare const iconMap: {
|
|
124
127
|
'ic-info-filled-color': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
125
128
|
'ic-info-filled': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
126
129
|
'ic-info-outline': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
130
|
+
'ic-input': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
127
131
|
'ic-install': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
128
132
|
'ic-job-color': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
129
133
|
'ic-k3s': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { FiltersTypeEnum, TableContentProps } from './types';
|
2
|
-
declare const TableContent: <RowData extends unknown, FilterVariant extends FiltersTypeEnum, AdditionalProps extends Record<string, any>>({ filterData, rows, resizableConfig, additionalProps, visibleColumns, stylesConfig, loading, bulkSelectionConfig, bulkSelectionReturnValue, handleClearBulkSelection, handleToggleBulkSelectionOnRow, paginationVariant, RowActionsOnHoverComponent, pageSizeOptions, filteredRows, areFilteredRowsLoading, }: TableContentProps<RowData, FilterVariant, AdditionalProps>) => JSX.Element;
|
2
|
+
declare const TableContent: <RowData extends unknown, FilterVariant extends FiltersTypeEnum, AdditionalProps extends Record<string, any>>({ filterData, rows, resizableConfig, additionalProps, visibleColumns, stylesConfig, loading, bulkSelectionConfig, bulkSelectionReturnValue, handleClearBulkSelection, handleToggleBulkSelectionOnRow, paginationVariant, RowActionsOnHoverComponent, pageSizeOptions, filteredRows, areFilteredRowsLoading, getRows, totalRows, }: TableContentProps<RowData, FilterVariant, AdditionalProps>) => JSX.Element;
|
3
3
|
export default TableContent;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Dispatch, FunctionComponent, MouseEvent, PropsWithChildren, SetStateAction } from 'react';
|
2
2
|
import { GenericFilterEmptyStateProps } from '../../../Common/EmptyState/types';
|
3
3
|
import { UseStateFiltersProps, UseStateFiltersReturnType, UseUrlFiltersProps, UseUrlFiltersReturnType } from '../../../Common/Hooks';
|
4
|
-
import { GenericEmptyStateType } from '../../../Common/index';
|
4
|
+
import { APIOptions, GenericEmptyStateType } from '../../../Common/index';
|
5
5
|
import { PageSizeOption } from '../../../Common/Pagination/types';
|
6
6
|
import { SortableTableHeaderCellProps, useResizableTableConfig } from '../../../Common/SortableTableHeaderCell';
|
7
7
|
import { useBulkSelection, UseBulkSelectionProps } from '../BulkSelection';
|
@@ -105,7 +105,7 @@ export interface ConfigurableColumnsType<RowData extends unknown, FilterVariant
|
|
105
105
|
interface GetRowsProps extends Pick<UseFiltersReturnType, 'offset' | 'pageSize' | 'searchKey' | 'sortBy' | 'sortOrder'> {
|
106
106
|
}
|
107
107
|
type AdditionalFilterPropsType<T extends FiltersTypeEnum> = T extends FiltersTypeEnum.URL ? Pick<UseUrlFiltersProps<string, unknown>, 'parseSearchParams' | 'localStorageKey' | 'redirectionMethod' | 'initialSortKey' | 'defaultPageSize'> : T extends FiltersTypeEnum.STATE ? Pick<UseStateFiltersProps<string>, 'initialSortKey' | 'defaultPageSize'> : never;
|
108
|
-
export type ViewWrapperProps<RowData extends unknown = unknown, FilterVariant extends FiltersTypeEnum = FiltersTypeEnum.NONE, AdditionalProps extends Record<string, any> = {}> = PropsWithChildren<(FilterVariant extends FiltersTypeEnum.NONE ? {} : Pick<UseFiltersReturnType, 'offset' | 'handleSearch' | 'searchKey' | 'sortBy' | 'sortOrder' | 'clearFilters'>) & AdditionalProps & Partial<ConfigurableColumnsType<RowData, FilterVariant, AdditionalProps>> & {
|
108
|
+
export type ViewWrapperProps<RowData extends unknown = unknown, FilterVariant extends FiltersTypeEnum = FiltersTypeEnum.NONE, AdditionalProps extends Record<string, any> = {}> = PropsWithChildren<(FilterVariant extends FiltersTypeEnum.NONE ? {} : Pick<UseFiltersReturnType, 'offset' | 'handleSearch' | 'searchKey' | 'sortBy' | 'sortOrder' | 'clearFilters' | 'areFiltersApplied'>) & AdditionalProps & Partial<ConfigurableColumnsType<RowData, FilterVariant, AdditionalProps>> & {
|
109
109
|
areRowsLoading: boolean;
|
110
110
|
filteredRows: RowsType<RowData> | null;
|
111
111
|
rows: RowsType<RowData> | null;
|
@@ -177,7 +177,10 @@ export type InternalTableProps<RowData extends unknown, FilterVariant extends Fi
|
|
177
177
|
} | {
|
178
178
|
rows?: never;
|
179
179
|
/** NOTE: Sorting on frontend is only handled if rows is provided instead of getRows */
|
180
|
-
getRows: (props: GetRowsProps) => Promise<
|
180
|
+
getRows: (props: GetRowsProps, abortControllerRef: APIOptions['abortControllerRef']) => Promise<{
|
181
|
+
rows: RowsType<RowData>;
|
182
|
+
totalRows: number;
|
183
|
+
}>;
|
181
184
|
}) & ({
|
182
185
|
paginationVariant: PaginationEnum.PAGINATED;
|
183
186
|
pageSizeOptions?: PageSizeOption[];
|
@@ -203,8 +206,9 @@ export interface GetFilteringPromiseProps<RowData extends unknown> {
|
|
203
206
|
searchSortTimeoutRef: React.MutableRefObject<number>;
|
204
207
|
callback: () => Promise<RowsType<RowData>> | RowsType<RowData>;
|
205
208
|
}
|
206
|
-
export interface TableContentProps<RowData extends unknown, FilterVariant extends FiltersTypeEnum, AdditionalProps extends Record<string, any>> extends Pick<InternalTableProps<RowData, FilterVariant, AdditionalProps>, 'filterData' | 'rows' | 'resizableConfig' | 'additionalProps' | 'visibleColumns' | 'stylesConfig' | 'loading' | 'bulkSelectionConfig' | 'bulkSelectionReturnValue' | 'handleClearBulkSelection' | 'handleToggleBulkSelectionOnRow' | 'paginationVariant' | 'RowActionsOnHoverComponent' | 'pageSizeOptions'> {
|
209
|
+
export interface TableContentProps<RowData extends unknown, FilterVariant extends FiltersTypeEnum, AdditionalProps extends Record<string, any>> extends Pick<InternalTableProps<RowData, FilterVariant, AdditionalProps>, 'filterData' | 'rows' | 'resizableConfig' | 'additionalProps' | 'visibleColumns' | 'stylesConfig' | 'loading' | 'bulkSelectionConfig' | 'bulkSelectionReturnValue' | 'handleClearBulkSelection' | 'handleToggleBulkSelectionOnRow' | 'paginationVariant' | 'RowActionsOnHoverComponent' | 'pageSizeOptions' | 'getRows'> {
|
207
210
|
filteredRows: RowsType<RowData>;
|
208
211
|
areFilteredRowsLoading: boolean;
|
212
|
+
totalRows: number;
|
209
213
|
}
|
210
214
|
export {};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Column, ConfigurableColumnsType, FiltersTypeEnum, GetFilteringPromiseProps, RowsType, TableProps, UseFiltersReturnType } from './types';
|
2
|
-
export declare const searchAndSortRows: <RowData extends unknown, FilterVariant extends FiltersTypeEnum, AdditionalProps extends Record<string, any>>(rows: TableProps<RowData, FilterVariant, AdditionalProps>["rows"], filter: TableProps<RowData, FilterVariant, AdditionalProps>["filter"], filterData: UseFiltersReturnType, comparator?: Column<RowData, FilterVariant, AdditionalProps>["comparator"]) =>
|
2
|
+
export declare const searchAndSortRows: <RowData extends unknown, FilterVariant extends FiltersTypeEnum, AdditionalProps extends Record<string, any>>(rows: TableProps<RowData, FilterVariant, AdditionalProps>["rows"], filter: TableProps<RowData, FilterVariant, AdditionalProps>["filter"], filterData: UseFiltersReturnType, comparator?: Column<RowData, FilterVariant, AdditionalProps>["comparator"]) => Awaited<ReturnType<TableProps<RowData>["getRows"]>>;
|
3
3
|
export declare const getVisibleColumnsFromLocalStorage: <RowData extends unknown, FilterVariant extends FiltersTypeEnum, AdditionalProps extends Record<string, any>>({ allColumns, id, }: Pick<ConfigurableColumnsType<RowData, FilterVariant, AdditionalProps>, "allColumns"> & Pick<TableProps<RowData, FilterVariant, AdditionalProps>, "id">) => Column<RowData, FilterVariant, AdditionalProps>[];
|
4
4
|
export declare const setVisibleColumnsToLocalStorage: <RowData extends unknown, FilterVariant extends FiltersTypeEnum, AdditionalProps extends Record<string, any>>({ id, visibleColumns, }: Pick<ConfigurableColumnsType<RowData, FilterVariant, AdditionalProps>, "visibleColumns"> & Pick<TableProps<RowData, FilterVariant, AdditionalProps>, "id">) => void;
|
5
5
|
export declare const getVisibleColumns: <RowData extends unknown, FilterVariant extends FiltersTypeEnum, AdditionalProps extends Record<string, any>>({ areColumnsConfigurable, columns, id, }: Pick<TableProps<RowData, FilterVariant, AdditionalProps>, "areColumnsConfigurable" | "columns" | "id">) => Column<RowData, FilterVariant, AdditionalProps>[];
|
@@ -1,2 +1,3 @@
|
|
1
|
-
import { ToastProps } from './types';
|
1
|
+
import { ShortcutToastContentProps, ToastProps } from './types';
|
2
2
|
export declare const ToastContent: ({ title, description, buttonProps, }: Pick<ToastProps, "title" | "description" | "buttonProps">) => JSX.Element;
|
3
|
+
export declare const ShortcutToastContent: ({ shortcuts, text }: ShortcutToastContentProps) => JSX.Element;
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import { ToastContainerProps, ToastOptions } from 'react-toastify';
|
2
|
-
import {
|
2
|
+
import { BaseToastProps, ToastProps } from './types';
|
3
3
|
export declare const TOAST_BASE_CONFIG: ToastContainerProps;
|
4
|
-
export declare const TOAST_VARIANT_TO_CONFIG_MAP: Record<
|
4
|
+
export declare const TOAST_VARIANT_TO_CONFIG_MAP: Record<BaseToastProps['variant'], Required<Pick<ToastProps, 'icon' | 'title' | 'progressBarBg'>> & Pick<ToastOptions, 'type'>>;
|
@@ -65,7 +65,7 @@ declare class ToastManager {
|
|
65
65
|
/**
|
66
66
|
* Handler for showing the toast
|
67
67
|
*/
|
68
|
-
showToast: ({ variant, icon: customIcon, title, description, buttonProps, progressBarBg: customProgressBarBg, }: ToastProps, options?: Pick<ToastOptions, "autoClose">) => import('react-toastify').Id;
|
68
|
+
showToast: ({ variant, icon: customIcon, title, description, buttonProps, progressBarBg: customProgressBarBg, text, shortcuts, }: ToastProps, options?: Pick<ToastOptions, "autoClose">) => import('react-toastify').Id;
|
69
69
|
/**
|
70
70
|
* Handler for dismissing an existing toast
|
71
71
|
*/
|
@@ -1,13 +1,28 @@
|
|
1
1
|
import { ReactElement } from 'react';
|
2
|
+
import { SupportedKeyboardKeysType } from '../../../Common/Hooks';
|
2
3
|
import { ButtonComponentType, ButtonProps } from '../../Components';
|
3
4
|
export declare enum ToastVariantType {
|
4
5
|
info = "info",
|
5
6
|
success = "success",
|
6
7
|
error = "error",
|
7
8
|
warn = "warn",
|
8
|
-
notAuthorized = "notAuthorized"
|
9
|
+
notAuthorized = "notAuthorized",
|
10
|
+
shortcut = "shortcut"
|
9
11
|
}
|
10
|
-
export interface
|
12
|
+
export interface ShortcutToastProps {
|
13
|
+
variant: ToastVariantType.shortcut;
|
14
|
+
/**
|
15
|
+
* Text to display along the shortcuts in the toast
|
16
|
+
* Example: "Press [S] to switch context"
|
17
|
+
*/
|
18
|
+
text: string;
|
19
|
+
/**
|
20
|
+
* The shortcuts to be displayed in the toast
|
21
|
+
* Note: The shortcuts should be in the format of `['Ctrl', 'A']
|
22
|
+
*/
|
23
|
+
shortcuts: SupportedKeyboardKeysType[];
|
24
|
+
}
|
25
|
+
export interface BaseToastProps {
|
11
26
|
/**
|
12
27
|
* Title for the toast
|
13
28
|
* If not provided, defaults to a value based on the selected variant
|
@@ -26,7 +41,7 @@ export interface ToastProps {
|
|
26
41
|
*
|
27
42
|
* @default ToastVariantType.info
|
28
43
|
*/
|
29
|
-
variant?: ToastVariantType
|
44
|
+
variant?: Exclude<ToastVariantType, ToastVariantType.shortcut>;
|
30
45
|
/**
|
31
46
|
* Props for the action button to be displayed in the toast
|
32
47
|
*
|
@@ -38,3 +53,8 @@ export interface ToastProps {
|
|
38
53
|
*/
|
39
54
|
progressBarBg?: string;
|
40
55
|
}
|
56
|
+
export type ToastProps = (BaseToastProps & Partial<Record<Exclude<keyof ShortcutToastProps, 'variant'>, never>>) | (ShortcutToastProps & Partial<Record<Exclude<keyof BaseToastProps, 'variant'>, never>>);
|
57
|
+
export interface ShortcutToastContentProps {
|
58
|
+
text: string;
|
59
|
+
shortcuts: SupportedKeyboardKeysType[];
|
60
|
+
}
|