@devtron-labs/devtron-fe-common-lib 1.2.6-beta-2 → 1.2.7-beta-1
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-_onshah4.js → @code-editor-DNKnnjou.js} +5986 -5661
- package/dist/{@common-rjsf-D6NBS9PZ.js → @common-rjsf-DG46ATXL.js} +2 -2
- package/dist/{@framer-motion-DFECMTRh.js → @framer-motion-DHY98qq3.js} +1 -1
- package/dist/{@react-dates-MalCS5BJ.js → @react-dates-WNnwjI5S.js} +1 -1
- package/dist/{@react-select-B8JuvbeY.js → @react-select-BbR996pa.js} +50 -50
- package/dist/{@vendor-CPMO6uwj.js → @vendor-RU8AW1bK.js} +93 -94
- package/dist/Common/CodeEditor/CodeEditor.reducer.d.ts +1 -2
- package/dist/Common/CodeEditor/types.d.ts +1 -2
- package/dist/Common/Constants.d.ts +0 -3
- 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 -3
- package/dist/Common/Markdown/MarkDown.d.ts +1 -1
- package/dist/Common/RJSF/index.d.ts +1 -1
- package/dist/Common/Types.d.ts +2 -1
- package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/types.d.ts +3 -21
- package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/OverrideStrategyTippyContent.d.ts +1 -2
- package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/index.d.ts +0 -1
- package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/types.d.ts +0 -7
- package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/utils.d.ts +1 -1
- package/dist/Pages/index.d.ts +0 -1
- package/dist/Shared/Components/CollapsibleList/CollapsibleList.types.d.ts +0 -6
- 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/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 -1
- package/dist/Shared/Helpers.d.ts +3 -5
- package/dist/Shared/Hooks/useForm/useForm.d.ts +0 -4
- package/dist/Shared/Services/app.types.d.ts +0 -4
- package/dist/assets/@code-editor.css +1 -1
- package/dist/assets/ic-clear-square.e60de021.svg +8 -0
- package/dist/assets/ic-file-code.21a1f748.svg +7 -0
- package/dist/assets/ic-stamp.8689f42d.svg +9 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.js +498 -503
- package/package.json +1 -1
- package/dist/Pages/App/AppConfiguration/DeploymentTemplate/GUIView/index.d.ts +0 -2
- package/dist/Pages/App/AppConfiguration/DeploymentTemplate/GUIView/types.d.ts +0 -2
- package/dist/Pages/App/AppConfiguration/DeploymentTemplate/GUIView/utils.d.ts +0 -6
- package/dist/Pages/App/AppConfiguration/DeploymentTemplate/index.d.ts +0 -1
- package/dist/Pages/App/AppConfiguration/index.d.ts +0 -1
- package/dist/Pages/App/index.d.ts +0 -1
- package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/ConfigMapSecret/index.d.ts +0 -1
- package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/ConfigMapSecret/utils.d.ts +0 -3
- package/dist/Shared/Components/EnterpriseTag/EnterpriseTag.component.d.ts +0 -2
- package/dist/Shared/Components/EnterpriseTag/index.d.ts +0 -1
- package/dist/assets/ic-file-code.80000c9b.svg +0 -7
- package/dist/assets/ic-medal.4a7e5cbc.svg +0 -3
- package/dist/assets/ic-stamp.526499d2.svg +0 -7
@@ -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
@@ -59,10 +59,9 @@ export declare const getFilteredChartVersions: (charts: any, selectedChartType:
|
|
59
59
|
* @param {object} object from which we need to delete nulls in its arrays
|
60
60
|
* @returns object after removing (in-place) the null items in arrays
|
61
61
|
*/
|
62
|
-
export declare const
|
62
|
+
export declare const recursivelyRemoveNullsFromArraysInObject: (object: object) => object;
|
63
63
|
/**
|
64
64
|
* Merges the objects into one object
|
65
|
-
* Works more like Object.assign; that doesn't deep copy
|
66
65
|
* @param {object[]} objects list of js objects
|
67
66
|
* @returns object after the merge
|
68
67
|
*/
|
@@ -91,7 +90,7 @@ export declare const getRegexMatchPositions: (string: string, regex: RegExp) =>
|
|
91
90
|
export declare const powerSetOfSubstringsFromStart: (strings: string[], regex: RegExp) => string[];
|
92
91
|
export declare const convertJSONPointerToJSONPath: (pointer: string) => string;
|
93
92
|
export declare const flatMapOfJSONPaths: (paths: string[], json: object, resultType?: JSONPathOptions["resultType"]) => string[];
|
94
|
-
export declare const applyCompareDiffOnUneditedDocument: (uneditedDocument: object, editedDocument: object) =>
|
93
|
+
export declare const applyCompareDiffOnUneditedDocument: (uneditedDocument: object, editedDocument: object) => object;
|
95
94
|
/**
|
96
95
|
* Returns a debounced variant of the function
|
97
96
|
*/
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { MarkDownProps } from './Types';
|
2
|
-
declare const MarkDown: ({ setExpandableIcon, markdown
|
2
|
+
declare const MarkDown: ({ setExpandableIcon, markdown, className, breaks, disableEscapedText, ...props }: MarkDownProps) => JSX.Element;
|
3
3
|
export default MarkDown;
|
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/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/types.d.ts
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
import { DraftMetadataDTO, TemplateListType } from '../../../../../../Shared/Services';
|
2
|
-
import { ServerErrors } from '../../../../../../Common/ServerError';
|
3
2
|
import { OverrideMergeStrategyType } from '../types';
|
4
3
|
export type DeploymentChartOptionkind = 'base' | 'env' | 'chartVersion' | 'deployment';
|
5
4
|
export interface DeploymentChartVersionType {
|
@@ -109,15 +108,15 @@ interface BaseDeploymentTemplateConfigState {
|
|
109
108
|
environmentConfig?: never;
|
110
109
|
mergeStrategy?: never;
|
111
110
|
}
|
112
|
-
|
111
|
+
interface EnvironmentOverrideDeploymentTemplateConfigState {
|
113
112
|
chartConfig?: never;
|
114
113
|
isOverridden: boolean;
|
115
114
|
environmentConfig: EnvironmentConfigType;
|
116
115
|
mergeStrategy: OverrideMergeStrategyType;
|
117
|
-
}
|
116
|
+
}
|
118
117
|
export interface DeploymentTemplateConfigCommonState extends SelectedChartDetailsType {
|
119
118
|
/**
|
120
|
-
* The first ever state of the deployment template
|
119
|
+
* The first ever state of the deployment template
|
121
120
|
*/
|
122
121
|
originalTemplate: Record<string, string>;
|
123
122
|
isAppMetricsEnabled: boolean;
|
@@ -127,23 +126,6 @@ export interface DeploymentTemplateConfigCommonState extends SelectedChartDetail
|
|
127
126
|
latestDraft?: DraftMetadataDTO;
|
128
127
|
editorTemplate: string;
|
129
128
|
editorTemplateWithoutLockedKeys: string;
|
130
|
-
/**
|
131
|
-
* This final template to be applied on the deployment in string format
|
132
|
-
* In current editor, this may be null initially
|
133
|
-
*/
|
134
|
-
mergedTemplate: string | null;
|
135
|
-
/**
|
136
|
-
* This final template to be applied on the deployment without locked keys in string format
|
137
|
-
* In current editor, this may be null initially
|
138
|
-
*/
|
139
|
-
mergedTemplateWithoutLockedKeys: string | null;
|
140
|
-
/**
|
141
|
-
* This final template to be applied on the deployment in object format
|
142
|
-
* In current editor, this may be null initially
|
143
|
-
*/
|
144
|
-
mergedTemplateObject: Record<string, string> | null;
|
145
|
-
isLoadingMergedTemplate: boolean;
|
146
|
-
mergedTemplateError: ServerErrors | null;
|
147
129
|
}
|
148
130
|
export type DeploymentTemplateConfigState = DeploymentTemplateConfigCommonState & (BaseDeploymentTemplateConfigState | EnvironmentOverrideDeploymentTemplateConfigState);
|
149
131
|
type DTApplicationMetricsReadOnlyProps = {
|
@@ -1,3 +1,2 @@
|
|
1
|
-
|
2
|
-
declare const OverrideStrategyTippyContent: ({ children }: OverrideStrategyTippyContentProps) => JSX.Element;
|
1
|
+
declare const OverrideStrategyTippyContent: () => JSX.Element;
|
3
2
|
export default OverrideStrategyTippyContent;
|
@@ -20,15 +20,8 @@ export interface ConfigToolbarPopupMenuConfigType {
|
|
20
20
|
disabled?: boolean;
|
21
21
|
icon?: ReactNode | null;
|
22
22
|
variant?: 'default' | 'negative';
|
23
|
-
tooltipText?: string;
|
24
23
|
}
|
25
24
|
export declare enum ConfigToolbarPopupNodeType {
|
26
25
|
DISCARD_DRAFT = "discardDraft",
|
27
26
|
EDIT_HISTORY = "editHistory"
|
28
27
|
}
|
29
|
-
export interface OverrideStrategyTippyContentProps {
|
30
|
-
/**
|
31
|
-
* Would be rendered as li conveying the information about the merge strategy
|
32
|
-
*/
|
33
|
-
children?: ReactNode;
|
34
|
-
}
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { DeploymentStageType } from '../../../../../Shared/constants';
|
2
|
-
export declare const getDeploymentStageTitle: (stage: DeploymentStageType) => "
|
2
|
+
export declare const getDeploymentStageTitle: (stage: DeploymentStageType) => "deployment" | "pre-deployment" | "post-deployment" | "-";
|
package/dist/Pages/index.d.ts
CHANGED
@@ -54,12 +54,6 @@ export type CollapsibleListItem<TabType extends TabOptions = 'navLink'> = Condit
|
|
54
54
|
*/
|
55
55
|
tooltipProps?: TippyProps;
|
56
56
|
};
|
57
|
-
/**
|
58
|
-
* If `true`, clears query parameters during navigation.
|
59
|
-
*
|
60
|
-
* @default false
|
61
|
-
*/
|
62
|
-
clearQueryParamsOnNavigation?: boolean;
|
63
57
|
};
|
64
58
|
export interface CollapsibleListConfig<TabType extends TabOptions = 'navLink'> {
|
65
59
|
/**
|
@@ -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;
|
@@ -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
|
+
};
|
@@ -41,6 +41,6 @@ export * from './Collapse';
|
|
41
41
|
export * from './Security';
|
42
42
|
export * from './Button';
|
43
43
|
export * from './InvalidYAMLTippy';
|
44
|
-
export * from './EnterpriseTag';
|
45
44
|
export * from './ConfirmationModal';
|
46
45
|
export * from './DiffViewer';
|
46
|
+
export * from './DynamicDataTable';
|
package/dist/Shared/Helpers.d.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
import { ReactElement } from 'react';
|
2
2
|
import { Pair } from 'yaml';
|
3
|
-
import { StrictRJSFSchema } from '@rjsf/utils';
|
4
3
|
import { MaterialHistoryType } from '@Shared/Services/app.types';
|
5
4
|
import { MaterialInfo, SortingOrder, UserApprovalConfigType } from '../Common';
|
6
5
|
import { GitTriggers, IntersectionChangeHandler, IntersectionOptions, PreventOutsideFocusProps, WebhookEventNameType } from './types';
|
@@ -67,11 +66,10 @@ export declare const getDefaultValueFromType: (value: unknown) => {};
|
|
67
66
|
*/
|
68
67
|
export declare const groupArrayByObjectKey: <T extends Record<string, any>, K extends keyof T>(array: T[], key: K) => Record<string, T[]>;
|
69
68
|
/**
|
70
|
-
*
|
71
|
-
*
|
72
|
-
* @
|
69
|
+
* @description - Function to get the lower case object
|
70
|
+
* @param input - The input object
|
71
|
+
* @returns Record<string, any>
|
73
72
|
*/
|
74
|
-
export declare const getNullValueFromType: (type: StrictRJSFSchema["type"]) => any;
|
75
73
|
export declare const getLowerCaseObject: (input: any) => Record<string, any>;
|
76
74
|
/**
|
77
75
|
* @description - Function to get the webhook date
|
@@ -61,10 +61,6 @@ export declare const useForm: <T extends Record<keyof T, any> = {}>(options?: {
|
|
61
61
|
keepTouched?: boolean;
|
62
62
|
/** A boolean indicating whether to retain the current error state of the form fields. */
|
63
63
|
keepErrors?: boolean;
|
64
|
-
/** A boolean indicating whether the form should check for dirty state upon reset. */
|
65
|
-
triggerDirty?: boolean;
|
66
|
-
/** A boolean indicating whether the initial values of the form should be retained after reset. If false, provided formData will become initial data. */
|
67
|
-
keepInitialValues?: boolean;
|
68
64
|
}) => void;
|
69
65
|
/** An object representing additional form state. */
|
70
66
|
formState: {
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { OverrideMergeStrategyType } from '../../Pages/Applications';
|
2
1
|
import { ReleaseTag } from '../../Common';
|
3
2
|
interface WebhookDataType {
|
4
3
|
id: number;
|
@@ -148,11 +147,9 @@ export declare enum CMSecretExternalType {
|
|
148
147
|
}
|
149
148
|
export interface ConfigDatum {
|
150
149
|
name: string;
|
151
|
-
mergeStrategy: OverrideMergeStrategyType;
|
152
150
|
type: string;
|
153
151
|
external: boolean;
|
154
152
|
data: Record<string, any>;
|
155
|
-
patchData: Record<string, any>;
|
156
153
|
defaultData: Record<string, any>;
|
157
154
|
global: boolean;
|
158
155
|
externalType: CMSecretExternalType;
|
@@ -175,7 +172,6 @@ export interface ConfigMapSecretDataType {
|
|
175
172
|
id: number;
|
176
173
|
appId: number;
|
177
174
|
configData: ConfigMapSecretDataConfigDatumDTO[];
|
178
|
-
isDeletable: boolean;
|
179
175
|
}
|
180
176
|
export declare enum ConfigResourceType {
|
181
177
|
ConfigMap = "ConfigMap",
|