@devtron-labs/devtron-fe-common-lib 1.2.4-beta-9 → 1.2.4-beta-11

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.
Files changed (70) hide show
  1. package/dist/{@code-editor-PcFhYm66.js → @code-editor-Chu1vTHn.js} +5900 -5475
  2. package/dist/{@common-rjsf-BHHUa3Wt.js → @common-rjsf-BfhqMfwN.js} +2 -2
  3. package/dist/{@framer-motion-DFECMTRh.js → @framer-motion-DHY98qq3.js} +1 -1
  4. package/dist/{@react-dates-MalCS5BJ.js → @react-dates-WNnwjI5S.js} +1 -1
  5. package/dist/{@react-select-B8JuvbeY.js → @react-select-BbR996pa.js} +50 -50
  6. package/dist/{@vendor-CPMO6uwj.js → @vendor-RU8AW1bK.js} +93 -94
  7. package/dist/Common/CIPipeline.Types.d.ts +26 -1
  8. package/dist/Common/CodeEditor/CodeEditor.reducer.d.ts +1 -2
  9. package/dist/Common/CodeEditor/types.d.ts +1 -2
  10. package/dist/Common/Constants.d.ts +1 -2
  11. package/dist/Common/CustomTagSelector/ResizableTagTextArea.d.ts +1 -1
  12. package/dist/Common/CustomTagSelector/Types.d.ts +8 -15
  13. package/dist/Common/Helper.d.ts +1 -1
  14. package/dist/Common/Markdown/MarkDown.d.ts +1 -1
  15. package/dist/Common/PopupMenu.d.ts +1 -1
  16. package/dist/Common/RJSF/Form.d.ts +1 -1
  17. package/dist/Common/RJSF/index.d.ts +1 -1
  18. package/dist/Common/Types.d.ts +5 -3
  19. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/types.d.ts +3 -21
  20. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/OverrideStrategyTippyContent.d.ts +1 -2
  21. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/index.d.ts +0 -1
  22. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/types.d.ts +0 -7
  23. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/utils.d.ts +1 -1
  24. package/dist/Pages/Applications/DevtronApps/Details/CDPipeline/index.d.ts +1 -0
  25. package/dist/Pages/Applications/DevtronApps/Details/CDPipeline/services.d.ts +7 -0
  26. package/dist/Pages/Applications/DevtronApps/Details/CIPipeline/index.d.ts +1 -0
  27. package/dist/Pages/Applications/DevtronApps/Details/CIPipeline/services.d.ts +11 -0
  28. package/dist/Pages/Applications/DevtronApps/Details/index.d.ts +1 -0
  29. package/dist/Pages/index.d.ts +0 -1
  30. package/dist/Shared/Components/CollapsibleList/CollapsibleList.types.d.ts +0 -6
  31. package/dist/Shared/Components/DynamicDataTable/DynamicDataTable.d.ts +2 -0
  32. package/dist/Shared/Components/DynamicDataTable/DynamicDataTableHeader.d.ts +2 -0
  33. package/dist/Shared/Components/DynamicDataTable/DynamicDataTableRow.d.ts +2 -0
  34. package/dist/Shared/Components/DynamicDataTable/constants.d.ts +2 -0
  35. package/dist/Shared/Components/DynamicDataTable/index.d.ts +2 -0
  36. package/dist/Shared/Components/DynamicDataTable/types.d.ts +161 -0
  37. package/dist/Shared/Components/DynamicDataTable/utils.d.ts +5 -0
  38. package/dist/Shared/Components/FileUpload/FileUpload.d.ts +2 -0
  39. package/dist/Shared/Components/FileUpload/index.d.ts +2 -0
  40. package/dist/Shared/Components/FileUpload/types.d.ts +7 -0
  41. package/dist/Shared/Components/KeyValueTable/KeyValueTable.types.d.ts +1 -1
  42. package/dist/Shared/Components/SelectTextArea/SelectTextArea.d.ts +2 -0
  43. package/dist/Shared/Components/SelectTextArea/index.d.ts +2 -0
  44. package/dist/Shared/Components/SelectTextArea/types.d.ts +12 -0
  45. package/dist/Shared/Components/index.d.ts +2 -1
  46. package/dist/Shared/Helpers.d.ts +3 -5
  47. package/dist/Shared/Hooks/useForm/useForm.d.ts +0 -4
  48. package/dist/Shared/Services/app.types.d.ts +0 -4
  49. package/dist/Shared/types.d.ts +32 -2
  50. package/dist/assets/@code-editor.css +1 -1
  51. package/dist/assets/ic-clear-square.e60de021.svg +1 -0
  52. package/dist/assets/ic-cloud-upload.18066e05.svg +1 -0
  53. package/dist/assets/ic-file-code.21a1f748.svg +1 -0
  54. package/dist/assets/ic-stamp.8689f42d.svg +1 -0
  55. package/dist/index.d.ts +0 -2
  56. package/dist/index.js +289 -289
  57. package/package.json +1 -1
  58. package/dist/Pages/App/AppConfiguration/DeploymentTemplate/GUIView/index.d.ts +0 -2
  59. package/dist/Pages/App/AppConfiguration/DeploymentTemplate/GUIView/types.d.ts +0 -2
  60. package/dist/Pages/App/AppConfiguration/DeploymentTemplate/GUIView/utils.d.ts +0 -6
  61. package/dist/Pages/App/AppConfiguration/DeploymentTemplate/index.d.ts +0 -1
  62. package/dist/Pages/App/AppConfiguration/index.d.ts +0 -1
  63. package/dist/Pages/App/index.d.ts +0 -1
  64. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/ConfigMapSecret/index.d.ts +0 -1
  65. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/ConfigMapSecret/utils.d.ts +0 -3
  66. package/dist/Shared/Components/EnterpriseTag/EnterpriseTag.component.d.ts +0 -2
  67. package/dist/Shared/Components/EnterpriseTag/index.d.ts +0 -1
  68. package/dist/assets/ic-file-code.80000c9b.svg +0 -1
  69. package/dist/assets/ic-medal.4a7e5cbc.svg +0 -1
  70. package/dist/assets/ic-stamp.526499d2.svg +0 -1
@@ -4,7 +4,6 @@ export declare const Host: string;
4
4
  export declare const DOCUMENTATION_HOME_PAGE = "https://docs.devtron.ai";
5
5
  export declare const DOCUMENTATION_VERSION = "/v/v0.7";
6
6
  export declare const DISCORD_LINK = "https://discord.devtron.ai/";
7
- export declare const DEFAULT_JSON_SCHEMA_URI = "https://json-schema.org/draft/2020-12/schema";
8
7
  export declare const DOCUMENTATION: {
9
8
  APP_METRICS: string;
10
9
  APP_TAGS: string;
@@ -95,6 +94,7 @@ export declare const ROUTES: {
95
94
  USER_LIST_MIN: string;
96
95
  CONFIG_DATA: string;
97
96
  K8S_RESOURCE_LIST: string;
97
+ FILE_UPLOAD: string;
98
98
  };
99
99
  export declare enum KEY_VALUE {
100
100
  KEY = "key",
@@ -259,7 +259,6 @@ export declare const API_STATUS_CODES: {
259
259
  EXPECTATION_FAILED: number;
260
260
  UNPROCESSABLE_ENTITY: number;
261
261
  LOCKED: number;
262
- UNPROCESSABLE_CONTENT: number;
263
262
  };
264
263
  export declare enum SERVER_MODE {
265
264
  EA_ONLY = "EA_ONLY",
@@ -1,2 +1,2 @@
1
1
  import { ResizableTagTextAreaProps } from './Types';
2
- export declare const ResizableTagTextArea: ({ className, minHeight, maxHeight, value, onChange, onBlur, onFocus, placeholder, tabIndex, refVar, dependentRef, dataTestId, handleKeyDown, disabled, disableOnBlurResizeToMinHeight, }: ResizableTagTextAreaProps) => JSX.Element;
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?: React.MutableRefObject<HTMLTextAreaElement>;
52
- dependentRef?: React.MutableRefObject<HTMLTextAreaElement>;
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?: string;
60
- onChange?: (e: any) => void;
61
- onBlur?: (e: any) => void;
62
- onFocus?: (e: any) => void;
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
  }
@@ -89,7 +89,7 @@ export declare const getRegexMatchPositions: (string: string, regex: RegExp) =>
89
89
  export declare const powerSetOfSubstringsFromStart: (strings: string[], regex: RegExp) => string[];
90
90
  export declare const convertJSONPointerToJSONPath: (pointer: string) => string;
91
91
  export declare const flatMapOfJSONPaths: (paths: string[], json: object, resultType?: JSONPathOptions["resultType"]) => string[];
92
- export declare const applyCompareDiffOnUneditedDocument: (uneditedDocument: object, editedDocument: object) => any;
92
+ export declare const applyCompareDiffOnUneditedDocument: (uneditedDocument: object, editedDocument: object) => object;
93
93
  /**
94
94
  * Returns a debounced variant of the function
95
95
  */
@@ -1,3 +1,3 @@
1
1
  import { MarkDownProps } from './Types';
2
- declare const MarkDown: ({ setExpandableIcon, markdown: markdownProp, className, breaks, disableEscapedText, ...props }: MarkDownProps) => JSX.Element;
2
+ declare const MarkDown: ({ setExpandableIcon, markdown, className, breaks, disableEscapedText, ...props }: MarkDownProps) => JSX.Element;
3
3
  export default MarkDown;
@@ -1,6 +1,6 @@
1
1
  import { PopupMenuBodyType, PopupMenuButtonType, PopupMenuType } from './Types';
2
2
  declare const PopupMenu: {
3
- ({ children, onToggleCallback, autoClose, autoPosition, shouldPreventDefault, }: PopupMenuType): any;
3
+ ({ children, onToggleCallback, autoClose, autoPosition, shouldPreventDefault, disableClose, }: PopupMenuType): any;
4
4
  Button: ({ children, disabled, rootClassName, tabIndex, onHover, isKebab, dataTestId, }: PopupMenuButtonType) => JSX.Element;
5
5
  Body: ({ children, rootClassName, style, autoWidth, preventWheelDisable, noBackDrop, }: PopupMenuBodyType) => JSX.Element;
6
6
  };
@@ -1,3 +1,3 @@
1
1
  import { default as RJSF } from '@rjsf/core';
2
2
  import { FormProps } from './types';
3
- export declare const RJSFForm: import('react').ForwardRefExoticComponent<Pick<FormProps, "name" | "children" | "className" | "disabled" | "id" | "onFocus" | "onBlur" | "onChange" | "onSubmit" | "onError" | "target" | "action" | "tagName" | "autoComplete" | "method" | "noValidate" | "readonly" | "schema" | "uiSchema" | "formContext" | "formData" | "idPrefix" | "idSeparator" | "fields" | "templates" | "widgets" | "translateString" | "acceptcharset" | "acceptCharset" | "enctype" | "customValidate" | "extraErrors" | "extraErrorsBlockSubmit" | "noHtml5Validate" | "liveValidate" | "liveOmit" | "omitExtraData" | "showErrorList" | "transformErrors" | "focusOnFirstError" | "experimental_defaultFormStateBehavior" | "_internalFormWrapper"> & import('react').RefAttributes<RJSF<unknown, import('json-schema').JSONSchema7, import('@rjsf/utils').GenericObjectType>>>;
3
+ export declare const RJSFForm: import('react').ForwardRefExoticComponent<Pick<FormProps, "name" | "id" | "children" | "className" | "disabled" | "onFocus" | "onBlur" | "onChange" | "onSubmit" | "onError" | "target" | "action" | "tagName" | "autoComplete" | "method" | "noValidate" | "readonly" | "schema" | "uiSchema" | "formContext" | "formData" | "idPrefix" | "idSeparator" | "fields" | "templates" | "widgets" | "translateString" | "acceptcharset" | "acceptCharset" | "enctype" | "customValidate" | "extraErrors" | "extraErrorsBlockSubmit" | "noHtml5Validate" | "liveValidate" | "liveOmit" | "omitExtraData" | "showErrorList" | "transformErrors" | "focusOnFirstError" | "experimental_defaultFormStateBehavior" | "_internalFormWrapper"> & import('react').RefAttributes<RJSF<unknown, import('json-schema').JSONSchema7, import('@rjsf/utils').GenericObjectType>>>;
@@ -1,4 +1,4 @@
1
1
  export { RJSFForm } from './Form';
2
- export type * from './types';
2
+ export * from './types';
3
3
  export { getInferredTypeFromValueType, getRedirectionProps } from './utils';
4
4
  export { HIDE_SUBMIT_BUTTON_UI_SCHEMA } from './constants';
@@ -1,8 +1,9 @@
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';
5
- import { MandatoryPluginBaseStateType, RegistryType, RuntimeParamsListItemType, Severity } from '../Shared';
6
+ import { MandatoryPluginBaseStateType, RegistryType, RuntimePluginVariables, Severity } from '../Shared';
6
7
  import { ACTION_STATE, DEPLOYMENT_WINDOW_TYPE, DockerConfigOverrideType, SortingOrder, TaskErrorObj } from '.';
7
8
  /**
8
9
  * Generic response type object with support for overriding the result type
@@ -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;
@@ -229,6 +230,7 @@ export interface PopupMenuType {
229
230
  autoClose?: boolean;
230
231
  autoPosition?: boolean;
231
232
  shouldPreventDefault?: boolean;
233
+ disableClose?: boolean;
232
234
  }
233
235
  export interface PopupMenuButtonType {
234
236
  children?: ReactNode;
@@ -591,7 +593,7 @@ export interface CDMaterialsMetaInfo {
591
593
  * This is the ID of user that has request the material
592
594
  */
593
595
  requestedUserId: number;
594
- runtimeParams: RuntimeParamsListItemType[];
596
+ runtimeParams: RuntimePluginVariables[];
595
597
  }
596
598
  export interface ImagePromotionMaterialInfo {
597
599
  isApprovalPendingForPromotion: boolean;
@@ -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
- type EnvironmentOverrideDeploymentTemplateConfigState = {
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 on editor
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
- import { OverrideStrategyTippyContentProps } from './types';
2
- declare const OverrideStrategyTippyContent: ({ children }: OverrideStrategyTippyContentProps) => JSX.Element;
1
+ declare const OverrideStrategyTippyContent: () => JSX.Element;
3
2
  export default OverrideStrategyTippyContent;
@@ -3,4 +3,3 @@ export * from './types';
3
3
  export * from './constants';
4
4
  export { default as OverrideStrategyTippyContent } from './OverrideStrategyTippyContent';
5
5
  export { getDeploymentStageTitle } from './utils';
6
- export * from './ConfigMapSecret';
@@ -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) => "-" | "pre-deployment" | "post-deployment" | "deployment";
2
+ export declare const getDeploymentStageTitle: (stage: DeploymentStageType) => "deployment" | "pre-deployment" | "post-deployment" | "-";
@@ -1 +1,2 @@
1
1
  export * from './types';
2
+ export * from './services';
@@ -0,0 +1,7 @@
1
+ import { MutableRefObject } from 'react';
2
+ import { UploadFileDTO, UploadFileProps } from '../../../../../Shared/types';
3
+ export declare const uploadCDPipelineFile: ({ file, appId, envId, allowedExtensions, maxUploadSize, abortControllerRef, }: UploadFileProps & {
4
+ appId: number;
5
+ envId: number;
6
+ abortControllerRef?: MutableRefObject<AbortController>;
7
+ }) => Promise<UploadFileDTO>;
@@ -0,0 +1 @@
1
+ export * from './services';
@@ -0,0 +1,11 @@
1
+ import { MutableRefObject } from 'react';
2
+ import { UploadFileDTO } from '../../../../../Shared/types';
3
+ export declare const uploadCIPipelineFile: ({ file, appId, ciPipelineId, envId, allowedExtensions, maxUploadSize, abortControllerRef, }: {
4
+ file: File[];
5
+ appId: number;
6
+ ciPipelineId: number;
7
+ envId?: number;
8
+ allowedExtensions?: string[];
9
+ maxUploadSize?: number;
10
+ abortControllerRef?: MutableRefObject<AbortController>;
11
+ }) => Promise<UploadFileDTO>;
@@ -1,2 +1,3 @@
1
1
  export * from './AppConfigurations';
2
2
  export * from './CDPipeline';
3
+ export * from './CIPipeline';
@@ -1,4 +1,3 @@
1
1
  export * from './GlobalConfigurations';
2
2
  export * from './ResourceBrowser';
3
3
  export * from './Applications';
4
- export * from './App';
@@ -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
  /**
@@ -0,0 +1,2 @@
1
+ import { DynamicDataTableProps } from './types';
2
+ export declare const DynamicDataTable: <K extends string, CustomStateType = Record<string, unknown>>({ headers, ...props }: DynamicDataTableProps<K, CustomStateType>) => JSX.Element;
@@ -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, validationSchema, showError, actionButtonConfig, onRowEdit, onRowDelete, leadingCellIcon, trailingCellIcon, buttonCellWrapComponent, }: DynamicDataTableRowProps<K, CustomStateType>) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ export declare const ACTION_BUTTON_DEFAULT_WIDTH = "33px";
2
+ export declare const DELETE_BUTTON_WIDTH = "33px";
@@ -0,0 +1,2 @@
1
+ export * from './DynamicDataTable';
2
+ export * from './types';
@@ -0,0 +1,161 @@
1
+ import { DetailedHTMLProps, ReactElement, ReactNode } from 'react';
2
+ import { ResizableTagTextAreaProps } from '../../../Common/CustomTagSelector';
3
+ import { UseStateFiltersReturnType } from '../../../Common/Hooks';
4
+ import { SelectPickerOptionType, SelectPickerProps } from '../SelectPicker';
5
+ import { SelectTextAreaProps } from '../SelectTextArea';
6
+ import { FileUploadProps } from '../FileUpload';
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
+ FILE_UPLOAD = "file-upload"
29
+ }
30
+ export type DynamicDataTableCellPropsMap = {
31
+ [DynamicDataTableRowDataType.TEXT]: Omit<ResizableTagTextAreaProps, 'id' | 'className' | 'minHeight' | 'maxHeight' | 'value' | 'onChange' | 'disabled' | 'disableOnBlurResizeToMinHeight' | 'refVar' | 'dependentRef'>;
32
+ [DynamicDataTableRowDataType.DROPDOWN]: Omit<SelectPickerProps<string, false>, 'inputId' | 'value' | 'onChange' | 'fullWidth' | 'isDisabled'>;
33
+ [DynamicDataTableRowDataType.SELECT_TEXT]: Omit<SelectTextAreaProps, 'value' | 'onChange' | 'inputId' | 'isDisabled' | 'dependentRef' | 'refVar' | 'textAreaProps'> & {
34
+ textAreaProps?: Omit<SelectTextAreaProps['textAreaProps'], 'className' | 'disableOnBlurResizeToMinHeight' | 'minHeight' | 'maxHeight'>;
35
+ };
36
+ [DynamicDataTableRowDataType.BUTTON]: Pick<DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, 'onClick'> & {
37
+ icon?: ReactNode;
38
+ text: string;
39
+ };
40
+ [DynamicDataTableRowDataType.FILE_UPLOAD]: Omit<FileUploadProps, 'className' | 'fileName' | 'onUpload' | 'multiple'>;
41
+ };
42
+ type DynamicDataTableCellData<T extends keyof DynamicDataTableCellPropsMap = keyof DynamicDataTableCellPropsMap> = T extends keyof DynamicDataTableCellPropsMap ? {
43
+ type: T;
44
+ props: DynamicDataTableCellPropsMap[T];
45
+ } : never;
46
+ /**
47
+ * Type representing a key-value row.
48
+ * @template K - A string representing the key type.
49
+ */
50
+ export type DynamicDataTableRowType<K extends string, CustomStateType = Record<string, unknown>> = {
51
+ data: {
52
+ [key in K]: {
53
+ value: string;
54
+ disabled?: boolean;
55
+ /** An optional boolean indicating if an asterisk should be shown. */
56
+ required?: boolean;
57
+ /** An optional tooltip text to show when hovering over cell. */
58
+ tooltipText?: string;
59
+ } & DynamicDataTableCellData;
60
+ };
61
+ id: string | number;
62
+ /** */
63
+ customState?: CustomStateType;
64
+ /** An optional boolean indicating if row deletion is disabled. */
65
+ disableDelete?: boolean;
66
+ };
67
+ type DynamicDataTableCellIcon<K extends string, CustomStateType = Record<string, unknown>> = {
68
+ [key in K]?: (row: DynamicDataTableRowType<K, CustomStateType>) => ReactNode;
69
+ };
70
+ /**
71
+ * Interface representing the properties for the dynamic data table component.
72
+ * @template K - A string representing the key type.
73
+ */
74
+ export type DynamicDataTableProps<K extends string, CustomStateType = Record<string, unknown>> = {
75
+ /**
76
+ * An array containing the headers for the data table. \
77
+ * Each header defines a column with its label, key, width, and optional settings.
78
+ */
79
+ headers: DynamicDataTableHeaderType<K>[];
80
+ /**
81
+ * An array of rows where each row contains data corresponding to the table headers.
82
+ */
83
+ rows: DynamicDataTableRowType<K, CustomStateType>[];
84
+ /** Optional configuration for sorting the table. */
85
+ sortingConfig?: Pick<UseStateFiltersReturnType<K>, 'sortBy' | 'sortOrder' | 'handleSorting'>;
86
+ /** Optional configuration for displaying an icon in the leading position of a cell. */
87
+ leadingCellIcon?: DynamicDataTableCellIcon<K, CustomStateType>;
88
+ /** Optional configuration for displaying an icon in the trailing position of a cell. */
89
+ trailingCellIcon?: DynamicDataTableCellIcon<K, CustomStateType>;
90
+ /** An optional function to render a custom wrapper component for the type `DynamicDataTableRowDataType.BUTTON`. */
91
+ buttonCellWrapComponent?: (row: DynamicDataTableRowType<K, CustomStateType>) => ReactElement;
92
+ /** An optional React node for a custom header component. */
93
+ headerComponent?: ReactNode;
94
+ /** When true, data addition field will not be shown. */
95
+ isAdditionNotAllowed?: boolean;
96
+ /** When true, data addition field will not be shown. */
97
+ isDeletionNotAllowed?: boolean;
98
+ /** When true, data add or update is disabled. */
99
+ readOnly?: boolean;
100
+ /** Function to handle the addition of a new row to the table. */
101
+ onRowAdd: () => void;
102
+ /**
103
+ * Function to handle changes in the table rows.
104
+ * @param row - The row that changed.
105
+ * @param headerKey - The key of the header that changed.
106
+ * @param value - The value of the cell.
107
+ * @param extraData - Additional data, such as a selected value for dropdowns.
108
+ */
109
+ onRowEdit: (row: DynamicDataTableRowType<K, CustomStateType>, headerKey: K, value: string, extraData: {
110
+ files?: File[];
111
+ selectedValue?: SelectPickerOptionType<string>;
112
+ }) => void;
113
+ /**
114
+ * Function to handle row deletions.
115
+ * @param row - The row that was deleted.
116
+ */
117
+ onRowDelete: (row: DynamicDataTableRowType<K, CustomStateType>) => void;
118
+ /** Optional configuration for rendering a custom action button in a row. */
119
+ actionButtonConfig?: {
120
+ /**
121
+ * Function to render the action button.
122
+ * @param row - The current row being rendered.
123
+ * @returns A React node representing the action button.
124
+ */
125
+ renderer: (row: DynamicDataTableRowType<K, CustomStateType>) => ReactNode;
126
+ /**
127
+ * This represents under which header key the action button will be rendered.
128
+ */
129
+ key: K;
130
+ /**
131
+ * The width of the action button.
132
+ * @default '33px'
133
+ */
134
+ width?: string;
135
+ /**
136
+ * The position of the action button under the header key.
137
+ * @default 'start'
138
+ */
139
+ position?: 'start' | 'end';
140
+ };
141
+ /**
142
+ * Indicates whether to show errors.
143
+ */
144
+ showError?: boolean;
145
+ /**
146
+ * Function to validate the value of a table cell.
147
+ * @param value - The value to validate.
148
+ * @param key - The column key of the cell.
149
+ * @param row - The row containing the cell.
150
+ * @returns An object with a boolean indicating validity and an array of error messages.
151
+ */
152
+ validationSchema?: (value: string, key: K, row: DynamicDataTableRowType<K, CustomStateType>) => {
153
+ isValid: boolean;
154
+ errorMessages: string[];
155
+ };
156
+ };
157
+ export interface DynamicDataTableHeaderProps<K extends string, CustomStateType = Record<string, unknown>> extends Pick<DynamicDataTableProps<K, CustomStateType>, 'headers' | 'rows' | 'headerComponent' | 'sortingConfig' | 'onRowAdd' | 'readOnly' | 'isAdditionNotAllowed' | 'isDeletionNotAllowed' | 'actionButtonConfig'> {
158
+ }
159
+ export interface DynamicDataTableRowProps<K extends string, CustomStateType = Record<string, unknown>> extends Pick<DynamicDataTableProps<K, CustomStateType>, 'rows' | 'headers' | 'isAdditionNotAllowed' | 'isDeletionNotAllowed' | 'readOnly' | 'onRowEdit' | 'onRowDelete' | 'actionButtonConfig' | 'showError' | 'validationSchema' | 'leadingCellIcon' | 'trailingCellIcon' | 'buttonCellWrapComponent'> {
160
+ }
161
+ 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;
@@ -0,0 +1,2 @@
1
+ import { FileUploadProps } from './types';
2
+ export declare const FileUpload: ({ label, fileName, multiple, fileTypes, onUpload }: FileUploadProps) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ export * from './FileUpload';
2
+ export * from './types';
@@ -0,0 +1,7 @@
1
+ export interface FileUploadProps {
2
+ fileName: string;
3
+ onUpload: (files: File[]) => void;
4
+ multiple?: boolean;
5
+ label?: string;
6
+ fileTypes?: string[];
7
+ }
@@ -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' | 'dataTestId' | 'disabled' | 'tabIndex'> & {
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,2 @@
1
+ import { SelectTextAreaProps } from './types';
2
+ export declare const SelectTextArea: ({ value, Icon, onChange, options, inputId, placeholder, refVar, dependentRefs, disabled, selectPickerProps, textAreaProps, }: SelectTextAreaProps) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ export * from './SelectTextArea';
2
+ export * from './types';
@@ -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,7 @@ 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';
47
+ export * from './FileUpload';
@@ -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
- * This function returns a null/zero value corresponding to @type
71
- *
72
- * @param type - a RJSF supported type
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",