@devtron-labs/devtron-fe-common-lib 1.2.5-beta-11 → 1.2.5-beta-13
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-Dmahpc3a.js → @code-editor-CzAjJrLY.js} +6111 -5650
- package/dist/{@common-rjsf-CzIa4Fr9.js → @common-rjsf-BBfFhcwN.js} +1 -1
- package/dist/Common/CustomTagSelector/ResizableTagTextArea.d.ts +1 -1
- package/dist/Common/CustomTagSelector/Types.d.ts +8 -15
- package/dist/Common/Helper.d.ts +2 -1
- package/dist/Common/SegmentedControl/SegmentedControl.component.d.ts +3 -0
- package/dist/Common/SegmentedControl/index.d.ts +2 -0
- package/dist/Common/SegmentedControl/types.d.ts +14 -0
- package/dist/Common/Types.d.ts +2 -1
- package/dist/Common/index.d.ts +1 -0
- package/dist/Shared/Components/ConfirmationModal/types.d.ts +9 -7
- package/dist/Shared/Components/DynamicDataTable/DynamicDataTable.d.ts +2 -0
- package/dist/Shared/Components/DynamicDataTable/DynamicDataTableHeader.d.ts +2 -0
- package/dist/Shared/Components/DynamicDataTable/DynamicDataTableRow.d.ts +2 -0
- package/dist/Shared/Components/DynamicDataTable/constants.d.ts +2 -0
- package/dist/Shared/Components/DynamicDataTable/index.d.ts +2 -0
- package/dist/Shared/Components/DynamicDataTable/types.d.ts +162 -0
- package/dist/Shared/Components/DynamicDataTable/utils.d.ts +5 -0
- package/dist/Shared/Components/InvalidYAMLTippy/utils.d.ts +3 -1
- package/dist/Shared/Components/KeyValueTable/KeyValueTable.types.d.ts +1 -1
- package/dist/Shared/Components/SelectTextArea/SelectTextArea.d.ts +2 -0
- package/dist/Shared/Components/SelectTextArea/index.d.ts +2 -0
- package/dist/Shared/Components/SelectTextArea/types.d.ts +12 -0
- package/dist/Shared/Components/index.d.ts +1 -0
- package/dist/Shared/Store/IndexStore.d.ts +1 -0
- package/dist/Shared/types.d.ts +1 -0
- package/dist/assets/@code-editor.css +1 -1
- package/dist/assets/app-not-deployed.acdf0271.png +0 -0
- package/dist/assets/delete-medium.baa284da.svg +26 -1
- package/dist/assets/empty-noresult@2x.022ec87c.png +0 -0
- package/dist/assets/ic-abort.0d2773e9.svg +34 -1
- package/dist/assets/ic-aborted.e7288a6c.svg +5 -1
- package/dist/assets/ic-add.cfaa779b.svg +19 -1
- package/dist/assets/ic-appstatus-cancelled.05bb3352.svg +22 -1
- package/dist/assets/ic-arrow-backward.d951202a.svg +19 -1
- package/dist/assets/ic-arrow-counter-clockwise.01cbb0e1.svg +21 -1
- package/dist/assets/ic-arrow-down.18e5e332.svg +19 -1
- package/dist/assets/ic-arrow-forward.a2b8ab45.svg +27 -1
- package/dist/assets/ic-arrow-out.6aea09d0.svg +19 -1
- package/dist/assets/ic-arrow-right.f942ee03.svg +7 -1
- package/dist/assets/ic-arrow-square-out.1be837ac.svg +19 -1
- package/dist/assets/ic-arrow-up-down.945ee496.svg +19 -1
- package/dist/assets/ic-bold.2140b7c6.svg +19 -1
- package/dist/assets/ic-book-open.7cb94ee8.svg +19 -1
- package/dist/assets/ic-bot.f1d4abcc.svg +23 -1
- package/dist/assets/ic-branch.8db43d66.svg +19 -1
- package/dist/assets/ic-calendar.984accc5.svg +19 -1
- package/dist/assets/ic-calender-blank.963e3423.svg +19 -1
- package/dist/assets/ic-caret-down-small.2cc24039.svg +3 -1
- package/dist/assets/ic-caret-down.1666c029.svg +19 -1
- package/dist/assets/ic-caret-left-small.fe00c98d.svg +19 -1
- package/dist/assets/ic-charts.f41e185f.svg +19 -1
- package/dist/assets/ic-chat-circle-dots.e15514f8.svg +23 -1
- package/dist/assets/ic-check-all.0376437d.svg +21 -1
- package/dist/assets/ic-check-circle.ad80d835.svg +25 -1
- package/dist/assets/ic-check-grey.f556e371.svg +21 -1
- package/dist/assets/ic-check-square.2a3d3fb9.svg +20 -1
- package/dist/assets/ic-check.27c51fa1.svg +21 -1
- package/dist/assets/ic-checked-list.aba26c40.svg +19 -1
- package/dist/assets/ic-chevron-down.fc70d7a7.svg +21 -1
- package/dist/assets/ic-circle.05f86ff6.svg +9 -1
- package/dist/assets/ic-clair.ba79956f.svg +21 -1
- package/dist/assets/ic-clear-square.e60de021.svg +8 -0
- package/dist/assets/ic-clock.c21a2d14.svg +19 -1
- package/dist/assets/ic-close.43adc42a.svg +25 -1
- package/dist/assets/ic-code-commit.161a6b3c.svg +19 -1
- package/dist/assets/ic-code.1d1d4dd8.svg +19 -1
- package/dist/assets/ic-collapse-all.fd7b27b1.svg +3 -1
- package/dist/assets/ic-commit.e3113dd9.svg +23 -1
- package/dist/assets/ic-compare.0ee3e4cf.svg +22 -1
- package/dist/assets/ic-copy.94cee0fb.svg +19 -1
- package/dist/assets/ic-cpu.8be677ee.svg +20 -1
- package/dist/assets/ic-cross.01e03666.svg +19 -1
- package/dist/assets/ic-delete-interactive.304dd293.svg +19 -1
- package/dist/assets/ic-diff-file-added.0deb6763.svg +10 -1
- package/dist/assets/ic-diff-file-removed.2ed80281.svg +10 -1
- package/dist/assets/ic-diff-file-updated.c8740f72.svg +10 -1
- package/dist/assets/ic-disconnected.551d6161.svg +29 -1
- package/dist/assets/ic-discord-fill.1a1b291d.svg +19 -1
- package/dist/assets/ic-docker.48906f4d.svg +19 -1
- package/dist/assets/ic-download.c30437cd.svg +21 -1
- package/dist/assets/ic-drag.3f71e8aa.svg +24 -1
- package/dist/assets/ic-edit-file.a782640f.svg +20 -1
- package/dist/assets/ic-enter.cab07082.svg +19 -1
- package/dist/assets/ic-error-cross.bf21e563.svg +24 -1
- package/dist/assets/ic-error-exclamation.c224de09.svg +22 -1
- package/dist/assets/ic-error-medium.ea542259.svg +22 -1
- package/dist/assets/ic-error.a25d2f0d.svg +4 -1
- package/dist/assets/ic-errorInfo.d8d674b8.svg +23 -1
- package/dist/assets/ic-exit-fullscreen.1ae582d1.svg +19 -1
- package/dist/assets/ic-expand-all.a0744f9f.svg +3 -1
- package/dist/assets/ic-expand.ab992205.svg +19 -1
- package/dist/assets/ic-feedback.d32fa6b0.svg +19 -1
- package/dist/assets/ic-file-code.21a1f748.svg +7 -1
- package/dist/assets/ic-file-text.f9563710.svg +19 -1
- package/dist/assets/ic-files.fc290dee.svg +19 -1
- package/dist/assets/ic-filter-applied.9fc48d0f.svg +20 -1
- package/dist/assets/ic-filter.8f403d6f.svg +19 -1
- package/dist/assets/ic-folder.051cd30d.svg +19 -1
- package/dist/assets/ic-fullscreen-2.f138a5e8.svg +19 -1
- package/dist/assets/ic-fullscreen.b05e5087.svg +19 -1
- package/dist/assets/ic-hash.cd11c334.svg +3 -1
- package/dist/assets/ic-header.a91a9800.svg +21 -1
- package/dist/assets/ic-help-outline.9c012a0c.svg +19 -1
- package/dist/assets/ic-help.39c58c34.svg +19 -1
- package/dist/assets/ic-image.2a8ed117.svg +20 -1
- package/dist/assets/ic-in-progress.0598554b.svg +10 -1
- package/dist/assets/ic-info-filled-override.99e8094a.svg +20 -1
- package/dist/assets/ic-info-filled.4b0b46d1.svg +20 -1
- package/dist/assets/ic-info-outline.f4be8a1e.svg +4 -1
- package/dist/assets/ic-info-outlined.f4fa3224.svg +29 -1
- package/dist/assets/ic-italic.358ca070.svg +19 -1
- package/dist/assets/ic-k8s-job.f4414c10.svg +19 -1
- package/dist/assets/ic-lego-block.ee4b63f1.svg +36 -1
- package/dist/assets/ic-lines.395ef3db.svg +3 -1
- package/dist/assets/ic-link.8453e775.svg +19 -1
- package/dist/assets/ic-loading-failure.aa68693d.png +0 -0
- package/dist/assets/ic-locked.3b9eff02.svg +5 -1
- package/dist/assets/ic-mechanical-operation.08b38afd.svg +84 -1
- package/dist/assets/ic-medium-info.eee4a07b.svg +5 -1
- package/dist/assets/ic-megaphone.b9f9a901.svg +19 -1
- package/dist/assets/ic-memory.c4159f96.svg +19 -1
- package/dist/assets/ic-message.be6dba43.svg +19 -1
- package/dist/assets/ic-minus.df865aaf.svg +19 -1
- package/dist/assets/ic-nav-rocket.9e50bb61.svg +19 -1
- package/dist/assets/ic-not-authorized.2d8e208f.svg +78 -1
- package/dist/assets/ic-not-found.86f588bf.svg +176 -1
- package/dist/assets/ic-onboarding.c98f9ef9.svg +19 -1
- package/dist/assets/ic-open-in-new.6aea09d0.svg +19 -1
- package/dist/assets/ic-ordered-list.879dc7c8.svg +19 -1
- package/dist/assets/ic-page-not-found.da74a367.svg +81 -1
- package/dist/assets/ic-pencil.c75a6acc.svg +19 -1
- package/dist/assets/ic-person.f78738ac.svg +22 -1
- package/dist/assets/ic-pull-request.31d0c981.svg +19 -1
- package/dist/assets/ic-pulsate-status.9264740e.svg +21 -1
- package/dist/assets/ic-quote.10768489.svg +19 -1
- package/dist/assets/ic-regex.e14a4ea3.svg +19 -1
- package/dist/assets/ic-rocket-fail.874e54ce.svg +20 -1
- package/dist/assets/ic-rotate-devtron.200e165b.svg +119 -1
- package/dist/assets/ic-search.976327f1.svg +22 -1
- package/dist/assets/ic-sort-arrow-down.5cf54d08.svg +19 -1
- package/dist/assets/ic-stamp.8689f42d.svg +9 -1
- package/dist/assets/ic-strikethrough.a1652ad9.svg +19 -1
- package/dist/assets/ic-success.8c8fe69d.svg +4 -1
- package/dist/assets/ic-tag.1613fc59.svg +19 -1
- package/dist/assets/ic-timeout-red.5eda1010.svg +21 -1
- package/dist/assets/ic-timer.b62145ec.svg +19 -1
- package/dist/assets/ic-trivy.d5338454.svg +25 -1
- package/dist/assets/ic-unordered-list.42c1cbbc.svg +22 -1
- package/dist/assets/ic-view-variable-toggle.c335dfa0.svg +24 -1
- package/dist/assets/ic-vulnerability-not-found.d8a4d43c.svg +65 -1
- package/dist/assets/ic-warning-y5.2ad9d7f4.svg +20 -1
- package/dist/assets/ic-warning.10bcf8bd.svg +23 -1
- package/dist/assets/ic-webhook.d4431b07.svg +31 -1
- package/dist/assets/ic-world.1f6a5eaf.svg +19 -1
- package/dist/assets/inject-tag.28e72db6.svg +21 -1
- package/dist/assets/lifebuoy.7d8fdf27.png +0 -0
- package/dist/assets/no-artifact@2x.6afc74bc.png +0 -0
- package/dist/index.js +560 -555
- package/package.json +7 -7
- package/dist/yaml.worker.d.ts +0 -0
@@ -2,7 +2,7 @@ import { j as n, J as A } from "./@vendor-DI8rS9OQ.js";
|
|
2
2
|
import E, { forwardRef as $ } from "react";
|
3
3
|
import L, { getDefaultRegistry as k } from "@rjsf/core";
|
4
4
|
import D from "@rjsf/validator-ajv8";
|
5
|
-
import { T as y, c as H, a as J, d as w } from "./@code-editor-
|
5
|
+
import { T as y, c as H, a as J, d as w } from "./@code-editor-CzAjJrLY.js";
|
6
6
|
import M, { components as O } from "react-select";
|
7
7
|
import { getUiOptions as B, getTemplate as I, getSubmitButtonOptions as U, ADDITIONAL_PROPERTY_FLAG as P, errorId as W, englishStringTranslator as V, TranslatableString as q, titleId as K, canExpand as Y, deepEquals as z } from "@rjsf/utils";
|
8
8
|
import { ReactComponent as G } from "./assets/ic-chevron-down.fc70d7a7.svg";
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { ResizableTagTextAreaProps } from './Types';
|
2
|
-
export declare const ResizableTagTextArea: ({
|
2
|
+
export declare const ResizableTagTextArea: ({ value, minHeight, maxHeight, onBlur, onFocus, refVar, dependentRef, dependentRefs, className, disableOnBlurResizeToMinHeight, id, ...restProps }: ResizableTagTextAreaProps) => JSX.Element;
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { DetailedHTMLProps, MutableRefObject, TextareaHTMLAttributes } from 'react';
|
1
2
|
import { KEY_VALUE } from '../Constants';
|
2
3
|
import { OptionType } from '../Types';
|
3
4
|
export interface SuggestedTagOptionType extends OptionType {
|
@@ -48,24 +49,16 @@ export interface TagLabelValueSelectorType {
|
|
48
49
|
tagInputType?: KEY_VALUE;
|
49
50
|
placeholder?: string;
|
50
51
|
tabIndex?: number;
|
51
|
-
refVar?:
|
52
|
-
dependentRef?:
|
52
|
+
refVar?: MutableRefObject<HTMLTextAreaElement>;
|
53
|
+
dependentRef?: MutableRefObject<HTMLTextAreaElement>;
|
53
54
|
noBackDrop?: boolean;
|
54
55
|
}
|
55
|
-
export interface ResizableTagTextAreaProps {
|
56
|
-
className?: string;
|
56
|
+
export interface ResizableTagTextAreaProps extends Omit<DetailedHTMLProps<TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, 'value'> {
|
57
57
|
minHeight?: number;
|
58
58
|
maxHeight?: number;
|
59
|
-
value
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
placeholder?: string;
|
64
|
-
tabIndex?: number;
|
65
|
-
refVar?: React.MutableRefObject<HTMLTextAreaElement>;
|
66
|
-
dependentRef?: React.MutableRefObject<HTMLTextAreaElement>;
|
67
|
-
dataTestId?: string;
|
68
|
-
handleKeyDown?: any;
|
69
|
-
disabled?: boolean;
|
59
|
+
value: string;
|
60
|
+
refVar?: MutableRefObject<HTMLTextAreaElement>;
|
61
|
+
dependentRef?: MutableRefObject<HTMLTextAreaElement>;
|
62
|
+
dependentRefs?: Record<string | number, MutableRefObject<HTMLTextAreaElement>>;
|
70
63
|
disableOnBlurResizeToMinHeight?: boolean;
|
71
64
|
}
|
package/dist/Common/Helper.d.ts
CHANGED
@@ -2,6 +2,7 @@ import { default as React, SyntheticEvent } from 'react';
|
|
2
2
|
import { JSONPathOptions } from 'jsonpath-plus';
|
3
3
|
import { AsyncOptions, UseSearchString } from './Types';
|
4
4
|
import { scrollableInterface } from '../Shared';
|
5
|
+
import * as Sentry from '@sentry/browser';
|
5
6
|
export declare function showError(serverError: any, showToastOnUnknownError?: boolean, hideAccessError?: boolean): void;
|
6
7
|
interface ConditionalWrapper<T> {
|
7
8
|
condition: boolean;
|
@@ -45,7 +46,7 @@ export declare const getUrlWithSearchParams: <T extends string | number = string
|
|
45
46
|
/**
|
46
47
|
* Custom exception logger function for logging errors to sentry
|
47
48
|
*/
|
48
|
-
export declare const logExceptionToSentry:
|
49
|
+
export declare const logExceptionToSentry: typeof Sentry.captureException;
|
49
50
|
export declare const customStyles: {
|
50
51
|
control: (base: any, state: any) => any;
|
51
52
|
indicatorSeparator: (base: any, state: any) => any;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { OptionType } from '../Types';
|
2
|
+
export declare enum SegmentedControlVariant {
|
3
|
+
GRAY_ON_WHITE = "gui-yaml-switch",
|
4
|
+
WHITE_ON_GRAY = "gui-yaml-switch-window-bg"
|
5
|
+
}
|
6
|
+
export interface SegmentedControlProps {
|
7
|
+
tabs: OptionType[];
|
8
|
+
initialTab: string;
|
9
|
+
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
10
|
+
tooltips?: string[];
|
11
|
+
disabled?: boolean;
|
12
|
+
rootClassName?: string;
|
13
|
+
variant?: SegmentedControlVariant;
|
14
|
+
}
|
package/dist/Common/Types.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import { default as React, ReactNode, CSSProperties, ReactElement, MutableRefObject } from 'react';
|
2
|
+
import { TippyProps } from '@tippyjs/react';
|
2
3
|
import { Placement } from 'tippy.js';
|
3
4
|
import { UserGroupDTO } from '../Pages/GlobalConfigurations';
|
4
5
|
import { ImageComment, ReleaseTag } from './ImageTags.Types';
|
@@ -65,7 +66,7 @@ export interface CheckboxProps {
|
|
65
66
|
id?: string;
|
66
67
|
dataTestId?: string;
|
67
68
|
}
|
68
|
-
export interface TippyCustomizedProps {
|
69
|
+
export interface TippyCustomizedProps extends Pick<TippyProps, 'appendTo'> {
|
69
70
|
theme: TippyTheme;
|
70
71
|
visible?: boolean;
|
71
72
|
heading?: ReactNode | string;
|
package/dist/Common/index.d.ts
CHANGED
@@ -33,12 +33,7 @@ type CustomInputConfigOrChildrenType = {
|
|
33
33
|
customInputConfig?: never;
|
34
34
|
children?: never;
|
35
35
|
};
|
36
|
-
|
37
|
-
title: string;
|
38
|
-
subtitle: ReactNode;
|
39
|
-
handleClose: (e?: SyntheticEvent) => void;
|
40
|
-
showConfirmationModal: boolean;
|
41
|
-
} & ({
|
36
|
+
type ButtonConfigAndVariantType = {
|
42
37
|
variant: Exclude<ConfirmationModalVariantType, ConfirmationModalVariantType.custom>;
|
43
38
|
Icon?: never;
|
44
39
|
buttonConfig: ButtonConfig<Pick<ButtonProps, 'isLoading' | 'disabled'>, Pick<ButtonProps, 'disabled'>>;
|
@@ -46,5 +41,12 @@ export type ConfirmationModalProps = {
|
|
46
41
|
variant: ConfirmationModalVariantType.custom;
|
47
42
|
Icon: FunctionComponent<SVGProps<SVGSVGElement>>;
|
48
43
|
buttonConfig: ButtonConfig<Pick<ButtonProps, 'isLoading' | 'disabled' | 'style'>, Pick<ButtonProps, 'disabled' | 'style'>>;
|
49
|
-
}
|
44
|
+
};
|
45
|
+
export type ConfirmationModalProps = {
|
46
|
+
title: string;
|
47
|
+
subtitle: ReactNode;
|
48
|
+
handleClose: (e?: SyntheticEvent) => void;
|
49
|
+
showConfirmationModal: boolean;
|
50
|
+
} & ButtonConfigAndVariantType & CustomInputConfigOrChildrenType;
|
51
|
+
export type ConfirmationModalBodyProps = Omit<ConfirmationModalProps, 'showConfirmationModal'>;
|
50
52
|
export {};
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import { DynamicDataTableHeaderProps } from './types';
|
2
|
+
export declare const DynamicDataTableHeader: <K extends string, CustomStateType = Record<string, unknown>>({ headers, rows, sortingConfig, onRowAdd, readOnly, isAdditionNotAllowed, isDeletionNotAllowed, headerComponent, actionButtonConfig, }: DynamicDataTableHeaderProps<K, CustomStateType>) => JSX.Element;
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import { DynamicDataTableRowProps } from './types';
|
2
|
+
export declare const DynamicDataTableRow: <K extends string, CustomStateType = Record<string, unknown>>({ rows, headers, readOnly, isDeletionNotAllowed, cellError, actionButtonConfig, onRowEdit, onRowDelete, leadingCellIcon, trailingCellIcon, buttonCellWrapComponent, }: DynamicDataTableRowProps<K, CustomStateType>) => JSX.Element;
|
@@ -0,0 +1,162 @@
|
|
1
|
+
import { DetailedHTMLProps, ReactElement, ReactNode } from 'react';
|
2
|
+
import { ResizableTagTextAreaProps } from '../../../Common/CustomTagSelector';
|
3
|
+
import { UseStateFiltersReturnType } from '../../../Common/Hooks';
|
4
|
+
import { TooltipProps } from '@Common/Tooltip/types';
|
5
|
+
import { SelectPickerOptionType, SelectPickerProps } from '../SelectPicker';
|
6
|
+
import { SelectTextAreaProps } from '../SelectTextArea';
|
7
|
+
/**
|
8
|
+
* Interface representing header for a dynamic data table.
|
9
|
+
* @template K - A string representing the key type.
|
10
|
+
*/
|
11
|
+
export type DynamicDataTableHeaderType<K extends string> = {
|
12
|
+
/** The display label of the header, shown in the table's column header. */
|
13
|
+
label: string;
|
14
|
+
/** The unique key associated with the header, used to map the column to data fields. */
|
15
|
+
key: K;
|
16
|
+
/** The width of the column, defined as a CSS string (e.g., "100px", "10%", "1fr", or "auto"). */
|
17
|
+
width: string;
|
18
|
+
/** An optional boolean indicating whether the column is sortable. */
|
19
|
+
isSortable?: boolean;
|
20
|
+
/** An optional boolean to control the visibility of the column. */
|
21
|
+
isHidden?: boolean;
|
22
|
+
};
|
23
|
+
export declare enum DynamicDataTableRowDataType {
|
24
|
+
TEXT = "text",
|
25
|
+
DROPDOWN = "dropdown",
|
26
|
+
SELECT_TEXT = "select-text",
|
27
|
+
BUTTON = "button"
|
28
|
+
}
|
29
|
+
export type DynamicDataTableCellPropsMap = {
|
30
|
+
[DynamicDataTableRowDataType.TEXT]: Omit<ResizableTagTextAreaProps, 'id' | 'className' | 'minHeight' | 'maxHeight' | 'value' | 'onChange' | 'disabled' | 'disableOnBlurResizeToMinHeight' | 'refVar' | 'dependentRef'>;
|
31
|
+
[DynamicDataTableRowDataType.DROPDOWN]: Omit<SelectPickerProps<string, false>, 'inputId' | 'value' | 'onChange' | 'fullWidth' | 'isDisabled'>;
|
32
|
+
[DynamicDataTableRowDataType.SELECT_TEXT]: Omit<SelectTextAreaProps, 'value' | 'onChange' | 'inputId' | 'isDisabled' | 'dependentRef' | 'refVar' | 'textAreaProps'> & {
|
33
|
+
textAreaProps?: Omit<SelectTextAreaProps['textAreaProps'], 'className' | 'disableOnBlurResizeToMinHeight' | 'minHeight' | 'maxHeight'>;
|
34
|
+
};
|
35
|
+
[DynamicDataTableRowDataType.BUTTON]: Pick<DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, 'onClick'> & {
|
36
|
+
icon?: ReactNode;
|
37
|
+
text: string;
|
38
|
+
};
|
39
|
+
};
|
40
|
+
type DynamicDataTableCellData<T extends keyof DynamicDataTableCellPropsMap = keyof DynamicDataTableCellPropsMap> = T extends keyof DynamicDataTableCellPropsMap ? {
|
41
|
+
type: T;
|
42
|
+
props: DynamicDataTableCellPropsMap[T];
|
43
|
+
} : never;
|
44
|
+
/**
|
45
|
+
* Type representing a key-value row.
|
46
|
+
* @template K - A string representing the key type.
|
47
|
+
*/
|
48
|
+
export type DynamicDataTableRowType<K extends string, CustomStateType = Record<string, unknown>> = {
|
49
|
+
data: {
|
50
|
+
[key in K]: {
|
51
|
+
value: string;
|
52
|
+
disabled?: boolean;
|
53
|
+
/** An optional boolean indicating if an asterisk should be shown. */
|
54
|
+
required?: boolean;
|
55
|
+
/** An optional tooltip to show when hovering over cell. */
|
56
|
+
tooltip?: Partial<Pick<TooltipProps, 'content' | 'className'>>;
|
57
|
+
} & DynamicDataTableCellData;
|
58
|
+
};
|
59
|
+
id: string | number;
|
60
|
+
/** */
|
61
|
+
customState?: CustomStateType;
|
62
|
+
/** An optional boolean indicating if row deletion is disabled. */
|
63
|
+
disableDelete?: boolean;
|
64
|
+
};
|
65
|
+
/**
|
66
|
+
* Represents the validation state of a cell in a dynamic data table.
|
67
|
+
*/
|
68
|
+
export type DynamicDataTableCellValidationState = {
|
69
|
+
isValid: boolean;
|
70
|
+
errorMessages: string[];
|
71
|
+
};
|
72
|
+
/**
|
73
|
+
* Defines the structure of validation errors for a cell.
|
74
|
+
*
|
75
|
+
* `K` represents the column `key` of the cell (i.e., the column identifiers).
|
76
|
+
*/
|
77
|
+
export type DynamicDataTableCellErrorType<K extends string> = {
|
78
|
+
[rowId: string | number]: Partial<Record<K, DynamicDataTableCellValidationState>>;
|
79
|
+
};
|
80
|
+
type DynamicDataTableCellIcon<K extends string, CustomStateType = Record<string, unknown>> = {
|
81
|
+
[key in K]?: (row: DynamicDataTableRowType<K, CustomStateType>) => ReactNode;
|
82
|
+
};
|
83
|
+
/**
|
84
|
+
* Interface representing the properties for the dynamic data table component.
|
85
|
+
* @template K - A string representing the key type.
|
86
|
+
*/
|
87
|
+
export type DynamicDataTableProps<K extends string, CustomStateType = Record<string, unknown>> = {
|
88
|
+
/**
|
89
|
+
* An array containing the headers for the data table. \
|
90
|
+
* Each header defines a column with its label, key, width, and optional settings.
|
91
|
+
*/
|
92
|
+
headers: DynamicDataTableHeaderType<K>[];
|
93
|
+
/**
|
94
|
+
* An array of rows where each row contains data corresponding to the table headers.
|
95
|
+
*/
|
96
|
+
rows: DynamicDataTableRowType<K, CustomStateType>[];
|
97
|
+
/** Optional configuration for sorting the table. */
|
98
|
+
sortingConfig?: Pick<UseStateFiltersReturnType<K>, 'sortBy' | 'sortOrder' | 'handleSorting'>;
|
99
|
+
/** Optional configuration for displaying an icon in the leading position of a cell. */
|
100
|
+
leadingCellIcon?: DynamicDataTableCellIcon<K, CustomStateType>;
|
101
|
+
/** Optional configuration for displaying an icon in the trailing position of a cell. */
|
102
|
+
trailingCellIcon?: DynamicDataTableCellIcon<K, CustomStateType>;
|
103
|
+
/** An optional function to render a custom wrapper component for the type `DynamicDataTableRowDataType.BUTTON`. */
|
104
|
+
buttonCellWrapComponent?: (row: DynamicDataTableRowType<K, CustomStateType>) => ReactElement;
|
105
|
+
/** An optional React node for a custom header component. */
|
106
|
+
headerComponent?: ReactNode;
|
107
|
+
/** When true, data addition field will not be shown. */
|
108
|
+
isAdditionNotAllowed?: boolean;
|
109
|
+
/** When true, data addition field will not be shown. */
|
110
|
+
isDeletionNotAllowed?: boolean;
|
111
|
+
/** When true, data add or update is disabled. */
|
112
|
+
readOnly?: boolean;
|
113
|
+
/** Function to handle the addition of a new row to the table. */
|
114
|
+
onRowAdd: () => void;
|
115
|
+
/**
|
116
|
+
* Function to handle changes in the table rows.
|
117
|
+
* @param row - The row that changed.
|
118
|
+
* @param headerKey - The key of the header that changed.
|
119
|
+
* @param value - The value of the cell.
|
120
|
+
* @param extraData - Additional data, such as a selected value for dropdowns.
|
121
|
+
*/
|
122
|
+
onRowEdit: (row: DynamicDataTableRowType<K, CustomStateType>, headerKey: K, value: string, extraData: {
|
123
|
+
selectedValue?: SelectPickerOptionType<string>;
|
124
|
+
}) => void;
|
125
|
+
/**
|
126
|
+
* Function to handle row deletions.
|
127
|
+
* @param row - The row that was deleted.
|
128
|
+
*/
|
129
|
+
onRowDelete: (row: DynamicDataTableRowType<K, CustomStateType>) => void;
|
130
|
+
/** Optional configuration for rendering a custom action button in a row. */
|
131
|
+
actionButtonConfig?: {
|
132
|
+
/**
|
133
|
+
* Function to render the action button.
|
134
|
+
* @param row - The current row being rendered.
|
135
|
+
* @returns A React node representing the action button.
|
136
|
+
*/
|
137
|
+
renderer: (row: DynamicDataTableRowType<K, CustomStateType>) => ReactNode;
|
138
|
+
/**
|
139
|
+
* This represents under which header key the action button will be rendered.
|
140
|
+
*/
|
141
|
+
key: K;
|
142
|
+
/**
|
143
|
+
* The width of the action button.
|
144
|
+
* @default '33px'
|
145
|
+
*/
|
146
|
+
width?: string;
|
147
|
+
/**
|
148
|
+
* The position of the action button under the header key.
|
149
|
+
* @default 'start'
|
150
|
+
*/
|
151
|
+
position?: 'start' | 'end';
|
152
|
+
};
|
153
|
+
/**
|
154
|
+
* Validation state for a specific cell in a dynamic data table.
|
155
|
+
*/
|
156
|
+
cellError?: DynamicDataTableCellErrorType<K>;
|
157
|
+
};
|
158
|
+
export interface DynamicDataTableHeaderProps<K extends string, CustomStateType = Record<string, unknown>> extends Pick<DynamicDataTableProps<K, CustomStateType>, 'headers' | 'rows' | 'headerComponent' | 'sortingConfig' | 'onRowAdd' | 'readOnly' | 'isAdditionNotAllowed' | 'isDeletionNotAllowed' | 'actionButtonConfig'> {
|
159
|
+
}
|
160
|
+
export interface DynamicDataTableRowProps<K extends string, CustomStateType = Record<string, unknown>> extends Pick<DynamicDataTableProps<K, CustomStateType>, 'rows' | 'headers' | 'isAdditionNotAllowed' | 'isDeletionNotAllowed' | 'readOnly' | 'onRowEdit' | 'onRowDelete' | 'actionButtonConfig' | 'cellError' | 'leadingCellIcon' | 'trailingCellIcon' | 'buttonCellWrapComponent'> {
|
161
|
+
}
|
162
|
+
export {};
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { DynamicDataTableHeaderType, DynamicDataTableProps, DynamicDataTableRowDataType } from './types';
|
2
|
+
export declare const getActionButtonPosition: <K extends string, CustomStateType = Record<string, unknown>>({ headers, actionButtonConfig, }: Pick<DynamicDataTableProps<K, CustomStateType>, "headers" | "actionButtonConfig">) => number;
|
3
|
+
export declare const getHeaderGridTemplateColumn: <K extends string, CustomStateType = Record<string, unknown>>(headers: DynamicDataTableHeaderType<K>[], actionButtonConfig: DynamicDataTableProps<K, CustomStateType>["actionButtonConfig"], noDeleteBtn: boolean) => string;
|
4
|
+
export declare const getRowGridTemplateColumn: <K extends string, CustomStateType = Record<string, unknown>>(headers: DynamicDataTableHeaderType<K>[], actionButtonConfig: DynamicDataTableProps<K, CustomStateType>["actionButtonConfig"], noDeleteBtn: boolean) => string;
|
5
|
+
export declare const rowTypeHasInputField: (type: DynamicDataTableRowDataType) => boolean;
|
@@ -1,2 +1,4 @@
|
|
1
1
|
import { InvalidYAMLTippyWrapperProps } from './types';
|
2
|
-
export declare const getInvalidTippyContent: ({ parsingError, restoreLastSavedYAML, }: Pick<InvalidYAMLTippyWrapperProps, "parsingError" | "restoreLastSavedYAML">
|
2
|
+
export declare const getInvalidTippyContent: ({ type, parsingError, restoreLastSavedYAML, }: Pick<InvalidYAMLTippyWrapperProps, "parsingError" | "restoreLastSavedYAML"> & {
|
3
|
+
type?: "yaml" | "json";
|
4
|
+
}) => JSX.Element;
|
@@ -18,7 +18,7 @@ export interface KeyValueHeader<K extends string> {
|
|
18
18
|
*/
|
19
19
|
export type KeyValueRow<K extends string> = {
|
20
20
|
data: {
|
21
|
-
[key in K]: Pick<ResizableTagTextAreaProps, 'value' | '
|
21
|
+
[key in K]: Pick<ResizableTagTextAreaProps, 'value' | 'disabled' | 'tabIndex'> & {
|
22
22
|
/** An optional boolean indicating if an asterisk should be shown. */
|
23
23
|
required?: boolean;
|
24
24
|
};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { ReactElement } from 'react';
|
2
|
+
import { ResizableTagTextAreaProps } from '../../../Common/CustomTagSelector';
|
3
|
+
import { SelectPickerOptionType, SelectPickerProps } from '../SelectPicker';
|
4
|
+
export type SelectTextAreaProps = Pick<SelectPickerProps<string, false>, 'inputId' | 'options'> & Pick<ResizableTagTextAreaProps, 'refVar' | 'dependentRefs'> & {
|
5
|
+
value: string;
|
6
|
+
Icon?: ReactElement;
|
7
|
+
onChange?: (selectedValue: SelectPickerOptionType<string>) => void;
|
8
|
+
disabled?: boolean;
|
9
|
+
placeholder?: string;
|
10
|
+
textAreaProps?: Omit<ResizableTagTextAreaProps, 'refVar' | 'dependentRef' | 'id' | 'value' | 'onChange' | 'placeholder' | 'disabled'>;
|
11
|
+
selectPickerProps?: Omit<SelectPickerProps<string, false>, 'inputId' | 'options' | 'isDisabled' | 'onChange' | 'variant' | 'value' | 'placeholder' | 'fullWidth' | 'selectRef' | 'onCreateOption' | 'isMulti'>;
|
12
|
+
};
|
@@ -9,6 +9,7 @@ export declare const IndexStore: {
|
|
9
9
|
getEnvDetails: () => EnvDetails;
|
10
10
|
getEnvDetailsObservable: () => import('rxjs').Observable<EnvDetails>;
|
11
11
|
publishAppDetails: (data: AppDetails, appType: AppType) => void;
|
12
|
+
clearAppDetails(): void;
|
12
13
|
getAppDetails: () => AppDetails;
|
13
14
|
getAppDetailsObservable: () => import('rxjs').Observable<AppDetails>;
|
14
15
|
getAppDetailsNodes: () => Node[];
|
package/dist/Shared/types.d.ts
CHANGED
@@ -585,6 +585,7 @@ export declare enum ConfigurationType {
|
|
585
585
|
GUI = "GUI",
|
586
586
|
YAML = "YAML"
|
587
587
|
}
|
588
|
+
export declare const CONFIGURATION_TYPE_OPTIONS: OptionType<ConfigurationType, ConfigurationType>[];
|
588
589
|
export interface BaseURLParams {
|
589
590
|
appId: string;
|
590
591
|
envId: string;
|