@devtron-labs/devtron-fe-common-lib 0.1.15-beta-18 → 0.1.15-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 (46) hide show
  1. package/dist/Shared/Components/CICDHistory/DeploymentHistoryDiff/DeploymentHistoryDiffView.d.ts +1 -1
  2. package/dist/Shared/Components/CICDHistory/types.d.ts +3 -1
  3. package/dist/Shared/Components/Collapse/Collapse.d.ts +3 -0
  4. package/dist/Shared/Components/Collapse/index.d.ts +2 -0
  5. package/dist/Shared/Components/Collapse/types.d.ts +7 -0
  6. package/dist/Shared/Components/CollapsibleList/CollapsibleList.component.d.ts +3 -0
  7. package/dist/Shared/Components/CollapsibleList/CollapsibleList.types.d.ts +96 -0
  8. package/dist/Shared/Components/CollapsibleList/index.d.ts +2 -0
  9. package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.component.d.ts +3 -0
  10. package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffAccordion.d.ts +3 -0
  11. package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffMain.d.ts +3 -0
  12. package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffNavigation.d.ts +3 -0
  13. package/dist/Shared/Components/DeploymentConfigDiff/index.d.ts +2 -0
  14. package/dist/Shared/Components/DeploymentConfigDiff/types.d.ts +67 -0
  15. package/dist/Shared/Components/GitCommitInfoGeneric/GitMaterialInfoHeader.d.ts +0 -1
  16. package/dist/Shared/Components/KeyValueTable/KeyValueTable.component.d.ts +1 -1
  17. package/dist/Shared/Components/KeyValueTable/KeyValueTable.types.d.ts +23 -1
  18. package/dist/Shared/Components/MaterialHistory/MaterialHistory.component.d.ts +1 -1
  19. package/dist/Shared/Components/MaterialHistory/types.d.ts +0 -1
  20. package/dist/Shared/Components/SelectPicker/SelectPicker.component.d.ts +1 -1
  21. package/dist/Shared/Components/SelectPicker/common.d.ts +1 -1
  22. package/dist/Shared/Components/SelectPicker/type.d.ts +16 -0
  23. package/dist/Shared/Components/SelectPicker/utils.d.ts +1 -1
  24. package/dist/Shared/Components/index.d.ts +3 -0
  25. package/dist/Shared/Helpers.d.ts +2 -0
  26. package/dist/assets/index.css +1 -1
  27. package/dist/{cssMode-d2c005a3.js → cssMode-dab85311.js} +1 -1
  28. package/dist/{freemarker2-baf01dce.js → freemarker2-c7e19b5e.js} +1 -1
  29. package/dist/{handlebars-244472df.js → handlebars-7888a28b.js} +1 -1
  30. package/dist/{html-dbe85e28.js → html-49a4bf44.js} +1 -1
  31. package/dist/{htmlMode-322d33fc.js → htmlMode-1e7a9c09.js} +1 -1
  32. package/dist/{index-ffb8e3f2.js → index-22c2be1a.js} +24608 -24169
  33. package/dist/index.d.ts +1 -0
  34. package/dist/index.js +423 -418
  35. package/dist/{javascript-08f36b2f.js → javascript-e668b880.js} +1 -1
  36. package/dist/{jsonMode-1581651d.js → jsonMode-3deac21e.js} +1 -1
  37. package/dist/{liquid-8186f4dd.js → liquid-d09625e4.js} +1 -1
  38. package/dist/{mdx-e44e6791.js → mdx-79182c99.js} +1 -1
  39. package/dist/{python-6d38169d.js → python-b0a38116.js} +1 -1
  40. package/dist/{razor-db112cf2.js → razor-5ed7f1c3.js} +1 -1
  41. package/dist/{tsMode-e7293cd7.js → tsMode-bb790075.js} +1 -1
  42. package/dist/{typescript-92fd8874.js → typescript-3d78c01c.js} +1 -1
  43. package/dist/{xml-69f459f4.js → xml-01d0bf7d.js} +1 -1
  44. package/dist/{yaml-0cd8e170.js → yaml-a617bbb3.js} +1 -1
  45. package/package.json +1 -1
  46. package/dist/Shared/Components/GitCommitInfoGeneric/constants.d.ts +0 -4
@@ -1,4 +1,4 @@
1
1
  import { DeploymentTemplateHistoryType } from '../types';
2
2
 
3
- declare const DeploymentHistoryDiffView: ({ currentConfiguration, baseTemplateConfiguration, previousConfigAvailable, isUnpublished, isDeleteDraft, rootClassName, }: DeploymentTemplateHistoryType) => JSX.Element;
3
+ declare const DeploymentHistoryDiffView: ({ currentConfiguration, baseTemplateConfiguration, previousConfigAvailable, isUnpublished, isDeleteDraft, rootClassName, comparisonBodyClassName, sortOrder, }: DeploymentTemplateHistoryType) => JSX.Element;
4
4
  export default DeploymentHistoryDiffView;
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties } from 'react';
2
- import { OptionType, UserApprovalMetadataType, ReleaseTag, ImageComment, PromotionApprovalMetadataType, FilterConditionsListType, DeploymentAppTypes, ResponseType, PaginationProps } from '../../../Common';
2
+ import { OptionType, UserApprovalMetadataType, ReleaseTag, ImageComment, PromotionApprovalMetadataType, FilterConditionsListType, DeploymentAppTypes, ResponseType, PaginationProps, SortingOrder } from '../../../Common';
3
3
  import { DeploymentStageType } from '../../constants';
4
4
  import { AggregationKeys, GitTriggers, Node, NodeType, ResourceKindType, ResourceVersionType } from '../../types';
5
5
 
@@ -368,6 +368,8 @@ export interface DeploymentTemplateHistoryType {
368
368
  isUnpublished?: boolean;
369
369
  isDeleteDraft?: boolean;
370
370
  rootClassName?: string;
371
+ comparisonBodyClassName?: string;
372
+ sortOrder?: SortingOrder;
371
373
  }
372
374
  export interface DeploymentHistoryDetailRes extends ResponseType {
373
375
  result?: DeploymentHistoryDetail;
@@ -0,0 +1,3 @@
1
+ import { CollapseProps } from './types';
2
+
3
+ export declare const Collapse: ({ expand, onTransitionEnd, children }: CollapseProps) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ export * from './Collapse';
2
+ export * from './types';
@@ -0,0 +1,7 @@
1
+ import { ReactNode, TransitionEvent } from 'react';
2
+
3
+ export interface CollapseProps {
4
+ expand: boolean;
5
+ children: ReactNode;
6
+ onTransitionEnd?: (e: TransitionEvent<HTMLDivElement>) => void;
7
+ }
@@ -0,0 +1,3 @@
1
+ import { CollapsibleListProps } from './CollapsibleList.types';
2
+
3
+ export declare const CollapsibleList: ({ config, onCollapseBtnClick }: CollapsibleListProps) => JSX.Element;
@@ -0,0 +1,96 @@
1
+ import { default as React } from 'react';
2
+ import { TippyProps } from '@tippyjs/react';
3
+
4
+ export interface CollapsibleListItem {
5
+ /**
6
+ * The title of the list item.
7
+ */
8
+ title: string;
9
+ /**
10
+ * The subtitle of the list item.
11
+ */
12
+ subtitle?: string;
13
+ /**
14
+ * Configuration for the icon.
15
+ */
16
+ iconConfig?: {
17
+ /**
18
+ * A React component representing an icon to be displayed with the list item.
19
+ */
20
+ Icon: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
21
+ /**
22
+ * Properties for the icon component.
23
+ */
24
+ props?: React.SVGProps<SVGSVGElement>;
25
+ /**
26
+ * Properties for the tooltip component of the icon.
27
+ */
28
+ tooltipProps?: TippyProps;
29
+ };
30
+ /**
31
+ * The URL of the nav link.
32
+ */
33
+ href?: string;
34
+ /**
35
+ * The callback function to handle click events on the nav link.
36
+ */
37
+ onClick?: (e: React.MouseEvent<HTMLAnchorElement>) => void;
38
+ }
39
+ export interface CollapsibleListConfig {
40
+ /**
41
+ * The unique identifier for the collapsible list.
42
+ */
43
+ id: string;
44
+ /**
45
+ * The header text for the collapsible list.
46
+ */
47
+ header: string;
48
+ /**
49
+ * Configuration for the header icon.
50
+ */
51
+ headerIconConfig?: {
52
+ /**
53
+ * A React component representing an icon button to be displayed with the header.
54
+ */
55
+ Icon: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
56
+ /**
57
+ * Properties for the header icon component.
58
+ */
59
+ props?: React.SVGProps<SVGSVGElement>;
60
+ /**
61
+ * Properties for the header icon button component.
62
+ */
63
+ btnProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;
64
+ /**
65
+ * Properties for the tooltip component of the icon.
66
+ */
67
+ tooltipProps?: TippyProps;
68
+ };
69
+ /**
70
+ * Text to display when there are no items in the list.
71
+ * @default 'No items found.'
72
+ */
73
+ noItemsText?: string;
74
+ /**
75
+ * An array of items to be displayed in the collapsible list.
76
+ */
77
+ items: CollapsibleListItem[];
78
+ /**
79
+ * Boolean indicating whether the list is expanded or not.
80
+ */
81
+ isExpanded?: boolean;
82
+ }
83
+ export interface CollapsibleListProps {
84
+ /**
85
+ * An array of collapsible list configurations.
86
+ */
87
+ config: CollapsibleListConfig[];
88
+ /**
89
+ * Function to handle the collapse button click event.
90
+ *
91
+ * @param id - The unique identifier for the item to collapse.
92
+ * @param e - The mouse event triggered by the button click.
93
+ *
94
+ */
95
+ onCollapseBtnClick?: (id: string, e: React.MouseEvent<HTMLButtonElement>) => void;
96
+ }
@@ -0,0 +1,2 @@
1
+ export * from './CollapsibleList.component';
2
+ export * from './CollapsibleList.types';
@@ -0,0 +1,3 @@
1
+ import { DeploymentConfigDiffProps } from './types';
2
+
3
+ export declare const DeploymentConfigDiff: ({ isLoading, configList, collapsibleNavList, navList, goBackURL, navHeading, navHelpText, ...resProps }: DeploymentConfigDiffProps) => JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { DeploymentConfigDiffAccordionProps } from './types';
2
+
3
+ export declare const DeploymentConfigDiffAccordion: import('react').ForwardRefExoticComponent<DeploymentConfigDiffAccordionProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,3 @@
1
+ import { DeploymentConfigDiffMainProps } from './types';
2
+
3
+ export declare const DeploymentConfigDiffMain: ({ isLoading, headerText, configList, selectorsConfig, sortingConfig, scrollIntoViewId, }: DeploymentConfigDiffMainProps) => JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { DeploymentConfigDiffNavigationProps } from './types';
2
+
3
+ export declare const DeploymentConfigDiffNavigation: ({ isLoading, collapsibleNavList, navList, goBackURL, navHeading, navHelpText, }: DeploymentConfigDiffNavigationProps) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ export * from './DeploymentConfigDiff.component';
2
+ export * from './types';
@@ -0,0 +1,67 @@
1
+ import { SortingOrder } from '../../../Common/Constants';
2
+ import { DeploymentHistoryDetail } from '../CICDHistory';
3
+ import { CollapsibleListConfig, CollapsibleListItem } from '../CollapsibleList';
4
+ import { SelectPickerProps } from '../SelectPicker';
5
+ import { CollapseProps } from '../Collapse';
6
+
7
+ export interface DeploymentConfigType {
8
+ list: DeploymentHistoryDetail;
9
+ heading: React.ReactNode;
10
+ }
11
+ export interface DeploymentConfigListItem {
12
+ id: string;
13
+ title: string;
14
+ primaryConfig: DeploymentConfigType;
15
+ secondaryConfig: DeploymentConfigType;
16
+ hasDiff?: boolean;
17
+ isDeploymentTemplate?: boolean;
18
+ }
19
+ export type DeploymentConfigDiffSelectPickerProps = {
20
+ type: 'string';
21
+ id: string;
22
+ text: string | React.ReactNode;
23
+ selectPickerProps?: never;
24
+ } | {
25
+ type: 'selectPicker';
26
+ id: string;
27
+ text?: never;
28
+ selectPickerProps: SelectPickerProps;
29
+ };
30
+ export interface DeploymentConfigDiffNavigationItem extends Pick<CollapsibleListItem, 'href' | 'title' | 'onClick'> {
31
+ hasDiff?: boolean;
32
+ }
33
+ export interface DeploymentConfigDiffNavigationCollapsibleItem extends Pick<CollapsibleListConfig, 'id' | 'header' | 'noItemsText'> {
34
+ items: DeploymentConfigDiffNavigationItem[];
35
+ }
36
+ export interface DeploymentConfigDiffProps {
37
+ isLoading?: boolean;
38
+ configList: DeploymentConfigListItem[];
39
+ headerText?: string;
40
+ scrollIntoViewId?: string;
41
+ selectorsConfig: {
42
+ primaryConfig: DeploymentConfigDiffSelectPickerProps[];
43
+ secondaryConfig: DeploymentConfigDiffSelectPickerProps[];
44
+ };
45
+ sortingConfig?: {
46
+ sortBy: string;
47
+ sortOrder: SortingOrder;
48
+ handleSorting: () => void;
49
+ };
50
+ navList: DeploymentConfigDiffNavigationItem[];
51
+ collapsibleNavList: DeploymentConfigDiffNavigationCollapsibleItem[];
52
+ goBackURL?: string;
53
+ navHeading: string;
54
+ navHelpText?: string;
55
+ }
56
+ export interface DeploymentConfigDiffNavigationProps extends Pick<DeploymentConfigDiffProps, 'isLoading' | 'navList' | 'collapsibleNavList' | 'goBackURL' | 'navHeading' | 'navHelpText'> {
57
+ }
58
+ export interface DeploymentConfigDiffMainProps extends Pick<DeploymentConfigDiffProps, 'isLoading' | 'headerText' | 'configList' | 'scrollIntoViewId' | 'selectorsConfig' | 'sortingConfig'> {
59
+ }
60
+ export interface DeploymentConfigDiffAccordionProps extends Pick<CollapseProps, 'onTransitionEnd'> {
61
+ id: string;
62
+ title: string;
63
+ children: React.ReactNode;
64
+ hasDiff?: boolean;
65
+ isExpanded?: boolean;
66
+ onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
67
+ }
@@ -1,4 +1,3 @@
1
-
2
1
  declare const GitMaterialInfoHeader: ({ index, repoUrl, materialType, materialValue, style, ...props }: {
3
2
  [x: string]: any;
4
3
  index: any;
@@ -1,3 +1,3 @@
1
1
  import { KeyValueTableProps } from './KeyValueTable.types';
2
2
 
3
- export declare const KeyValueTable: <K extends string>({ config, maskValue, isSortable, headerComponent, onChange, onDelete, placeholder, isAdditionNotAllowed, }: KeyValueTableProps<K>) => JSX.Element;
3
+ export declare const KeyValueTable: <K extends string>({ config, maskValue, isSortable, headerComponent, onChange, onDelete, placeholder, isAdditionNotAllowed, readOnly, showError, validationSchema, errorMessages, onError, }: KeyValueTableProps<K>) => JSX.Element;
@@ -60,8 +60,10 @@ export interface KeyValueTableProps<K extends string> {
60
60
  isSortable?: boolean;
61
61
  /** An optional React node for a custom header component. */
62
62
  headerComponent?: ReactNode;
63
- /** When true, data addition field will not be shown */
63
+ /** When true, data addition field will not be shown. */
64
64
  isAdditionNotAllowed?: boolean;
65
+ /** When true, data add or update is disabled. */
66
+ readOnly?: boolean;
65
67
  /**
66
68
  * An optional function to handle changes in the table rows.
67
69
  * @param rowId - The id of the row that changed.
@@ -74,4 +76,24 @@ export interface KeyValueTableProps<K extends string> {
74
76
  * @param deletedRowIndex - The index of the row that was deleted.
75
77
  */
76
78
  onDelete?: (deletedRowId: string | number) => void;
79
+ /**
80
+ * Indicates whether to show errors.
81
+ */
82
+ showError?: boolean;
83
+ /**
84
+ * The function to use to validate the value of the cell.
85
+ * @param value - The value to validate.
86
+ * @returns Return true if the value is valid, otherwise false
87
+ * and set `showError` to `true` and provide errorMessages array to show error message.
88
+ */
89
+ validationSchema?: (value: string) => boolean;
90
+ /**
91
+ * An array of error messages to be displayed in the cell error tooltip.
92
+ */
93
+ errorMessages?: string[];
94
+ /**
95
+ * A callback function called when an error occurs.
96
+ * @param errorState - The error state, true when any cell has error, otherwise false.
97
+ */
98
+ onError?: (errorState: boolean) => void;
77
99
  }
@@ -1,4 +1,4 @@
1
1
  import { MaterialHistoryProps } from './types';
2
2
 
3
- declare const MaterialHistory: ({ material, pipelineName, ciPipelineId, selectCommit, isCommitInfoModal, }: MaterialHistoryProps) => JSX.Element;
3
+ declare const MaterialHistory: ({ material, pipelineName, ciPipelineId, selectCommit }: MaterialHistoryProps) => JSX.Element;
4
4
  export default MaterialHistory;
@@ -5,5 +5,4 @@ export interface MaterialHistoryProps {
5
5
  pipelineName: string;
6
6
  ciPipelineId?: string;
7
7
  selectCommit?: (materialId: string, commit: string, ciPipelineId?: string) => void;
8
- isCommitInfoModal?: boolean;
9
8
  }
@@ -81,5 +81,5 @@ import { SelectPickerProps } from './type';
81
81
  * <SelectPicker ... showSelectedOptionsCount />
82
82
  * ```
83
83
  */
84
- declare const SelectPicker: ({ error, icon, renderMenuListFooter, helperText, placeholder, label, showSelectedOptionIcon, size, disabledTippyContent, showSelectedOptionsCount, menuSize, ...props }: SelectPickerProps) => JSX.Element;
84
+ declare const SelectPicker: ({ error, icon, renderMenuListFooter, helperText, placeholder, label, showSelectedOptionIcon, size, disabledTippyContent, showSelectedOptionsCount, menuSize, variant, ...props }: SelectPickerProps) => JSX.Element;
85
85
  export default SelectPicker;
@@ -6,5 +6,5 @@ export declare const SelectPickerClearIndicator: (props: ClearIndicatorProps<Sel
6
6
  export declare const SelectPickerControl: ({ icon, showSelectedOptionIcon, ...props }: ControlProps<SelectPickerOptionType> & Pick<SelectPickerProps, 'icon' | 'showSelectedOptionIcon'>) => JSX.Element;
7
7
  export declare const SelectPickerValueContainer: ({ showSelectedOptionsCount, ...props }: ValueContainerProps<SelectPickerOptionType> & Pick<SelectPickerProps, 'showSelectedOptionsCount'>) => JSX.Element;
8
8
  export declare const SelectPickerLoadingIndicator: () => JSX.Element;
9
- export declare const SelectPickerOption: (props: OptionProps<SelectPickerOptionType>) => JSX.Element;
9
+ export declare const SelectPickerOption: ({ disableDescriptionEllipsis }: SelectPickerProps) => (props: OptionProps<SelectPickerOptionType>) => JSX.Element;
10
10
  export declare const SelectPickerMenuList: ({ renderMenuListFooter, ...props }: MenuListProps<SelectPickerOptionType> & Pick<SelectPickerProps, 'renderMenuListFooter'>) => JSX.Element;
@@ -17,6 +17,10 @@ export interface SelectPickerOptionType extends OptionType<number | string, Reac
17
17
  */
18
18
  endIcon?: ReactElement;
19
19
  }
20
+ export declare enum SelectPickerVariantType {
21
+ DEFAULT = "default",
22
+ BORDERLESS = "borderless"
23
+ }
20
24
  type SelectProps = ReactSelectProps<SelectPickerOptionType>;
21
25
  export interface SelectPickerProps extends Pick<SelectProps, 'options' | 'value' | 'onChange' | 'isSearchable' | 'isClearable' | 'isLoading' | 'hideSelectedOptions' | 'controlShouldRenderValue' | 'closeMenuOnSelect' | 'isDisabled' | 'isLoading' | 'required' | 'isOptionDisabled' | 'placeholder'>, Required<Pick<SelectProps, 'classNamePrefix' | 'inputId' | 'name'>> {
22
26
  /**
@@ -70,5 +74,17 @@ export interface SelectPickerProps extends Pick<SelectProps, 'options' | 'value'
70
74
  * @default 'ComponentSizeType.small'
71
75
  */
72
76
  menuSize?: ComponentSizeType;
77
+ /**
78
+ * Variant of the select.
79
+ *
80
+ * @default SelectPickerVariantType.DEFAULT
81
+ */
82
+ variant?: SelectPickerVariantType;
83
+ /**
84
+ * Disables the ellipsis on description, it will be shown in full width, wrapped if required.
85
+ *
86
+ * @default false
87
+ */
88
+ disableDescriptionEllipsis?: boolean;
73
89
  }
74
90
  export {};
@@ -1,4 +1,4 @@
1
1
  import { StylesConfig } from 'react-select';
2
2
  import { SelectPickerOptionType, SelectPickerProps } from './type';
3
3
 
4
- export declare const getCommonSelectStyle: ({ error, size, menuSize, }: Pick<SelectPickerProps, 'error' | 'size' | 'menuSize'>) => StylesConfig<SelectPickerOptionType>;
4
+ export declare const getCommonSelectStyle: ({ error, size, menuSize, variant, }: Pick<SelectPickerProps, 'error' | 'size' | 'menuSize' | 'variant'>) => StylesConfig<SelectPickerOptionType>;
@@ -33,4 +33,7 @@ export * from './IframeContainer';
33
33
  export * from './Plugin';
34
34
  export * from './KeyValueTable';
35
35
  export * from './SelectPicker';
36
+ export * from './CollapsibleList';
37
+ export * from './DeploymentConfigDiff';
36
38
  export * from './DetectBottom';
39
+ export * from './Collapse';
@@ -1,4 +1,5 @@
1
1
  import { ReactElement } from 'react';
2
+ import { Pair } from 'yaml';
2
3
  import { MaterialInfo, SortingOrder } from '../Common';
3
4
  import { GitTriggers, IntersectionChangeHandler, IntersectionOptions, WebhookEventNameType } from './types';
4
5
  import { AggregatedNodes, DeploymentStatusDetailsBreakdownDataType, DeploymentStatusDetailsType, PodMetadatum } from './Components';
@@ -24,6 +25,7 @@ export declare const getGitCommitInfo: (materialInfo: MaterialInfo) => GitTrigge
24
25
  export declare const stringComparatorBySortOrder: (a: string, b: string, sortOrder?: SortingOrder, isCaseSensitive?: boolean) => number;
25
26
  export declare const numberComparatorBySortOrder: (a: number, b: number, sortOrder?: SortingOrder) => number;
26
27
  export declare const getWebhookEventIcon: (eventName: WebhookEventNameType) => JSX.Element;
28
+ export declare const yamlComparatorBySortOrder: (a: Pair, b: Pair, sortOrder?: SortingOrder) => number;
27
29
  export declare const useIntersection: (target: React.RefObject<Element> | Element | null, options?: IntersectionOptions, callback?: IntersectionChangeHandler) => boolean;
28
30
  export declare const isNullOrUndefined: (value: unknown) => boolean;
29
31
  export declare const handleDisableSubmitOnEnter: (event: React.KeyboardEvent<HTMLFormElement>) => void;