@devtron-labs/devtron-fe-common-lib 0.1.7 → 0.1.8-beta-2
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/Helper.d.ts +3 -0
- package/dist/Common/RJSF/templates/ArrayFieldItemTemplate.d.ts +1 -1
- package/dist/Common/RJSF/templates/ObjectFieldTemplate.d.ts +2 -1
- package/dist/Common/RJSF/types.d.ts +12 -0
- package/dist/Common/RJSF/utils.d.ts +2 -2
- package/dist/Common/Tippy.d.ts +4 -0
- package/dist/Common/index.d.ts +1 -0
- package/dist/Shared/Components/SelectPicker/SelectPicker.component.d.ts +85 -0
- package/dist/Shared/Components/SelectPicker/common.d.ts +10 -0
- package/dist/Shared/Components/SelectPicker/index.d.ts +2 -0
- package/dist/Shared/Components/SelectPicker/type.d.ts +74 -0
- package/dist/Shared/Components/SelectPicker/utils.d.ts +4 -0
- package/dist/Shared/Components/index.d.ts +1 -0
- package/dist/Shared/constants.d.ts +8 -0
- package/dist/assets/index.css +1 -1
- package/dist/{cssMode-2977678b.js → cssMode-a4ee32ac.js} +1 -1
- package/dist/{freemarker2-ed0eec7d.js → freemarker2-a8a05eec.js} +1 -1
- package/dist/{handlebars-3abd8462.js → handlebars-60e2a630.js} +1 -1
- package/dist/{html-6dbbc2f9.js → html-e4ae368f.js} +1 -1
- package/dist/{htmlMode-1eb5fded.js → htmlMode-45af9cc5.js} +1 -1
- package/dist/{index-628c18a8.js → index-1b29af8c.js} +29174 -27240
- package/dist/index.js +394 -389
- package/dist/{javascript-1b65b212.js → javascript-41790160.js} +1 -1
- package/dist/{jsonMode-0ea0e048.js → jsonMode-b3c90434.js} +1 -1
- package/dist/{liquid-e0bae7a8.js → liquid-752454c3.js} +1 -1
- package/dist/{mdx-3c1d3df7.js → mdx-3737a76d.js} +1 -1
- package/dist/{python-f86872ea.js → python-63abe626.js} +1 -1
- package/dist/{razor-cc577f9e.js → razor-da5d9543.js} +1 -1
- package/dist/{tsMode-5bbb1481.js → tsMode-39be316b.js} +1 -1
- package/dist/{typescript-56994d01.js → typescript-8f59fda6.js} +1 -1
- package/dist/{xml-adb6a988.js → xml-aee32c03.js} +1 -1
- package/dist/{yaml-01419bec.js → yaml-082aac40.js} +1 -1
- package/package.json +3 -2
package/dist/Common/Helper.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as React, SyntheticEvent } from 'react';
|
|
2
|
+
import { JSONPathOptions } from 'jsonpath-plus';
|
|
2
3
|
import { AsyncOptions, UseSearchString } from './Types';
|
|
3
4
|
import { scrollableInterface } from '../Shared';
|
|
4
5
|
|
|
@@ -94,6 +95,8 @@ export declare const getRegexMatchPositions: (string: string, regex: RegExp) =>
|
|
|
94
95
|
* @returns set of substrings
|
|
95
96
|
*/
|
|
96
97
|
export declare const powerSetOfSubstringsFromStart: (strings: string[], regex: RegExp) => string[];
|
|
98
|
+
export declare const convertJSONPointerToJSONPath: (pointer: string) => string;
|
|
99
|
+
export declare const flatMapOfJSONPaths: (paths: string[], json: object, resultType?: JSONPathOptions['resultType']) => string[];
|
|
97
100
|
/**
|
|
98
101
|
* Returns a debounced variant of the function
|
|
99
102
|
*/
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ArrayFieldTemplateItemType } from '@rjsf/utils';
|
|
2
2
|
|
|
3
|
-
export declare const ArrayFieldItemTemplate: ({ children,
|
|
3
|
+
export declare const ArrayFieldItemTemplate: ({ children, disabled, hasToolbar, hasRemove, index, onDropIndexClick, readonly, registry, uiSchema, }: ArrayFieldTemplateItemType) => JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { ObjectFieldTemplateProps } from '@rjsf/utils';
|
|
2
|
+
import { RJSFFormSchema } from '../types';
|
|
2
3
|
|
|
3
|
-
export declare const ObjectFieldTemplate: (props: ObjectFieldTemplateProps) => JSX.Element;
|
|
4
|
+
export declare const ObjectFieldTemplate: (props: ObjectFieldTemplateProps<any, RJSFFormSchema, any>) => JSX.Element;
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
2
|
import { default as RJSFForm } from '@rjsf/core';
|
|
3
|
+
import { StrictRJSFSchema } from '@rjsf/utils';
|
|
3
4
|
|
|
4
5
|
export type FormProps = Omit<ComponentProps<typeof RJSFForm>, 'validator'>;
|
|
6
|
+
interface Hidden {
|
|
7
|
+
condition: boolean;
|
|
8
|
+
match: string;
|
|
9
|
+
}
|
|
10
|
+
export interface RJSFFormSchema extends StrictRJSFSchema {
|
|
11
|
+
properties: {
|
|
12
|
+
[key: string]: RJSFFormSchema;
|
|
13
|
+
};
|
|
14
|
+
hidden: Hidden;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TranslatableString } from '@rjsf/utils';
|
|
2
|
-
import { default as Tippy } from '
|
|
2
|
+
import { default as Tippy } from '../Tippy';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Override for the TranslatableString from RJSF
|
|
@@ -25,4 +25,4 @@ export declare const getRedirectionProps: (url: string) => import('react').Ancho
|
|
|
25
25
|
* Infers the type for json schema from value type
|
|
26
26
|
*/
|
|
27
27
|
export declare const getInferredTypeFromValueType: (value: any) => "string" | "number" | "boolean" | "object" | "array" | "null";
|
|
28
|
-
export declare const getTippyWrapperWithContent: (content: any, placement?: React.ComponentProps<typeof Tippy>['placement']) => (children: any) => JSX.Element;
|
|
28
|
+
export declare const getTippyWrapperWithContent: (content: any, placement?: React.ComponentProps<typeof Tippy>['placement'], truncateWidth?: number) => (children: any) => JSX.Element;
|
package/dist/Common/index.d.ts
CHANGED
|
@@ -0,0 +1,85 @@
|
|
|
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
|
+
*/
|
|
84
|
+
declare const SelectPicker: ({ error, icon, renderMenuListFooter, helperText, placeholder, label, showSelectedOptionIcon, size, disabledTippyContent, showSelectedOptionsCount, menuSize, ...props }: SelectPickerProps) => JSX.Element;
|
|
85
|
+
export default SelectPicker;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DropdownIndicatorProps, ControlProps, OptionProps, ClearIndicatorProps, ValueContainerProps, MenuListProps } from 'react-select';
|
|
2
|
+
import { SelectPickerOptionType, SelectPickerProps } from './type';
|
|
3
|
+
|
|
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
|
+
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> & Pick<SelectPickerProps, 'renderMenuListFooter'>) => JSX.Element;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { OptionType } from '../../../Common/Types';
|
|
2
|
+
import { ComponentSizeType } from '../../constants';
|
|
3
|
+
import { ReactElement, ReactNode } from 'react';
|
|
4
|
+
import { Props as ReactSelectProps } from 'react-select';
|
|
5
|
+
|
|
6
|
+
export interface SelectPickerOptionType extends OptionType<number | string, ReactNode> {
|
|
7
|
+
/**
|
|
8
|
+
* Description to be displayed for the option
|
|
9
|
+
*/
|
|
10
|
+
description?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Icon at the start of the option
|
|
13
|
+
*/
|
|
14
|
+
startIcon?: ReactElement;
|
|
15
|
+
/**
|
|
16
|
+
* Icon at the end of the option
|
|
17
|
+
*/
|
|
18
|
+
endIcon?: ReactElement;
|
|
19
|
+
}
|
|
20
|
+
type SelectProps = ReactSelectProps<SelectPickerOptionType>;
|
|
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'>> {
|
|
22
|
+
/**
|
|
23
|
+
* Icon to be rendered in the control
|
|
24
|
+
*/
|
|
25
|
+
icon?: ReactElement;
|
|
26
|
+
/**
|
|
27
|
+
* Error message for the select
|
|
28
|
+
*/
|
|
29
|
+
error?: ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* Render function for the footer at the bottom of menu list. It is sticky by default
|
|
32
|
+
*/
|
|
33
|
+
renderMenuListFooter?: () => ReactNode;
|
|
34
|
+
/**
|
|
35
|
+
* Info text for the select, if any
|
|
36
|
+
*/
|
|
37
|
+
helperText?: ReactNode;
|
|
38
|
+
/**
|
|
39
|
+
* Label for the select. if required is added, the corresponding * is also added
|
|
40
|
+
*/
|
|
41
|
+
label?: ReactNode;
|
|
42
|
+
/**
|
|
43
|
+
* If true, the selected option icon is shown in the container.
|
|
44
|
+
* startIcon has higher priority than endIcon.
|
|
45
|
+
*
|
|
46
|
+
* @default 'true'
|
|
47
|
+
*/
|
|
48
|
+
showSelectedOptionIcon?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Height of the dropdown
|
|
51
|
+
*
|
|
52
|
+
* @default 'ComponentSizeType.medium'
|
|
53
|
+
*/
|
|
54
|
+
size?: Extract<ComponentSizeType, ComponentSizeType.medium | ComponentSizeType.large>;
|
|
55
|
+
/**
|
|
56
|
+
* Content to be shown in a tippy when disabled
|
|
57
|
+
*/
|
|
58
|
+
disabledTippyContent?: ReactNode;
|
|
59
|
+
/**
|
|
60
|
+
* If true, the selected options count is shown in a chip inside ValueContainer
|
|
61
|
+
*
|
|
62
|
+
* @default 'false'
|
|
63
|
+
*/
|
|
64
|
+
showSelectedOptionsCount?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Width of the menu list
|
|
67
|
+
*
|
|
68
|
+
* Note: the overflow needs to be handled explicitly for non-small variants
|
|
69
|
+
*
|
|
70
|
+
* @default 'ComponentSizeType.small'
|
|
71
|
+
*/
|
|
72
|
+
menuSize?: ComponentSizeType;
|
|
73
|
+
}
|
|
74
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { StylesConfig } from 'react-select';
|
|
2
|
+
import { SelectPickerOptionType, SelectPickerProps } from './type';
|
|
3
|
+
|
|
4
|
+
export declare const getCommonSelectStyle: ({ error, size, menuSize, }: Pick<SelectPickerProps, 'error' | 'size' | 'menuSize'>) => StylesConfig<SelectPickerOptionType>;
|
|
@@ -353,3 +353,11 @@ export declare enum K8sResourcePayloadAppType {
|
|
|
353
353
|
HELM_APP = 1,
|
|
354
354
|
EXTERNAL_ARGO_APP = 2
|
|
355
355
|
}
|
|
356
|
+
/**
|
|
357
|
+
* Size variants for components
|
|
358
|
+
*/
|
|
359
|
+
export declare enum ComponentSizeType {
|
|
360
|
+
small = "small",
|
|
361
|
+
medium = "medium",
|
|
362
|
+
large = "large"
|
|
363
|
+
}
|