@devtron-labs/devtron-fe-common-lib 0.2.2-beta-7 → 0.2.2-beta-9

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 (45) hide show
  1. package/dist/Common/Api.d.ts +5 -5
  2. package/dist/Common/CIPipeline.Types.d.ts +4 -1
  3. package/dist/Common/Constants.d.ts +2 -0
  4. package/dist/Common/CustomInput/Types.d.ts +2 -2
  5. package/dist/Common/Modals/VisibleModal.d.ts +1 -1
  6. package/dist/Common/Modals/VisibleModal2.d.ts +1 -1
  7. package/dist/Common/MultiSelectCustomization.d.ts +1 -1
  8. package/dist/Common/Types.d.ts +2 -2
  9. package/dist/Shared/Components/DetectBottom/DetectBottom.component.d.ts +2 -1
  10. package/dist/Shared/Components/EditImageFormField/EditImageFormField.d.ts +19 -0
  11. package/dist/Shared/Components/EditImageFormField/constants.d.ts +7 -0
  12. package/dist/Shared/Components/EditImageFormField/index.d.ts +2 -0
  13. package/dist/Shared/Components/EditImageFormField/types.d.ts +41 -0
  14. package/dist/Shared/Components/Header/types.d.ts +1 -12
  15. package/dist/Shared/Components/Plugin/service.d.ts +4 -2
  16. package/dist/Shared/Components/Plugin/types.d.ts +11 -3
  17. package/dist/Shared/Components/Plugin/utils.d.ts +3 -0
  18. package/dist/Shared/Components/SelectPicker/SelectPicker.component.d.ts +1 -55
  19. package/dist/Shared/Components/SelectPicker/common.d.ts +8 -11
  20. package/dist/Shared/Components/SelectPicker/index.d.ts +0 -2
  21. package/dist/Shared/Components/SelectPicker/type.d.ts +10 -86
  22. package/dist/Shared/Components/SelectPicker/utils.d.ts +2 -13
  23. package/dist/Shared/Components/index.d.ts +1 -0
  24. package/dist/Shared/constants.d.ts +1 -0
  25. package/dist/Shared/validations.d.ts +11 -0
  26. package/dist/assets/index.css +1 -1
  27. package/dist/{cssMode-a7a20b4f.js → cssMode-b7a40cfa.js} +1 -1
  28. package/dist/{freemarker2-7ae32967.js → freemarker2-ff0a7c06.js} +1 -1
  29. package/dist/{handlebars-ea532d8e.js → handlebars-0b7a7efd.js} +1 -1
  30. package/dist/{html-bad89d3f.js → html-feeb68bd.js} +1 -1
  31. package/dist/{htmlMode-c1e0f91a.js → htmlMode-bcac9443.js} +1 -1
  32. package/dist/{index-699c118c.js → index-79eaedd6.js} +38072 -42370
  33. package/dist/index.js +328 -324
  34. package/dist/{javascript-46ae44e7.js → javascript-d16fe14e.js} +1 -1
  35. package/dist/{jsonMode-950fbd0d.js → jsonMode-74be8d73.js} +1 -1
  36. package/dist/{liquid-855a3272.js → liquid-78dc826f.js} +1 -1
  37. package/dist/{mdx-472fa858.js → mdx-927038f2.js} +1 -1
  38. package/dist/{python-580d8e15.js → python-1d5b3ab0.js} +1 -1
  39. package/dist/{razor-9ab62a02.js → razor-9f3bc729.js} +1 -1
  40. package/dist/{tsMode-3b66e5d3.js → tsMode-3f0ed0a8.js} +1 -1
  41. package/dist/{typescript-2e2235bc.js → typescript-b8689929.js} +1 -1
  42. package/dist/{xml-f408d4bf.js → xml-26b71a9d.js} +1 -1
  43. package/dist/{yaml-f13db3af.js → yaml-acff597f.js} +1 -1
  44. package/package.json +5 -5
  45. package/dist/Shared/Components/SelectPicker/FilterSelectPicker.d.ts +0 -4
@@ -1,11 +1,11 @@
1
1
  import { MutableRefObject } from 'react';
2
2
  import { ResponseType, APIOptions } from './Types';
3
3
 
4
- export declare const post: (url: string, data: object, options?: APIOptions, isMultipartRequest?: boolean) => Promise<ResponseType>;
5
- export declare const put: (url: string, data: object, options?: APIOptions) => Promise<ResponseType>;
6
- export declare const patch: (url: string, data: object, options?: APIOptions) => Promise<ResponseType>;
7
- export declare const get: (url: string, options?: APIOptions) => Promise<ResponseType>;
8
- export declare const trash: (url: string, data?: object, options?: APIOptions) => Promise<ResponseType>;
4
+ export declare const post: <T = any, K = object>(url: string, data: K, options?: APIOptions, isMultipartRequest?: boolean) => Promise<ResponseType<T>>;
5
+ export declare const put: <T = any, K = object>(url: string, data: K, options?: APIOptions) => Promise<ResponseType<T>>;
6
+ export declare const patch: <T = any, K = object>(url: string, data: K, options?: APIOptions) => Promise<ResponseType<T>>;
7
+ export declare const get: <T = any>(url: string, options?: APIOptions) => Promise<ResponseType<T>>;
8
+ export declare const trash: <T = any, K = object>(url: string, data?: K, options?: APIOptions) => Promise<ResponseType<T>>;
9
9
  /**
10
10
  * Aborts the previous request before triggering next request
11
11
  */
@@ -77,6 +77,7 @@ export interface VariableType {
77
77
  format: string;
78
78
  description: string;
79
79
  defaultValue: string;
80
+ allowEmptyValue: boolean;
80
81
  variableType: RefVariableType;
81
82
  refVariableStepIndex: number;
82
83
  refVariableName: string;
@@ -98,7 +99,7 @@ interface ConditionDetails {
98
99
  conditionType: ConditionType;
99
100
  conditionalValue: string;
100
101
  }
101
- interface InlineStepDetailType {
102
+ export interface InlineStepDetailType {
102
103
  scriptType: ScriptType;
103
104
  isMountCustomScript?: boolean;
104
105
  script?: string;
@@ -117,6 +118,8 @@ interface InlineStepDetailType {
117
118
  inputVariables?: VariableType[];
118
119
  outputVariables?: VariableType[];
119
120
  conditionDetails: ConditionDetails[];
121
+ storeScriptAt?: string;
122
+ mountCodeToContainerPath?: string;
120
123
  }
121
124
  interface PluginRefStepDetailType {
122
125
  id: number;
@@ -81,6 +81,7 @@ export declare const ROUTES: {
81
81
  PLUGIN_GLOBAL_LIST_DETAIL_V2: string;
82
82
  PLUGIN_GLOBAL_LIST_V2: string;
83
83
  PLUGIN_GLOBAL_LIST_TAGS: string;
84
+ PLUGIN_LIST_MIN: string;
84
85
  };
85
86
  export declare enum KEY_VALUE {
86
87
  KEY = "key",
@@ -270,3 +271,4 @@ export declare const DATE_TIME_FORMATS: {
270
271
  DD_MMM_YYYY_HH_MM: string;
271
272
  DD_MMM_YYYY: string;
272
273
  };
274
+ export declare const SEMANTIC_VERSION_DOCUMENTATION_LINK = "https://semver.org/";
@@ -1,4 +1,4 @@
1
- import { default as React, HTMLInputTypeAttribute, InputHTMLAttributes } from 'react';
1
+ import { default as React, HTMLInputTypeAttribute, InputHTMLAttributes, ReactNode } from 'react';
2
2
 
3
3
  export interface CustomInputProps {
4
4
  name: string;
@@ -17,7 +17,7 @@ export interface CustomInputProps {
17
17
  autoFocus?: boolean;
18
18
  rootClassName?: string;
19
19
  error?: string[] | string;
20
- helperText?: string;
20
+ helperText?: ReactNode;
21
21
  handleOnBlur?: (e: any) => void;
22
22
  readOnly?: boolean;
23
23
  noTrim?: boolean;
@@ -1,7 +1,7 @@
1
1
  import { default as React, SyntheticEvent } from 'react';
2
2
 
3
3
  export declare class VisibleModal extends React.Component<{
4
- className: string;
4
+ className?: string;
5
5
  parentClassName?: string;
6
6
  noBackground?: boolean;
7
7
  close?: (e: any) => void;
@@ -1,7 +1,7 @@
1
1
  import { default as React, SyntheticEvent } from 'react';
2
2
 
3
3
  export declare class VisibleModal2 extends React.Component<{
4
- className: string;
4
+ className?: string;
5
5
  close?: (e: any) => void;
6
6
  }> {
7
7
  modalRef: HTMLElement;
@@ -4,7 +4,7 @@ export declare const Option: (props: any) => JSX.Element;
4
4
  export declare const SingleSelectOption: (props: any) => JSX.Element;
5
5
  /**
6
6
  * Multi value container
7
- */
7
+ */
8
8
  export declare const MultiValueContainer: (props: any) => JSX.Element;
9
9
  /**
10
10
  *
@@ -177,10 +177,10 @@ export interface RadioGroupItemProps {
177
177
  export interface RadioGroupInterface {
178
178
  name: string;
179
179
  onChange: any;
180
- className?: string;
181
180
  initialTab: string;
182
- disabled: boolean;
183
181
  children: ReactNode;
182
+ disabled?: boolean;
183
+ className?: string;
184
184
  }
185
185
  export interface RadioInterface {
186
186
  children: ReactNode;
@@ -1,5 +1,6 @@
1
1
  interface DetectBottomProps {
2
2
  callback: () => void;
3
+ hasError?: boolean;
3
4
  }
4
- declare const DetectBottom: ({ callback }: DetectBottomProps) => JSX.Element;
5
+ declare const DetectBottom: ({ callback, hasError }: DetectBottomProps) => JSX.Element;
5
6
  export default DetectBottom;
@@ -0,0 +1,19 @@
1
+ import { EditImageFormFieldProps } from './types';
2
+
3
+ /**
4
+ * @example
5
+ * ```tsx
6
+ * <EditImageFormField
7
+ * url={icon}
8
+ * defaultIcon={<ICSampleIcon className="w-100 h-100 dc__opacity-1 p-5" />}
9
+ * errorMessage={formError.icon}
10
+ * handleError={handleError}
11
+ * handleURLChange={handleURLChange}
12
+ * ariaLabelPrefix="Edit icon url"
13
+ * dataTestIdPrefix="edit-icon-url"
14
+ * altText="Form icon"
15
+ * />
16
+ * ```
17
+ */
18
+ declare const EditImageFormField: ({ defaultIcon, errorMessage, handleError, url, handleURLChange, ariaLabelPrefix, dataTestIdPrefix, altText, }: EditImageFormFieldProps) => JSX.Element;
19
+ export default EditImageFormField;
@@ -0,0 +1,7 @@
1
+ export declare const DEFAULT_MAX_IMAGE_SIZE: number;
2
+ export declare const DEFAULT_IMAGE_DIMENSIONS: {
3
+ readonly width: 72;
4
+ readonly height: 72;
5
+ };
6
+ export declare const EMPTY_PREVIEW_URL_ERROR_MESSAGE = "Please provide image URL to preview";
7
+ export declare const BASE_IMAGE_CLASS = "edit-image-form-field__figure-container--base-image";
@@ -0,0 +1,2 @@
1
+ export { default as EditImageFormField } from './EditImageFormField';
2
+ export * from './types';
@@ -0,0 +1,41 @@
1
+ import { ReactElement } from 'react';
2
+
3
+ export interface EditImageFormFieldProps {
4
+ /**
5
+ * Fallback icon to be shown when image is not available
6
+ */
7
+ defaultIcon: ReactElement;
8
+ /**
9
+ * Would be shown below input, there are two types of error messages:
10
+ * External - Error message handled from state above and would propagate to parent through handleError
11
+ * Internal - Error message handled internally and would not propagate to parent, like empty preview URL
12
+ */
13
+ errorMessage: string;
14
+ /**
15
+ * Would be called when there is an error in the image URL during handleChange or handlePreviewImage
16
+ */
17
+ handleError: (error: string) => void;
18
+ /**
19
+ * The current value of input field
20
+ */
21
+ url: string;
22
+ /**
23
+ * Would be called when the URL is changed in the input field
24
+ */
25
+ handleURLChange: (url: string) => void;
26
+ /**
27
+ * The alt text for the image
28
+ */
29
+ altText: string;
30
+ /**
31
+ * Prefix for aria-label
32
+ */
33
+ ariaLabelPrefix: string;
34
+ /**
35
+ * Prefix for data-testid
36
+ */
37
+ dataTestIdPrefix: string;
38
+ }
39
+ export interface FallbackImageProps extends Pick<EditImageFormFieldProps, 'defaultIcon'> {
40
+ showEditIcon: boolean;
41
+ }
@@ -1,3 +1,4 @@
1
+ import { ModuleStatus } from '../../types';
1
2
  import { ResponseType, TippyCustomizedProps } from '../../../Common';
2
3
 
3
4
  export declare enum InstallationType {
@@ -5,18 +6,6 @@ export declare enum InstallationType {
5
6
  OSS_HELM = "oss_helm",
6
7
  ENTERPRISE = "enterprise"
7
8
  }
8
- export declare enum ModuleStatus {
9
- HEALTHY = "healthy",
10
- NONE = "none",
11
- UNKNOWN = "unknown",
12
- UPGRADING = "upgrading",
13
- UPGRADE_FAILED = "upgradeFailed",
14
- INSTALLED = "installed",
15
- INSTALLING = "installing",
16
- INSTALL_FAILED = "installFailed",
17
- NOT_INSTALLED = "notInstalled",
18
- TIMEOUT = "timeout"
19
- }
20
9
  export interface PageHeaderType {
21
10
  headerName?: string;
22
11
  showTabs?: boolean;
@@ -1,5 +1,7 @@
1
- import { GetPluginStoreDataReturnType, GetPluginStoreDataServiceParamsType, PluginDetailServiceParamsType } from './types';
1
+ import { ResponseType } from '../../../Common';
2
+ import { GetPluginStoreDataReturnType, GetPluginStoreDataServiceParamsType, MinParentPluginDTO, PluginDetailServiceParamsType } from './types';
2
3
 
3
- export declare const getPluginsDetail: ({ appId, parentPluginIds, pluginIds, shouldShowError, }: PluginDetailServiceParamsType) => Promise<Pick<GetPluginStoreDataReturnType, 'pluginStore'>>;
4
+ export declare const getPluginsDetail: ({ appId, parentPluginIds, pluginIds, signal, shouldShowError, }: PluginDetailServiceParamsType) => Promise<Pick<GetPluginStoreDataReturnType, 'pluginStore'>>;
4
5
  export declare const getPluginStoreData: ({ searchKey, selectedTags, appId, offset, signal, }: GetPluginStoreDataServiceParamsType) => Promise<GetPluginStoreDataReturnType>;
5
6
  export declare const getAvailablePluginTags: (appId: number) => Promise<string[]>;
7
+ export declare const getParentPluginList: (appId?: number) => Promise<ResponseType<MinParentPluginDTO[]>>;
@@ -8,9 +8,13 @@ export declare enum PluginCreationType {
8
8
  SHARED = "SHARED",
9
9
  PRESET = "PRESET"
10
10
  }
11
- export interface GetPluginTagsPayloadType {
11
+ export interface PluginAPIBaseQueryParamsType {
12
12
  appId: number;
13
13
  }
14
+ export interface GetPluginTagsPayloadType extends PluginAPIBaseQueryParamsType {
15
+ }
16
+ export interface GetParentPluginListPayloadType extends PluginAPIBaseQueryParamsType {
17
+ }
14
18
  export interface PluginTagNamesDTO {
15
19
  tagNames: string[];
16
20
  }
@@ -45,6 +49,9 @@ export interface ParentPluginDTO {
45
49
  type: PluginCreationType;
46
50
  icon: string;
47
51
  pluginVersions: PluginVersionsDTO;
52
+ pluginIdentifier: string;
53
+ }
54
+ export interface MinParentPluginDTO extends Pick<ParentPluginDTO, 'id' | 'name' | 'icon'> {
48
55
  }
49
56
  export interface PluginDetailDTO {
50
57
  parentPlugins: ParentPluginDTO[];
@@ -58,6 +65,7 @@ export interface PluginDetailServiceParamsType {
58
65
  * @default true
59
66
  */
60
67
  shouldShowError?: boolean;
68
+ signal?: AbortSignal;
61
69
  }
62
70
  export interface PluginDetailPayloadType extends Pick<PluginDetailServiceParamsType, 'appId'> {
63
71
  pluginId?: PluginDetailServiceParamsType['pluginIds'];
@@ -66,11 +74,11 @@ export interface PluginDetailPayloadType extends Pick<PluginDetailServiceParamsT
66
74
  export interface PluginListFiltersType extends Pick<BaseFilterQueryParams<unknown>, 'searchKey'> {
67
75
  selectedTags: string[];
68
76
  }
69
- interface ParentPluginType extends Pick<ParentPluginDTO, 'id' | 'name' | 'description' | 'type' | 'icon'> {
77
+ interface ParentPluginType extends Pick<ParentPluginDTO, 'id' | 'name' | 'description' | 'type' | 'icon' | 'pluginIdentifier'> {
70
78
  latestVersionId: MinimalPluginVersionDataDTO['id'];
71
79
  pluginVersions: MinimalPluginVersionDataDTO[];
72
80
  }
73
- interface DetailedPluginVersionType extends Pick<MinimalPluginVersionDataDTO, 'id' | 'description' | 'name' | 'pluginVersion'>, Pick<DetailedPluginVersionDTO, 'tags' | 'isLatest' | 'inputVariables' | 'outputVariables' | 'updatedBy' | 'docLink'>, Pick<ParentPluginType, 'icon' | 'type'> {
81
+ interface DetailedPluginVersionType extends Pick<MinimalPluginVersionDataDTO, 'id' | 'description' | 'name' | 'pluginVersion'>, Pick<DetailedPluginVersionDTO, 'tags' | 'isLatest' | 'inputVariables' | 'outputVariables' | 'updatedBy' | 'docLink'>, Pick<ParentPluginType, 'icon' | 'type' | 'pluginIdentifier'> {
74
82
  parentPluginId: ParentPluginType['id'];
75
83
  }
76
84
  export interface PluginDataStoreType {
@@ -1,3 +1,5 @@
1
+ import { OptionProps } from 'react-select';
2
+ import { OptionType } from '../../../Common/Types';
1
3
  import { ParentPluginDTO, PluginDataStoreType } from './types';
2
4
 
3
5
  export declare const parsePluginDetailsDTOIntoPluginStore: (pluginData: ParentPluginDTO[]) => PluginDataStoreType;
@@ -14,6 +16,7 @@ export declare const pluginTagSelectStyles: {
14
16
  group: (base: any) => any;
15
17
  groupHeading: (base: any) => any;
16
18
  };
19
+ export declare const PluginTagOption: (props: OptionProps<OptionType, true>) => JSX.Element;
17
20
  /**
18
21
  * @description This method takes the initial plugin data store and updates the keys with the target parent plugin store and plugin version store
19
22
  */
@@ -80,60 +80,6 @@ import { SelectPickerProps } from './type';
80
80
  * ```tsx
81
81
  * <SelectPicker ... showSelectedOptionsCount />
82
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
83
  */
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, ...props }: SelectPickerProps<OptionValue, IsMulti>) => JSX.Element;
84
+ declare const SelectPicker: ({ error, icon, renderMenuListFooter, helperText, placeholder, label, showSelectedOptionIcon, size, disabledTippyContent, showSelectedOptionsCount, menuSize, optionListError, reloadOptionList, ...props }: SelectPickerProps) => JSX.Element;
139
85
  export default SelectPicker;
@@ -1,13 +1,10 @@
1
- import { DropdownIndicatorProps, ControlProps, OptionProps, ClearIndicatorProps, ValueContainerProps, MenuListProps, MultiValueRemoveProps, MultiValueProps } from 'react-select';
2
- import { SelectPickerGroupHeadingProps, SelectPickerOptionType, SelectPickerProps } from './type';
1
+ import { DropdownIndicatorProps, ControlProps, OptionProps, ClearIndicatorProps, ValueContainerProps, MenuListProps } from 'react-select';
2
+ import { SelectPickerOptionType, SelectPickerProps } from './type';
3
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, ...props }: ValueContainerProps<SelectPickerOptionType<OptionValue>, boolean, import('react-select').GroupBase<SelectPickerOptionType<OptionValue>>> & Pick<SelectPickerProps<OptionValue, IsMulti>, "showSelectedOptionsCount">) => JSX.Element;
4
+ export declare const SelectPickerDropdownIndicator: (props: DropdownIndicatorProps<SelectPickerOptionType>) => JSX.Element;
5
+ export declare const SelectPickerClearIndicator: (props: ClearIndicatorProps<SelectPickerOptionType>) => JSX.Element;
6
+ export declare const SelectPickerControl: ({ icon, showSelectedOptionIcon, ...props }: ControlProps<SelectPickerOptionType> & Pick<SelectPickerProps, 'icon' | 'showSelectedOptionIcon'>) => JSX.Element;
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: <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;
9
+ export declare const SelectPickerOption: (props: OptionProps<SelectPickerOptionType>) => JSX.Element;
10
+ export declare const SelectPickerMenuList: ({ renderMenuListFooter, ...props }: MenuListProps<SelectPickerOptionType> & Pick<SelectPickerProps, 'renderMenuListFooter'>) => JSX.Element;
@@ -1,4 +1,2 @@
1
1
  export { default as SelectPicker } from './SelectPicker.component';
2
- export { default as FilterSelectPicker } from './FilterSelectPicker';
3
2
  export * from './type';
4
- export { getSelectPickerOptionByValue } from './utils';
@@ -1,10 +1,10 @@
1
+ import { ServerErrors } from '../../../Common/ServerError';
1
2
  import { OptionType } from '../../../Common/Types';
2
3
  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';
4
+ import { ReactElement, ReactNode } from 'react';
5
+ import { Props as ReactSelectProps } from 'react-select';
6
6
 
7
- export interface SelectPickerOptionType<OptionValue = string | number> extends OptionType<OptionValue, ReactNode> {
7
+ export interface SelectPickerOptionType extends OptionType<number | string, ReactNode> {
8
8
  /**
9
9
  * Description to be displayed for the option
10
10
  */
@@ -18,12 +18,8 @@ export interface SelectPickerOptionType<OptionValue = string | number> extends O
18
18
  */
19
19
  endIcon?: ReactElement;
20
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'>> & {
21
+ type SelectProps = ReactSelectProps<SelectPickerOptionType>;
22
+ export interface SelectPickerProps extends Pick<SelectProps, 'options' | 'value' | 'onChange' | 'isSearchable' | 'isClearable' | 'isLoading' | 'hideSelectedOptions' | 'controlShouldRenderValue' | 'closeMenuOnSelect' | 'isDisabled' | 'isLoading' | 'required' | 'isOptionDisabled' | 'placeholder' | 'autoFocus' | 'onKeyDown'>, Required<Pick<SelectProps, 'classNamePrefix' | 'inputId' | 'name'>> {
27
23
  /**
28
24
  * Icon to be rendered in the control
29
25
  */
@@ -76,84 +72,12 @@ export type SelectPickerProps<OptionValue = number | string, IsMulti extends boo
76
72
  */
77
73
  menuSize?: ComponentSizeType;
78
74
  /**
79
- * Variant of the select.
80
- *
81
- * @default SelectPickerVariantType.DEFAULT
82
- */
83
- variant?: SelectPickerVariantType;
84
- /**
85
- * Disables the ellipsis on description, it will be shown in full width, wrapped if required.
86
- *
87
- * @default false
88
- */
89
- disableDescriptionEllipsis?: boolean;
90
- /**
91
- * Ref for the select picker
92
- */
93
- selectRef?: IsMulti extends true ? MutableRefObject<SelectInstance<SelectPickerOptionType<OptionValue>, true>> : MutableRefObject<SelectInstance<SelectPickerOptionType<OptionValue>>>;
94
- /**
95
- * If true, the menu is aligned at the right end to prevent going outside of viewport
96
- * in case of menu being larger than the control
97
- *
98
- * @default false
75
+ * If truthy, would show generic section error state as no options message
99
76
  */
100
- shouldMenuAlignRight?: boolean;
77
+ optionListError?: ServerErrors;
101
78
  /**
102
- * If true, the select spans to the max available width
103
- *
104
- * @default false
105
- */
106
- fullWidth?: boolean;
107
- } & (IsMulti extends true ? {
108
- isMulti: IsMulti | boolean;
109
- multiSelectProps?: Pick<CreatableProps<SelectPickerOptionType<OptionValue>, true, GroupBase<SelectPickerOptionType<OptionValue>>>, 'onCreateOption'> & {
110
- /**
111
- * If true, the select picker creates the new option
112
- * Only applicable for IsMulti: true
113
- *
114
- * @default false
115
- */
116
- isCreatable?: boolean;
117
- /**
118
- * If true, the group heading can be selected
119
- *
120
- * Only applicable for IsMulti: true
121
- *
122
- * @default false
123
- */
124
- isGroupHeadingSelectable?: boolean;
125
- /**
126
- * Callback handler to check if the given selection is valid or not
127
- */
128
- getIsOptionValid?: (option: SelectPickerOptionType<OptionValue>) => boolean;
129
- };
130
- } : {
131
- isMulti?: never;
132
- multiSelectProps?: never;
133
- }) & ({
134
- /**
135
- * If true, custom options are rendered in the menuList component of react select
136
- *
137
- * Note: renderCustomOptions is required to be passed; renderMenuListFooter is also not called
138
- *
139
- * @default false
140
- */
141
- shouldRenderCustomOptions: boolean;
142
- /**
143
- * Callback handler for custom options
144
- *
145
- * Imp Note: The menu open/close needs to handled by the consumer in this case
79
+ * Would reload the option list when called in case optionListError is present
146
80
  */
147
- renderCustomOptions: () => ReactElement;
148
- } | {
149
- shouldRenderCustomOptions?: never;
150
- renderCustomOptions?: never;
151
- });
152
- export type SelectPickerGroupHeadingProps<OptionValue> = GroupHeadingProps<SelectPickerOptionType<OptionValue>> & {
153
- isGroupHeadingSelectable: boolean;
154
- };
155
- export interface FilterSelectPickerProps extends Required<Pick<SelectPickerProps<number | string, true>, 'options' | 'isDisabled' | 'placeholder' | 'isLoading'>>, Pick<SelectPickerProps<number | string, true>, 'selectRef' | 'inputId' | 'menuPosition' | 'autoFocus' | 'shouldMenuAlignRight'> {
156
- appliedFilterOptions: SelectPickerProps<number | string, true>['options'];
157
- handleApplyFilter: (filtersToApply: SelectPickerOptionType<number | string>[]) => void;
81
+ reloadOptionList?: () => void;
158
82
  }
159
83
  export {};
@@ -1,15 +1,4 @@
1
- import { CHECKBOX_VALUE } from '../../../Common/Types';
2
- import { GroupBase, MultiValue, OptionsOrGroups, StylesConfig } from 'react-select';
1
+ import { StylesConfig } from 'react-select';
3
2
  import { SelectPickerOptionType, SelectPickerProps } from './type';
4
3
 
5
- export declare const getCommonSelectStyle: <OptionValue, IsMulti extends boolean>({ error, size, menuSize, variant, getIsOptionValid, isGroupHeadingSelectable, shouldMenuAlignRight, }: Pick<SelectPickerProps<OptionValue, IsMulti>, "error" | "size" | "shouldMenuAlignRight" | "menuSize" | "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>;
4
+ export declare const getCommonSelectStyle: ({ error, size, menuSize, }: Pick<SelectPickerProps, 'error' | 'size' | 'menuSize'>) => StylesConfig<SelectPickerOptionType>;
@@ -34,3 +34,4 @@ export * from './Plugin';
34
34
  export * from './KeyValueTable';
35
35
  export * from './SelectPicker';
36
36
  export * from './DetectBottom';
37
+ export * from './EditImageFormField';
@@ -388,6 +388,7 @@ export declare enum ComponentSizeType {
388
388
  medium = "medium",
389
389
  large = "large"
390
390
  }
391
+ export declare const POP_UP_MENU_MODAL_ID = "popup";
391
392
  /**
392
393
  * Identifiers for grouped / all resources
393
394
  */
@@ -12,6 +12,7 @@ export declare const MESSAGES: {
12
12
  VALID_POSITIVE_NUMBER: string;
13
13
  VALID_POSITIVE_INTEGER: string;
14
14
  MAX_SAFE_INTEGER: string;
15
+ INVALID_SEMANTIC_VERSION: string;
15
16
  };
16
17
  export declare const requiredField: (value: string) => ValidationResponseType;
17
18
  export declare const validateName: (name: string) => ValidationResponseType;
@@ -28,3 +29,13 @@ export declare const validateUniqueKeys: (keys: string[]) => {
28
29
  isValid: boolean;
29
30
  message: string;
30
31
  };
32
+ /**
33
+ * Rules for valid semantic version:
34
+ * 1. version.length < 128 and not empty
35
+ * 2. version should follow semantic versioning regex from https://semver.org/
36
+ */
37
+ export declare const validateSemanticVersioning: (version: string) => ValidationResponseType;
38
+ /**
39
+ * A valid display name should be between 3 and 50 characters
40
+ */
41
+ export declare const validateDisplayName: (name: string) => ValidationResponseType;