@devtron-labs/devtron-fe-common-lib 0.2.2-beta-8 → 0.2.2-beta-10
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/Shared/Components/CICDHistory/Artifacts.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/LogStageAccordion.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/LogsRenderer.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/TriggerOutput.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/types.d.ts +17 -18
- package/dist/Shared/Components/CICDHistory/utils.d.ts +0 -1
- package/dist/Shared/Components/CommitChipCell/types.d.ts +1 -1
- package/dist/Shared/Components/ImageChipCell/ImageChipCell.component.d.ts +1 -1
- package/dist/Shared/Components/ImageChipCell/types.d.ts +5 -13
- package/dist/Shared/Components/SelectPicker/FilterSelectPicker.d.ts +4 -0
- package/dist/Shared/Components/SelectPicker/SelectPicker.component.d.ts +55 -1
- package/dist/Shared/Components/SelectPicker/common.d.ts +11 -8
- package/dist/Shared/Components/SelectPicker/index.d.ts +2 -0
- package/dist/Shared/Components/SelectPicker/type.d.ts +90 -5
- package/dist/Shared/Components/SelectPicker/utils.d.ts +13 -2
- package/dist/Shared/Components/ShowMoreText/ShowMoreText.d.ts +2 -2
- package/dist/Shared/Components/index.d.ts +0 -1
- package/dist/Shared/Helpers.d.ts +0 -5
- package/dist/Shared/constants.d.ts +0 -6
- package/dist/assets/index.css +1 -1
- package/dist/{cssMode-f45645f2.js → cssMode-82a944e5.js} +1 -1
- package/dist/{freemarker2-9a27c868.js → freemarker2-281dd29e.js} +1 -1
- package/dist/{handlebars-b46ae50c.js → handlebars-402af903.js} +1 -1
- package/dist/{html-4ebd201f.js → html-e0c917b4.js} +1 -1
- package/dist/{htmlMode-e0c16e0c.js → htmlMode-b3b2c4b1.js} +1 -1
- package/dist/{index-f9d0fa07.js → index-182a9c8e.js} +42326 -37873
- package/dist/index.js +210 -211
- package/dist/{javascript-e2ac226c.js → javascript-cc0aa1b1.js} +1 -1
- package/dist/{jsonMode-10a833fd.js → jsonMode-04682bb0.js} +1 -1
- package/dist/{liquid-5e4656ca.js → liquid-9d69388d.js} +1 -1
- package/dist/{mdx-b7c4beac.js → mdx-781e1f35.js} +1 -1
- package/dist/{python-c5fda31e.js → python-a3a10c4e.js} +1 -1
- package/dist/{razor-79ab7843.js → razor-37366ce9.js} +1 -1
- package/dist/{tsMode-35f336ee.js → tsMode-545943e6.js} +1 -1
- package/dist/{typescript-c80682d7.js → typescript-6634a376.js} +1 -1
- package/dist/{xml-10ecc0b3.js → xml-388afb21.js} +1 -1
- package/dist/{yaml-0f49bfd9.js → yaml-31e8dfa8.js} +1 -1
- package/package.json +5 -5
- package/dist/Shared/Components/ShowMoreText/index.d.ts +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ArtifactType, CIListItemType } from './types';
|
|
2
2
|
|
|
3
3
|
export declare const CIListItem: ({ type, userApprovalMetadata, triggeredBy, children, ciPipelineId, artifactId, imageComment, imageReleaseTags, appReleaseTagNames, tagsEditable, hideImageTaggingHardDelete, appliedFilters, isSuperAdmin, promotionApprovalMetadata, appliedFiltersTimestamp, selectedEnvironmentName, renderCIListHeader, }: CIListItemType) => JSX.Element;
|
|
4
|
-
declare const Artifacts: ({ status, artifact, blobStorageEnabled, isArtifactUploaded, downloadArtifactUrl, ciPipelineId, artifactId, isJobView, isJobCI, imageComment, imageReleaseTags, type, appReleaseTagNames, tagsEditable, hideImageTaggingHardDelete,
|
|
4
|
+
declare const Artifacts: ({ status, artifact, blobStorageEnabled, isArtifactUploaded, downloadArtifactUrl, ciPipelineId, artifactId, isJobView, isJobCI, imageComment, imageReleaseTags, type, appReleaseTagNames, tagsEditable, hideImageTaggingHardDelete, jobCIClass, renderCIListHeader, }: ArtifactType) => JSX.Element;
|
|
5
5
|
export default Artifacts;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { LogStageAccordionProps } from './types';
|
|
2
2
|
|
|
3
|
-
declare const LogStageAccordion: ({ stage, isOpen, logs, endTime, startTime, status, handleStageClose, handleStageOpen, stageIndex, isLoading,
|
|
3
|
+
declare const LogStageAccordion: ({ stage, isOpen, logs, endTime, startTime, status, handleStageClose, handleStageOpen, stageIndex, isLoading, }: LogStageAccordionProps) => JSX.Element;
|
|
4
4
|
export default LogStageAccordion;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { LogsRendererType } from './types';
|
|
2
2
|
|
|
3
|
-
export declare const LogsRenderer: ({ triggerDetails, isBlobStorageConfigured, parentType,
|
|
3
|
+
export declare const LogsRenderer: ({ triggerDetails, isBlobStorageConfigured, parentType, }: LogsRendererType) => JSX.Element;
|
|
4
4
|
export default LogsRenderer;
|
|
@@ -2,5 +2,5 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { TriggerDetailsType, TriggerOutputProps } from './types';
|
|
3
3
|
|
|
4
4
|
export declare const TriggerDetails: React.MemoExoticComponent<({ status, startedOn, finishedOn, triggeredBy, triggeredByEmail, ciMaterials, gitTriggers, message, podStatus, type, stage, artifact, environmentName, isJobView, workerPodName, triggerMetadata, renderDeploymentHistoryTriggerMetaText, }: TriggerDetailsType) => JSX.Element>;
|
|
5
|
-
declare const TriggerOutput: ({ fullScreenView, triggerHistory, setTriggerHistory, setFullScreenView, setDeploymentHistoryList, deploymentHistoryList, deploymentAppType, isBlobStorageConfigured, appReleaseTags, tagsEditable, hideImageTaggingHardDelete, fetchIdData, setFetchTriggerIdData, selectedEnvironmentName, deploymentHistoryResult, renderRunSource, renderCIListHeader, renderDeploymentApprovalInfo, processVirtualEnvironmentDeploymentData, renderVirtualHistoryArtifacts, renderDeploymentHistoryTriggerMetaText, resourceId,
|
|
5
|
+
declare const TriggerOutput: ({ fullScreenView, triggerHistory, setTriggerHistory, setFullScreenView, setDeploymentHistoryList, deploymentHistoryList, deploymentAppType, isBlobStorageConfigured, appReleaseTags, tagsEditable, hideImageTaggingHardDelete, fetchIdData, setFetchTriggerIdData, selectedEnvironmentName, deploymentHistoryResult, renderRunSource, renderCIListHeader, renderDeploymentApprovalInfo, processVirtualEnvironmentDeploymentData, renderVirtualHistoryArtifacts, renderDeploymentHistoryTriggerMetaText, resourceId, }: TriggerOutputProps) => JSX.Element;
|
|
6
6
|
export default TriggerOutput;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
|
-
import { OptionType, UserApprovalMetadataType, ReleaseTag, ImageComment, PromotionApprovalMetadataType, FilterConditionsListType, DeploymentAppTypes, ResponseType, PaginationProps
|
|
2
|
+
import { OptionType, UserApprovalMetadataType, ReleaseTag, ImageComment, PromotionApprovalMetadataType, FilterConditionsListType, DeploymentAppTypes, ResponseType, PaginationProps } from '../../../Common';
|
|
3
3
|
import { DeploymentStageType } from '../../constants';
|
|
4
4
|
import { AggregationKeys, GitTriggers, Node, NodeType, ResourceKindType, ResourceVersionType } from '../../types';
|
|
5
5
|
|
|
@@ -143,8 +143,12 @@ export interface CurrentStatusType {
|
|
|
143
143
|
status: string;
|
|
144
144
|
finishedOn: string;
|
|
145
145
|
artifact: string;
|
|
146
|
+
message: string;
|
|
147
|
+
podStatus: string;
|
|
146
148
|
stage: DeploymentStageType;
|
|
147
149
|
type: HistoryComponentType;
|
|
150
|
+
isJobView?: boolean;
|
|
151
|
+
workerPodName?: string;
|
|
148
152
|
}
|
|
149
153
|
export interface StartDetailsType {
|
|
150
154
|
startedOn: string;
|
|
@@ -180,8 +184,12 @@ export interface TriggerDetailsType {
|
|
|
180
184
|
}
|
|
181
185
|
export interface ProgressingStatusType {
|
|
182
186
|
status: string;
|
|
187
|
+
message: string;
|
|
188
|
+
podStatus: string;
|
|
183
189
|
stage: DeploymentStageType;
|
|
184
190
|
type: HistoryComponentType;
|
|
191
|
+
finishedOn?: string;
|
|
192
|
+
workerPodName?: string;
|
|
185
193
|
}
|
|
186
194
|
export interface WorkerStatusType {
|
|
187
195
|
message: string;
|
|
@@ -198,6 +206,12 @@ export interface FinishedType {
|
|
|
198
206
|
}
|
|
199
207
|
export interface TriggerDetailsStatusIconType {
|
|
200
208
|
status: string;
|
|
209
|
+
isDeploymentWindowInfo?: boolean;
|
|
210
|
+
}
|
|
211
|
+
export interface LogsRendererType {
|
|
212
|
+
triggerDetails: History;
|
|
213
|
+
isBlobStorageConfigured: boolean;
|
|
214
|
+
parentType: HistoryComponentType;
|
|
201
215
|
}
|
|
202
216
|
export interface SyncStageResourceDetail {
|
|
203
217
|
id: number;
|
|
@@ -316,21 +330,6 @@ export interface TriggerOutputProps extends RenderRunSourceType {
|
|
|
316
330
|
deploymentHistoryResult: Pick<DeploymentHistoryResult, 'result'>;
|
|
317
331
|
setFetchTriggerIdData: React.Dispatch<React.SetStateAction<FetchIdDataStatus>>;
|
|
318
332
|
setTriggerHistory: React.Dispatch<React.SetStateAction<Map<Number, History>>>;
|
|
319
|
-
scrollToTop: ReturnType<typeof useScrollable>[1];
|
|
320
|
-
scrollToBottom: ReturnType<typeof useScrollable>[2];
|
|
321
|
-
}
|
|
322
|
-
export interface HistoryLogsProps extends Pick<TriggerOutputProps, 'scrollToTop' | 'scrollToBottom' | 'setFullScreenView' | 'deploymentHistoryList' | 'setDeploymentHistoryList' | 'deploymentAppType' | 'isBlobStorageConfigured' | 'appReleaseTags' | 'tagsEditable' | 'hideImageTaggingHardDelete' | 'selectedEnvironmentName' | 'processVirtualEnvironmentDeploymentData' | 'renderDeploymentApprovalInfo' | 'renderCIListHeader' | 'renderVirtualHistoryArtifacts' | 'fullScreenView'> {
|
|
323
|
-
triggerDetails: History;
|
|
324
|
-
loading: boolean;
|
|
325
|
-
userApprovalMetadata: UserApprovalMetadataType;
|
|
326
|
-
triggeredByEmail: string;
|
|
327
|
-
artifactId: number;
|
|
328
|
-
ciPipelineId: number;
|
|
329
|
-
resourceId?: number;
|
|
330
|
-
renderRunSource: (runSource: RunSourceType, isDeployedInThisResource: boolean) => JSX.Element;
|
|
331
|
-
}
|
|
332
|
-
export interface LogsRendererType extends Pick<HistoryLogsProps, 'fullScreenView' | 'triggerDetails' | 'isBlobStorageConfigured'> {
|
|
333
|
-
parentType: HistoryComponentType;
|
|
334
333
|
}
|
|
335
334
|
export interface DeploymentStatusDetailBreakdownType {
|
|
336
335
|
deploymentStatusDetailsBreakdownData: DeploymentStatusDetailsBreakdownDataType;
|
|
@@ -481,7 +480,7 @@ export interface ArtifactType {
|
|
|
481
480
|
appReleaseTagNames?: string[];
|
|
482
481
|
tagsEditable?: boolean;
|
|
483
482
|
hideImageTaggingHardDelete?: boolean;
|
|
484
|
-
|
|
483
|
+
jobCIClass?: string;
|
|
485
484
|
renderCIListHeader: (renderCIListHeaderProps: RenderCIListHeaderProps) => JSX.Element;
|
|
486
485
|
}
|
|
487
486
|
export interface CIListItemType extends Pick<GitChangesType, 'promotionApprovalMetadata' | 'selectedEnvironmentName'> {
|
|
@@ -603,7 +602,7 @@ export interface StageDetailType extends Pick<StageInfoDTO, 'stage' | 'startTime
|
|
|
603
602
|
logs: string[];
|
|
604
603
|
isOpen: boolean;
|
|
605
604
|
}
|
|
606
|
-
export interface LogStageAccordionProps extends StageDetailType
|
|
605
|
+
export interface LogStageAccordionProps extends StageDetailType {
|
|
607
606
|
handleStageClose: (index: number) => void;
|
|
608
607
|
handleStageOpen: (index: number) => void;
|
|
609
608
|
stageIndex: number;
|
|
@@ -5,4 +5,3 @@ export declare const getParsedTriggerHistory: (result: any) => DeploymentHistory
|
|
|
5
5
|
export declare const buildHoverHtmlForWebhook: (eventName: any, condition: any, selectors: any) => JSX.Element;
|
|
6
6
|
export declare const renderIcon: (iconState: string) => JSX.Element;
|
|
7
7
|
export declare const getStageStatusIcon: (status: StageStatusType) => JSX.Element;
|
|
8
|
-
export declare const getTriggerStatusIcon: (triggerDetailStatus: string) => JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ImageChipCellProps } from './types';
|
|
2
2
|
|
|
3
|
-
declare const ImageChipCell: ({
|
|
3
|
+
declare const ImageChipCell: ({ handleClick, imagePath, isExpanded, registryType }: ImageChipCellProps) => JSX.Element;
|
|
4
4
|
export default ImageChipCell;
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ComponentProps, SyntheticEvent } from 'react';
|
|
1
|
+
import { SyntheticEvent } from 'react';
|
|
3
2
|
import { RegistryType } from '../../types';
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
export interface ImageChipCellProps {
|
|
6
5
|
handleClick: (e: SyntheticEvent) => void;
|
|
7
|
-
isExpanded: boolean;
|
|
8
|
-
} | {
|
|
9
|
-
handleClick?: never;
|
|
10
|
-
isExpanded?: never;
|
|
11
|
-
};
|
|
12
|
-
export type ImageChipCellProps = {
|
|
13
6
|
imagePath: string;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
7
|
+
isExpanded: boolean;
|
|
8
|
+
registryType: RegistryType;
|
|
9
|
+
}
|
|
@@ -80,6 +80,60 @@ 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
|
+
* ```
|
|
83
137
|
*/
|
|
84
|
-
declare const SelectPicker: ({ error, icon, renderMenuListFooter, helperText, placeholder, label, showSelectedOptionIcon, size, disabledTippyContent, showSelectedOptionsCount, menuSize, ...props }: SelectPickerProps) => JSX.Element;
|
|
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;
|
|
85
139
|
export default SelectPicker;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { DropdownIndicatorProps, ControlProps, OptionProps, ClearIndicatorProps, ValueContainerProps, MenuListProps } from 'react-select';
|
|
2
|
-
import { SelectPickerOptionType, SelectPickerProps } from './type';
|
|
1
|
+
import { DropdownIndicatorProps, ControlProps, OptionProps, ClearIndicatorProps, ValueContainerProps, MenuListProps, MultiValueRemoveProps, MultiValueProps } from 'react-select';
|
|
2
|
+
import { SelectPickerGroupHeadingProps, SelectPickerOptionType, SelectPickerProps } from './type';
|
|
3
3
|
|
|
4
|
-
export declare const SelectPickerDropdownIndicator: (props: DropdownIndicatorProps<SelectPickerOptionType
|
|
5
|
-
export declare const SelectPickerClearIndicator: (props: ClearIndicatorProps<SelectPickerOptionType
|
|
6
|
-
export declare const SelectPickerControl: ({ icon, showSelectedOptionIcon, ...props }: ControlProps<SelectPickerOptionType
|
|
7
|
-
export declare const SelectPickerValueContainer: ({ showSelectedOptionsCount, ...props }: ValueContainerProps<SelectPickerOptionType
|
|
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;
|
|
8
8
|
export declare const SelectPickerLoadingIndicator: () => JSX.Element;
|
|
9
|
-
export declare const SelectPickerOption: (props: OptionProps<SelectPickerOptionType>) => JSX.Element;
|
|
10
|
-
export declare const SelectPickerMenuList: ({ renderMenuListFooter, ...props }: MenuListProps<SelectPickerOptionType
|
|
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;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { OptionType } from '../../../Common/Types';
|
|
2
2
|
import { ComponentSizeType } from '../../constants';
|
|
3
|
-
import { ReactElement, ReactNode } from 'react';
|
|
4
|
-
import { Props as ReactSelectProps } from 'react-select';
|
|
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';
|
|
5
6
|
|
|
6
|
-
export interface SelectPickerOptionType extends OptionType<
|
|
7
|
+
export interface SelectPickerOptionType<OptionValue = string | number> extends OptionType<OptionValue, ReactNode> {
|
|
7
8
|
/**
|
|
8
9
|
* Description to be displayed for the option
|
|
9
10
|
*/
|
|
@@ -17,8 +18,12 @@ export interface SelectPickerOptionType extends OptionType<number | string, Reac
|
|
|
17
18
|
*/
|
|
18
19
|
endIcon?: ReactElement;
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
-
|
|
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'>> & {
|
|
22
27
|
/**
|
|
23
28
|
* Icon to be rendered in the control
|
|
24
29
|
*/
|
|
@@ -70,5 +75,85 @@ export interface SelectPickerProps extends Pick<SelectProps, 'options' | 'value'
|
|
|
70
75
|
* @default 'ComponentSizeType.small'
|
|
71
76
|
*/
|
|
72
77
|
menuSize?: ComponentSizeType;
|
|
78
|
+
/**
|
|
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
|
|
99
|
+
*/
|
|
100
|
+
shouldMenuAlignRight?: boolean;
|
|
101
|
+
/**
|
|
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
|
|
146
|
+
*/
|
|
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;
|
|
73
158
|
}
|
|
74
159
|
export {};
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CHECKBOX_VALUE } from '../../../Common/Types';
|
|
2
|
+
import { GroupBase, MultiValue, OptionsOrGroups, StylesConfig } from 'react-select';
|
|
2
3
|
import { SelectPickerOptionType, SelectPickerProps } from './type';
|
|
3
4
|
|
|
4
|
-
export declare const getCommonSelectStyle: ({ error, size, menuSize, }: Pick<SelectPickerProps,
|
|
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>;
|
package/dist/Shared/Helpers.d.ts
CHANGED
|
@@ -36,9 +36,4 @@ export declare const decode: (data: any, isEncoded?: boolean) => {};
|
|
|
36
36
|
export declare const isTimeStringAvailable: (time: string) => boolean;
|
|
37
37
|
export declare const getTimeDifference: (startTime: string, endTime: string) => string;
|
|
38
38
|
export declare const getFileNameFromHeaders: (headers: Headers) => string;
|
|
39
|
-
/**
|
|
40
|
-
* @description - Function to open a new tab with the given url
|
|
41
|
-
* @param url - url to be opened in new tab
|
|
42
|
-
*/
|
|
43
|
-
export declare const getHandleOpenURL: (url: string) => () => void;
|
|
44
39
|
export {};
|
|
@@ -347,12 +347,6 @@ export declare const statusColor: {
|
|
|
347
347
|
unabletofetch: string;
|
|
348
348
|
hibernating: string;
|
|
349
349
|
};
|
|
350
|
-
export declare const PULSATING_STATUS_MAP: {
|
|
351
|
-
progressing: boolean;
|
|
352
|
-
initiating: boolean;
|
|
353
|
-
starting: boolean;
|
|
354
|
-
running: boolean;
|
|
355
|
-
};
|
|
356
350
|
export declare const APP_STATUS_HEADERS: string[];
|
|
357
351
|
export declare const MATERIAL_EXCLUDE_TIPPY_TEXT = "Not available for build as this commit contains changes in excluded files or folders";
|
|
358
352
|
export declare const AppListConstants: {
|