@reportportal/ui-kit 0.0.1-alpha.102 → 0.0.1-alpha.104
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/attachedFile.js +1 -1
- package/dist/{arrowUp-4a5caee7.js → chevronDownDropdown-66f5b1af.js} +4 -3
- package/dist/common/utils/index.d.ts +1 -0
- package/dist/common/utils/isString.d.ts +1 -0
- package/dist/components/fileDropArea/attachedFilesList/attachedFilesList.d.ts +1 -0
- package/dist/components/fileDropArea/hooks/useFileProcessing.d.ts +2 -2
- package/dist/components/fileDropArea/types.d.ts +1 -0
- package/dist/components/fileDropArea/utils/getValidationErrorMessage.d.ts +1 -1
- package/dist/components/table/constants.d.ts +3 -0
- package/dist/components/table/hooks/index.d.ts +4 -0
- package/dist/components/table/hooks/useColumnWidths.d.ts +8 -0
- package/dist/components/table/hooks/useTableColumns.d.ts +13 -0
- package/dist/components/table/hooks/useTableExpansion.d.ts +15 -0
- package/dist/components/table/hooks/useTableHover.d.ts +10 -0
- package/dist/components/table/types.d.ts +14 -2
- package/dist/components/table/utils.d.ts +7 -1
- package/dist/fileDropArea.js +160 -155
- package/dist/icons.js +37 -37
- package/dist/index-803576c3.js +110 -0
- package/dist/index.js +38 -38
- package/dist/style.css +1 -1
- package/dist/table-0ca84375.js +476 -0
- package/dist/table.js +2 -2
- package/package.json +1 -1
- package/dist/index-e27a72a8.js +0 -99
- package/dist/table-920fdad9.js +0 -142
package/dist/attachedFile.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as e from "react";
|
|
2
|
-
const
|
|
2
|
+
const l = (t) => /* @__PURE__ */ e.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ e.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.85355 12.8536C7.65829 13.0488 7.34171 13.0488 7.14645 12.8536L4.14645 9.85355C3.95118 9.65829 3.95118 9.34171 4.14645 9.14645C4.34171 8.95118 4.65829 8.95118 4.85355 9.14645L7 11.2929L7 3.5C7 3.22386 7.22386 3 7.5 3C7.77614 3 8 3.22386 8 3.5L8 11.2929L10.1464 9.14645C10.3417 8.95119 10.6583 8.95118 10.8536 9.14645C11.0488 9.34171 11.0488 9.65829 10.8536 9.85355L7.85355 12.8536Z", fill: "#A2AAB5" })), n = (t) => /* @__PURE__ */ e.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ e.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.14645 3.14645C7.34171 2.95118 7.65829 2.95118 7.85355 3.14645L10.8536 6.14645C11.0488 6.34171 11.0488 6.65829 10.8536 6.85355C10.6583 7.04882 10.3417 7.04882 10.1464 6.85355L8 4.70711V12.5C8 12.7761 7.77614 13 7.5 13C7.22386 13 7 12.7761 7 12.5L7 4.70711L4.85355 6.85355C4.65829 7.04882 4.34171 7.04882 4.14645 6.85355C3.95118 6.65829 3.95118 6.34171 4.14645 6.14645L7.14645 3.14645Z", fill: "#A2AAB5" })), o = (t) => /* @__PURE__ */ e.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ e.createElement("path", { d: "M14.2174 5.82426C14.3736 5.66805 14.3736 5.41479 14.2174 5.25858L14.0759 5.11716C13.9197 4.96095 13.6665 4.96095 13.5103 5.11716L8.16726 10.4602L2.82426 5.11716C2.66805 4.96095 2.41479 4.96095 2.25858 5.11716L2.11716 5.25858C1.96095 5.41479 1.96095 5.66805 2.11716 5.82426L7.89176 11.5989C8.04797 11.7551 8.30124 11.7551 8.45745 11.5989L8.88171 11.1746L8.87436 11.1673L14.2174 5.82426Z", fill: "#A2AAB5" }));
|
|
3
3
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
l as S,
|
|
5
|
+
n as a,
|
|
6
|
+
o as b
|
|
6
7
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isString: (value: unknown) => value is string;
|
|
@@ -5,9 +5,9 @@ interface FileProcessingOptions extends FileValidationOptions {
|
|
|
5
5
|
onFilesAdded: (files: FileWithValidation[]) => void;
|
|
6
6
|
}
|
|
7
7
|
export declare const useFileProcessing: ({ maxFileSize, acceptFileMimeTypes, onFilesAdded, }: FileProcessingOptions) => {
|
|
8
|
-
onDrop: (acceptedFiles: File[]) => void;
|
|
9
|
-
handleFileInputChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
10
8
|
error: ValidationError | null;
|
|
9
|
+
handleFileInputChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
11
10
|
clearError: () => void;
|
|
11
|
+
onDrop: (acceptedFiles: File[]) => void;
|
|
12
12
|
};
|
|
13
13
|
export {};
|
|
@@ -49,6 +49,7 @@ export interface FileValidationOptions {
|
|
|
49
49
|
export interface FileWithValidation {
|
|
50
50
|
file: File;
|
|
51
51
|
validationErrors: FileValidationError[];
|
|
52
|
+
customErrorMessage?: string;
|
|
52
53
|
}
|
|
53
54
|
export interface FileDropAreaBaseConfig extends FileValidationOptions {
|
|
54
55
|
messages: FileValidationMessages;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { FileValidationError, FileValidationMessages } from '../types';
|
|
2
2
|
|
|
3
|
-
export declare const getValidationErrorMessage: (errors: FileValidationError[], messages: FileValidationMessages) => string | null;
|
|
3
|
+
export declare const getValidationErrorMessage: (errors: FileValidationError[], messages: FileValidationMessages, customErrorMessage?: string) => string | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { MutableRefObject } from 'react';
|
|
2
|
+
|
|
3
|
+
interface UseColumnWidthsReturn {
|
|
4
|
+
columnWidthsRef: MutableRefObject<Map<string, number>>;
|
|
5
|
+
setCellRef: (columnKey: string) => (element: HTMLDivElement | null) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const useColumnWidths: () => UseColumnWidthsReturn;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PrimaryColumn, FixedColumn, Column } from '../types';
|
|
2
|
+
|
|
3
|
+
interface UseTableColumnsProps {
|
|
4
|
+
primaryColumns: Column[];
|
|
5
|
+
fixedColumns: FixedColumn[];
|
|
6
|
+
pinnedColumnKeys: string[];
|
|
7
|
+
}
|
|
8
|
+
interface UseTableColumnsReturn {
|
|
9
|
+
pinnedColumns: (PrimaryColumn | FixedColumn)[];
|
|
10
|
+
scrollableColumns: (PrimaryColumn | FixedColumn)[];
|
|
11
|
+
}
|
|
12
|
+
export declare const useTableColumns: ({ primaryColumns, fixedColumns, pinnedColumnKeys, }: UseTableColumnsProps) => UseTableColumnsReturn;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Column, FixedColumn } from '../types';
|
|
2
|
+
|
|
3
|
+
interface UseTableExpansionProps {
|
|
4
|
+
primaryColumns: Column[];
|
|
5
|
+
fixedColumns: FixedColumn[];
|
|
6
|
+
expandedRowIds: (string | number)[];
|
|
7
|
+
onToggleRowExpansion: (id: string | number) => void;
|
|
8
|
+
}
|
|
9
|
+
interface UseTableExpansionReturn {
|
|
10
|
+
expandedCells: Set<string>;
|
|
11
|
+
handleToggleRowExpansion: (id: string | number) => void;
|
|
12
|
+
isCellExpanded: (rowId: string | number, columnKey: string) => boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const useTableExpansion: ({ primaryColumns, fixedColumns, expandedRowIds, onToggleRowExpansion, }: UseTableExpansionProps) => UseTableExpansionReturn;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface UseTableHoverReturn {
|
|
2
|
+
hoveredColumn: string | null;
|
|
3
|
+
hoveredRow: number | null;
|
|
4
|
+
handleColumnMouseEnter: (columnKey: string) => void;
|
|
5
|
+
handleColumnMouseLeave: () => void;
|
|
6
|
+
handleRowMouseEnter: (rowIndex: number) => void;
|
|
7
|
+
handleRowMouseLeave: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const useTableHover: () => UseTableHoverReturn;
|
|
10
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { Dispatch, ReactNode, SetStateAction } from 'react';
|
|
2
2
|
import { ASC, DESC } from './constants';
|
|
3
3
|
|
|
4
4
|
export interface Column {
|
|
@@ -12,6 +12,10 @@ export interface FixedColumn extends Column {
|
|
|
12
12
|
width: string | number;
|
|
13
13
|
align?: 'left' | 'center' | 'right';
|
|
14
14
|
}
|
|
15
|
+
export interface PinnedColumn extends FixedColumn {
|
|
16
|
+
pinned: boolean;
|
|
17
|
+
pinnedPosition?: number;
|
|
18
|
+
}
|
|
15
19
|
export interface RowConfigs {
|
|
16
20
|
size?: 'small' | 'medium' | 'large';
|
|
17
21
|
}
|
|
@@ -35,7 +39,7 @@ export interface SortConfig {
|
|
|
35
39
|
}
|
|
36
40
|
export interface TableComponentProps {
|
|
37
41
|
data: RowData[];
|
|
38
|
-
primaryColumn: Column;
|
|
42
|
+
primaryColumn: Column | Column[];
|
|
39
43
|
fixedColumns: FixedColumn[];
|
|
40
44
|
renderRowActions?: (metaData?: MetaData) => ReactNode;
|
|
41
45
|
selectable?: boolean;
|
|
@@ -46,7 +50,15 @@ export interface TableComponentProps {
|
|
|
46
50
|
sortingDirection?: SortingDirection;
|
|
47
51
|
sortingColumn?: Column;
|
|
48
52
|
sortableColumns?: string[];
|
|
53
|
+
isHeaderFixed?: boolean;
|
|
54
|
+
isHorizontallyScrollable?: boolean;
|
|
55
|
+
pinnedColumnKeys?: string[];
|
|
56
|
+
isRowsExpandable?: boolean;
|
|
57
|
+
expandedRowIds?: (string | number)[];
|
|
58
|
+
setExpandedRowIds?: Dispatch<SetStateAction<Set<string | number>>>;
|
|
49
59
|
onChangeSorting?: (sortConfig?: SortConfig) => void;
|
|
50
60
|
onToggleRowSelection?: (id: string | number) => void;
|
|
51
61
|
onToggleAllRowsSelection?: () => void;
|
|
62
|
+
onToggleRowExpansion?: (id: string | number) => void;
|
|
63
|
+
onToggleAllRowsExpansion?: () => void;
|
|
52
64
|
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CSSProperties, MutableRefObject } from 'react';
|
|
2
|
+
import { Column, RowData, SortConfig, SortingDirection, PrimaryColumn, FixedColumn } from './types';
|
|
2
3
|
|
|
3
4
|
export declare const isAsc: (direction: SortingDirection) => boolean;
|
|
4
5
|
export declare const sortTableData: (tableData: RowData[], sortConfig?: SortConfig) => RowData[];
|
|
5
6
|
export declare const getColumnsKeys: (columns: Column[]) => string[];
|
|
6
7
|
export declare const toggleDirection: (direction: SortingDirection) => "asc" | "desc";
|
|
8
|
+
export declare const isPrimaryColumn: (column: PrimaryColumn | FixedColumn) => boolean;
|
|
9
|
+
export declare const getRowSizeClassName: (rowData: RowData) => string;
|
|
10
|
+
export declare const calculatePinnedPosition: (columnIndex: number, columns: (PrimaryColumn | FixedColumn)[], columnWidthsRef: MutableRefObject<Map<string, number>>, isRowsExpandable: boolean, selectable: boolean) => number;
|
|
11
|
+
export declare const getCellStyle: (column: FixedColumn | PrimaryColumn, isPinned: boolean, pinnedIndex: number | undefined, pinnedColumns: (PrimaryColumn | FixedColumn)[], columnWidthsRef: MutableRefObject<Map<string, number>>, isRowsExpandable: boolean, selectable: boolean) => CSSProperties;
|
|
12
|
+
export declare const getGridTemplateColumns: (pinnedColumns: (PrimaryColumn | FixedColumn)[], scrollableColumns: (PrimaryColumn | FixedColumn)[], isRowsExpandable: boolean, selectable: boolean, renderRowActions: boolean, isHeader?: boolean) => string;
|