Skip to content

Commit

Permalink
Merge pull request #14 from weka/sofi/final-fixes-events
Browse files Browse the repository at this point in the history
Sofi/final fixes events
  • Loading branch information
sofa-tata authored Mar 26, 2023
2 parents dfedaf5 + 77f4bc7 commit bf01a15
Show file tree
Hide file tree
Showing 138 changed files with 3,501 additions and 1,543 deletions.
12 changes: 6 additions & 6 deletions dist/cjs/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cjs/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/cjs/types/components/FilterBox/FilterBox.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import './filterBox.scss';
interface FilterBoxProps {
name: string;
text: string | Array<string>;
value: string | Array<string> | Record<string, unknown>;
onDelete: () => void;
}
declare function FilterBox({ name, text, onDelete }: FilterBoxProps): JSX.Element;
declare function FilterBox({ name, value: value, onDelete }: FilterBoxProps): JSX.Element;
export default FilterBox;
10 changes: 10 additions & 0 deletions dist/cjs/types/components/FilterButton/FilterButton.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/// <reference types="react" />
import './filterButton.scss';
interface FilterButtonProps {
onClick: () => void;
disable?: boolean;
extraClass?: string;
tooltipText?: string;
}
declare function FilterButton({ onClick, disable, extraClass, tooltipText }: FilterButtonProps): JSX.Element;
export default FilterButton;
1 change: 1 addition & 0 deletions dist/cjs/types/components/FilterButton/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './FilterButton';
1 change: 1 addition & 0 deletions dist/cjs/types/components/JsonEditor/JsonEditor.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ interface JsonEditorProps {
readOnly?: boolean;
value?: string;
onValidate?: () => void;
extraClass?: string;
[key: string]: any;
}
declare function JsonEditor(props: JsonEditorProps): JSX.Element;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/// <reference types="react" />
interface MonacoJsonEditorProps {
value: string;
}
declare function MonacoJsonEditor({ value }: MonacoJsonEditorProps): JSX.Element;
export default MonacoJsonEditor;
1 change: 1 addition & 0 deletions dist/cjs/types/components/MonacoJsonEditor/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './MonacoJsonEditor';
10 changes: 10 additions & 0 deletions dist/cjs/types/components/Table/Pagination/Pagination.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/// <reference types="react" />
import './pagination.scss';
interface PaginationProps {
onPageChange: (page: number) => void;
totalRows: number;
rowsPerPage: number;
defaultCurrentPage: number;
}
declare function Pagination({ onPageChange, totalRows, rowsPerPage, defaultCurrentPage }: PaginationProps): JSX.Element | null;
export default Pagination;
1 change: 1 addition & 0 deletions dist/cjs/types/components/Table/Pagination/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './Pagination';
9 changes: 9 additions & 0 deletions dist/cjs/types/components/Table/PerPage/PerPage.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/// <reference types="react" />
import './perPage.scss';
interface PerPageProps {
value: string | number;
onChange: (val: string | number) => void;
options?: Option[];
}
declare function PerPage({ value, onChange, options }: PerPageProps): JSX.Element;
export default PerPage;
1 change: 1 addition & 0 deletions dist/cjs/types/components/Table/PerPage/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './PerPage';
23 changes: 20 additions & 3 deletions dist/cjs/types/components/Table/Table.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { ReactNode } from 'react';
import { Row, Column, UseExpandedRowProps, UseRowStateRowProps, CellProps } from 'react-table';
import { Row, Column, UseExpandedRowProps, UseRowStateRowProps, CellProps, Filters } from 'react-table';
import './table.scss';
export interface RowAction {
hideAction: boolean | ((original: object) => boolean);
Expand All @@ -8,6 +8,13 @@ export interface RowAction {
disabled?: boolean | ((original: object) => boolean);
text?: string;
}
export interface CustomRowAction {
Icon: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
disabled?: boolean | ((original: object) => boolean);
onClick: ((original: object) => void) | (() => void);
tooltipText?: any;
extraClass?: string;
}
export interface CustomCellProps {
cell: CellProps<object>;
}
Expand All @@ -30,7 +37,8 @@ interface TableProps {
globalFilter?: string | ((rows: Array<Row>) => Row[]);
defaultGlobalFilter?: string;
checkRowSelected?: (row: object) => boolean;
getRowId?: ((originalRow: object, relativeIndex: number, parent?: (Row<object> | undefined)) => string);
checkRowHighlighted?: (row: object) => boolean;
getRowId?: (originalRow: object, relativeIndex: number, parent?: Row<object> | undefined) => string;
addFilterToUrl?: boolean;
RowSubComponent?: React.FC<{
row: any;
Expand All @@ -41,6 +49,15 @@ interface TableProps {
fixedPageSize?: number;
disableActionsPortal?: boolean;
colPropForShowColumns?: string;
manualPagination?: boolean;
itemsAmount?: number;
canExpandAll?: boolean;
loading?: boolean;
onFiltersChanged?: (newFilters: Filters<object>) => void;
defaultDescendingSort?: boolean;
customRowActions?: CustomRowAction[];
manualFilters?: boolean;
initialFilters?: Filter[];
}
declare function Table({ columns, data, rowActions, tableActions, title, defaultSort, globalFilter, defaultGlobalFilter, checkRowSelected, getRowId, addFilterToUrl, RowSubComponent, listenerPrefix, onRowClick, miniTable, filterCategory, fixedPageSize, disableActionsPortal, maxRows, emptyMessage, colPropForShowColumns }: TableProps): JSX.Element;
declare function Table({ columns, data, rowActions, tableActions, title, defaultSort, globalFilter, defaultGlobalFilter, checkRowSelected, checkRowHighlighted, getRowId, addFilterToUrl, RowSubComponent, listenerPrefix, onRowClick, miniTable, filterCategory, fixedPageSize, disableActionsPortal, maxRows, emptyMessage, colPropForShowColumns, manualPagination, itemsAmount, canExpandAll, loading, onFiltersChanged, defaultDescendingSort, customRowActions, manualFilters, initialFilters: initialUserFilters }: TableProps): JSX.Element;
export default Table;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="react" />
import { CustomCellProps } from '../../Table';
import './entityCell.scss';
declare function EntityCell({ cell }: CustomCellProps): JSX.Element;
export default EntityCell;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './EntityCell';
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/// <reference types="react" />
import { CustomRowAction, ExtendedRow } from '../../Table';
import './iconButtonCell.scss';
interface IconButtonCellProps {
action: CustomRowAction;
row: ExtendedRow<object>;
}
declare function IconButtonCell({ row, action }: IconButtonCellProps): JSX.Element;
export default IconButtonCell;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './IconButtonCell';
5 changes: 5 additions & 0 deletions dist/cjs/types/components/Table/cells/NodeCell/NodeCell.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="react" />
import { CustomCellProps } from '../../Table';
import './nodeCell.scss';
declare function NodeCell({ cell }: CustomCellProps): JSX.Element;
export default NodeCell;
1 change: 1 addition & 0 deletions dist/cjs/types/components/Table/cells/NodeCell/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './NodeCell';
17 changes: 17 additions & 0 deletions dist/cjs/types/components/Table/filters/DateFilter/DateFilter.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/// <reference types="react" />
import { UseFiltersColumnProps } from 'react-table';
import './dateFilter.scss';
interface ExtendedFiltersColumn<T extends object> extends UseFiltersColumnProps<T> {
Header: string;
id?: string;
}
interface DateFilterProps {
column: ExtendedFiltersColumn<object>;
}
export interface DateFilterValue {
startTime?: string;
endTime?: string;
}
export declare const isDateFilterValue: (obj: unknown) => obj is DateFilterValue;
declare function DateFilter({ column }: DateFilterProps): JSX.Element;
export default DateFilter;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './DateFilter';
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';
import './filterHeader.scss';
interface FilterHeaderProps {
title?: string;
setFilter: (val: any) => void;
Filter: typeof React.Component;
dataForFilter?: {
[key: string]: any;
};
filterKey?: string;
}
declare function FilterHeader({ title, setFilter, Filter, dataForFilter, filterKey }: FilterHeaderProps): JSX.Element;
export default FilterHeader;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './FilterHeader';
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ interface FilterWrapperProps {
setFilter: (value: any) => void;
children: ReactElement;
value?: any;
columnTitle?: string;
columnTitle: string;
hideWrapper?: boolean;
isPopperOpen?: boolean;
onTogglePopper?: () => void;
}
declare function FilterWrapper({ setFilter, value, children, columnTitle }: FilterWrapperProps): JSX.Element;
declare function FilterWrapper({ setFilter, value, children, columnTitle, hideWrapper, isPopperOpen: isPopperOpenOuter, onTogglePopper: onTogglePopperOuter }: FilterWrapperProps): JSX.Element;
export default FilterWrapper;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/// <reference types="react" />
import './multiSelectFilter.scss';
declare function IncludeExcludeFilter({ column }: {
[key: string]: any;
}): JSX.Element;
export default IncludeExcludeFilter;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './IncludeExcludeFilter';
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
/// <reference types="react" />
import { UseFiltersColumnProps } from 'react-table';
import './multiSelectFilter.scss';
declare function MultiSelectFilter({ column }: {
interface ExtendedFiltersColumn<T extends object> extends UseFiltersColumnProps<T> {
fixedOptions: Array<any>;
Header: string;
id?: string;
[key: string]: any;
}): JSX.Element;
}
declare function MultiSelectFilter({ column }: ExtendedFiltersColumn<object>): JSX.Element;
export default MultiSelectFilter;
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
/// <reference types="react" />
import { UseFiltersColumnProps } from 'react-table';
import './selectFilter.scss';
declare function SelectFilter({ column }: {
interface ExtendedFiltersColumn<T extends object> extends UseFiltersColumnProps<T> {
fixedOptions: Array<any>;
Header: string;
id?: string;
[key: string]: any;
}): JSX.Element;
}
declare function SelectFilter({ column }: ExtendedFiltersColumn<object>): JSX.Element;
export default SelectFilter;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/// <reference types="react" />
import { UseFiltersColumnProps } from 'react-table';
import './severityFilter.scss';
interface ExtendedFiltersColumn<T extends object> extends UseFiltersColumnProps<T> {
fixedOptions: Array<any>;
Header: string;
id?: string;
[key: string]: any;
}
declare function SeverityFilter({ column: { filterValue, setFilter, Header, columnName } }: {
column: ExtendedFiltersColumn<object>;
}): JSX.Element;
export default SeverityFilter;
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/// <reference types="react" />
import { Severities } from "../../../../consts";
import "./severityFilter.scss";
interface SeverityFilterProps {
setFilter: (value: Severities) => void;
import { UseFiltersColumnProps } from 'react-table';
import './severityFilter.scss';
interface ExtendedFiltersColumn<T extends object> extends UseFiltersColumnProps<T> {
Header: string;
[key: string]: any;
byMinSeverity?: boolean;
}
declare function SeverityFilter({ setFilter }: SeverityFilterProps): JSX.Element;
declare function SeverityFilter({ column }: ExtendedFiltersColumn<object>): JSX.Element;
export default SeverityFilter;
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
import React from 'react';
import SeverityFilter from './SeverityFilter';
declare const _default: React.MemoExoticComponent<typeof SeverityFilter>;
export default _default;
export { default } from './SeverityFilter';
1 change: 1 addition & 0 deletions dist/cjs/types/components/Table/hooks/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './useUrlFilters';
6 changes: 6 additions & 0 deletions dist/cjs/types/components/Table/hooks/useUrlFilters.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export declare const useUrlFilters: ({ enabled, filterIds, initial, filterCategory }: {
enabled?: boolean | undefined;
filterIds: string[];
initial?: Filter[] | undefined;
filterCategory: string;
}) => readonly [Filter[], (filters: Filter[]) => void];
1 change: 1 addition & 0 deletions dist/cjs/types/components/Table/index.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { default } from './Table';
export { useUrlFilters } from './hooks';
12 changes: 11 additions & 1 deletion dist/cjs/types/components/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ export { default as Tab } from "./Tab";
export { default as Toast } from "./Toast";
export { default as ToggleButton } from "./ToggleButton";
export { default as Tooltip } from "./Tooltip";
export { default as Table } from "./Table";
export { default as Table, useUrlFilters } from './Table';
export { default as MultiSelectFilter } from "./Table/filters/MultiSelectFilter";
export { default as SelectFilter } from "./Table/filters/SelectFilter";
export { default as TextFilter } from "./Table/filters/TextFilter";
export { default as SeverityFilter } from './Table/filters/SeverityFilter';
export { default as ActionsCell } from "./Table/cells/ActionsCell";
export { default as ApiCallCell } from "./Table/cells/ApiCallCell";
export { default as BarCell } from "./Table/cells/BarCell";
Expand All @@ -34,5 +35,14 @@ export { default as TimeCell } from "./Table/cells/TimeCell";
export { default as UptimeCell } from "./Table/cells/UptimeCell";
export { default as SeverityCell } from "./Table/cells/SeverityCell";
export { default as DateCell } from "./Table/cells/DateCell";
export { default as NodeCell } from "./Table/cells/NodeCell";
export { default as IconButtonCell } from "./Table/cells/IconButtonCell";
export { default as DateTimePicker } from "./DateTimePicker";
export { default as NumInput } from "./DateTimePicker/components/NumInput";
export { default as Pagination } from "./Table/Pagination";
export { default as PerPage } from './Table/PerPage';
export { default as DateFilter } from './Table/filters/DateFilter';
export { default as FilterButton } from './FilterButton';
export { default as FilterHeader } from './Table/filters/FilterHeader';
export { default as FilterBox } from './FilterBox';
export { default as EntityCell } from './Table/cells/EntityCell';
1 change: 1 addition & 0 deletions dist/cjs/types/components/inputs/Select/Select.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ interface SelectProps {
isClearable?: boolean;
autoFocus?: boolean;
groupedOptions?: boolean;
isSingleClearable?: boolean;
}
declare function Select(props: SelectProps): JSX.Element;
export default Select;
20 changes: 20 additions & 0 deletions dist/cjs/types/consts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,25 @@ export declare const TIME_PARTS: {
interface SeverityIcons {
[key: string]: any;
}
export declare const SEVERITY_DEBUG = "DEBUG";
export declare const SEVERITY_INFO = "INFO";
export declare const SEVERITY_WARNING = "WARNING";
export declare const SEVERITY_MINOR = "MINOR";
export declare const SEVERITY_MAJOR = "MAJOR";
export declare const SEVERITY_CRITICAL = "CRITICAL";
export declare const SEVERITIES: readonly ["DEBUG", "INFO", "WARNING", "MINOR", "MAJOR", "CRITICAL"];
export declare type Severities = typeof SEVERITIES[number];
export declare const SEVERITIES_ICONS: SeverityIcons;
interface ShortRoles {
[key: string]: any;
}
export declare const SHORT_ROLES: ShortRoles;
export declare const PER_PAGE_OPTIONS: {
value: number;
label: string;
}[];
export declare const ORIGIN_OPTIONS: {
USER: string;
WEKA: string;
};
export {};
1 change: 1 addition & 0 deletions dist/cjs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ import './style/theme.scss';
import './style/app.scss';
import './style/fonts.scss';
export * from './components';
export { default as Utils } from './utils';
3 changes: 3 additions & 0 deletions dist/cjs/types/svgs/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ export { ReactComponent as AccidentMinor } from './034-accident-minor-24.svg';
export { ReactComponent as AccidentMajor } from './035-accident-major-24.svg';
export { ReactComponent as AccidentCritical } from './036-accident-critical-24.svg';
export { ReactComponent as Warning } from './031-warning-24.svg';
export { ReactComponent as ThinArrow } from './079-arrow-12.svg';
export { ReactComponent as User } from './017-user-16.svg';
export { ReactComponent as Weka } from './043-weka-16.svg';
2 changes: 1 addition & 1 deletion dist/cjs/types/utils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ declare const utils: {
};
isEmpty(val: any): boolean;
isString: (value: any) => boolean;
isObject: (value: any) => boolean;
isObject: (value: any) => value is Record<string, unknown>;
insensitiveSort(array: any[], key: string): any[];
range(startOrEnd: number, end?: number, step?: number): number[];
mask2SubnetOp(val: number): string;
Expand Down
14 changes: 7 additions & 7 deletions dist/esm/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/esm/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/esm/types/components/FilterBox/FilterBox.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import './filterBox.scss';
interface FilterBoxProps {
name: string;
text: string | Array<string>;
value: string | Array<string> | Record<string, unknown>;
onDelete: () => void;
}
declare function FilterBox({ name, text, onDelete }: FilterBoxProps): JSX.Element;
declare function FilterBox({ name, value: value, onDelete }: FilterBoxProps): JSX.Element;
export default FilterBox;
10 changes: 10 additions & 0 deletions dist/esm/types/components/FilterButton/FilterButton.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/// <reference types="react" />
import './filterButton.scss';
interface FilterButtonProps {
onClick: () => void;
disable?: boolean;
extraClass?: string;
tooltipText?: string;
}
declare function FilterButton({ onClick, disable, extraClass, tooltipText }: FilterButtonProps): JSX.Element;
export default FilterButton;
1 change: 1 addition & 0 deletions dist/esm/types/components/FilterButton/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './FilterButton';
1 change: 1 addition & 0 deletions dist/esm/types/components/JsonEditor/JsonEditor.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ interface JsonEditorProps {
readOnly?: boolean;
value?: string;
onValidate?: () => void;
extraClass?: string;
[key: string]: any;
}
declare function JsonEditor(props: JsonEditorProps): JSX.Element;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/// <reference types="react" />
interface MonacoJsonEditorProps {
value: string;
}
declare function MonacoJsonEditor({ value }: MonacoJsonEditorProps): JSX.Element;
export default MonacoJsonEditor;
1 change: 1 addition & 0 deletions dist/esm/types/components/MonacoJsonEditor/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './MonacoJsonEditor';
Loading

0 comments on commit bf01a15

Please sign in to comment.