@devtron-labs/devtron-fe-common-lib 1.2.4-beta-12 → 1.2.5-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.
Files changed (34) hide show
  1. package/dist/{@code-editor-CQmGGn4U.js → @code-editor-BXzLnnOG.js} +5681 -6143
  2. package/dist/{@common-rjsf-D7fgYUGe.js → @common-rjsf-BQcgb0iz.js} +1 -1
  3. package/dist/Common/Constants.d.ts +1 -1
  4. package/dist/Common/CustomTagSelector/ResizableTagTextArea.d.ts +1 -1
  5. package/dist/Common/CustomTagSelector/Types.d.ts +14 -19
  6. package/dist/Common/Helper.d.ts +1 -2
  7. package/dist/Common/SegmentedControl/SegmentedControl.component.d.ts +3 -0
  8. package/dist/Common/SegmentedControl/index.d.ts +2 -0
  9. package/dist/Common/SegmentedControl/types.d.ts +9 -0
  10. package/dist/Common/Types.d.ts +2 -21
  11. package/dist/Common/index.d.ts +1 -0
  12. package/dist/Shared/Components/SelectPicker/type.d.ts +4 -5
  13. package/dist/Shared/Components/index.d.ts +0 -2
  14. package/dist/Shared/Services/app.service.d.ts +1 -0
  15. package/dist/Shared/Services/app.types.d.ts +1 -1
  16. package/dist/Shared/types.d.ts +2 -19
  17. package/dist/assets/@code-editor.css +1 -1
  18. package/dist/index.js +539 -543
  19. package/package.json +1 -1
  20. package/dist/Shared/Components/DynamicDataTable/DynamicDataTable.d.ts +0 -2
  21. package/dist/Shared/Components/DynamicDataTable/DynamicDataTableHeader.d.ts +0 -2
  22. package/dist/Shared/Components/DynamicDataTable/DynamicDataTableRow.d.ts +0 -2
  23. package/dist/Shared/Components/DynamicDataTable/index.d.ts +0 -2
  24. package/dist/Shared/Components/DynamicDataTable/types.d.ts +0 -165
  25. package/dist/Shared/Components/DynamicDataTable/utils.d.ts +0 -5
  26. package/dist/Shared/Components/SelectTextArea/SelectTextArea.d.ts +0 -2
  27. package/dist/Shared/Components/SelectTextArea/index.d.ts +0 -2
  28. package/dist/Shared/Components/SelectTextArea/types.d.ts +0 -12
  29. package/dist/Shared/Components/TagsKeyValueTable/TagsContainer.d.ts +0 -3
  30. package/dist/Shared/Components/TagsKeyValueTable/constants.d.ts +0 -4
  31. package/dist/Shared/Components/TagsKeyValueTable/index.d.ts +0 -3
  32. package/dist/Shared/Components/TagsKeyValueTable/types.d.ts +0 -9
  33. package/dist/Shared/Components/TagsKeyValueTable/utils.d.ts +0 -3
  34. package/dist/assets/ic-clear-square.e60de021.svg +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtron-labs/devtron-fe-common-lib",
3
- "version": "1.2.4-beta-12",
3
+ "version": "1.2.5-beta-1",
4
4
  "description": "Supporting common component library",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,2 +0,0 @@
1
- import { DynamicDataTableProps } from './types';
2
- export declare const DynamicDataTable: <K extends string>({ headers, ...props }: DynamicDataTableProps<K>) => JSX.Element;
@@ -1,2 +0,0 @@
1
- import { DynamicDataTableHeaderProps } from './types';
2
- export declare const DynamicDataTableHeader: <K extends string>({ headers, rows, sortingConfig, onRowAdd, readOnly, isAdditionNotAllowed, isDeletionNotAllowed, headerComponent, actionButtonConfig, }: DynamicDataTableHeaderProps<K>) => JSX.Element;
@@ -1,2 +0,0 @@
1
- import { DynamicDataTableRowProps } from './types';
2
- export declare const DynamicDataTableRow: <K extends string>({ rows, headers, maskValue, readOnly, isAdditionNotAllowed, isDeletionNotAllowed, validationSchema, showError, actionButtonConfig, onRowEdit, onRowDelete, leadingCellIcon, trailingCellIcon, buttonCellWrapComponent, }: DynamicDataTableRowProps<K>) => JSX.Element;
@@ -1,2 +0,0 @@
1
- export * from './DynamicDataTable';
2
- export * from './types';
@@ -1,165 +0,0 @@
1
- import { DetailedHTMLProps, ReactElement, ReactNode } from 'react';
2
- import { SortingOrder } from '../../../Common/Constants';
3
- import { ResizableTagTextAreaProps } from '../../../Common/CustomTagSelector';
4
- import { InfoIconTippyProps } from '../../../Common/Types';
5
- import { SelectPickerOptionType, SelectPickerProps } from '../SelectPicker';
6
- import { SelectTextAreaProps } from '../SelectTextArea';
7
- /**
8
- * Interface representing header for a dynamic data table.
9
- * @template K - A string representing the key type.
10
- */
11
- export type DynamicDataTableHeaderType<K extends string> = {
12
- /** The display label of the header, shown in the table's column header. */
13
- label: string;
14
- /** The unique key associated with the header, used to map the column to data fields. */
15
- key: K;
16
- /** The width of the column, defined as a CSS string (e.g., "100px", "10%", "1fr", or "auto"). */
17
- width: string;
18
- /** An optional boolean indicating whether the column is sortable. */
19
- isSortable?: boolean;
20
- /** An optional boolean to control the visibility of the column. */
21
- isHidden?: boolean;
22
- /** An optional boolean to show the column */
23
- renderHelpTextForHeader?: () => ReactNode;
24
- };
25
- export declare enum DynamicDataTableRowDataType {
26
- TEXT = "text",
27
- DROPDOWN = "dropdown",
28
- SELECT_TEXT = "select-text",
29
- BUTTON = "button"
30
- }
31
- export type DynamicDataTableCellPropsMap = {
32
- [DynamicDataTableRowDataType.TEXT]: Omit<ResizableTagTextAreaProps, 'className' | 'minHeight' | 'maxHeight' | 'value' | 'onChange' | 'disabled' | 'disableOnBlurResizeToMinHeight' | 'refVar' | 'dependentRef'>;
33
- [DynamicDataTableRowDataType.DROPDOWN]: Omit<SelectPickerProps<string, false>, 'inputId' | 'value' | 'onChange' | 'fullWidth' | 'isDisabled'>;
34
- [DynamicDataTableRowDataType.SELECT_TEXT]: Omit<SelectTextAreaProps, 'value' | 'onChange' | 'inputId' | 'isDisabled' | 'dependentRef' | 'refVar' | 'textAreaProps'> & {
35
- textAreaProps?: Omit<SelectTextAreaProps['textAreaProps'], 'className' | 'disableOnBlurResizeToMinHeight' | 'minHeight' | 'maxHeight'>;
36
- };
37
- [DynamicDataTableRowDataType.BUTTON]: Pick<DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, 'onClick'> & {
38
- icon?: ReactNode;
39
- text: string;
40
- };
41
- };
42
- type DynamicDataTableCellData<T extends keyof DynamicDataTableCellPropsMap = keyof DynamicDataTableCellPropsMap> = T extends keyof DynamicDataTableCellPropsMap ? {
43
- type: T;
44
- props: DynamicDataTableCellPropsMap[T];
45
- } : never;
46
- /**
47
- * Type representing a key-value row.
48
- * @template K - A string representing the key type.
49
- */
50
- export type DynamicDataTableRowType<K extends string, CustomStateType = Record<string, unknown>> = {
51
- data: {
52
- [key in K]: {
53
- value: string;
54
- disabled?: boolean;
55
- /** An optional boolean indicating if an asterisk should be shown. */
56
- required?: boolean;
57
- } & DynamicDataTableCellData;
58
- };
59
- id: string | number;
60
- /** */
61
- customState?: CustomStateType;
62
- };
63
- type DynamicDataTableMask<K extends string> = {
64
- [key in K]?: boolean;
65
- };
66
- type DynamicDataTableCellIcon<K extends string> = {
67
- [key in K]?: (row: DynamicDataTableRowType<K>) => ReactNode;
68
- };
69
- /**
70
- * Interface representing the properties for the dynamic data table component.
71
- * @template K - A string representing the key type.
72
- */
73
- export type DynamicDataTableProps<K extends string> = {
74
- /**
75
- * An array containing the headers for the data table. \
76
- * Each header defines a column with its label, key, width, and optional settings.
77
- */
78
- headers: DynamicDataTableHeaderType<K>[];
79
- /**
80
- * An array of rows where each row contains data corresponding to the table headers.
81
- */
82
- rows: DynamicDataTableRowType<K>[];
83
- /** Optional configuration for sorting the table. */
84
- sortingConfig?: {
85
- sortBy: K;
86
- sortOrder: SortingOrder;
87
- handleSorting: () => void;
88
- };
89
- /** An optional mask to hide the values of the cell. */
90
- maskValue?: DynamicDataTableMask<K>;
91
- /** Optional configuration for displaying an icon in the leading position of a cell. */
92
- leadingCellIcon?: DynamicDataTableCellIcon<K>;
93
- /** Optional configuration for displaying an icon in the trailing position of a cell. */
94
- trailingCellIcon?: DynamicDataTableCellIcon<K>;
95
- /** An optional function to render a custom wrapper component for the type `DynamicDataTableRowDataType.BUTTON`. */
96
- buttonCellWrapComponent?: (row: DynamicDataTableRowType<K>) => ReactElement;
97
- /** An optional React node for a custom header component. */
98
- headerComponent?: ReactNode;
99
- /** When true, data addition field will not be shown. */
100
- isAdditionNotAllowed?: boolean;
101
- /** When true, data addition field will not be shown. */
102
- isDeletionNotAllowed?: boolean;
103
- /** When true, data add or update is disabled. */
104
- readOnly?: boolean;
105
- /** Function to handle the addition of a new row to the table. */
106
- onRowAdd: () => void;
107
- /**
108
- * Function to handle changes in the table rows.
109
- * @param row - The row that changed.
110
- * @param headerKey - The key of the header that changed.
111
- * @param value - The value of the cell.
112
- * @param extraData - Additional data, such as a selected value for dropdowns.
113
- */
114
- onRowEdit: (row: DynamicDataTableRowType<K>, headerKey: K, value: string, extraData: {
115
- selectedValue?: SelectPickerOptionType<string>;
116
- }) => void;
117
- /**
118
- * Function to handle row deletions.
119
- * @param row - The row that was deleted.
120
- */
121
- onRowDelete: (row: DynamicDataTableRowType<K>) => void;
122
- /** Optional configuration for rendering a custom action button in a row. */
123
- actionButtonConfig?: {
124
- /**
125
- * Function to render the action button.
126
- * @param row - The current row being rendered.
127
- * @returns A React node representing the action button.
128
- */
129
- renderer: (row: DynamicDataTableRowType<K>) => ReactNode;
130
- /**
131
- * This represents under which header key the action button will be rendered.
132
- */
133
- key: K;
134
- /**
135
- * The width of the action button.
136
- * @default '32px'
137
- */
138
- width?: string;
139
- /**
140
- * The position of the action button under the header key.
141
- * @default 'start'
142
- */
143
- position?: 'start' | 'end';
144
- };
145
- /**
146
- * Indicates whether to show errors.
147
- */
148
- showError?: boolean;
149
- /**
150
- * Function to validate the value of a table cell.
151
- * @param value - The value to validate.
152
- * @param key - The column key of the cell.
153
- * @param row - The row containing the cell.
154
- * @returns An object with a boolean indicating validity and an array of error messages.
155
- */
156
- validationSchema?: (value: string, key: K, row: DynamicDataTableRowType<K>) => {
157
- isValid: boolean;
158
- errorMessages: string[];
159
- };
160
- };
161
- export interface DynamicDataTableHeaderProps<K extends string> extends Pick<DynamicDataTableProps<K>, 'headers' | 'rows' | 'headerComponent' | 'sortingConfig' | 'onRowAdd' | 'readOnly' | 'isAdditionNotAllowed' | 'isDeletionNotAllowed' | 'actionButtonConfig'>, Pick<InfoIconTippyProps, 'heading' | 'additionalContent'> {
162
- }
163
- export interface DynamicDataTableRowProps<K extends string> extends Pick<DynamicDataTableProps<K>, 'rows' | 'headers' | 'maskValue' | 'isAdditionNotAllowed' | 'isDeletionNotAllowed' | 'readOnly' | 'onRowEdit' | 'onRowDelete' | 'actionButtonConfig' | 'showError' | 'validationSchema' | 'leadingCellIcon' | 'trailingCellIcon' | 'buttonCellWrapComponent'> {
164
- }
165
- export {};
@@ -1,5 +0,0 @@
1
- import { DynamicDataTableHeaderType, DynamicDataTableProps, DynamicDataTableRowDataType } from './types';
2
- export declare const getActionButtonPosition: <K extends string>({ headers, actionButtonConfig, }: Pick<DynamicDataTableProps<K>, "headers" | "actionButtonConfig">) => number;
3
- export declare const getHeaderGridTemplateColumn: <K extends string>(headers: DynamicDataTableHeaderType<K>[], actionButtonConfig: DynamicDataTableProps<K>["actionButtonConfig"], noDeleteBtn: boolean) => string;
4
- export declare const getRowGridTemplateColumn: <K extends string>(headers: DynamicDataTableHeaderType<K>[], actionButtonConfig: DynamicDataTableProps<K>["actionButtonConfig"], noDeleteBtn: boolean) => string;
5
- export declare const rowTypeHasInputField: (type: DynamicDataTableRowDataType) => boolean;
@@ -1,2 +0,0 @@
1
- import { SelectTextAreaProps } from './types';
2
- export declare const SelectTextArea: ({ value, Icon, onChange, options, inputId, placeholder, refVar, dependentRef, disabled, selectPickerProps, textAreaProps, }: SelectTextAreaProps) => JSX.Element;
@@ -1,2 +0,0 @@
1
- export * from './SelectTextArea';
2
- export * from './types';
@@ -1,12 +0,0 @@
1
- import { ReactElement } from 'react';
2
- import { ResizableTagTextAreaProps } from '../../../Common/CustomTagSelector';
3
- import { SelectPickerOptionType, SelectPickerProps } from '../SelectPicker';
4
- export type SelectTextAreaProps = Pick<SelectPickerProps<string, false>, 'inputId' | 'options'> & Pick<ResizableTagTextAreaProps, 'refVar' | 'dependentRef'> & {
5
- value: string;
6
- Icon?: ReactElement;
7
- onChange?: (selectedValue: SelectPickerOptionType<string>) => void;
8
- disabled?: boolean;
9
- placeholder?: string;
10
- textAreaProps?: Omit<ResizableTagTextAreaProps, 'refVar' | 'dependentRef' | 'id' | 'value' | 'onChange' | 'placeholder' | 'disabled'>;
11
- selectPickerProps?: Omit<SelectPickerProps<string, false>, 'inputId' | 'options' | 'isDisabled' | 'onChange' | 'variant' | 'value' | 'placeholder' | 'fullWidth' | 'selectRef' | 'onCreateOption' | 'isMulti'>;
12
- };
@@ -1,3 +0,0 @@
1
- import { TagsContainerProps } from './types';
2
- declare const TagsContainer: ({ isCreateApp, hidePropagateTags, ...props }: TagsContainerProps) => JSX.Element;
3
- export default TagsContainer;
@@ -1,4 +0,0 @@
1
- import { DynamicDataTableHeaderType } from '../DynamicDataTable';
2
- import { TagsTableColumnsType } from './types';
3
- export declare const TAGS_TABLE_HEADERS: DynamicDataTableHeaderType<TagsTableColumnsType>[];
4
- export declare const DEVTRON_AI_URL: string;
@@ -1,3 +0,0 @@
1
- export { default as TagsContainer } from './TagsContainer';
2
- export { getEmptyTagTableRow } from './utils';
3
- export type { TagsTableColumnsType } from './types';
@@ -1,9 +0,0 @@
1
- import { DynamicDataTableProps, DynamicDataTableRowType } from '../DynamicDataTable';
2
- export type TagsTableColumnsType = 'tagKey' | 'tagValue';
3
- export interface TagsContainerProps extends Partial<Pick<DynamicDataTableProps<TagsTableColumnsType>, 'onRowEdit'>> {
4
- isCreateApp?: boolean;
5
- rows: DynamicDataTableRowType<TagsTableColumnsType>[];
6
- setRows: (updatedRows: DynamicDataTableRowType<TagsTableColumnsType>[]) => void;
7
- hidePropagateTags?: boolean;
8
- getEmptyRow?: (keyChoices?: string[]) => DynamicDataTableRowType<TagsTableColumnsType>;
9
- }
@@ -1,3 +0,0 @@
1
- import { DynamicDataTableRowType } from '../DynamicDataTable';
2
- import { TagsTableColumnsType } from './types';
3
- export declare const getEmptyTagTableRow: () => DynamicDataTableRowType<TagsTableColumnsType>;
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><rect width="13.3333" height="13.3333" x="1.33301" y="1.33331" fill="#596168" rx="4"/><path stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m10 6-4 4m4 0L6 6"/></svg>