@devtron-labs/devtron-fe-common-lib 1.14.1-pre-1 → 1.14.1-pre-3
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/{@code-editor-DCLOIdJm.js → @code-editor-CRu2zup5.js} +5983 -5827
- package/dist/{@common-rjsf-DZwjTDv9.js → @common-rjsf-CdWy2S0B.js} +1 -1
- package/dist/Shared/Components/DynamicDataTable/DynamicDataTable.d.ts +1 -1
- package/dist/Shared/Components/DynamicDataTable/DynamicDataTableRow.d.ts +1 -1
- package/dist/Shared/Components/DynamicDataTable/types.d.ts +8 -4
- package/dist/Shared/Components/Icon/Icon.d.ts +1 -0
- package/dist/Shared/Components/KeyValueTable/KeyValueTable.component.d.ts +1 -1
- package/dist/Shared/Components/KeyValueTable/KeyValueTable.types.d.ts +1 -1
- package/dist/Shared/Components/Switch/Switch.component.d.ts +3 -0
- package/dist/Shared/Components/Switch/constants.d.ts +14 -0
- package/dist/Shared/Components/Switch/index.d.ts +2 -0
- package/dist/Shared/Components/Switch/types.d.ts +105 -0
- package/dist/Shared/Components/Switch/utils.d.ts +12 -0
- package/dist/Shared/Components/index.d.ts +1 -0
- package/dist/Shared/DocLink/constants.d.ts +1 -0
- package/dist/assets/@code-editor.css +1 -1
- package/dist/assets/ic-spray-can.624b202a.svg +3 -0
- package/dist/index.js +715 -714
- package/package.json +1 -1
@@ -1,7 +1,7 @@
|
|
1
1
|
import { j as n, J as y, b as k, a as W } from "./@vendor-BtL2Znh4.js";
|
2
2
|
import J, { forwardRef as V, useMemo as P } from "react";
|
3
3
|
import K, { getDefaultRegistry as q } from "@rjsf/core";
|
4
|
-
import { T as F, j as N, c as v, b as S, a as Y, i as z, d as w, e as E, S as G } from "./@code-editor-
|
4
|
+
import { T as F, j as N, c as v, b as S, a as Y, i as z, d as w, e as E, S as G } from "./@code-editor-CRu2zup5.js";
|
5
5
|
import Q, { components as D } from "react-select";
|
6
6
|
import { ReactComponent as X } from "./assets/ic-chevron-down.fc70d7a7.svg";
|
7
7
|
import { getUiOptions as B, getTemplate as $, getSubmitButtonOptions as Z, ADDITIONAL_PROPERTY_FLAG as L, errorId as ee, englishStringTranslator as te, TranslatableString as ne, titleId as re, canExpand as se, deepEquals as ae } from "@rjsf/utils";
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { DynamicDataTableProps } from './types';
|
2
|
-
export declare const DynamicDataTable: <K extends string, CustomStateType = Record<string, unknown>>({ headers,
|
2
|
+
export declare const DynamicDataTable: <K extends string, CustomStateType = Record<string, unknown>>({ headers, ...props }: DynamicDataTableProps<K, CustomStateType>) => JSX.Element;
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { DynamicDataTableRowProps } from './types';
|
2
|
-
export declare const DynamicDataTableRow: <K extends string, CustomStateType = Record<string, unknown>>({ rows, headers, readOnly, isDeletionNotAllowed, cellError, actionButtonConfig, onRowEdit, onRowDelete, leadingCellIcon, trailingCellIcon, buttonCellWrapComponent, focusableFieldKey,
|
2
|
+
export declare const DynamicDataTableRow: <K extends string, CustomStateType = Record<string, unknown>>({ rows, headers, readOnly, isDeletionNotAllowed, cellError, actionButtonConfig, onRowEdit, onRowDelete, leadingCellIcon, trailingCellIcon, buttonCellWrapComponent, focusableFieldKey, shouldAutoFocusOnMount, }: DynamicDataTableRowProps<K, CustomStateType>) => JSX.Element;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { DetailedHTMLProps,
|
1
|
+
import { DetailedHTMLProps, ReactElement, ReactNode } from 'react';
|
2
2
|
import { ResizableTagTextAreaProps } from '../../../Common/CustomTagSelector';
|
3
3
|
import { UseStateFiltersReturnType } from '../../../Common/Hooks';
|
4
4
|
import { TooltipProps } from '@Common/Tooltip/types';
|
@@ -166,11 +166,15 @@ export type DynamicDataTableProps<K extends string, CustomStateType = Record<str
|
|
166
166
|
* @default 'first column key'
|
167
167
|
*/
|
168
168
|
focusableFieldKey?: K;
|
169
|
+
/**
|
170
|
+
* When true, the table will automatically focus the first focusable cell
|
171
|
+
* or cell key denoted by `focusableFieldKey` when the component mounts.
|
172
|
+
* @default false
|
173
|
+
*/
|
174
|
+
shouldAutoFocusOnMount?: boolean;
|
169
175
|
};
|
170
176
|
export interface DynamicDataTableHeaderProps<K extends string, CustomStateType = Record<string, unknown>> extends Pick<DynamicDataTableProps<K, CustomStateType>, 'headers' | 'rows' | 'headerComponent' | 'sortingConfig' | 'addBtnTooltip' | 'onRowAdd' | 'readOnly' | 'isAdditionNotAllowed' | 'isDeletionNotAllowed' | 'actionButtonConfig'> {
|
171
177
|
}
|
172
|
-
export interface DynamicDataTableRowProps<K extends string, CustomStateType = Record<string, unknown>> extends Pick<DynamicDataTableProps<K, CustomStateType>, 'rows' | 'headers' | 'isAdditionNotAllowed' | 'isDeletionNotAllowed' | 'readOnly' | 'onRowEdit' | 'onRowDelete' | 'actionButtonConfig' | 'cellError' | 'leadingCellIcon' | 'trailingCellIcon' | 'buttonCellWrapComponent' | 'focusableFieldKey'> {
|
173
|
-
isAddRowButtonClicked: boolean;
|
174
|
-
setIsAddRowButtonClicked: Dispatch<SetStateAction<boolean>>;
|
178
|
+
export interface DynamicDataTableRowProps<K extends string, CustomStateType = Record<string, unknown>> extends Pick<DynamicDataTableProps<K, CustomStateType>, 'rows' | 'headers' | 'isAdditionNotAllowed' | 'isDeletionNotAllowed' | 'readOnly' | 'onRowEdit' | 'onRowDelete' | 'actionButtonConfig' | 'cellError' | 'leadingCellIcon' | 'trailingCellIcon' | 'buttonCellWrapComponent' | 'focusableFieldKey' | 'shouldAutoFocusOnMount'> {
|
175
179
|
}
|
176
180
|
export {};
|
@@ -136,6 +136,7 @@ export declare const iconMap: {
|
|
136
136
|
'ic-sortable': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
137
137
|
'ic-sparkle-color': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
138
138
|
'ic-spinny': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
139
|
+
'ic-spray-can': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
139
140
|
'ic-stack': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
140
141
|
'ic-stamp': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
141
142
|
'ic-success': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { KeyValueTableProps } from './KeyValueTable.types';
|
2
|
-
export declare const KeyValueTable: ({ headerLabel, rows: initialRows, placeholder, maskValue, isSortable, headerComponent, onChange, isAdditionNotAllowed, readOnly, showError, validationSchema: parentValidationSchema, onError, validateDuplicateKeys, validateEmptyKeys, }: KeyValueTableProps) => JSX.Element;
|
2
|
+
export declare const KeyValueTable: ({ headerLabel, rows: initialRows, placeholder, maskValue, isSortable, headerComponent, onChange, isAdditionNotAllowed, shouldAutoFocusOnMount, readOnly, showError, validationSchema: parentValidationSchema, onError, validateDuplicateKeys, validateEmptyKeys, }: KeyValueTableProps) => JSX.Element;
|
@@ -55,7 +55,7 @@ export interface KeyValueTableData extends Pick<KeyValueTableRowType, 'id'> {
|
|
55
55
|
/**
|
56
56
|
* Props for the KeyValueTable component.
|
57
57
|
*/
|
58
|
-
export type KeyValueTableProps = Pick<DynamicDataTableProps<KeyValueTableDataType>, 'isAdditionNotAllowed' | 'readOnly' | 'headerComponent'> & {
|
58
|
+
export type KeyValueTableProps = Pick<DynamicDataTableProps<KeyValueTableDataType>, 'isAdditionNotAllowed' | 'readOnly' | 'headerComponent' | 'shouldAutoFocusOnMount'> & {
|
59
59
|
/**
|
60
60
|
* The label for the table header.
|
61
61
|
*/
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { IconBaseColorType } from '../../types';
|
2
|
+
import { DTSwitchProps } from './types';
|
3
|
+
export declare const ROUNDED_SWITCH_SIZE_MAP: Readonly<Record<DTSwitchProps['size'], string>>;
|
4
|
+
export declare const SQUARE_SWITCH_SIZE_MAP: typeof ROUNDED_SWITCH_SIZE_MAP;
|
5
|
+
export declare const SWITCH_HEIGHT_MAP: Readonly<Record<DTSwitchProps['size'], string>>;
|
6
|
+
export declare const LOADING_COLOR_MAP: Record<DTSwitchProps['variant'], IconBaseColorType>;
|
7
|
+
export declare const ROUNDED_SWITCH_TRACK_COLOR_MAP: Record<DTSwitchProps['variant'], string>;
|
8
|
+
export declare const ROUNDED_SWITCH_TRACK_HOVER_COLOR_MAP: Record<DTSwitchProps['variant'], `var(--${IconBaseColorType})`>;
|
9
|
+
export declare const SQUARE_SWITCH_TRACK_COLOR_MAP: typeof ROUNDED_SWITCH_TRACK_COLOR_MAP;
|
10
|
+
export declare const SQUARE_SWITCH_TRACK_HOVER_COLOR_MAP: typeof ROUNDED_SWITCH_TRACK_HOVER_COLOR_MAP;
|
11
|
+
export declare const ROUNDED_SWITCH_THUMB_SIZE_MAP: Record<DTSwitchProps['size'], string>;
|
12
|
+
export declare const INDETERMINATE_ICON_WIDTH_MAP: Record<DTSwitchProps['size'], string>;
|
13
|
+
export declare const SWITCH_THUMB_PADDING_MAP: Record<DTSwitchProps['size'], string>;
|
14
|
+
export declare const THUMB_OUTER_PADDING_MAP: Record<DTSwitchProps['shape'], string>;
|
@@ -0,0 +1,105 @@
|
|
1
|
+
import { ComponentSizeType } from '../../constants';
|
2
|
+
import { IconBaseColorType } from '../../types';
|
3
|
+
import { IconName } from '../Icon';
|
4
|
+
/**
|
5
|
+
* Represents the properties for configuring the shape and behavior of a switch component.
|
6
|
+
*
|
7
|
+
* - When `shape` is `rounded`:
|
8
|
+
* - The switch will have a rounded appearance.
|
9
|
+
* - `iconName`, `iconColor`, and `indeterminate` are not applicable.
|
10
|
+
*
|
11
|
+
* - When `shape` is `square`:
|
12
|
+
* - The switch will have a square appearance.
|
13
|
+
* - `iconName` specifies the name of the icon to display.
|
14
|
+
* - `iconColor` allows customization of the icon's color in the active state.
|
15
|
+
* - `indeterminate` indicates whether the switch is in an indeterminate state, typically used for checkboxes to represent a mixed state.
|
16
|
+
* If `indeterminate` is true, the switch will not be fully checked or unchecked.
|
17
|
+
*/
|
18
|
+
type SwitchShapeProps = {
|
19
|
+
/**
|
20
|
+
* The shape of the switch. Defaults to `rounded` if not specified.
|
21
|
+
*/
|
22
|
+
shape?: 'rounded';
|
23
|
+
/**
|
24
|
+
* Icon name is not applicable for the `rounded` shape.
|
25
|
+
*/
|
26
|
+
iconName?: never;
|
27
|
+
/**
|
28
|
+
* Icon color is not applicable for the `rounded` shape.
|
29
|
+
*/
|
30
|
+
iconColor?: never;
|
31
|
+
/**
|
32
|
+
* Indicates whether the switch is in an indeterminate state.
|
33
|
+
* This state is typically used for checkboxes to indicate a mixed state.
|
34
|
+
* If true, the switch will not be fully checked or unchecked. Due this state alone we are keeping role as `checkbox` instead of `switch`.
|
35
|
+
* This property is not applicable for the `square` shape.
|
36
|
+
* @default false
|
37
|
+
*/
|
38
|
+
indeterminate?: boolean;
|
39
|
+
} | {
|
40
|
+
/**
|
41
|
+
* The shape of the switch. Must be `square` to enable icon-related properties.
|
42
|
+
*/
|
43
|
+
shape: 'square';
|
44
|
+
/**
|
45
|
+
* The name of the icon to display when the shape is `square`.
|
46
|
+
*/
|
47
|
+
iconName: IconName;
|
48
|
+
/**
|
49
|
+
* The color of the icon. If provided, this will override the default color in the active state.
|
50
|
+
*/
|
51
|
+
iconColor?: IconBaseColorType;
|
52
|
+
indeterminate?: never;
|
53
|
+
};
|
54
|
+
/**
|
55
|
+
* Represents the properties for the `Switch` component.
|
56
|
+
*/
|
57
|
+
export type DTSwitchProps = {
|
58
|
+
/**
|
59
|
+
* The ARIA label for the switch, used for accessibility purposes.
|
60
|
+
*/
|
61
|
+
ariaLabel: string;
|
62
|
+
/**
|
63
|
+
* Used in forms to identify the switch.
|
64
|
+
*/
|
65
|
+
name: string;
|
66
|
+
/**
|
67
|
+
* A unique identifier for testing purposes.
|
68
|
+
*/
|
69
|
+
dataTestId: string;
|
70
|
+
/**
|
71
|
+
* The visual variant of the switch.
|
72
|
+
*
|
73
|
+
* @default `positive`
|
74
|
+
*/
|
75
|
+
variant?: 'theme' | 'positive';
|
76
|
+
/**
|
77
|
+
* The size of the switch.
|
78
|
+
* @default `ComponentSizeType.medium`
|
79
|
+
*/
|
80
|
+
size?: Extract<ComponentSizeType, ComponentSizeType.medium | ComponentSizeType.small>;
|
81
|
+
/**
|
82
|
+
* Callback function that is called when the switch state changes.
|
83
|
+
* This function should handle the logic for toggling the switch.
|
84
|
+
*/
|
85
|
+
onChange: () => void;
|
86
|
+
/**
|
87
|
+
* Indicates whether the switch is disabled.
|
88
|
+
*/
|
89
|
+
isDisabled?: boolean;
|
90
|
+
/**
|
91
|
+
* Indicates whether the switch is in a loading state.
|
92
|
+
*/
|
93
|
+
isLoading?: boolean;
|
94
|
+
/**
|
95
|
+
* Indicates whether the switch is currently checked (on).
|
96
|
+
*/
|
97
|
+
isChecked: boolean;
|
98
|
+
/**
|
99
|
+
* Optional tooltip content to display when hovering over the switch.
|
100
|
+
*
|
101
|
+
* @default undefined
|
102
|
+
*/
|
103
|
+
tooltipContent?: string;
|
104
|
+
} & SwitchShapeProps;
|
105
|
+
export {};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { IconBaseColorType } from '../../types';
|
2
|
+
import { ROUNDED_SWITCH_TRACK_HOVER_COLOR_MAP } from './constants';
|
3
|
+
import { DTSwitchProps } from './types';
|
4
|
+
export declare const getSwitchContainerClass: ({ shape, size }: Required<Pick<DTSwitchProps, "shape" | "size">>) => string;
|
5
|
+
export declare const getSwitchTrackColor: ({ shape, variant, isChecked, isLoading, }: Required<Pick<DTSwitchProps, "shape" | "variant" | "isChecked" | "isLoading">>) => string;
|
6
|
+
export declare const getSwitchTrackHoverColor: ({ shape, variant, isChecked, }: Required<Pick<DTSwitchProps, "shape" | "variant" | "isChecked">>) => (typeof ROUNDED_SWITCH_TRACK_HOVER_COLOR_MAP)[DTSwitchProps["variant"]];
|
7
|
+
export declare const getSwitchThumbClass: ({ shape, size, showIndeterminateIcon, }: Pick<DTSwitchProps, "shape" | "size"> & {
|
8
|
+
showIndeterminateIcon: boolean;
|
9
|
+
}) => string;
|
10
|
+
export declare const getSwitchIconColor: ({ iconColor, isChecked, variant, }: Pick<DTSwitchProps, "iconColor" | "isChecked" | "variant">) => IconBaseColorType;
|
11
|
+
export declare const getThumbPosition: ({ isLoading, isChecked, }: Pick<DTSwitchProps, "isLoading" | "isChecked">) => "left" | "right" | "center";
|
12
|
+
export declare const getThumbPadding: ({ shape, isLoading }: Pick<DTSwitchProps, "shape" | "isLoading">) => string;
|
@@ -71,6 +71,7 @@ export * from './SelectPicker';
|
|
71
71
|
export * from './ShowMoreText';
|
72
72
|
export * from './SSOProviderIcon';
|
73
73
|
export * from './StatusComponent';
|
74
|
+
export * from './Switch';
|
74
75
|
export * from './TabGroup';
|
75
76
|
export * from './Table';
|
76
77
|
export * from './TagsKeyValueTable';
|
@@ -31,6 +31,7 @@ export declare const DOCUMENTATION: {
|
|
31
31
|
readonly EXTERNAL_SECRET: "usage/applications/creating-application/secrets#external-secrets";
|
32
32
|
readonly HOME_PAGE: "https://devtron.ai";
|
33
33
|
readonly KUBE_CONFIG: "usage/resource-browser#running-kubectl-commands-locally";
|
34
|
+
readonly TAINT: "usage/resource-browser#taint-a-node";
|
34
35
|
readonly GLOBAL_CONFIG_API_TOKEN: "getting-started/global-configurations/authorization/api-tokens";
|
35
36
|
readonly GLOBAL_CONFIG_BUILD_INFRA: "global-configurations/build-infra";
|
36
37
|
readonly GLOBAL_CONFIG_CHART: "getting-started/global-configurations/chart-repo";
|