@devtron-labs/devtron-fe-common-lib 0.2.5-beta-2 → 0.2.6-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/Common/CodeEditor/types.d.ts +2 -2
- package/dist/Common/Common.service.d.ts +0 -6
- package/dist/Common/Constants.d.ts +2 -12
- package/dist/Common/RJSF/constants.d.ts +5 -0
- package/dist/Common/RJSF/index.d.ts +1 -0
- package/dist/Common/Security/ScanVulnerabilitiesTable.d.ts +1 -1
- package/dist/Common/Types.d.ts +2 -3
- package/dist/Pages/GlobalConfigurations/Authorization/index.d.ts +1 -1
- package/dist/Pages/GlobalConfigurations/Authorization/types.d.ts +18 -0
- package/dist/Pages/GlobalConfigurations/DeploymentCharts/basicViewSchema.json.d.ts +273 -0
- package/dist/Pages/GlobalConfigurations/DeploymentCharts/fallbackJobsNCronJobGuiSchema.json.d.ts +157 -0
- package/dist/Pages/GlobalConfigurations/DeploymentCharts/index.d.ts +2 -0
- package/dist/Pages/GlobalConfigurations/DeploymentCharts/types.d.ts +24 -0
- package/dist/Pages/GlobalConfigurations/DeploymentCharts/utils.d.ts +4 -0
- package/dist/Pages/GlobalConfigurations/index.d.ts +1 -0
- package/dist/Shared/Components/CICDHistory/DeploymentHistoryDiff/DeploymentHistoryDiffView.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/types.d.ts +1 -3
- package/dist/Shared/Components/KeyValueTable/KeyValueTable.component.d.ts +1 -1
- package/dist/Shared/Components/KeyValueTable/KeyValueTable.types.d.ts +3 -47
- package/dist/Shared/Components/ScannedObjectBar/ScannedObjectBar.d.ts +4 -0
- package/dist/Shared/Components/ScannedObjectBar/index.d.ts +1 -0
- package/dist/Shared/Components/ScannedObjectBar/types.d.ts +7 -0
- package/dist/Shared/Components/SelectPicker/SelectPicker.component.d.ts +1 -1
- package/dist/Shared/Components/SelectPicker/common.d.ts +1 -1
- package/dist/Shared/Components/SelectPicker/index.d.ts +0 -1
- package/dist/Shared/Components/SelectPicker/type.d.ts +0 -16
- package/dist/Shared/Components/SelectPicker/utils.d.ts +2 -11
- package/dist/Shared/Components/SelectPickerCustom/FilterSelectPicker.d.ts +4 -0
- package/dist/Shared/Components/SelectPickerCustom/SelectPicker.component.d.ts +139 -0
- package/dist/Shared/Components/SelectPickerCustom/common.d.ts +13 -0
- package/dist/Shared/Components/SelectPickerCustom/index.d.ts +3 -0
- package/dist/Shared/Components/SelectPickerCustom/type.d.ts +163 -0
- package/dist/Shared/Components/SelectPickerCustom/utils.d.ts +15 -0
- package/dist/Shared/Components/Vulnerabilities/utils.d.ts +0 -1
- package/dist/Shared/Components/index.d.ts +2 -4
- package/dist/Shared/Helpers.d.ts +1 -2
- package/dist/Shared/Services/app.service.d.ts +1 -3
- package/dist/Shared/Services/app.types.d.ts +0 -116
- package/dist/Shared/constants.d.ts +0 -4
- package/dist/Shared/types.d.ts +7 -31
- package/dist/Shared/validations.d.ts +1 -3
- package/dist/assets/editor.worker-60ba9509.js +12 -0
- package/dist/assets/index.css +1 -1
- package/dist/assets/yaml.worker-3bbe780a.js +472 -0
- package/dist/{cssMode-07da02cd.js → cssMode-a92794b5.js} +1 -1
- package/dist/{freemarker2-9fd83d43.js → freemarker2-e5ee51c9.js} +1 -1
- package/dist/{handlebars-18dccb78.js → handlebars-9153151b.js} +1 -1
- package/dist/{html-201758e1.js → html-011bc885.js} +1 -1
- package/dist/{htmlMode-10964d27.js → htmlMode-4885a742.js} +1 -1
- package/dist/{index-8bb539c6.js → index-a419ec38.js} +45125 -40807
- package/dist/index.d.ts +0 -2
- package/dist/index.js +488 -504
- package/dist/{javascript-4327a7e8.js → javascript-9b5d9b49.js} +1 -1
- package/dist/{jsonMode-e59deb57.js → jsonMode-fa67bdba.js} +1 -1
- package/dist/{liquid-c96eb385.js → liquid-a2b3aabb.js} +1 -1
- package/dist/{mdx-0eb9a0f4.js → mdx-96b66709.js} +1 -1
- package/dist/{python-d79b6153.js → python-93cea446.js} +1 -1
- package/dist/{razor-4d69a090.js → razor-a13e6ece.js} +1 -1
- package/dist/{tsMode-b991e21c.js → tsMode-fa82c200.js} +1 -1
- package/dist/{typescript-0b46acf6.js → typescript-9835808a.js} +1 -1
- package/dist/{xml-eb10ea00.js → xml-f03d7ed4.js} +1 -1
- package/dist/{yaml-a9060343.js → yaml-82f4884e.js} +1 -1
- package/package.json +5 -5
- package/dist/Common/Security/types.d.ts +0 -4
- package/dist/Shared/Components/Collapse/Collapse.d.ts +0 -3
- package/dist/Shared/Components/Collapse/index.d.ts +0 -2
- package/dist/Shared/Components/Collapse/types.d.ts +0 -7
- package/dist/Shared/Components/CollapsibleList/CollapsibleList.component.d.ts +0 -3
- package/dist/Shared/Components/CollapsibleList/CollapsibleList.types.d.ts +0 -96
- package/dist/Shared/Components/CollapsibleList/index.d.ts +0 -2
- package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.component.d.ts +0 -3
- package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.utils.d.ts +0 -38
- package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffAccordion.d.ts +0 -3
- package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffMain.d.ts +0 -3
- package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffNavigation.d.ts +0 -3
- package/dist/Shared/Components/DeploymentConfigDiff/index.d.ts +0 -3
- package/dist/Shared/Components/DeploymentConfigDiff/types.d.ts +0 -69
- package/dist/Shared/Components/FilterButton/FilterButton.d.ts +0 -5
- package/dist/Shared/Components/FilterButton/index.d.ts +0 -1
- package/dist/Shared/Components/FilterButton/types.d.ts +0 -12
- package/dist/Shared/Components/FilterButton/utils.d.ts +0 -15
- package/dist/Shared/Components/KeyValueTable/constants.d.ts +0 -2
|
@@ -36,29 +36,6 @@ export interface KeyValueConfig<K extends string> {
|
|
|
36
36
|
/** An array of key-value rows. */
|
|
37
37
|
rows: KeyValueRow<K>[];
|
|
38
38
|
}
|
|
39
|
-
type ErrorUIProps = {
|
|
40
|
-
/**
|
|
41
|
-
* Indicates whether to show errors.
|
|
42
|
-
*/
|
|
43
|
-
showError: true;
|
|
44
|
-
/**
|
|
45
|
-
* @default - false
|
|
46
|
-
* If true, would validate for duplicate keys and if present would show error tooltip on the cell.
|
|
47
|
-
*/
|
|
48
|
-
validateDuplicateKeys?: boolean;
|
|
49
|
-
/**
|
|
50
|
-
* @default - false
|
|
51
|
-
* If true, would validate for rows having values but no key and if error would show error tooltip on the cell.
|
|
52
|
-
*/
|
|
53
|
-
validateEmptyKeys?: boolean;
|
|
54
|
-
} | {
|
|
55
|
-
/**
|
|
56
|
-
* Indicates whether to show errors.
|
|
57
|
-
*/
|
|
58
|
-
showError?: false;
|
|
59
|
-
validateDuplicateKeys?: never;
|
|
60
|
-
validateEmptyKeys?: never;
|
|
61
|
-
};
|
|
62
39
|
/**
|
|
63
40
|
* Type representing a mask for key-value pairs.
|
|
64
41
|
* @template K - A string representing the key type.
|
|
@@ -73,7 +50,7 @@ export type KeyValuePlaceholder<K extends string> = {
|
|
|
73
50
|
* Interface representing the properties for a key-value table component.
|
|
74
51
|
* @template K - A string representing the key type.
|
|
75
52
|
*/
|
|
76
|
-
export
|
|
53
|
+
export interface KeyValueTableProps<K extends string> {
|
|
77
54
|
/** The configuration for the key-value table. */
|
|
78
55
|
config: KeyValueConfig<K>;
|
|
79
56
|
/** An optional mask for the key-value pairs. */
|
|
@@ -83,10 +60,8 @@ export type KeyValueTableProps<K extends string> = {
|
|
|
83
60
|
isSortable?: boolean;
|
|
84
61
|
/** An optional React node for a custom header component. */
|
|
85
62
|
headerComponent?: ReactNode;
|
|
86
|
-
/** When true, data addition field will not be shown
|
|
63
|
+
/** When true, data addition field will not be shown */
|
|
87
64
|
isAdditionNotAllowed?: boolean;
|
|
88
|
-
/** When true, data add or update is disabled. */
|
|
89
|
-
readOnly?: boolean;
|
|
90
65
|
/**
|
|
91
66
|
* An optional function to handle changes in the table rows.
|
|
92
67
|
* @param rowId - The id of the row that changed.
|
|
@@ -99,23 +74,4 @@ export type KeyValueTableProps<K extends string> = {
|
|
|
99
74
|
* @param deletedRowIndex - The index of the row that was deleted.
|
|
100
75
|
*/
|
|
101
76
|
onDelete?: (deletedRowId: string | number) => void;
|
|
102
|
-
|
|
103
|
-
* The function to use to validate the value of the cell.
|
|
104
|
-
* @param value - The value to validate.
|
|
105
|
-
* @param key - The row key of the value.
|
|
106
|
-
* @param rowId - The id of the row.
|
|
107
|
-
* @returns Return true if the value is valid, otherwise false
|
|
108
|
-
* and set `showError` to `true` and provide errorMessages array to show error message.
|
|
109
|
-
*/
|
|
110
|
-
validationSchema?: (value: string, key: K, rowId: string | number) => boolean;
|
|
111
|
-
/**
|
|
112
|
-
* An array of error messages to be displayed in the cell error tooltip.
|
|
113
|
-
*/
|
|
114
|
-
errorMessages?: string[];
|
|
115
|
-
/**
|
|
116
|
-
* A callback function called when an error occurs.
|
|
117
|
-
* @param errorState - The error state, true when any cell has error, otherwise false.
|
|
118
|
-
*/
|
|
119
|
-
onError?: (errorState: boolean) => void;
|
|
120
|
-
} & ErrorUIProps;
|
|
121
|
-
export {};
|
|
77
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ScannedObjectBarProps } from './types';
|
|
2
|
+
|
|
3
|
+
declare const ScannedObjectBar: ({ criticalVulnerabilitiesCount, moderateVulnerabilitiesCount, lowVulnerabilitiesCount, objectBarClassName, removeObjectCountMargin, }: ScannedObjectBarProps) => JSX.Element;
|
|
4
|
+
export default ScannedObjectBar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ScannedObjectBar } from './ScannedObjectBar';
|
|
@@ -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,
|
|
84
|
+
declare const SelectPicker: ({ error, icon, renderMenuListFooter, helperText, placeholder, label, showSelectedOptionIcon, size, disabledTippyContent, showSelectedOptionsCount, menuSize, ...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: (
|
|
9
|
+
export declare const SelectPickerOption: (props: OptionProps<SelectPickerOptionType>) => JSX.Element;
|
|
10
10
|
export declare const SelectPickerMenuList: ({ renderMenuListFooter, ...props }: MenuListProps<SelectPickerOptionType> & Pick<SelectPickerProps, 'renderMenuListFooter'>) => JSX.Element;
|
|
@@ -17,10 +17,6 @@ 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
|
-
}
|
|
24
20
|
type SelectProps = ReactSelectProps<SelectPickerOptionType>;
|
|
25
21
|
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'>> {
|
|
26
22
|
/**
|
|
@@ -74,17 +70,5 @@ export interface SelectPickerProps extends Pick<SelectProps, 'options' | 'value'
|
|
|
74
70
|
* @default 'ComponentSizeType.small'
|
|
75
71
|
*/
|
|
76
72
|
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;
|
|
89
73
|
}
|
|
90
74
|
export {};
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StylesConfig } from 'react-select';
|
|
2
2
|
import { SelectPickerOptionType, SelectPickerProps } from './type';
|
|
3
3
|
|
|
4
|
-
export declare const getCommonSelectStyle: ({ error, size, menuSize,
|
|
5
|
-
/**
|
|
6
|
-
* Retrieves an option from the options list based on the provided value.
|
|
7
|
-
*
|
|
8
|
-
* @param optionsList - The list of options or groups of options.
|
|
9
|
-
* @param value - The value to compare against the options' values.
|
|
10
|
-
* @param defaultOption - The default option to return if no match is found.
|
|
11
|
-
* @returns The matched option or the default option if no match is found.
|
|
12
|
-
*/
|
|
13
|
-
export declare const getSelectPickerOptionByValue: (optionsList: OptionsOrGroups<SelectPickerOptionType, GroupBase<SelectPickerOptionType>>, value: string | number, defaultOption?: SelectPickerOptionType) => SelectPickerOptionType;
|
|
4
|
+
export declare const getCommonSelectStyle: ({ error, size, menuSize, }: Pick<SelectPickerProps, 'error' | 'size' | 'menuSize'>) => StylesConfig<SelectPickerOptionType>;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { SelectPickerProps } from './type';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Generic component for select picker
|
|
5
|
+
*
|
|
6
|
+
* @example With icon in control
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <SelectPicker ... icon={<CustomIcon />} />
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* @example Medium menu list width
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <SelectPicker ... menuSize={ComponentSizeType.medium} />
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @example Large menu list width
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <SelectPicker ... menuSize={ComponentSizeType.large} />
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @example Required label
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <SelectPicker ... required label="Label" />
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @example Custom label
|
|
27
|
+
* ```tsx
|
|
28
|
+
* <SelectPicker ... label={<div>Label</div>} />
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @example Error state
|
|
32
|
+
* ```tsx
|
|
33
|
+
* <SelectPicker ... error="Something went wrong" />
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @example Helper text
|
|
37
|
+
* ```tsx
|
|
38
|
+
* <SelectPicker ... helperText="Help information" />
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @example Menu list footer
|
|
42
|
+
* The footer is sticky by default
|
|
43
|
+
* ```tsx
|
|
44
|
+
* <SelectPicker
|
|
45
|
+
* ...
|
|
46
|
+
* renderMenuListFooter={() => (
|
|
47
|
+
* <div className="px-8 py-6 dc__border-top bcn-50 cn-6">
|
|
48
|
+
* <div>Foot note</div>
|
|
49
|
+
* </div>
|
|
50
|
+
* )}
|
|
51
|
+
* />
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @example Loading state
|
|
55
|
+
* ```tsx
|
|
56
|
+
* <SelectPicker ... isLoading />
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* @example Disabled state
|
|
60
|
+
* ```tsx
|
|
61
|
+
* <SelectPicker ... isDisabled />
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @example Loading & disabled state
|
|
65
|
+
* ```tsx
|
|
66
|
+
* <SelectPicker ... isLoading isDisabled />
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* @example Hide selected option icon in control
|
|
70
|
+
* ```tsx
|
|
71
|
+
* <SelectPicker ... showSelectedOptionIcon={false} />
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* @example Selected option clearable
|
|
75
|
+
* ```tsx
|
|
76
|
+
* <SelectPicker ... isClearable />
|
|
77
|
+
* ```
|
|
78
|
+
*
|
|
79
|
+
* @example Selected option clearable
|
|
80
|
+
* ```tsx
|
|
81
|
+
* <SelectPicker ... showSelectedOptionsCount />
|
|
82
|
+
* ```
|
|
83
|
+
* @example Multi Select
|
|
84
|
+
* ```tsx
|
|
85
|
+
* <SelectPicker ... isMulti />
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
88
|
+
* @example Creatable Multi Select
|
|
89
|
+
* ```tsx
|
|
90
|
+
* <SelectPicker
|
|
91
|
+
* ...
|
|
92
|
+
* isMulti
|
|
93
|
+
* multiSelectProps={{
|
|
94
|
+
* isCreatable: true
|
|
95
|
+
* }}
|
|
96
|
+
* />
|
|
97
|
+
* ```
|
|
98
|
+
*
|
|
99
|
+
* @example Multi Select with group heading selectable
|
|
100
|
+
* ```tsx
|
|
101
|
+
* <SelectPicker
|
|
102
|
+
* ...
|
|
103
|
+
* isMulti
|
|
104
|
+
* multiSelectProps={{
|
|
105
|
+
* isGroupHeadingSelectable: true
|
|
106
|
+
* }}
|
|
107
|
+
* />
|
|
108
|
+
* ```
|
|
109
|
+
*
|
|
110
|
+
* @example Multi Select with selected option validator
|
|
111
|
+
* ```tsx
|
|
112
|
+
* <SelectPicker
|
|
113
|
+
* ...
|
|
114
|
+
* isMulti
|
|
115
|
+
* multiSelectProps={{
|
|
116
|
+
* getIsOptionValid: (option) => boolean
|
|
117
|
+
* }}
|
|
118
|
+
* />
|
|
119
|
+
* ```
|
|
120
|
+
*
|
|
121
|
+
* @example Custom options rendering support (menuIsOpen needs to be handled by consumer)
|
|
122
|
+
* ```tsx
|
|
123
|
+
* <SelectPicker
|
|
124
|
+
* ...
|
|
125
|
+
* shouldRenderCustomOptions
|
|
126
|
+
* renderCustomOptions={() => <div />}
|
|
127
|
+
* />
|
|
128
|
+
* ```
|
|
129
|
+
*
|
|
130
|
+
* @example Align the menu at the right most end
|
|
131
|
+
* ```tsx
|
|
132
|
+
* <SelectPicker
|
|
133
|
+
* ...
|
|
134
|
+
* shouldMenuAlignRight
|
|
135
|
+
* />
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
declare const SelectPicker: <OptionValue, IsMulti extends boolean>({ error, icon, renderMenuListFooter, helperText, placeholder, label, showSelectedOptionIcon, size, disabledTippyContent, showSelectedOptionsCount, menuSize, menuPosition, variant, disableDescriptionEllipsis, multiSelectProps, isMulti, name, classNamePrefix, renderCustomOptions, shouldRenderCustomOptions, isSearchable, selectRef, shouldMenuAlignRight, fullWidth, customSelectedOptionsCount, ...props }: SelectPickerProps<OptionValue, IsMulti>) => JSX.Element;
|
|
139
|
+
export default SelectPicker;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DropdownIndicatorProps, ControlProps, OptionProps, ClearIndicatorProps, ValueContainerProps, MenuListProps, MultiValueRemoveProps, MultiValueProps } from 'react-select';
|
|
2
|
+
import { SelectPickerGroupHeadingProps, SelectPickerOptionType, SelectPickerProps } from './type';
|
|
3
|
+
|
|
4
|
+
export declare const SelectPickerDropdownIndicator: <OptionValue>(props: DropdownIndicatorProps<SelectPickerOptionType<OptionValue>, boolean, import('react-select').GroupBase<SelectPickerOptionType<OptionValue>>>) => JSX.Element;
|
|
5
|
+
export declare const SelectPickerClearIndicator: <OptionValue>(props: ClearIndicatorProps<SelectPickerOptionType<OptionValue>, boolean, import('react-select').GroupBase<SelectPickerOptionType<OptionValue>>>) => JSX.Element;
|
|
6
|
+
export declare const SelectPickerControl: <OptionValue, IsMulti extends boolean>({ icon, showSelectedOptionIcon, ...props }: ControlProps<SelectPickerOptionType<OptionValue>, boolean, import('react-select').GroupBase<SelectPickerOptionType<OptionValue>>> & Pick<SelectPickerProps<OptionValue, IsMulti>, "icon" | "showSelectedOptionIcon">) => JSX.Element;
|
|
7
|
+
export declare const SelectPickerValueContainer: <OptionValue, IsMulti extends boolean>({ showSelectedOptionsCount, customSelectedOptionsCount, ...props }: ValueContainerProps<SelectPickerOptionType<OptionValue>, boolean, import('react-select').GroupBase<SelectPickerOptionType<OptionValue>>> & Pick<SelectPickerProps<OptionValue, IsMulti>, "showSelectedOptionsCount" | "customSelectedOptionsCount">) => JSX.Element;
|
|
8
|
+
export declare const SelectPickerLoadingIndicator: () => JSX.Element;
|
|
9
|
+
export declare const SelectPickerOption: <OptionValue, IsMulti extends boolean>({ disableDescriptionEllipsis, ...props }: OptionProps<SelectPickerOptionType<OptionValue>, boolean, import('react-select').GroupBase<SelectPickerOptionType<OptionValue>>> & Pick<SelectPickerProps<OptionValue, IsMulti>, "disableDescriptionEllipsis">) => JSX.Element;
|
|
10
|
+
export declare const SelectPickerMenuList: <OptionValue, IsMulti extends boolean>({ renderMenuListFooter, shouldRenderCustomOptions, renderCustomOptions, ...props }: MenuListProps<SelectPickerOptionType<OptionValue>, boolean, import('react-select').GroupBase<SelectPickerOptionType<OptionValue>>> & Pick<SelectPickerProps<OptionValue, IsMulti>, "renderMenuListFooter" | "shouldRenderCustomOptions" | "renderCustomOptions">) => JSX.Element;
|
|
11
|
+
export declare const SelectPickerMultiValueLabel: <OptionValue, IsMulti extends boolean>({ getIsOptionValid, ...props }: MultiValueProps<SelectPickerOptionType<OptionValue>, true, import('react-select').GroupBase<SelectPickerOptionType<OptionValue>>> & Pick<SelectPickerProps<OptionValue, IsMulti>["multiSelectProps"], "getIsOptionValid">) => JSX.Element;
|
|
12
|
+
export declare const SelectPickerMultiValueRemove: (props: MultiValueRemoveProps) => JSX.Element;
|
|
13
|
+
export declare const SelectPickerGroupHeading: <OptionValue>({ isGroupHeadingSelectable, ...props }: SelectPickerGroupHeadingProps<OptionValue>) => JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { default as SelectPickerCustom } from './SelectPicker.component';
|
|
2
|
+
export { default as FilterSelectPickerCustom } from './FilterSelectPicker';
|
|
3
|
+
export type { SelectPickerOptionType as SelectPickerCustomOptionType, SelectPickerVariantType as SelectPickerCustomVariantType, SelectPickerProps as SelectPickerCustomProps, FilterSelectPickerProps as FilterSelectPickerCustomProps, } from './type';
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { OptionType } from '../../../Common/Types';
|
|
2
|
+
import { ComponentSizeType } from '../../constants';
|
|
3
|
+
import { MutableRefObject, ReactElement, ReactNode } from 'react';
|
|
4
|
+
import { GroupBase, GroupHeadingProps, Props as ReactSelectProps, SelectInstance } from 'react-select';
|
|
5
|
+
import { CreatableProps } from 'react-select/creatable';
|
|
6
|
+
|
|
7
|
+
export interface SelectPickerOptionType<OptionValue = string | number> extends OptionType<OptionValue, ReactNode> {
|
|
8
|
+
/**
|
|
9
|
+
* Description to be displayed for the option
|
|
10
|
+
*/
|
|
11
|
+
description?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Icon at the start of the option
|
|
14
|
+
*/
|
|
15
|
+
startIcon?: ReactElement;
|
|
16
|
+
/**
|
|
17
|
+
* Icon at the end of the option
|
|
18
|
+
*/
|
|
19
|
+
endIcon?: ReactElement;
|
|
20
|
+
}
|
|
21
|
+
export declare enum SelectPickerVariantType {
|
|
22
|
+
DEFAULT = "default",
|
|
23
|
+
BORDER_LESS = "border-less"
|
|
24
|
+
}
|
|
25
|
+
type SelectProps<OptionValue, IsMulti extends boolean> = ReactSelectProps<SelectPickerOptionType<OptionValue>, IsMulti, GroupBase<SelectPickerOptionType<OptionValue>>>;
|
|
26
|
+
export type SelectPickerProps<OptionValue = number | string, IsMulti extends boolean = false> = Pick<SelectProps<OptionValue, IsMulti>, 'name' | 'classNamePrefix' | 'options' | 'value' | 'onChange' | 'isSearchable' | 'isClearable' | 'isLoading' | 'hideSelectedOptions' | 'controlShouldRenderValue' | 'closeMenuOnSelect' | 'isDisabled' | 'isLoading' | 'required' | 'isOptionDisabled' | 'placeholder' | 'menuPosition' | 'getOptionLabel' | 'getOptionValue' | 'isOptionSelected' | 'menuIsOpen' | 'onMenuOpen' | 'onMenuClose' | 'autoFocus'> & Required<Pick<SelectProps<OptionValue, IsMulti>, 'inputId'>> & {
|
|
27
|
+
/**
|
|
28
|
+
* Icon to be rendered in the control
|
|
29
|
+
*/
|
|
30
|
+
icon?: ReactElement;
|
|
31
|
+
/**
|
|
32
|
+
* Error message for the select
|
|
33
|
+
*/
|
|
34
|
+
error?: ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* Render function for the footer at the bottom of menu list. It is sticky by default
|
|
37
|
+
*/
|
|
38
|
+
renderMenuListFooter?: (selectedOptions: SelectProps<OptionValue, IsMulti>['value']) => ReactNode;
|
|
39
|
+
/**
|
|
40
|
+
* Info text for the select, if any
|
|
41
|
+
*/
|
|
42
|
+
helperText?: ReactNode;
|
|
43
|
+
/**
|
|
44
|
+
* Label for the select. if required is added, the corresponding * is also added
|
|
45
|
+
*/
|
|
46
|
+
label?: ReactNode;
|
|
47
|
+
/**
|
|
48
|
+
* If true, the selected option icon is shown in the container.
|
|
49
|
+
* startIcon has higher priority than endIcon.
|
|
50
|
+
*
|
|
51
|
+
* @default 'true'
|
|
52
|
+
*/
|
|
53
|
+
showSelectedOptionIcon?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Custom selected options count for use cases like filters
|
|
56
|
+
*/
|
|
57
|
+
customSelectedOptionsCount?: number;
|
|
58
|
+
/**
|
|
59
|
+
* Height of the dropdown
|
|
60
|
+
*
|
|
61
|
+
* @default 'ComponentSizeType.medium'
|
|
62
|
+
*/
|
|
63
|
+
size?: Extract<ComponentSizeType, ComponentSizeType.medium | ComponentSizeType.large>;
|
|
64
|
+
/**
|
|
65
|
+
* Content to be shown in a tippy when disabled
|
|
66
|
+
*/
|
|
67
|
+
disabledTippyContent?: ReactNode;
|
|
68
|
+
/**
|
|
69
|
+
* If true, the selected options count is shown in a chip inside ValueContainer
|
|
70
|
+
*
|
|
71
|
+
* @default 'false'
|
|
72
|
+
*/
|
|
73
|
+
showSelectedOptionsCount?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Width of the menu list
|
|
76
|
+
*
|
|
77
|
+
* Note: the overflow needs to be handled explicitly for non-small variants
|
|
78
|
+
*
|
|
79
|
+
* @default 'ComponentSizeType.small'
|
|
80
|
+
*/
|
|
81
|
+
menuSize?: ComponentSizeType;
|
|
82
|
+
/**
|
|
83
|
+
* Variant of the select.
|
|
84
|
+
*
|
|
85
|
+
* @default SelectPickerVariantType.DEFAULT
|
|
86
|
+
*/
|
|
87
|
+
variant?: SelectPickerVariantType;
|
|
88
|
+
/**
|
|
89
|
+
* Disables the ellipsis on description, it will be shown in full width, wrapped if required.
|
|
90
|
+
*
|
|
91
|
+
* @default false
|
|
92
|
+
*/
|
|
93
|
+
disableDescriptionEllipsis?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Ref for the select picker
|
|
96
|
+
*/
|
|
97
|
+
selectRef?: IsMulti extends true ? MutableRefObject<SelectInstance<SelectPickerOptionType<OptionValue>, true>> : MutableRefObject<SelectInstance<SelectPickerOptionType<OptionValue>>>;
|
|
98
|
+
/**
|
|
99
|
+
* If true, the menu is aligned at the right end to prevent going outside of viewport
|
|
100
|
+
* in case of menu being larger than the control
|
|
101
|
+
*
|
|
102
|
+
* @default false
|
|
103
|
+
*/
|
|
104
|
+
shouldMenuAlignRight?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* If true, the select spans to the max available width
|
|
107
|
+
*
|
|
108
|
+
* @default false
|
|
109
|
+
*/
|
|
110
|
+
fullWidth?: boolean;
|
|
111
|
+
} & (IsMulti extends true ? {
|
|
112
|
+
isMulti: IsMulti | boolean;
|
|
113
|
+
multiSelectProps?: Pick<CreatableProps<SelectPickerOptionType<OptionValue>, true, GroupBase<SelectPickerOptionType<OptionValue>>>, 'onCreateOption'> & {
|
|
114
|
+
/**
|
|
115
|
+
* If true, the select picker creates the new option
|
|
116
|
+
* Only applicable for IsMulti: true
|
|
117
|
+
*
|
|
118
|
+
* @default false
|
|
119
|
+
*/
|
|
120
|
+
isCreatable?: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* If true, the group heading can be selected
|
|
123
|
+
*
|
|
124
|
+
* Only applicable for IsMulti: true
|
|
125
|
+
*
|
|
126
|
+
* @default false
|
|
127
|
+
*/
|
|
128
|
+
isGroupHeadingSelectable?: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Callback handler to check if the given selection is valid or not
|
|
131
|
+
*/
|
|
132
|
+
getIsOptionValid?: (option: SelectPickerOptionType<OptionValue>) => boolean;
|
|
133
|
+
};
|
|
134
|
+
} : {
|
|
135
|
+
isMulti?: never;
|
|
136
|
+
multiSelectProps?: never;
|
|
137
|
+
}) & ({
|
|
138
|
+
/**
|
|
139
|
+
* If true, custom options are rendered in the menuList component of react select
|
|
140
|
+
*
|
|
141
|
+
* Note: renderCustomOptions is required to be passed; renderMenuListFooter is also not called
|
|
142
|
+
*
|
|
143
|
+
* @default false
|
|
144
|
+
*/
|
|
145
|
+
shouldRenderCustomOptions: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* Callback handler for custom options
|
|
148
|
+
*
|
|
149
|
+
* Imp Note: The menu open/close needs to handled by the consumer in this case
|
|
150
|
+
*/
|
|
151
|
+
renderCustomOptions: () => ReactElement;
|
|
152
|
+
} | {
|
|
153
|
+
shouldRenderCustomOptions?: never;
|
|
154
|
+
renderCustomOptions?: never;
|
|
155
|
+
});
|
|
156
|
+
export type SelectPickerGroupHeadingProps<OptionValue> = GroupHeadingProps<SelectPickerOptionType<OptionValue>> & {
|
|
157
|
+
isGroupHeadingSelectable: boolean;
|
|
158
|
+
};
|
|
159
|
+
export interface FilterSelectPickerProps extends Required<Pick<SelectPickerProps<number | string, true>, 'options' | 'isDisabled' | 'placeholder' | 'isLoading'>>, Pick<SelectPickerProps<number | string, true>, 'selectRef' | 'inputId' | 'menuPosition' | 'autoFocus' | 'shouldMenuAlignRight'> {
|
|
160
|
+
appliedFilterOptions: SelectPickerOptionType[];
|
|
161
|
+
handleApplyFilter: (filtersToApply: SelectPickerOptionType<number | string>[]) => void;
|
|
162
|
+
}
|
|
163
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CHECKBOX_VALUE } from '../../../Common/Types';
|
|
2
|
+
import { GroupBase, MultiValue, OptionsOrGroups, StylesConfig } from 'react-select';
|
|
3
|
+
import { SelectPickerOptionType, SelectPickerProps } from './type';
|
|
4
|
+
|
|
5
|
+
export declare const getCommonSelectStyle: <OptionValue, IsMulti extends boolean>({ error, size, menuSize, variant, getIsOptionValid, isGroupHeadingSelectable, shouldMenuAlignRight, }: Pick<SelectPickerProps<OptionValue, IsMulti>, "error" | "size" | "menuSize" | "shouldMenuAlignRight" | "variant"> & Pick<SelectPickerProps<OptionValue, IsMulti>["multiSelectProps"], "getIsOptionValid" | "isGroupHeadingSelectable">) => StylesConfig<SelectPickerOptionType<OptionValue>, boolean, GroupBase<SelectPickerOptionType<OptionValue>>>;
|
|
6
|
+
export declare const getGroupCheckboxValue: <OptionValue>(groupHeadingOptions: readonly SelectPickerOptionType<OptionValue>[], selectedOptions: MultiValue<SelectPickerOptionType<OptionValue>>, getOptionValue: (option: SelectPickerOptionType<OptionValue>) => string) => CHECKBOX_VALUE.CHECKED | CHECKBOX_VALUE.INTERMEDIATE;
|
|
7
|
+
/**
|
|
8
|
+
* Retrieves an option from the options list based on the provided value.
|
|
9
|
+
*
|
|
10
|
+
* @param optionsList - The list of options or groups of options.
|
|
11
|
+
* @param value - The value to compare against the options' values.
|
|
12
|
+
* @param defaultOption - The default option to return if no match is found.
|
|
13
|
+
* @returns The matched option or the default option if no match is found.
|
|
14
|
+
*/
|
|
15
|
+
export declare const getSelectPickerOptionByValue: <OptionValue>(optionsList: OptionsOrGroups<SelectPickerOptionType<OptionValue>, GroupBase<SelectPickerOptionType<OptionValue>>>, value: string | number, defaultOption?: SelectPickerOptionType<OptionValue>) => SelectPickerOptionType<OptionValue>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { LastExecutionResponseType, LastExecutionResultType } from '../../types';
|
|
2
2
|
|
|
3
|
-
export declare const getSortedVulnerabilities: (vulnerabilities: any) => any;
|
|
4
3
|
export declare const getParsedScanResult: (scanResult: any) => LastExecutionResultType;
|
|
5
4
|
export declare const parseLastExecutionResponse: (response: any) => LastExecutionResponseType;
|
|
@@ -10,6 +10,7 @@ export * from './FilterChips';
|
|
|
10
10
|
export * from './ActivityIndicator';
|
|
11
11
|
export * from './GenericSectionErrorState';
|
|
12
12
|
export * from './KeyValueList';
|
|
13
|
+
export * from './ScannedObjectBar';
|
|
13
14
|
export * from './InfoIconTippy';
|
|
14
15
|
export * from './EditableTextArea';
|
|
15
16
|
export * from './Header';
|
|
@@ -32,8 +33,5 @@ export * from './IframeContainer';
|
|
|
32
33
|
export * from './Plugin';
|
|
33
34
|
export * from './KeyValueTable';
|
|
34
35
|
export * from './SelectPicker';
|
|
35
|
-
export * from './CollapsibleList';
|
|
36
|
-
export * from './DeploymentConfigDiff';
|
|
37
36
|
export * from './DetectBottom';
|
|
38
|
-
export * from './
|
|
39
|
-
export * from './FilterButton';
|
|
37
|
+
export * from './SelectPickerCustom';
|
package/dist/Shared/Helpers.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
|
-
import { Pair } from 'yaml';
|
|
3
2
|
import { MaterialInfo, SortingOrder } from '../Common';
|
|
4
3
|
import { GitTriggers, IntersectionChangeHandler, IntersectionOptions, WebhookEventNameType } from './types';
|
|
5
4
|
import { AggregatedNodes, DeploymentStatusDetailsBreakdownDataType, DeploymentStatusDetailsType, PodMetadatum } from './Components';
|
|
@@ -25,8 +24,8 @@ export declare const getIsMaterialInfoAvailable: (materialInfo: MaterialInfo[])
|
|
|
25
24
|
export declare const getGitCommitInfo: (materialInfo: MaterialInfo) => GitTriggers;
|
|
26
25
|
export declare const stringComparatorBySortOrder: (a: string, b: string, sortOrder?: SortingOrder, isCaseSensitive?: boolean) => number;
|
|
27
26
|
export declare const numberComparatorBySortOrder: (a: number, b: number, sortOrder?: SortingOrder) => number;
|
|
27
|
+
export declare function versionComparatorBySortOrder(a: Record<string, any>, b: Record<string, any>, compareKey: string, orderBy: SortingOrder): any;
|
|
28
28
|
export declare const getWebhookEventIcon: (eventName: WebhookEventNameType) => JSX.Element;
|
|
29
|
-
export declare const yamlComparatorBySortOrder: (a: Pair, b: Pair, sortOrder?: SortingOrder) => number;
|
|
30
29
|
export declare const useIntersection: (target: React.RefObject<Element> | Element | null, options?: IntersectionOptions, callback?: IntersectionChangeHandler) => boolean;
|
|
31
30
|
export declare const isNullOrUndefined: (value: unknown) => boolean;
|
|
32
31
|
export declare const handleDisableSubmitOnEnter: (event: React.KeyboardEvent<HTMLFormElement>) => void;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CIMaterialInfoType, GetCITriggerInfoParamsType, AppEnvDeploymentConfigDTO, AppEnvDeploymentConfigPayloadType } from './app.types';
|
|
1
|
+
import { CIMaterialInfoType, GetCITriggerInfoParamsType } from './app.types';
|
|
3
2
|
|
|
4
3
|
export declare const getCITriggerInfo: (params: GetCITriggerInfoParamsType) => Promise<CIMaterialInfoType>;
|
|
5
4
|
/**
|
|
6
5
|
* The only difference between this and getCITriggerInfo is it doesn't have env and trigger related meta info
|
|
7
6
|
*/
|
|
8
7
|
export declare const getArtifactInfo: (params: Pick<GetCITriggerInfoParamsType, 'ciArtifactId'>) => Promise<CIMaterialInfoType>;
|
|
9
|
-
export declare const getAppEnvDeploymentConfig: (params: AppEnvDeploymentConfigPayloadType, signal?: AbortSignal) => Promise<ResponseType<AppEnvDeploymentConfigDTO>>;
|