react-base-data-table 0.5.2 → 0.5.7

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 (86) hide show
  1. package/README.md +0 -1
  2. package/dist/index.cjs.js +22 -22
  3. package/dist/index.cjs.js.map +1 -1
  4. package/dist/index.es.js +7469 -7177
  5. package/dist/index.es.js.map +1 -1
  6. package/dist/style.css +1 -1
  7. package/package.json +1 -1
  8. package/dist/types/App.d.ts +0 -3
  9. package/dist/types/DUMMY_ITEMS.d.ts +0 -6
  10. package/dist/types/components/BaseButton.d.ts +0 -19
  11. package/dist/types/components/BaseCheckbox.d.ts +0 -11
  12. package/dist/types/components/BaseIcon.d.ts +0 -11
  13. package/dist/types/components/BaseTable/BaseTable.d.ts +0 -50
  14. package/dist/types/components/BaseTable/BaseTableFooter.d.ts +0 -10
  15. package/dist/types/components/BaseTable/BaseTableGroupRow.d.ts +0 -15
  16. package/dist/types/components/BaseTable/BaseTableHeader.d.ts +0 -13
  17. package/dist/types/components/BaseTable/BaseTableHeaders.d.ts +0 -15
  18. package/dist/types/components/BaseTable/BaseTableRow.d.ts +0 -12
  19. package/dist/types/components/BaseTable/BaseTableWithContext.d.ts +0 -3
  20. package/dist/types/components/BaseTable/CommentPopup.d.ts +0 -15
  21. package/dist/types/components/BaseTable/CustomRenderItem.d.ts +0 -12
  22. package/dist/types/components/BaseTable/contextMenu/ContextMenu.d.ts +0 -13
  23. package/dist/types/components/BaseTable/contextMenu/actions/cellActions.d.ts +0 -6
  24. package/dist/types/components/BaseTable/contextMenu/actions/headerActions.d.ts +0 -5
  25. package/dist/types/components/BaseTable/contextMenu/actions/index.d.ts +0 -2
  26. package/dist/types/components/BaseTable/contexts/useTableInteractionContext.d.ts +0 -11
  27. package/dist/types/components/BaseTable/dialogs/DialogWrapper.d.ts +0 -6
  28. package/dist/types/components/BaseTable/dialogs/columnsDialog/ChartDialog.d.ts +0 -7
  29. package/dist/types/components/BaseTable/dialogs/columnsDialog/ColumnsDialog.d.ts +0 -2
  30. package/dist/types/components/BaseTable/dialogs/columnsDialog/DragPreview.d.ts +0 -5
  31. package/dist/types/components/BaseTable/dialogs/columnsDialog/HeaderItem.d.ts +0 -20
  32. package/dist/types/components/BaseTable/hooks/useCellPopup.d.ts +0 -16
  33. package/dist/types/components/BaseTable/hooks/useRowDragDrop.d.ts +0 -16
  34. package/dist/types/components/BaseTable/hooks/useTableGrouping.d.ts +0 -14
  35. package/dist/types/components/BaseTable/hooks/useTableInteractions.d.ts +0 -59
  36. package/dist/types/components/BaseTable/hooks/useVirtualRows.d.ts +0 -11
  37. package/dist/types/components/BaseTable/models/ActiveTableFilter.d.ts +0 -6
  38. package/dist/types/components/BaseTable/models/AdvancedTableSettings.d.ts +0 -23
  39. package/dist/types/components/BaseTable/models/BaseTableHeaders.d.ts +0 -38
  40. package/dist/types/components/BaseTable/models/CellCordinate.d.ts +0 -8
  41. package/dist/types/components/BaseTable/models/CommentData.d.ts +0 -10
  42. package/dist/types/components/BaseTable/models/ContextMenu.d.ts +0 -10
  43. package/dist/types/components/BaseTable/models/ContextMenuAction.d.ts +0 -12
  44. package/dist/types/components/BaseTable/models/DialogItem.d.ts +0 -15
  45. package/dist/types/components/BaseTable/models/GroupInfo.d.ts +0 -7
  46. package/dist/types/components/BaseTable/models/HighlightCondition.d.ts +0 -7
  47. package/dist/types/components/BaseTable/models/ItemWithGroupInfo.d.ts +0 -7
  48. package/dist/types/components/BaseTable/models/LinkedGroup.d.ts +0 -4
  49. package/dist/types/components/BaseTable/models/TableConfiguration.d.ts +0 -4
  50. package/dist/types/components/BaseTable/models/TableItem.d.ts +0 -4
  51. package/dist/types/components/BaseTable/tableCell/BaseTableCell.d.ts +0 -21
  52. package/dist/types/components/BaseTable/tableCell/IndexCell.d.ts +0 -8
  53. package/dist/types/components/BaseTable/tableCell/baseTableCellFunctions.d.ts +0 -16
  54. package/dist/types/components/BaseTable/tableCell/cellImplementation/ListCell.d.ts +0 -13
  55. package/dist/types/components/BaseTable/tableCell/cellImplementation/NumberCell.d.ts +0 -11
  56. package/dist/types/components/BaseTable/tableCell/cellImplementation/OptionList.d.ts +0 -11
  57. package/dist/types/components/BaseTable/tableCell/cellImplementation/formatNumberFunctions.d.ts +0 -1
  58. package/dist/types/components/BaseTable/tableFilter/FilterDropdown.d.ts +0 -13
  59. package/dist/types/components/BaseTable/tableFilter/TableFilter.d.ts +0 -17
  60. package/dist/types/components/BaseTable/tableFilter/filterImplementations/NumberFilter/NumberConditionItem.d.ts +0 -10
  61. package/dist/types/components/BaseTable/tableFilter/filterImplementations/NumberFilter/NumberFilter.d.ts +0 -16
  62. package/dist/types/components/BaseTable/tableFilter/filterImplementations/TextFilter.d.ts +0 -9
  63. package/dist/types/components/BaseTable/tableFunctions/CellSelection.d.ts +0 -10
  64. package/dist/types/components/BaseTable/tableFunctions/FilteringAndSorting.d.ts +0 -7
  65. package/dist/types/components/BaseTable/tableFunctions/highlightCondition.d.ts +0 -5
  66. package/dist/types/components/ColorPicker.d.ts +0 -7
  67. package/dist/types/constants.d.ts +0 -1
  68. package/dist/types/enum/DateUnits.d.ts +0 -8
  69. package/dist/types/enum/FilterTypes.d.ts +0 -4
  70. package/dist/types/hooks/useClickOutside.d.ts +0 -2
  71. package/dist/types/index.d.ts +0 -7
  72. package/dist/types/main.d.ts +0 -1
  73. package/dist/types/stores/clipboardStore.d.ts +0 -24
  74. package/dist/types/stores/commentPopupStore.d.ts +0 -13
  75. package/dist/types/stores/contextMenuStore.d.ts +0 -13
  76. package/dist/types/stores/dialogsStore.d.ts +0 -21
  77. package/dist/types/stores/tableDataStore.d.ts +0 -99
  78. package/dist/types/stores/tableDragStore.d.ts +0 -17
  79. package/dist/types/stores/tableRefStore.d.ts +0 -17
  80. package/dist/types/stores/tableSelectionStore.d.ts +0 -23
  81. package/dist/types/utils/array.d.ts +0 -6
  82. package/dist/types/utils/cellCoordinates.d.ts +0 -3
  83. package/dist/types/utils/cellIdCreation.d.ts +0 -3
  84. package/dist/types/utils/cellOverlapping.d.ts +0 -6
  85. package/dist/types/utils/enum.d.ts +0 -3
  86. package/dist/types/utils/sorting.d.ts +0 -4
@@ -1,11 +0,0 @@
1
- import { useTableInteractions, type TableInteractionsProps } from "../hooks/useTableInteractions";
2
- import type TableItem from "../models/TableItem";
3
- import { useRowDragDrop } from "../hooks/useRowDragDrop";
4
- type TableInteractionContextValue = ReturnType<typeof useTableInteractions> & ReturnType<typeof useRowDragDrop>;
5
- export declare const TableInteractionProvider: <T extends TableItem>({ children, groupedItemsEntries, onChange, onBulkChange, onBulkFieldChange, onRowDoubleClick, onRowsReordered, onSaveComment, onDeleteComment, onSetHighlightCondition, onRemoveHighlightCondition, onAddListOption, }: TableInteractionsProps<T> & {
6
- children: React.ReactNode;
7
- } & {
8
- onRowsReordered?: ((fromIndex: number, toIndex: number) => void) | undefined;
9
- }) => import("react/jsx-runtime").JSX.Element;
10
- export declare function useTableInteractionContext(): TableInteractionContextValue;
11
- export {};
@@ -1,6 +0,0 @@
1
- import type DialogItem from "../models/DialogItem";
2
- interface DialogWrapperProps {
3
- dialogItem: DialogItem;
4
- }
5
- declare const DialogWrapper: React.FC<DialogWrapperProps>;
6
- export default DialogWrapper;
@@ -1,7 +0,0 @@
1
- import type BaseTableHeader from "../../models/BaseTableHeaders";
2
- interface SelectionChartProps {
3
- title?: string;
4
- selectedHeader?: BaseTableHeader;
5
- }
6
- declare const SelectionChart: React.FC<SelectionChartProps>;
7
- export default SelectionChart;
@@ -1,2 +0,0 @@
1
- declare const ColumnsDialog: React.FC;
2
- export default ColumnsDialog;
@@ -1,5 +0,0 @@
1
- interface DragPreviewProps {
2
- text: string;
3
- }
4
- declare const DragPreview: React.FC<DragPreviewProps>;
5
- export default DragPreview;
@@ -1,20 +0,0 @@
1
- import type BaseTableHeader from "../../models/BaseTableHeaders";
2
- declare const HeaderItem: React.FC<{
3
- header: BaseTableHeader;
4
- parentId?: string;
5
- idx: number;
6
- depth: number;
7
- hiddenColumns: string[];
8
- dropIndicator?: "above" | "below";
9
- dragInfo?: {
10
- parentId: string | undefined;
11
- fromIdx: number;
12
- };
13
- setDragInfo: React.Dispatch<React.SetStateAction<{
14
- parentId: string | undefined;
15
- fromIdx: number;
16
- } | undefined>>;
17
- onCheckboxChange: (headerId: string, checked: boolean) => void;
18
- getAllChildrenIds: (header: BaseTableHeader) => string[];
19
- }>;
20
- export default HeaderItem;
@@ -1,16 +0,0 @@
1
- interface UsePopupParams {
2
- isInteractionDisabled: () => boolean;
3
- canOpenCell: () => boolean;
4
- onOpen: () => void;
5
- onClose: () => void;
6
- timeoutDuration?: number;
7
- }
8
- interface UseCellPopupReturn {
9
- isMouseOverPopup: boolean;
10
- handleMouseEnter: () => void;
11
- handleMouseLeave: () => void;
12
- handlePopupMouseEnter: () => void;
13
- handlePopupMouseLeave: () => void;
14
- }
15
- export declare function useCellPopup({ isInteractionDisabled, canOpenCell, onOpen, onClose, timeoutDuration, }: UsePopupParams): UseCellPopupReturn;
16
- export {};
@@ -1,16 +0,0 @@
1
- import type TableItem from "../models/TableItem";
2
- interface UseRowDragDropProps {
3
- items: TableItem[];
4
- onRowsReordered?: (fromIndex: number, toIndex: number, draggedItem: TableItem, targetItem: TableItem) => void;
5
- groupBy?: string;
6
- }
7
- export declare const useRowDragDrop: ({ items, onRowsReordered, groupBy, }: UseRowDragDropProps) => {
8
- draggedRowIndex: number | null;
9
- dropTargetIndex: number | null;
10
- isDraggingRow: boolean;
11
- handleRowDragStart: (index: number, tableItem: TableItem) => void;
12
- handleDrop: (targetItem: TableItem) => void;
13
- handleDragEnd: () => void;
14
- handleRowDragOver: (index: number) => void;
15
- };
16
- export {};
@@ -1,14 +0,0 @@
1
- import type TableItem from "../models/TableItem";
2
- import type ItemWithGroupInfo from "../models/ItemWithGroupInfo";
3
- import type GroupInfo from "../models/GroupInfo";
4
- interface UseTableGroupingReturn {
5
- groupedItemsEntries: [string, {
6
- rowIndex: number;
7
- item: TableItem;
8
- }[]][];
9
- flatGroupedItems: Array<GroupInfo | ItemWithGroupInfo>;
10
- isGroupLinked: (groupName: string) => boolean;
11
- getMasterGroupNameLinked: (groupName: string) => string | undefined;
12
- }
13
- export default function useTableGrouping(): UseTableGroupingReturn;
14
- export {};
@@ -1,59 +0,0 @@
1
- import { type CSSProperties } from "react";
2
- import type BaseTableHeader from "../models/BaseTableHeaders";
3
- import type TableItem from "../models/TableItem";
4
- import type CellCoordinate from "../models/CellCordinate";
5
- import type HighlightCondition from "../models/HighlightCondition";
6
- import type CommentData from "../models/CommentData";
7
- export interface TableInteractionsProps<T extends TableItem> {
8
- items: TableItem[];
9
- groupedItemsEntries?: [string, {
10
- rowIndex: number;
11
- item: TableItem;
12
- }[]][];
13
- onChange?: (itemUpdated: T, originalIndex: number, fromArray?: {
14
- fromArrayIndex: number;
15
- headerId: string;
16
- }) => Promise<void> | void;
17
- onBulkChange?: (items: {
18
- itemUpdated: T;
19
- originalIndex: number;
20
- fromArrayItemsAffected: {
21
- fromArrayIndex: number;
22
- headerId: string;
23
- }[];
24
- }[], headerId?: string) => Promise<void> | void;
25
- onBulkFieldChange?: (items: {
26
- itemUpdated: T;
27
- originalIndex: number;
28
- fromArrayIndex?: number;
29
- }[], headerId: string) => Promise<void> | void;
30
- onRowDoubleClick?: (item: T) => Promise<void> | void;
31
- onSaveComment?: (comment: CommentData, item: TableItem) => Promise<void> | void;
32
- onDeleteComment?: (comment: CommentData, item: TableItem) => Promise<void> | void;
33
- onSetHighlightCondition?: (highlightCondition: HighlightCondition, item: TableItem) => Promise<void> | void;
34
- onRemoveHighlightCondition?: (highlightCondition: HighlightCondition, cssPropertyToRemove: keyof CSSProperties, item: TableItem) => Promise<void> | void;
35
- onAddListOption?: (newOption: string, header: BaseTableHeader) => Promise<void> | void;
36
- }
37
- export declare function useTableInteractions<T extends TableItem>({ items, groupedItemsEntries, onChange, onBulkChange, onBulkFieldChange, onRowDoubleClick, onSaveComment, onDeleteComment, onSetHighlightCondition, onRemoveHighlightCondition, onAddListOption, }: TableInteractionsProps<T>): {
38
- setExpandedSelection: (cells: CellCoordinate[]) => void;
39
- onHeaderClick: (event: React.MouseEvent<HTMLTableCellElement>, headerId: string) => void;
40
- onHeaderRightClick: (event: React.MouseEvent<HTMLTableCellElement>, headerId: string) => void;
41
- onCellBlur: (editValue: string | number | undefined, item: TableItem, header: BaseTableHeader, cellCoordinate: CellCoordinate) => Promise<void>;
42
- onCellEnter: (editValue: string | number | undefined, item: TableItem, header: BaseTableHeader, cellCoordinate: CellCoordinate) => Promise<void>;
43
- onCellClick: (cellCoordinate: CellCoordinate) => void;
44
- handleCellKeyDown: (e: React.KeyboardEvent) => void;
45
- handleRowDoubleClick: (item: TableItem) => Promise<void>;
46
- resetDefaultValueForSelectedCells: () => Promise<void>;
47
- saveCommentHandler: (comment: CommentData, item: TableItem) => Promise<void>;
48
- deleteCommentHandler: (comment: CommentData, item: TableItem) => Promise<void>;
49
- setHighlightCondition: (item: TableItem, headerId: string, cssStyle: React.CSSProperties) => Promise<void>;
50
- removeHighlightCondition: (item: TableItem, headerId: string, cssPropertyToRemove: keyof CSSProperties) => void;
51
- onCellMouseDown: (e: React.MouseEvent<HTMLTableCellElement>, cellCoordinate: CellCoordinate) => void;
52
- onCellMouseEnter: (e: React.MouseEvent<HTMLTableCellElement>, _cellCoordinate: CellCoordinate) => void;
53
- onMouseMove: (e: React.MouseEvent) => void;
54
- pasteClipboardData: () => Promise<void>;
55
- onRightClick: (cellCoordinate: CellCoordinate, e: React.MouseEvent) => void;
56
- addListOption: (newOption: string, header: BaseTableHeader) => Promise<void>;
57
- getItemFromCellCoordinates: (cell: CellCoordinate) => TableItem | undefined;
58
- getItemsFromCellCoordinates: (cells: CellCoordinate[]) => TableItem[];
59
- };
@@ -1,11 +0,0 @@
1
- import type { MutableRefObject } from "react";
2
- export type Props = {
3
- rowsCount: number;
4
- scrollRef: MutableRefObject<HTMLElement | null>;
5
- };
6
- export declare const useVirtualRows: ({ rowsCount, scrollRef }: Props) => {
7
- virtualizer: import("@tanstack/virtual-core").Virtualizer<HTMLElement, Element>;
8
- virtualRows: import("@tanstack/virtual-core").VirtualItem[];
9
- before: number;
10
- after: number;
11
- };
@@ -1,6 +0,0 @@
1
- import type { NumberCondition } from "../tableFilter/filterImplementations/NumberFilter/NumberFilter";
2
- export default interface ActiveTableFilter {
3
- headerId: string;
4
- itemsToHide: string[] | number[];
5
- numberConditions?: NumberCondition[];
6
- }
@@ -1,23 +0,0 @@
1
- export default interface AdvancedTableSettings {
2
- marginTop?: string;
3
- noBorder?: boolean;
4
- pinColumns?: boolean;
5
- alignCenterInLine?: boolean;
6
- currentSortId?: string;
7
- contrastRow?: boolean;
8
- indexUseOriginalOrder?: boolean;
9
- enableRowDragDrop?: boolean;
10
- currentUsername?: string;
11
- showIndex?: boolean;
12
- selectNewOptionOnAdd?: boolean;
13
- canAddListOptions?: boolean;
14
- showFooter?: boolean;
15
- rowIdProperty?: string;
16
- tableId?: string;
17
- focusedRowIndex?: number;
18
- showFlashOnCellUpdate?: boolean;
19
- disabledRows?: {
20
- property: string;
21
- values: string[] | number[] | boolean[];
22
- };
23
- }
@@ -1,38 +0,0 @@
1
- import { type ReactNode } from "react";
2
- import type TableItem from "./TableItem";
3
- export declare const TableHeaderType: {
4
- readonly STRING: "string";
5
- readonly LIST: "list";
6
- readonly NUMBER: "number";
7
- };
8
- export type TableHeaderType = (typeof TableHeaderType)[keyof typeof TableHeaderType];
9
- export default interface BaseTableHeader {
10
- id: string;
11
- text: string;
12
- hasFilter?: boolean;
13
- width?: number;
14
- children?: BaseTableHeader[];
15
- editOptions?: {
16
- editable?: boolean;
17
- isDisabled?: (item: TableItem, fromArrayData?: {
18
- index: number;
19
- }) => boolean;
20
- notApplicable?: (item: TableItem, fromArrayData?: {
21
- index: number;
22
- }) => boolean;
23
- greyedOutIfNotEditable?: boolean;
24
- required?: boolean;
25
- type: TableHeaderType;
26
- options?: string[];
27
- defaultValue?: string | number;
28
- canAddNewOption?: boolean;
29
- };
30
- fromArray?: string;
31
- sortable?: boolean;
32
- align?: "left" | "center" | "right";
33
- customSort?: (a: TableItem, b: TableItem, ascendingOrder: boolean) => number;
34
- customHeader?: (header: BaseTableHeader) => ReactNode;
35
- customRender?: (item: TableItem, header: BaseTableHeader, fromArrayData?: {
36
- index: number;
37
- }, isDisabled?: boolean) => ReactNode;
38
- }
@@ -1,8 +0,0 @@
1
- export default interface CellCoordinate {
2
- rowIndex: number;
3
- columnIndex: number;
4
- fromArrayData?: {
5
- index: number;
6
- fromArray: string;
7
- };
8
- }
@@ -1,10 +0,0 @@
1
- export default interface CommentData {
2
- propertyId: string;
3
- value: unknown;
4
- date: Date;
5
- formatDateFunction?: (date: Date) => string;
6
- author?: string;
7
- commentId?: number;
8
- columnId?: string;
9
- text: string;
10
- }
@@ -1,10 +0,0 @@
1
- import type BaseTableHeader from "./BaseTableHeaders";
2
- import type CellCoordinate from "./CellCordinate";
3
- import type TableItem from "./TableItem";
4
- export default interface ContextMenu {
5
- x: number;
6
- y: number;
7
- header: BaseTableHeader;
8
- item?: TableItem;
9
- cellCoordinate?: CellCoordinate;
10
- }
@@ -1,12 +0,0 @@
1
- import type CellCoordinate from "./CellCordinate";
2
- import type TableItem from "./TableItem";
3
- export default interface ContextMenuAction {
4
- icon?: string;
5
- iconColor?: string;
6
- text: string;
7
- onClick: (event: React.MouseEvent, item?: TableItem, itemCoordinates?: CellCoordinate) => void;
8
- groupName?: string;
9
- disabled?: boolean;
10
- subActions?: ContextMenuAction[];
11
- customRender?: () => React.ReactNode;
12
- }
@@ -1,15 +0,0 @@
1
- export default interface DialogItem {
2
- id: string;
3
- title: string;
4
- position: {
5
- x: number;
6
- y: number;
7
- };
8
- iconPath?: string;
9
- iconColor?: string;
10
- width?: number;
11
- height?: number;
12
- minHeight?: number;
13
- minWidth?: number;
14
- dialogImplementation: React.ReactNode;
15
- }
@@ -1,7 +0,0 @@
1
- export default interface GroupInfo {
2
- isGroup: boolean;
3
- groupName: string;
4
- isCollapsed?: boolean;
5
- masterGroupName?: string;
6
- linkedGroupNames?: string[];
7
- }
@@ -1,7 +0,0 @@
1
- import { type CSSProperties } from "react";
2
- export default interface HighlightCondition {
3
- propertyId: string;
4
- value: unknown;
5
- style: CSSProperties;
6
- columnId?: string;
7
- }
@@ -1,7 +0,0 @@
1
- import type GroupInfo from "./GroupInfo";
2
- import type TableItem from "./TableItem";
3
- export default interface ItemWithGroupInfo extends GroupInfo {
4
- isGroup: false;
5
- rowIndex: number;
6
- item: TableItem;
7
- }
@@ -1,4 +0,0 @@
1
- export default interface LinkedGroup {
2
- master: string;
3
- linked: string[];
4
- }
@@ -1,4 +0,0 @@
1
- export default interface TableConfiguration {
2
- defaultSortBy?: string;
3
- defaultSortDesc?: boolean;
4
- }
@@ -1,4 +0,0 @@
1
- export default interface TableItem {
2
- [key: string]: string | number | Array<any> | undefined;
3
- section?: string;
4
- }
@@ -1,21 +0,0 @@
1
- import { type CSSProperties } from "react";
2
- import "./BaseTableCell.css";
3
- import type TableItem from "../models/TableItem";
4
- import type CommentData from "../models/CommentData";
5
- import type BaseTableHeader from "../models/BaseTableHeaders";
6
- export interface BaseTableCellProps {
7
- header: BaseTableHeader;
8
- item: TableItem;
9
- rowIndex: number;
10
- columnIndex: number;
11
- rowSpan?: number;
12
- comments?: CommentData[];
13
- style?: CSSProperties;
14
- fromArrayData?: {
15
- fromArray: string;
16
- index: number;
17
- };
18
- isDisabled: boolean;
19
- }
20
- declare const BaseTableCell: React.FC<BaseTableCellProps>;
21
- export default BaseTableCell;
@@ -1,8 +0,0 @@
1
- import type TableItem from "../models/TableItem";
2
- interface IndexCellProps {
3
- item: TableItem;
4
- rowIndex: number;
5
- rowSpan: number;
6
- }
7
- declare const IndexCell: React.FC<IndexCellProps>;
8
- export default IndexCell;
@@ -1,16 +0,0 @@
1
- import type BaseTableHeader from "../models/BaseTableHeaders";
2
- import type CellCoordinate from "../models/CellCordinate";
3
- import type TableItem from "../models/TableItem";
4
- export declare const getDataToCopyForCell: (cellCoordinate: CellCoordinate, expandedSelection: CellCoordinate[], headers: BaseTableHeader[], item: TableItem, cellValue: any) => {
5
- value: any;
6
- headerId: string;
7
- }[];
8
- export declare const getSelectionStructure: (expandedSelection: CellCoordinate[], headers: BaseTableHeader[]) => BaseTableHeader[];
9
- export declare const isClipboardDataCompatible: (clipboardData: {
10
- value: any;
11
- headerId: string;
12
- }[], selectionStructure: {
13
- value: any;
14
- headerId: string;
15
- }[]) => boolean;
16
- export declare const canPasteValue: (sourceValue: any, sourceHeaderId: string, targetHeader: BaseTableHeader, processedLeafHeaders: BaseTableHeader[]) => boolean;
@@ -1,13 +0,0 @@
1
- import type BaseTableHeader from "../../models/BaseTableHeaders";
2
- interface ListCellProps {
3
- inputRef: React.RefObject<HTMLInputElement>;
4
- header: BaseTableHeader;
5
- value?: string;
6
- options: string[];
7
- onSelect: (value: string) => void;
8
- onEnter: (value: string) => void;
9
- disabled?: boolean;
10
- hideOptions?: boolean;
11
- }
12
- export default function ListCell(props: Readonly<ListCellProps>): import("react/jsx-runtime").JSX.Element;
13
- export {};
@@ -1,11 +0,0 @@
1
- interface NumberCellProps {
2
- id: string;
3
- cellValue: string | number | null | undefined;
4
- initialValue?: string;
5
- inputRef: React.RefObject<HTMLInputElement> | null;
6
- onBlur?: (e: React.ChangeEvent<HTMLInputElement>) => void;
7
- onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
8
- disabled?: boolean;
9
- }
10
- export default function NumberCell(props: Readonly<NumberCellProps>): import("react/jsx-runtime").JSX.Element;
11
- export {};
@@ -1,11 +0,0 @@
1
- interface ListCellProps {
2
- onClick: (option: string, isOptionToAdd?: boolean) => void;
3
- value: string;
4
- text: string;
5
- isSelected: boolean;
6
- italic?: boolean;
7
- optionKey: string;
8
- isOptionToAdd?: boolean;
9
- }
10
- export default function OptionList(props: Readonly<ListCellProps>): import("react/jsx-runtime").JSX.Element;
11
- export {};
@@ -1 +0,0 @@
1
- export declare const formatNumber: (value: number | string, precision?: number) => string;
@@ -1,13 +0,0 @@
1
- import { FilterTypes } from "../../../enum/FilterTypes";
2
- interface TableFilterProps {
3
- show: boolean;
4
- tableRef?: React.RefObject<HTMLTableElement | null>;
5
- headerId: string;
6
- filterType: FilterTypes;
7
- items: string[] | number[];
8
- filterButtonRef: React.RefObject<HTMLButtonElement | null>;
9
- wrapperRef: React.RefObject<HTMLDivElement | null>;
10
- onShowOrHide: (show: boolean) => void;
11
- }
12
- declare function FilterDropdown(props: Readonly<TableFilterProps>): import("react/jsx-runtime").JSX.Element;
13
- export default FilterDropdown;
@@ -1,17 +0,0 @@
1
- import { FilterTypes } from "../../../enum/FilterTypes";
2
- import type ActiveTableFilter from "../models/ActiveTableFilter";
3
- import type { NumberCondition } from "./filterImplementations/NumberFilter/NumberFilter";
4
- interface TableFilterProps {
5
- show: boolean;
6
- currentFilter?: ActiveTableFilter;
7
- tableRef?: React.RefObject<HTMLTableElement | null>;
8
- filterName: string;
9
- headerId: string;
10
- filterType: FilterTypes;
11
- items: string[] | number[];
12
- itemsToHide: string[] | number[];
13
- onShowOrHide: (show: boolean) => void;
14
- onSetFilter: (id: string, valueToFilter: string[] | number[], numberCondition?: NumberCondition[]) => void;
15
- }
16
- declare function TableFilter(props: Readonly<TableFilterProps>): import("react/jsx-runtime").JSX.Element;
17
- export default TableFilter;
@@ -1,10 +0,0 @@
1
- import type { NumberCondition } from "./NumberFilter";
2
- interface NumberConditionProps {
3
- numberCondition: NumberCondition;
4
- isNew: boolean;
5
- immediatApply?: boolean;
6
- deleteCondition?: (condition: NumberCondition) => void;
7
- updateCondition: (condition: NumberCondition) => void;
8
- }
9
- declare function NumberConditionItem(props: Readonly<NumberConditionProps>): import("react/jsx-runtime").JSX.Element;
10
- export default NumberConditionItem;
@@ -1,16 +0,0 @@
1
- import { FilterTypes } from "../../../../../enum/FilterTypes";
2
- interface NumberFilterProps {
3
- headerId: string;
4
- filterType: FilterTypes;
5
- items: string[] | number[];
6
- onShowOrHide: (show: boolean) => void;
7
- }
8
- export type Operator = "=" | ">" | "<" | ">=" | "<=" | "between";
9
- export interface NumberCondition {
10
- id: string;
11
- operator: Operator;
12
- value1: number;
13
- value2?: number;
14
- }
15
- declare function NumberFilter(props: Readonly<NumberFilterProps>): import("react/jsx-runtime").JSX.Element;
16
- export default NumberFilter;
@@ -1,9 +0,0 @@
1
- import { FilterTypes } from "../../../../enum/FilterTypes";
2
- interface TextFilterProps {
3
- headerId: string;
4
- filterType: FilterTypes;
5
- items: string[] | number[];
6
- onShowOrHide: (show: boolean) => void;
7
- }
8
- declare function TextFilter(props: Readonly<TextFilterProps>): import("react/jsx-runtime").JSX.Element;
9
- export default TextFilter;
@@ -1,10 +0,0 @@
1
- import type CellCoordinate from "../models/CellCordinate";
2
- import type TableItem from "../models/TableItem";
3
- import type BaseTableHeader from "../models/BaseTableHeaders";
4
- type ArrowKey = "ArrowUp" | "ArrowDown" | "ArrowLeft" | "ArrowRight";
5
- declare const calculateSelectedCellAndExpandedSelection: (e: React.KeyboardEvent, selectedCell: CellCoordinate | undefined, expandedSelection: CellCoordinate[], columnsCount: number, rowsCount: number, processedLeafHeaders: BaseTableHeader[], selectedItem?: TableItem) => {
6
- newSelectedCell: CellCoordinate | undefined;
7
- newExpandedSelection: CellCoordinate[];
8
- };
9
- export declare function expandSelectionWithArrow(selectedCell: CellCoordinate | undefined, expandedSelection: CellCoordinate[], arrowKey: ArrowKey): CellCoordinate[];
10
- export default calculateSelectedCellAndExpandedSelection;
@@ -1,7 +0,0 @@
1
- import type ActiveTableFilter from "../models/ActiveTableFilter";
2
- import type BaseTableHeader from "../models/BaseTableHeaders";
3
- import type TableItem from "../models/TableItem";
4
- export declare const NBSP = "\u00A0";
5
- export declare const filterItems: (items: TableItem[], filters: ActiveTableFilter[]) => TableItem[];
6
- export declare const sortItems: (items: TableItem[], headers: BaseTableHeader[], currentSortType: "asc" | "desc", sortBy: string | undefined) => TableItem[];
7
- export declare const tryToConvertToNumber: (item: any) => any;
@@ -1,5 +0,0 @@
1
- import type { CSSProperties } from "react";
2
- import type HighlightCondition from "../models/HighlightCondition";
3
- import type TableItem from "../models/TableItem";
4
- export declare const getCellHighlightConditions: (rowConditions: HighlightCondition[], columnId: string) => CSSProperties;
5
- export declare const getRowHighlightConditions: (row: TableItem, highlightConditions: HighlightCondition[]) => HighlightCondition[];
@@ -1,7 +0,0 @@
1
- declare const ColorPicker: ({ initialColor, applyOpacity, onColorChange, onClose, }: {
2
- initialColor?: string;
3
- applyOpacity?: number;
4
- onColorChange: (color: string) => void;
5
- onClose?: () => void;
6
- }) => import("react/jsx-runtime").JSX.Element;
7
- export default ColorPicker;
@@ -1 +0,0 @@
1
- export declare const TABLE_ID = "main-base-table";
@@ -1,8 +0,0 @@
1
- export declare enum DateUnits {
2
- YEARS = "Years",
3
- MONTHS = "Months",
4
- WEEKS = "Weeks",
5
- DAYS = "Days",
6
- HOURS = "Hours",
7
- MINUTES = "Minutes"
8
- }
@@ -1,4 +0,0 @@
1
- export declare enum FilterTypes {
2
- STRING = "string",
3
- NUMBER = "number"
4
- }
@@ -1,2 +0,0 @@
1
- import { type RefObject } from "react";
2
- export default function useClickOutside(ref: RefObject<HTMLElement | null> | RefObject<HTMLElement>[], callback: () => void): void;
@@ -1,7 +0,0 @@
1
- export { default as BaseTable } from "./components/BaseTable/BaseTableWithContext";
2
- import ActiveTableFilter from "./components/BaseTable/models/ActiveTableFilter";
3
- export type { ActiveTableFilter };
4
- import BaseTableHeader from "./components/BaseTable/models/BaseTableHeaders";
5
- export type { BaseTableHeader };
6
- import TableConfiguration from "./components/BaseTable/models/TableConfiguration";
7
- export type { TableConfiguration };
@@ -1 +0,0 @@
1
- import "./index.css";
@@ -1,24 +0,0 @@
1
- interface ClipboardState {
2
- clipboardData: {
3
- value: any;
4
- headerId: string;
5
- }[];
6
- actions: {
7
- setClipboardData: (data: {
8
- value: any;
9
- headerId: string;
10
- }[]) => void;
11
- };
12
- }
13
- export declare const useClipboardStore: import("zustand").UseBoundStore<import("zustand").StoreApi<ClipboardState>>;
14
- export declare const useClipboardData: () => {
15
- value: any;
16
- headerId: string;
17
- }[];
18
- export declare const useClipboardActions: () => {
19
- setClipboardData: (data: {
20
- value: any;
21
- headerId: string;
22
- }[]) => void;
23
- };
24
- export {};