@neo4j-ndl/react 2.0.0-alpha-e609471 → 2.0.0-alpha-5e223d7
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/lib/NOTICE.txt +2 -0
- package/lib/cjs/accordion/Accordion.js +6 -5
- package/lib/cjs/accordion/Accordion.js.map +1 -1
- package/lib/cjs/banner/Banner.js +9 -6
- package/lib/cjs/banner/Banner.js.map +1 -1
- package/lib/cjs/checkbox/Checkbox.js.map +1 -1
- package/lib/cjs/context-menu/ContextMenu.js +30 -16
- package/lib/cjs/context-menu/ContextMenu.js.map +1 -1
- package/lib/cjs/data-grid/Components.js +364 -0
- package/lib/cjs/data-grid/Components.js.map +1 -0
- package/lib/cjs/data-grid/DataGrid.js +98 -0
- package/lib/cjs/data-grid/DataGrid.js.map +1 -0
- package/lib/cjs/{table-deprecated/hooks/hookCallbackTypes.js → data-grid/DataGridContext.js} +12 -1
- package/lib/cjs/data-grid/DataGridContext.js.map +1 -0
- package/lib/cjs/data-grid/helpers.js +94 -0
- package/lib/cjs/data-grid/helpers.js.map +1 -0
- package/lib/cjs/{table-deprecated → data-grid}/index.js +19 -6
- package/lib/cjs/data-grid/index.js.map +1 -0
- package/lib/cjs/dialog/Dialog.js +4 -3
- package/lib/cjs/dialog/Dialog.js.map +1 -1
- package/lib/cjs/dropdown/Overrides.js +1 -1
- package/lib/cjs/dropdown/Overrides.js.map +1 -1
- package/lib/cjs/{drag-and-drop/DragAndDrop.js → dropzone/Dropzone.js} +7 -14
- package/lib/cjs/dropzone/Dropzone.js.map +1 -0
- package/lib/cjs/dropzone/icons/CSV-file.js.map +1 -0
- package/lib/cjs/dropzone/icons/Cloud.js +27 -0
- package/lib/cjs/dropzone/icons/Cloud.js.map +1 -0
- package/lib/cjs/{drag-and-drop → dropzone}/icons/File.js +1 -1
- package/lib/cjs/dropzone/icons/File.js.map +1 -0
- package/lib/cjs/{drag-and-drop → dropzone}/icons/InvalidFile.js +1 -1
- package/lib/cjs/dropzone/icons/InvalidFile.js.map +1 -0
- package/lib/cjs/{drag-and-drop → dropzone}/index.js +3 -3
- package/lib/cjs/dropzone/index.js.map +1 -0
- package/lib/cjs/index.js +4 -3
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/modal/Modal.js +5 -18
- package/lib/cjs/modal/Modal.js.map +1 -1
- package/lib/cjs/popover/Popover.js +7 -3
- package/lib/cjs/popover/Popover.js.map +1 -1
- package/lib/cjs/{view-selector/ViewSelector.js → segmented-control/SegmentedControl.js} +20 -13
- package/lib/cjs/segmented-control/SegmentedControl.js.map +1 -0
- package/lib/cjs/{table-deprecated/hooks → segmented-control}/index.js +1 -3
- package/lib/cjs/segmented-control/index.js.map +1 -0
- package/lib/cjs/side-navigation/SideNavigation.js +17 -31
- package/lib/cjs/side-navigation/SideNavigation.js.map +1 -1
- package/lib/cjs/table/Components.js +1 -3
- package/lib/cjs/table/Components.js.map +1 -1
- package/lib/cjs/table/Table.js +8 -0
- package/lib/cjs/table/Table.js.map +1 -1
- package/lib/cjs/tabs/Tabs.js +15 -4
- package/lib/cjs/tabs/Tabs.js.map +1 -1
- package/lib/cjs/theme/ThemeProvider.js +99 -0
- package/lib/cjs/theme/ThemeProvider.js.map +1 -0
- package/lib/cjs/{view-selector → theme}/index.js +1 -1
- package/lib/cjs/theme/index.js.map +1 -0
- package/lib/cjs/tip/Tip.js +2 -3
- package/lib/cjs/tip/Tip.js.map +1 -1
- package/lib/esm/accordion/Accordion.js +7 -8
- package/lib/esm/accordion/Accordion.js.map +1 -1
- package/lib/esm/banner/Banner.js +8 -4
- package/lib/esm/banner/Banner.js.map +1 -1
- package/lib/esm/checkbox/Checkbox.js.map +1 -1
- package/lib/esm/context-menu/ContextMenu.js +29 -15
- package/lib/esm/context-menu/ContextMenu.js.map +1 -1
- package/lib/esm/data-grid/Components.js +339 -0
- package/lib/esm/data-grid/Components.js.map +1 -0
- package/lib/esm/data-grid/DataGrid.js +92 -0
- package/lib/esm/data-grid/DataGrid.js.map +1 -0
- package/lib/esm/{drag-and-drop/index.js → data-grid/DataGridContext.js} +10 -2
- package/lib/esm/data-grid/DataGridContext.js.map +1 -0
- package/lib/esm/data-grid/helpers.js +88 -0
- package/lib/esm/data-grid/helpers.js.map +1 -0
- package/lib/esm/{table-deprecated → data-grid}/index.js +4 -2
- package/lib/esm/data-grid/index.js.map +1 -0
- package/lib/esm/dialog/Dialog.js +4 -3
- package/lib/esm/dialog/Dialog.js.map +1 -1
- package/lib/esm/dropdown/Overrides.js +1 -1
- package/lib/esm/dropdown/Overrides.js.map +1 -1
- package/lib/esm/{drag-and-drop/DragAndDrop.js → dropzone/Dropzone.js} +7 -14
- package/lib/esm/dropzone/Dropzone.js.map +1 -0
- package/lib/esm/dropzone/icons/CSV-file.js.map +1 -0
- package/lib/esm/dropzone/icons/Cloud.js +25 -0
- package/lib/esm/dropzone/icons/Cloud.js.map +1 -0
- package/lib/esm/dropzone/icons/File.js +25 -0
- package/lib/esm/dropzone/icons/File.js.map +1 -0
- package/lib/esm/dropzone/icons/InvalidFile.js +25 -0
- package/lib/esm/dropzone/icons/InvalidFile.js.map +1 -0
- package/lib/{types/table-deprecated/index.d.ts → esm/dropzone/index.js} +2 -2
- package/lib/esm/dropzone/index.js.map +1 -0
- package/lib/esm/index.js +4 -3
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/modal/Modal.js +6 -18
- package/lib/esm/modal/Modal.js.map +1 -1
- package/lib/esm/popover/Popover.js +7 -3
- package/lib/esm/popover/Popover.js.map +1 -1
- package/lib/esm/{view-selector/ViewSelector.js → segmented-control/SegmentedControl.js} +20 -13
- package/lib/esm/segmented-control/SegmentedControl.js.map +1 -0
- package/lib/esm/segmented-control/index.js +22 -0
- package/lib/esm/segmented-control/index.js.map +1 -0
- package/lib/esm/side-navigation/SideNavigation.js +16 -7
- package/lib/esm/side-navigation/SideNavigation.js.map +1 -1
- package/lib/esm/table/Components.js +1 -3
- package/lib/esm/table/Components.js.map +1 -1
- package/lib/esm/table/Table.js +8 -0
- package/lib/esm/table/Table.js.map +1 -1
- package/lib/esm/tabs/Tabs.js +15 -4
- package/lib/esm/tabs/Tabs.js.map +1 -1
- package/lib/esm/theme/ThemeProvider.js +68 -0
- package/lib/esm/theme/ThemeProvider.js.map +1 -0
- package/lib/esm/{view-selector → theme}/index.js +1 -1
- package/lib/esm/theme/index.js.map +1 -0
- package/lib/esm/tip/Tip.js +2 -3
- package/lib/esm/tip/Tip.js.map +1 -1
- package/lib/types/accordion/Accordion.d.ts +7 -6
- package/lib/types/banner/Banner.d.ts +9 -5
- package/lib/types/context-menu/ContextMenu.d.ts +16 -12
- package/lib/types/data-grid/Components.d.ts +94 -0
- package/lib/types/data-grid/DataGrid.d.ts +90 -0
- package/lib/types/data-grid/DataGridContext.d.ts +62 -0
- package/lib/types/{table-deprecated → data-grid}/helpers.d.ts +15 -21
- package/lib/types/{table-deprecated/hooks → data-grid}/index.d.ts +5 -3
- package/lib/types/dialog/Dialog.d.ts +1 -1
- package/lib/types/{drag-and-drop/DragAndDrop.d.ts → dropzone/Dropzone.d.ts} +4 -11
- package/lib/types/{drag-and-drop → dropzone}/index.d.ts +1 -1
- package/lib/types/helpers/forwardRef.d.ts +6 -0
- package/lib/types/index.d.ts +4 -3
- package/lib/types/modal/Modal.d.ts +13 -6
- package/lib/types/popover/Popover.d.ts +8 -2
- package/lib/types/{view-selector/ViewSelector.d.ts → segmented-control/SegmentedControl.d.ts} +13 -19
- package/lib/{esm/table-deprecated/hooks/hookCallbackTypes.js → types/segmented-control/index.d.ts} +1 -2
- package/lib/types/side-navigation/SideNavigation.d.ts +10 -9
- package/lib/types/table/Table.d.ts +4 -0
- package/lib/types/tabs/Tabs.d.ts +5 -4
- package/lib/types/theme/ThemeProvider.d.ts +54 -0
- package/lib/types/{view-selector → theme}/index.d.ts +1 -1
- package/package.json +2 -2
- package/lib/cjs/drag-and-drop/DragAndDrop.js.map +0 -1
- package/lib/cjs/drag-and-drop/icons/CSV-file.js.map +0 -1
- package/lib/cjs/drag-and-drop/icons/Cloud.js +0 -27
- package/lib/cjs/drag-and-drop/icons/Cloud.js.map +0 -1
- package/lib/cjs/drag-and-drop/icons/File.js.map +0 -1
- package/lib/cjs/drag-and-drop/icons/InvalidFile.js.map +0 -1
- package/lib/cjs/drag-and-drop/index.js.map +0 -1
- package/lib/cjs/table-deprecated/Table.js +0 -157
- package/lib/cjs/table-deprecated/Table.js.map +0 -1
- package/lib/cjs/table-deprecated/TableNavigation.js +0 -51
- package/lib/cjs/table-deprecated/TableNavigation.js.map +0 -1
- package/lib/cjs/table-deprecated/helpers.js +0 -123
- package/lib/cjs/table-deprecated/helpers.js.map +0 -1
- package/lib/cjs/table-deprecated/hooks/hookCallbackTypes.js.map +0 -1
- package/lib/cjs/table-deprecated/hooks/index.js.map +0 -1
- package/lib/cjs/table-deprecated/hooks/useMultiRowSelect.js +0 -84
- package/lib/cjs/table-deprecated/hooks/useMultiRowSelect.js.map +0 -1
- package/lib/cjs/table-deprecated/hooks/useSingleRowSelect.js +0 -61
- package/lib/cjs/table-deprecated/hooks/useSingleRowSelect.js.map +0 -1
- package/lib/cjs/table-deprecated/index.js.map +0 -1
- package/lib/cjs/view-selector/ViewSelector.js.map +0 -1
- package/lib/cjs/view-selector/index.js.map +0 -1
- package/lib/esm/drag-and-drop/DragAndDrop.js.map +0 -1
- package/lib/esm/drag-and-drop/icons/CSV-file.js.map +0 -1
- package/lib/esm/drag-and-drop/icons/Cloud.js +0 -25
- package/lib/esm/drag-and-drop/icons/Cloud.js.map +0 -1
- package/lib/esm/drag-and-drop/icons/File.js +0 -25
- package/lib/esm/drag-and-drop/icons/File.js.map +0 -1
- package/lib/esm/drag-and-drop/icons/InvalidFile.js +0 -25
- package/lib/esm/drag-and-drop/icons/InvalidFile.js.map +0 -1
- package/lib/esm/drag-and-drop/index.js.map +0 -1
- package/lib/esm/table-deprecated/Table.js +0 -150
- package/lib/esm/table-deprecated/Table.js.map +0 -1
- package/lib/esm/table-deprecated/TableNavigation.js +0 -44
- package/lib/esm/table-deprecated/TableNavigation.js.map +0 -1
- package/lib/esm/table-deprecated/helpers.js +0 -116
- package/lib/esm/table-deprecated/helpers.js.map +0 -1
- package/lib/esm/table-deprecated/hooks/hookCallbackTypes.js.map +0 -1
- package/lib/esm/table-deprecated/hooks/index.js +0 -24
- package/lib/esm/table-deprecated/hooks/index.js.map +0 -1
- package/lib/esm/table-deprecated/hooks/useMultiRowSelect.js +0 -82
- package/lib/esm/table-deprecated/hooks/useMultiRowSelect.js.map +0 -1
- package/lib/esm/table-deprecated/hooks/useSingleRowSelect.js +0 -57
- package/lib/esm/table-deprecated/hooks/useSingleRowSelect.js.map +0 -1
- package/lib/esm/table-deprecated/index.js.map +0 -1
- package/lib/esm/view-selector/ViewSelector.js.map +0 -1
- package/lib/esm/view-selector/index.js.map +0 -1
- package/lib/types/table-deprecated/Table.d.ts +0 -76
- package/lib/types/table-deprecated/TableNavigation.d.ts +0 -38
- package/lib/types/table-deprecated/hooks/hookCallbackTypes.d.ts +0 -27
- package/lib/types/table-deprecated/hooks/useMultiRowSelect.d.ts +0 -42
- package/lib/types/table-deprecated/hooks/useSingleRowSelect.d.ts +0 -37
- /package/lib/cjs/{drag-and-drop → dropzone}/icons/CSV-file.js +0 -0
- /package/lib/esm/{drag-and-drop → dropzone}/icons/CSV-file.js +0 -0
- /package/lib/types/{drag-and-drop → dropzone}/icons/CSV-file.d.ts +0 -0
- /package/lib/types/{drag-and-drop → dropzone}/icons/Cloud.d.ts +0 -0
- /package/lib/types/{drag-and-drop → dropzone}/icons/File.d.ts +0 -0
- /package/lib/types/{drag-and-drop → dropzone}/icons/InvalidFile.d.ts +0 -0
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* You should have received a copy of the GNU General Public License
|
|
19
19
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
import React from 'react';
|
|
22
22
|
import { type ElementBase } from '../helpers';
|
|
23
23
|
export type AccordionItemId = string | number;
|
|
24
24
|
export interface AccordionBase extends ElementBase<HTMLDivElement> {
|
|
@@ -39,7 +39,6 @@ interface IsMultiple<T extends AccordionItemId> {
|
|
|
39
39
|
type AccordionIsMultiple<T extends AccordionItemId> = AccordionBase & IsMultiple<T>;
|
|
40
40
|
type AccordionIsNotMultiple<T extends AccordionItemId> = AccordionBase & IsNotMultiple<T>;
|
|
41
41
|
export type AccordionProps<T extends AccordionItemId> = AccordionIsMultiple<T> | AccordionIsNotMultiple<T>;
|
|
42
|
-
declare const Accordion: <T extends AccordionItemId>(props: AccordionProps<T> & import("react").RefAttributes<unknown>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
|
|
43
42
|
export type AccordionArrowPosition = 'left' | 'right';
|
|
44
43
|
export interface AccordionItemProps<T extends AccordionItemId> extends ElementBase<HTMLDivElement> {
|
|
45
44
|
/** The component item id. */
|
|
@@ -53,8 +52,10 @@ export interface AccordionItemProps<T extends AccordionItemId> extends ElementBa
|
|
|
53
52
|
/** If the component item is disabled. */
|
|
54
53
|
disabled?: boolean;
|
|
55
54
|
}
|
|
56
|
-
declare const
|
|
57
|
-
Item:
|
|
55
|
+
declare const Accordion: (<T extends AccordionItemId>(props: AccordionProps<T> & React.RefAttributes<unknown>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & {
|
|
56
|
+
Item: {
|
|
57
|
+
<T_1 extends AccordionItemId>({ itemId, children, title, className, arrowPosition, disabled, onExpandedChange, ...restProps }: AccordionItemProps<T_1>): import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
displayName: string;
|
|
59
|
+
};
|
|
58
60
|
};
|
|
59
|
-
export {
|
|
60
|
-
export default Accordion;
|
|
61
|
+
export { Accordion };
|
|
@@ -27,7 +27,7 @@ import { type ElementBase } from '../helpers';
|
|
|
27
27
|
*
|
|
28
28
|
*
|
|
29
29
|
*/
|
|
30
|
-
export interface
|
|
30
|
+
export interface BannerActionsProps extends React.HTMLProps<HTMLAnchorElement> {
|
|
31
31
|
/** Label of the action item */
|
|
32
32
|
label: string;
|
|
33
33
|
/** Event handler when the action button is clicked. If set, the element is rendered as `button` */
|
|
@@ -54,7 +54,7 @@ export interface BannerCommonProps extends Omit<ElementBase, 'title'> {
|
|
|
54
54
|
/** Shows status icon. Icon is automatically picked based on `type` value */
|
|
55
55
|
icon?: boolean;
|
|
56
56
|
/** Shows Action buttons in the footer */
|
|
57
|
-
actions?:
|
|
57
|
+
actions?: BannerActionsProps[];
|
|
58
58
|
/** Adds shadow */
|
|
59
59
|
floating?: boolean;
|
|
60
60
|
}
|
|
@@ -71,6 +71,10 @@ type NonCloseableBannerProps = {
|
|
|
71
71
|
type BannerCloseProps = CloseableBannerProps | NonCloseableBannerProps;
|
|
72
72
|
export type BannerProps = BannerCommonProps & BannerCloseProps;
|
|
73
73
|
export type BannerType = 'info' | 'success' | 'warning' | 'danger';
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
declare const Banner: React.ForwardRefExoticComponent<BannerProps & React.RefAttributes<HTMLDivElement>> & {
|
|
75
|
+
Actions: {
|
|
76
|
+
({ label, ...props }: BannerActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
77
|
+
displayName: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
export { Banner };
|
|
@@ -39,13 +39,11 @@ export interface ContextMenuProps extends PopoverProps {
|
|
|
39
39
|
/** Whether the menu is nested. Internal prop provided when nesting menu elements */
|
|
40
40
|
nested?: boolean;
|
|
41
41
|
}
|
|
42
|
-
declare const Menu: React.ForwardRefExoticComponent<Omit<ContextMenuProps, "ref"> & React.RefAttributes<unknown>>;
|
|
43
42
|
interface MenuItemsProps extends ElementBase {
|
|
44
43
|
children: React.ReactNode | string;
|
|
45
44
|
/** Additional classes */
|
|
46
45
|
className?: string;
|
|
47
46
|
}
|
|
48
|
-
export declare const MenuItems: React.ForwardRefExoticComponent<Omit<MenuItemsProps, "ref"> & React.RefAttributes<unknown>>;
|
|
49
47
|
interface StandardMenuItemProps extends Omit<ElementBase, 'title' | 'onClick' | 'children'> {
|
|
50
48
|
/** Item title text */
|
|
51
49
|
title: string | React.ReactNode;
|
|
@@ -65,7 +63,6 @@ interface StandardMenuItemProps extends Omit<ElementBase, 'title' | 'onClick' |
|
|
|
65
63
|
/** Enforces no children on standard menu item. Overridden by nested menu item*/
|
|
66
64
|
children?: never;
|
|
67
65
|
}
|
|
68
|
-
export declare const MenuItem: React.ForwardRefExoticComponent<(Omit<StandardMenuItemProps, "ref"> | Omit<NestedMenuItemProps, "ref">) & React.RefAttributes<unknown>>;
|
|
69
66
|
declare const StandardMenuItem: React.ForwardRefExoticComponent<Omit<StandardMenuItemProps, "ref"> & React.RefAttributes<unknown>>;
|
|
70
67
|
interface MenuHeaderProps extends Omit<ElementBase, 'title'> {
|
|
71
68
|
/** Header title text */
|
|
@@ -75,17 +72,24 @@ interface MenuHeaderProps extends Omit<ElementBase, 'title'> {
|
|
|
75
72
|
/** Additional classes */
|
|
76
73
|
className?: string;
|
|
77
74
|
}
|
|
78
|
-
export declare const MenuHeader: React.ForwardRefExoticComponent<Omit<MenuHeaderProps, "ref"> & React.RefAttributes<unknown>>;
|
|
79
|
-
declare const MenuNamespace: React.ForwardRefExoticComponent<Omit<ContextMenuProps, "ref"> & React.RefAttributes<unknown>> & {
|
|
80
|
-
Divider: () => import("react/jsx-runtime").JSX.Element;
|
|
81
|
-
Subheader: (props: {
|
|
82
|
-
title: string;
|
|
83
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
84
|
-
};
|
|
85
|
-
export { MenuNamespace as Menu };
|
|
86
75
|
type NestedMenuItemProps = Omit<React.ComponentProps<typeof StandardMenuItem>, 'children'> & {
|
|
87
76
|
children: ({ nestedMenuProps, }: {
|
|
88
77
|
nestedMenuProps: Pick<React.ComponentProps<typeof Menu>, 'className' | 'open' | 'anchorEl' | 'onClose' | 'onMouseLeave' | 'onKeyDown' | 'nested'>;
|
|
89
78
|
}) => JSX.Element;
|
|
90
79
|
};
|
|
91
|
-
|
|
80
|
+
declare const Menu: React.ForwardRefExoticComponent<Omit<ContextMenuProps, "ref"> & React.RefAttributes<unknown>> & {
|
|
81
|
+
Divider: {
|
|
82
|
+
(): import("react/jsx-runtime").JSX.Element;
|
|
83
|
+
displayName: string;
|
|
84
|
+
};
|
|
85
|
+
Subheader: {
|
|
86
|
+
(props: {
|
|
87
|
+
title: string;
|
|
88
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
89
|
+
displayName: string;
|
|
90
|
+
};
|
|
91
|
+
Header: React.ForwardRefExoticComponent<Omit<MenuHeaderProps, "ref"> & React.RefAttributes<unknown>>;
|
|
92
|
+
Item: React.ForwardRefExoticComponent<(Omit<StandardMenuItemProps, "ref"> | Omit<NestedMenuItemProps, "ref">) & React.RefAttributes<unknown>>;
|
|
93
|
+
Items: React.ForwardRefExoticComponent<Omit<MenuItemsProps, "ref"> & React.RefAttributes<unknown>>;
|
|
94
|
+
};
|
|
95
|
+
export { Menu };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) "Neo4j"
|
|
5
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
6
|
+
*
|
|
7
|
+
* This file is part of Neo4j.
|
|
8
|
+
*
|
|
9
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
10
|
+
* it under the terms of the GNU General Public License as published by
|
|
11
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
12
|
+
* (at your option) any later version.
|
|
13
|
+
*
|
|
14
|
+
* This program is distributed in the hope that it will be useful,
|
|
15
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
* GNU General Public License for more details.
|
|
18
|
+
*
|
|
19
|
+
* You should have received a copy of the GNU General Public License
|
|
20
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
+
*/
|
|
22
|
+
import { type RowData, type Row, type Cell, type Header as HeaderType, type CellContext, type SortDirection } from '@tanstack/react-table';
|
|
23
|
+
import { type ElementBase } from '../helpers';
|
|
24
|
+
import { Menu } from '../context-menu';
|
|
25
|
+
import { type ColumnAction } from './datagrid-types';
|
|
26
|
+
type MenuItemProps = React.ComponentProps<typeof Menu.Item>;
|
|
27
|
+
export declare const DEFAULT_SORT_ACTIONS: (cell: HeaderType<any, unknown>) => {
|
|
28
|
+
[key in SortDirection | 'default']: ColumnAction;
|
|
29
|
+
};
|
|
30
|
+
export interface CommonInnerProps<T = HTMLDivElement> {
|
|
31
|
+
/** Children are surfaced to allow easy overriding */
|
|
32
|
+
children?: React.ReactNode;
|
|
33
|
+
innerProps?: ElementBase<T>;
|
|
34
|
+
}
|
|
35
|
+
export interface ResizingBarProps<T extends RowData> extends CommonInnerProps<HTMLButtonElement> {
|
|
36
|
+
header: HeaderType<T, unknown>;
|
|
37
|
+
}
|
|
38
|
+
declare const ResizingBar: <T extends unknown>({ header, children, innerProps, }: ResizingBarProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
declare const Scrollable: ({ children, innerProps }: CommonInnerProps) => import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
declare const Header: ({ children, innerProps }: CommonInnerProps<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export interface ActionButtonProps {
|
|
42
|
+
action: ColumnAction;
|
|
43
|
+
children?: React.ReactNode;
|
|
44
|
+
innerProps?: MenuItemProps;
|
|
45
|
+
/** Callback provided to close the context menu */
|
|
46
|
+
onClose: () => void;
|
|
47
|
+
}
|
|
48
|
+
export declare const ActionButton: ({ action, children, onClose, innerProps, }: ActionButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
export interface RowActionCellProps<T extends RowData> {
|
|
50
|
+
cell?: CellContext<T, unknown>;
|
|
51
|
+
innerProps?: React.ComponentProps<typeof Menu>;
|
|
52
|
+
}
|
|
53
|
+
export declare const RowActionCell: <T extends unknown>({ cell, innerProps, }: RowActionCellProps<T>) => import("react/jsx-runtime").JSX.Element | null;
|
|
54
|
+
export interface ColumnControlsProps<T extends RowData> extends CommonInnerProps<HTMLDivElement> {
|
|
55
|
+
cell: HeaderType<T, unknown>;
|
|
56
|
+
}
|
|
57
|
+
export declare const ColumnControls: <T extends unknown>({ cell, children, innerProps, }: ColumnControlsProps<T>) => import("react/jsx-runtime").JSX.Element | null;
|
|
58
|
+
export interface HeaderCellProps<T> extends CommonInnerProps<HTMLDivElement> {
|
|
59
|
+
cell: HeaderType<T, unknown>;
|
|
60
|
+
}
|
|
61
|
+
declare const HeaderCell: <T extends unknown>({ cell, children, innerProps, }: HeaderCellProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
62
|
+
declare const Body: ({ children, innerProps }: CommonInnerProps<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
63
|
+
export interface BodyCellProps<T extends RowData> extends CommonInnerProps<HTMLDivElement> {
|
|
64
|
+
cell: Cell<T, unknown>;
|
|
65
|
+
}
|
|
66
|
+
declare const BodyCell: <T extends unknown>({ cell, children, innerProps, }: BodyCellProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
67
|
+
export interface BodyRowProps<T extends RowData> extends CommonInnerProps<HTMLDivElement> {
|
|
68
|
+
row: Row<T>;
|
|
69
|
+
}
|
|
70
|
+
declare const BodyRow: <T extends unknown>({ row, children, innerProps, }: BodyRowProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
71
|
+
export interface TableResultProps extends CommonInnerProps<HTMLSpanElement> {
|
|
72
|
+
manualPagination?: {
|
|
73
|
+
from: number;
|
|
74
|
+
to: number;
|
|
75
|
+
totalRows: number;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
declare const TableResults: ({ children, innerProps, manualPagination, }: TableResultProps) => import("react/jsx-runtime").JSX.Element;
|
|
79
|
+
declare const RowsPerPage: ({ children, innerProps, }: CommonInnerProps<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
80
|
+
export interface PaginationArrowButtonProps extends CommonInnerProps<HTMLButtonElement> {
|
|
81
|
+
action: 'previous' | 'next';
|
|
82
|
+
}
|
|
83
|
+
declare const PaginationArrowButton: ({ action, children, innerProps, }: PaginationArrowButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
84
|
+
export interface PaginationNumericButtonProps extends CommonInnerProps<HTMLButtonElement> {
|
|
85
|
+
currentIndex: number | string;
|
|
86
|
+
isSelected: boolean;
|
|
87
|
+
}
|
|
88
|
+
declare const PaginationNumericButton: ({ currentIndex, isSelected, children, innerProps, }: PaginationNumericButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
89
|
+
declare const PaginationNumericButtons: () => import("react/jsx-runtime").JSX.Element;
|
|
90
|
+
declare const Pagination: ({ children, innerProps, }: CommonInnerProps<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
91
|
+
declare const Navigation: ({ children, innerProps, }: CommonInnerProps<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
92
|
+
declare const LoadingPlaceholder: ({ children, innerProps, }: CommonInnerProps<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
93
|
+
declare const NoDataPlaceholder: ({ children, innerProps, }: CommonInnerProps<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
94
|
+
export { ResizingBar, Header, Body, BodyCell, BodyRow, HeaderCell, Navigation, TableResults, RowsPerPage, Pagination, PaginationNumericButtons, PaginationArrowButton, PaginationNumericButton, NoDataPlaceholder, LoadingPlaceholder, Scrollable, };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
/// <reference types="react" />
|
|
22
|
+
import { type ElementBase } from '../helpers';
|
|
23
|
+
import type { RowData, Table as DataGridType } from '@tanstack/react-table';
|
|
24
|
+
import { type DataGridComponentsInterface } from './DataGridContext';
|
|
25
|
+
export declare const DataGridComponents: {
|
|
26
|
+
ResizingBar: <T extends unknown>({ header, children, innerProps, }: import("./Components").ResizingBarProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
Header: ({ children, innerProps }: import("./Components").CommonInnerProps<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
Body: ({ children, innerProps }: import("./Components").CommonInnerProps<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
BodyCell: <T_1 extends unknown>({ cell, children, innerProps, }: import("./Components").BodyCellProps<T_1>) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
BodyRow: <T_2 extends unknown>({ row, children, innerProps, }: import("./Components").BodyRowProps<T_2>) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
HeaderCell: <T_3 extends unknown>({ cell, children, innerProps, }: import("./Components").HeaderCellProps<T_3>) => import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
ActionButton: ({ action, children, onClose, innerProps, }: import("./Components").ActionButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
ColumnControls: <T_4 extends unknown>({ cell, children, innerProps, }: import("./Components").ColumnControlsProps<T_4>) => import("react/jsx-runtime").JSX.Element | null;
|
|
34
|
+
Navigation: ({ children, innerProps, }: import("./Components").CommonInnerProps<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
TableResults: ({ children, innerProps, manualPagination, }: import("./Components").TableResultProps) => import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
RowsPerPage: ({ children, innerProps, }: import("./Components").CommonInnerProps<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
Pagination: ({ children, innerProps, }: import("./Components").CommonInnerProps<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
PaginationNumericButtons: () => import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
PaginationNumericButton: ({ currentIndex, isSelected, children, innerProps, }: import("./Components").PaginationNumericButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
PaginationArrowButton: ({ action, children, innerProps, }: import("./Components").PaginationArrowButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
LoadingPlaceholder: ({ children, innerProps, }: import("./Components").CommonInnerProps<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
NoDataPlaceholder: ({ children, innerProps, }: import("./Components").CommonInnerProps<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
Scrollable: ({ children, innerProps }: import("./Components").CommonInnerProps<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
};
|
|
45
|
+
declare enum BorderStyleEnum {
|
|
46
|
+
AllSides = "all-sides",
|
|
47
|
+
Horizontal = "horizontal",
|
|
48
|
+
None = "none"
|
|
49
|
+
}
|
|
50
|
+
export type BorderStyle = `${BorderStyleEnum}`;
|
|
51
|
+
declare enum HeaderStyleEnum {
|
|
52
|
+
Filled = "filled",
|
|
53
|
+
Clean = "clean"
|
|
54
|
+
}
|
|
55
|
+
export type HeaderStyle = `${HeaderStyleEnum}`;
|
|
56
|
+
export type DataGridProps<T extends RowData> = {
|
|
57
|
+
styling?: Partial<{
|
|
58
|
+
/** Alternate the background colour of rows */
|
|
59
|
+
zebraStriping: boolean;
|
|
60
|
+
/** Type of border that will be used */
|
|
61
|
+
borderStyle: BorderStyle;
|
|
62
|
+
/** If header should have styles or not (Aura example) */
|
|
63
|
+
headerStyle: HeaderStyle;
|
|
64
|
+
}>;
|
|
65
|
+
/** Resizing the width of columns */
|
|
66
|
+
isResizable?: boolean;
|
|
67
|
+
/** Enables table's loading state */
|
|
68
|
+
isLoading?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Enables keyboard navigation.
|
|
71
|
+
* To control keyboard navigation programmatically
|
|
72
|
+
* for edge cases, pass a `ref` to `tableNavRef`
|
|
73
|
+
* @see {@link https://github.com/konsalex/table-nav }
|
|
74
|
+
*/
|
|
75
|
+
isKeyboardNavigable?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Reference to the tableNav instance
|
|
78
|
+
* for programmatic control
|
|
79
|
+
* @see {@link https://github.com/konsalex/table-nav }
|
|
80
|
+
*/
|
|
81
|
+
tableNavRef?: React.RefObject<any>;
|
|
82
|
+
/** Table instance created from `useTable`*/
|
|
83
|
+
tableInstance: DataGridType<T>;
|
|
84
|
+
/** Table sub-component overrides */
|
|
85
|
+
components?: DataGridComponentsInterface<T>;
|
|
86
|
+
/** Root `div` props */
|
|
87
|
+
rootProps?: ElementBase<HTMLDivElement>;
|
|
88
|
+
};
|
|
89
|
+
declare const DataGrid: <T extends unknown>(props: DataGridProps<T> & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
|
|
90
|
+
export default DataGrid;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
/// <reference types="react" />
|
|
22
|
+
import type { RowData, Table as DataGridType } from '@tanstack/react-table';
|
|
23
|
+
import { type Body, type BodyCell, type BodyRow, type TableResults, type ResizingBar, type Navigation, type Header, type Pagination, type NoDataPlaceholder, type LoadingPlaceholder, type PaginationNumericButtons, type PaginationNumericButton, type HeaderCell, type PaginationArrowButton, type RowsPerPage, type ActionButton, type ColumnControls, type Scrollable } from './Components';
|
|
24
|
+
type Nullable<T> = T | null;
|
|
25
|
+
export interface DataGridComponentsInterface<T extends RowData> {
|
|
26
|
+
ResizingBar?: Nullable<typeof ResizingBar<T>>;
|
|
27
|
+
/**
|
|
28
|
+
* Header Section
|
|
29
|
+
*/
|
|
30
|
+
Header?: Nullable<typeof Header>;
|
|
31
|
+
HeaderCell?: Nullable<typeof HeaderCell<T>>;
|
|
32
|
+
ActionButton?: Nullable<typeof ActionButton>;
|
|
33
|
+
ColumnControls?: Nullable<typeof ColumnControls>;
|
|
34
|
+
/**
|
|
35
|
+
* Body Section
|
|
36
|
+
*/
|
|
37
|
+
Scrollable?: Nullable<typeof Scrollable>;
|
|
38
|
+
Body?: Nullable<typeof Body>;
|
|
39
|
+
BodyCell?: Nullable<typeof BodyCell<T>>;
|
|
40
|
+
BodyRow?: Nullable<typeof BodyRow<T>>;
|
|
41
|
+
LoadingPlaceholder?: Nullable<typeof LoadingPlaceholder>;
|
|
42
|
+
NoDataPlaceholder?: Nullable<typeof NoDataPlaceholder>;
|
|
43
|
+
/**
|
|
44
|
+
* Navigation Section
|
|
45
|
+
*/
|
|
46
|
+
Navigation?: Nullable<typeof Navigation>;
|
|
47
|
+
Pagination?: Nullable<typeof Pagination>;
|
|
48
|
+
PaginationArrowButton?: Nullable<typeof PaginationArrowButton>;
|
|
49
|
+
TableResults?: Nullable<typeof TableResults>;
|
|
50
|
+
RowsPerPage?: Nullable<typeof RowsPerPage>;
|
|
51
|
+
PaginationNumericButtons?: Nullable<typeof PaginationNumericButtons>;
|
|
52
|
+
PaginationNumericButton?: Nullable<typeof PaginationNumericButton>;
|
|
53
|
+
}
|
|
54
|
+
export interface DataGridContextType<T extends RowData> {
|
|
55
|
+
resizable: boolean;
|
|
56
|
+
tableProps: DataGridType<T>;
|
|
57
|
+
components: DataGridComponentsInterface<T>;
|
|
58
|
+
loading: boolean;
|
|
59
|
+
}
|
|
60
|
+
export declare const DataGridContext: import("react").Context<DataGridContextType<any>>;
|
|
61
|
+
export declare function useDataGridContext<T extends RowData>(): DataGridContextType<T>;
|
|
62
|
+
export {};
|
|
@@ -18,24 +18,7 @@
|
|
|
18
18
|
* You should have received a copy of the GNU General Public License
|
|
19
19
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
|
-
|
|
22
|
-
import { type TableResizerProps } from 'react-table';
|
|
23
|
-
/**
|
|
24
|
-
*
|
|
25
|
-
* React Table helper to display sorting icon
|
|
26
|
-
* Source:
|
|
27
|
-
* https://react-table.tanstack.com/docs/api/useSortBy#column-properties
|
|
28
|
-
*
|
|
29
|
-
*/
|
|
30
|
-
export declare const SortIcon: ({ isSortedDesc, ...props }: {
|
|
31
|
-
isSortedDesc: boolean | undefined;
|
|
32
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
33
|
-
export declare const ResizingBar: import("react").NamedExoticComponent<TableResizerProps>;
|
|
34
|
-
/**
|
|
35
|
-
* The left section of the bottom navigation
|
|
36
|
-
* that is showing the current page and how many results we can see
|
|
37
|
-
*/
|
|
38
|
-
export declare const TableResults: ({ pageIndex, pageLength, rowsLength, }: Record<'pageIndex' | 'pageLength' | 'rowsLength', number>) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
import { type Table, type ColumnDef } from '@tanstack/react-table';
|
|
39
22
|
/**
|
|
40
23
|
* Modified from here: https://gist.github.com/kottenator/9d936eb3e4e3c3e02598
|
|
41
24
|
*
|
|
@@ -45,7 +28,18 @@ export declare const TableResults: ({ pageIndex, pageLength, rowsLength, }: Reco
|
|
|
45
28
|
*/
|
|
46
29
|
export declare const userFriendlyPagination: (current: number, max: number) => (string | number)[];
|
|
47
30
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
31
|
+
* Simple helper to generate inline grid style
|
|
32
|
+
* to be responsive.
|
|
33
|
+
*
|
|
34
|
+
* Secret sauce:
|
|
35
|
+
* The last element takes an "auto" width, so it will
|
|
36
|
+
* fill the available space, and the result till be for 4 columns:
|
|
37
|
+
* minmax(min column1Sizepx,column1Sizepx) minmax(min column2Sizepx,column2Sizepx) ... minmax(columnNSizepx, auto)
|
|
38
|
+
*/
|
|
39
|
+
export declare const gridGenerator: <T extends unknown>(table: Table<T>) => string;
|
|
40
|
+
/**
|
|
41
|
+
* Check if the column is size constrained,
|
|
42
|
+
* so we can let the column's width grow with `flex-grow: 1`
|
|
43
|
+
* @param columnDef
|
|
50
44
|
*/
|
|
51
|
-
export declare const
|
|
45
|
+
export declare const isSizeConstrained: <T extends unknown>(columnDef: ColumnDef<T>) => boolean;
|
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
* You should have received a copy of the GNU General Public License
|
|
19
19
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
|
-
export
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
export { default as DataGrid, DataGridComponents } from './DataGrid';
|
|
22
|
+
import * as dataGridUtils from './helpers';
|
|
23
|
+
import { useDataGridContext } from './DataGridContext';
|
|
24
|
+
export { dataGridUtils, useDataGridContext };
|
|
25
|
+
export type * from './datagrid-types';
|
|
@@ -38,7 +38,7 @@ export interface DialogProps extends Omit<ModalProps, 'onClose'> {
|
|
|
38
38
|
onClose?: (e: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>, reason?: DialogCloseReason) => void;
|
|
39
39
|
}
|
|
40
40
|
export declare const Dialog: {
|
|
41
|
-
({ open, onClose, children, type,
|
|
41
|
+
({ open, onClose, children, type, size, disableCloseButton, ...restProps }: DialogProps): import("react/jsx-runtime").JSX.Element | null;
|
|
42
42
|
Actions: ({ children, className, ...rest }: DialogActionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
43
43
|
Header: ({ children, className, ...rest }: DialogHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
44
44
|
Subtitle: ({ children, className, ...rest }: DialogSubtitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -28,7 +28,7 @@ import { type ElementBase } from '../helpers';
|
|
|
28
28
|
*
|
|
29
29
|
*
|
|
30
30
|
*/
|
|
31
|
-
export interface
|
|
31
|
+
export interface DropzoneProps extends ElementBase<HTMLDivElement> {
|
|
32
32
|
/**
|
|
33
33
|
* See here - https://react-dropzone.js.org/#src. Don't use 'accept'
|
|
34
34
|
* if using custom file extensions as this option is broken.
|
|
@@ -39,7 +39,7 @@ export interface DragAndDropProps extends ElementBase<HTMLDivElement> {
|
|
|
39
39
|
supportedFilesDescription?: React.ReactNode | string;
|
|
40
40
|
/** Element to display when uploading the file. When passed, drag&drop zone is disabled */
|
|
41
41
|
loadingComponent?: React.ReactNode | string;
|
|
42
|
-
/** To be used when want to test loadingComponent UI without
|
|
42
|
+
/** To be used when want to test loadingComponent UI without actually dragging and uploading the files */
|
|
43
43
|
isTesting?: boolean;
|
|
44
44
|
/** Use when wanting a custom title. */
|
|
45
45
|
customTitle?: React.ReactNode | string;
|
|
@@ -48,12 +48,5 @@ export interface DragAndDropProps extends ElementBase<HTMLDivElement> {
|
|
|
48
48
|
/** The accepted file extensions for the Drag-and-Drop. */
|
|
49
49
|
acceptedFileExtensions?: string[];
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
*
|
|
54
|
-
* DragAndDrop Component
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*/
|
|
58
|
-
declare const DragAndDrop: (props: DragAndDropProps) => import("react/jsx-runtime").JSX.Element;
|
|
59
|
-
export default DragAndDrop;
|
|
51
|
+
declare const Dropzone: (props: DropzoneProps) => import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
export default Dropzone;
|
|
@@ -21,4 +21,10 @@
|
|
|
21
21
|
import { type ForwardedRef, type ReactElement, type RefAttributes } from 'react';
|
|
22
22
|
type ForwardRefType = <T, P = Record<string, never>>(render: (props: P, ref: ForwardedRef<T>) => ReactElement | null) => (props: P & RefAttributes<T>) => ReactElement | null;
|
|
23
23
|
export declare const forwardRef: ForwardRefType;
|
|
24
|
+
/**
|
|
25
|
+
* This type is to help retain the ForwardRefExoticComponent properties
|
|
26
|
+
* on a component when using our own custom generic forwardRef function.
|
|
27
|
+
* This type can be removed when our custom generic forwardRef is removed.
|
|
28
|
+
*/
|
|
29
|
+
export type RetainForwardRefProps<T> = React.ForwardRefExoticComponent<T & React.RefAttributes<unknown>>;
|
|
24
30
|
export {};
|
package/lib/types/index.d.ts
CHANGED
|
@@ -32,17 +32,18 @@ export * from './dialog';
|
|
|
32
32
|
export * from './modal';
|
|
33
33
|
export * from './loading-spinner';
|
|
34
34
|
export * from './tabs';
|
|
35
|
-
export * from './
|
|
35
|
+
export * from './segmented-control';
|
|
36
36
|
export * from './popover';
|
|
37
37
|
export * from './progress-bar';
|
|
38
|
-
export * from './table-deprecated';
|
|
39
38
|
export * from './table';
|
|
40
|
-
export * from './
|
|
39
|
+
export * from './dropzone';
|
|
40
|
+
export * from './data-grid';
|
|
41
41
|
export * from './text-input';
|
|
42
42
|
export * from './textarea';
|
|
43
43
|
export * from './text-link';
|
|
44
44
|
export * from './dropdown';
|
|
45
45
|
export * from './tag';
|
|
46
|
+
export * from './theme';
|
|
46
47
|
export * from './widget';
|
|
47
48
|
export * from './wizard';
|
|
48
49
|
export * from './graph-label';
|
|
@@ -18,18 +18,25 @@
|
|
|
18
18
|
* You should have received a copy of the GNU General Public License
|
|
19
19
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
|
-
import React from 'react';
|
|
22
|
-
import { type ElementBase } from '../helpers';
|
|
21
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
23
22
|
export declare enum ModalCloseReason {
|
|
24
23
|
BACKDROP_CLICK = "backdropClick",
|
|
25
24
|
ESCAPE_KEY_DOWN = "escapeKeyDown"
|
|
26
25
|
}
|
|
27
|
-
export interface ModalProps
|
|
26
|
+
export interface ModalProps {
|
|
28
27
|
open: boolean;
|
|
29
28
|
children: React.ReactNode;
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
/**
|
|
30
|
+
* We provide convenient default sizes for the modal,
|
|
31
|
+
* but you can also set your own size, when providing
|
|
32
|
+
* `unset` to the `size` prop.
|
|
33
|
+
*/
|
|
34
|
+
size?: 'small' | 'medium' | 'large' | 'unset';
|
|
32
35
|
container?: Element;
|
|
33
36
|
onClose?: (e: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>, reason?: ModalCloseReason) => void;
|
|
37
|
+
/** Forwards the props to the modal container's wrapper - use with caution */
|
|
38
|
+
rootProps?: ComponentPropsWithoutRef<'div'>;
|
|
39
|
+
/** Forwards the props to the modal container */
|
|
40
|
+
modalProps?: ComponentPropsWithoutRef<'div'>;
|
|
34
41
|
}
|
|
35
|
-
export declare const Modal:
|
|
42
|
+
export declare const Modal: React.ForwardRefExoticComponent<ModalProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
* You should have received a copy of the GNU General Public License
|
|
19
19
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
|
-
import React from 'react';
|
|
21
|
+
import React, { type ComponentProps } from 'react';
|
|
22
|
+
import FocusLock from 'react-focus-lock';
|
|
22
23
|
/**
|
|
23
24
|
* A modified version of the Material UI (@mui/material) Popover component.
|
|
24
25
|
* We use a modified/slimmed version for easier maintenance.
|
|
@@ -70,7 +71,7 @@ export interface PopoverProps extends ElementBase {
|
|
|
70
71
|
onClose?: (e: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>) => void;
|
|
71
72
|
/** Additional classes */
|
|
72
73
|
className?: string;
|
|
73
|
-
/** Whether
|
|
74
|
+
/** Whether the menu is nested. IE is this menu a sub menu */
|
|
74
75
|
nested?: boolean;
|
|
75
76
|
/** Disable backdrop - Allows event capturing - and pointer events to pass to elements below */
|
|
76
77
|
disableBackdrop?: boolean;
|
|
@@ -78,6 +79,11 @@ export interface PopoverProps extends ElementBase {
|
|
|
78
79
|
anchorPortal?: boolean;
|
|
79
80
|
/** If the popover should constrain the focus inside the popover while open */
|
|
80
81
|
captureFocus?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Props to pass to the FocusLock component
|
|
84
|
+
* @see https://github.com/theKashey/react-focus-lock
|
|
85
|
+
*/
|
|
86
|
+
focusLockProps?: ComponentProps<typeof FocusLock>;
|
|
81
87
|
}
|
|
82
88
|
export declare const Popover: React.ForwardRefExoticComponent<Omit<PopoverProps, "ref"> & React.RefAttributes<unknown>>;
|
|
83
89
|
export {};
|
package/lib/types/{view-selector/ViewSelector.d.ts → segmented-control/SegmentedControl.d.ts}
RENAMED
|
@@ -20,32 +20,26 @@
|
|
|
20
20
|
*/
|
|
21
21
|
import React from 'react';
|
|
22
22
|
import { type ElementBase } from '../helpers';
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
*
|
|
26
|
-
* Types
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*/
|
|
30
|
-
type ViewSelectorID = string | number;
|
|
31
|
-
export interface ViewSelectorProps<T extends ViewSelectorID> extends ElementBase {
|
|
23
|
+
type SegmentedControlID = string | number;
|
|
24
|
+
export interface SegmentedControlProps<T extends SegmentedControlID> extends ElementBase {
|
|
32
25
|
/** Size of the selector */
|
|
33
26
|
size?: 'small' | 'large';
|
|
34
|
-
/** If selector items will include only icons */
|
|
35
|
-
|
|
27
|
+
/** If selector items will include only icons (makes controls rectangular) */
|
|
28
|
+
hasOnlyIcons?: boolean;
|
|
36
29
|
/**
|
|
37
30
|
* onChange function is more generic to support union type of strings as input
|
|
38
|
-
* to help useState in components that uses Switch group with
|
|
31
|
+
* to help useState in components that uses Switch group with type-safety
|
|
39
32
|
*/
|
|
40
33
|
onChange: (e: T) => void | ((e: React.SetStateAction<T>) => void);
|
|
41
34
|
/** Currently selected option */
|
|
42
35
|
selected: T;
|
|
43
36
|
children: React.ReactNode | string;
|
|
44
37
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
} & {
|
|
49
|
-
|
|
50
|
-
} & React.RefAttributes<unknown>>;
|
|
51
|
-
|
|
38
|
+
declare const SegmentedControl: (<T extends SegmentedControlID>(props: SegmentedControlProps<T> & React.RefAttributes<unknown>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & {
|
|
39
|
+
Item: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLElement>, "as" | "selected" | "size" | "onChange" | "ref"> & {
|
|
40
|
+
as?: string | React.ComponentType<any> | undefined;
|
|
41
|
+
} & {
|
|
42
|
+
value: string;
|
|
43
|
+
} & React.RefAttributes<unknown>>;
|
|
44
|
+
};
|
|
45
|
+
export { SegmentedControl };
|