@neo4j-ndl/react 0.16.4 → 1.0.0-alpha-093fe38
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/cjs/_common/input/RadioAndCheckboxWrapper.js +14 -6
- package/lib/cjs/_common/input/RadioAndCheckboxWrapper.js.map +1 -1
- package/lib/cjs/alert/Alert.js +16 -16
- package/lib/cjs/alert/Alert.js.map +1 -1
- package/lib/cjs/alert/index.js +14 -6
- package/lib/cjs/alert/index.js.map +1 -1
- package/lib/cjs/button/Button.js +11 -6
- package/lib/cjs/button/Button.js.map +1 -1
- package/lib/cjs/button/IconButton.js +12 -8
- package/lib/cjs/button/IconButton.js.map +1 -1
- package/lib/cjs/button/IconButtonArray.js +2 -2
- package/lib/cjs/button/IconButtonArray.js.map +1 -1
- package/lib/cjs/code-block/CodeBlock.js +13 -9
- package/lib/cjs/code-block/CodeBlock.js.map +1 -1
- package/lib/cjs/context-menu/ContextMenu.js +19 -12
- package/lib/cjs/context-menu/ContextMenu.js.map +1 -1
- package/lib/cjs/dialog/Dialog.js +9 -9
- package/lib/cjs/dialog/Dialog.js.map +1 -1
- package/lib/cjs/drag-and-drop/DragAndDrop.js +5 -5
- package/lib/cjs/drag-and-drop/DragAndDrop.js.map +1 -1
- package/lib/cjs/dropdown/Dropdown.js +15 -13
- package/lib/cjs/dropdown/Dropdown.js.map +1 -1
- package/lib/cjs/dropdown/Overrides.js +15 -6
- package/lib/cjs/dropdown/Overrides.js.map +1 -1
- package/lib/cjs/graph-label/GraphLabel.js +18 -14
- package/lib/cjs/graph-label/GraphLabel.js.map +1 -1
- package/lib/cjs/graph-label/color.js +6 -6
- package/lib/cjs/graph-label/color.js.map +1 -1
- package/lib/cjs/icons/{custom → generated/custom}/Circle.js +0 -0
- package/lib/cjs/icons/generated/custom/Circle.js.map +1 -0
- package/lib/cjs/icons/{custom → generated/custom}/CollapseExpand.js +0 -0
- package/lib/cjs/icons/generated/custom/CollapseExpand.js.map +1 -0
- package/lib/cjs/icons/{custom → generated/custom}/CollapseExpandLeft.js +0 -0
- package/lib/cjs/icons/generated/custom/CollapseExpandLeft.js.map +1 -0
- package/lib/cjs/icons/{custom → generated/custom}/CollapseExpandRight.js +0 -0
- package/lib/cjs/icons/generated/custom/CollapseExpandRight.js.map +1 -0
- package/lib/cjs/icons/{custom → generated/custom}/Configure.js +0 -0
- package/lib/cjs/icons/generated/custom/Configure.js.map +1 -0
- package/lib/cjs/icons/{custom → generated/custom}/DatabaseAddCircle.js +0 -0
- package/lib/cjs/icons/generated/custom/DatabaseAddCircle.js.map +1 -0
- package/lib/cjs/icons/{custom → generated/custom}/Dbms.js +0 -0
- package/lib/cjs/icons/generated/custom/Dbms.js.map +1 -0
- package/lib/cjs/icons/{custom → generated/custom}/Drag.js +0 -0
- package/lib/cjs/icons/generated/custom/Drag.js.map +1 -0
- package/lib/cjs/icons/{custom → generated/custom}/Expand.js +0 -0
- package/lib/cjs/icons/generated/custom/Expand.js.map +1 -0
- package/lib/cjs/icons/{custom → generated/custom}/ExternalLink.js +0 -0
- package/lib/cjs/icons/generated/custom/ExternalLink.js.map +1 -0
- package/lib/cjs/icons/{custom → generated/custom}/FitToScreen.js +0 -0
- package/lib/cjs/icons/generated/custom/FitToScreen.js.map +1 -0
- package/lib/cjs/icons/{custom → generated/custom}/FolderBookmark.js +0 -0
- package/lib/cjs/icons/generated/custom/FolderBookmark.js.map +1 -0
- package/lib/cjs/icons/{custom → generated/custom}/Heirarchy2.js +0 -0
- package/lib/cjs/icons/generated/custom/Heirarchy2.js.map +1 -0
- package/lib/cjs/icons/{custom → generated/custom}/Hierarchy1.js +0 -0
- package/lib/cjs/icons/generated/custom/Hierarchy1.js.map +1 -0
- package/lib/cjs/icons/{custom → generated/custom}/Hierarchy2.js +0 -0
- package/lib/cjs/icons/generated/custom/Hierarchy2.js.map +1 -0
- package/lib/cjs/icons/{custom → generated/custom}/NomLevel.js +0 -0
- package/lib/cjs/icons/generated/custom/NomLevel.js.map +1 -0
- package/lib/cjs/icons/{custom → generated/custom}/Pin.js +0 -0
- package/lib/cjs/icons/generated/custom/Pin.js.map +1 -0
- package/lib/cjs/icons/{custom → generated/custom}/Presentation.js +0 -0
- package/lib/cjs/icons/generated/custom/Presentation.js.map +1 -0
- package/lib/cjs/icons/{custom → generated/custom}/QueryBrowser.js +0 -0
- package/lib/cjs/icons/generated/custom/QueryBrowser.js.map +1 -0
- package/lib/cjs/icons/{custom → generated/custom}/Rhombus.js +0 -0
- package/lib/cjs/icons/generated/custom/Rhombus.js.map +1 -0
- package/lib/cjs/icons/{custom → generated/custom}/ScienceMolecule.js +0 -0
- package/lib/cjs/icons/generated/custom/ScienceMolecule.js.map +1 -0
- package/lib/cjs/icons/{custom → generated/custom}/Shrink.js +0 -0
- package/lib/cjs/icons/generated/custom/Shrink.js.map +1 -0
- package/lib/cjs/icons/{custom → generated/custom}/Status.js +0 -0
- package/lib/cjs/icons/generated/custom/Status.js.map +1 -0
- package/lib/cjs/icons/{custom → generated/custom}/Text.js +0 -0
- package/lib/cjs/icons/generated/custom/Text.js.map +1 -0
- package/lib/cjs/icons/{custom → generated/custom}/Triangle.js +0 -0
- package/lib/cjs/icons/generated/custom/Triangle.js.map +1 -0
- package/lib/cjs/icons/{custom → generated/custom}/VisualizeBloom.js +0 -0
- package/lib/cjs/icons/generated/custom/VisualizeBloom.js.map +1 -0
- package/lib/cjs/icons/{custom → generated/custom}/index.js +0 -0
- package/lib/cjs/icons/generated/custom/index.js.map +1 -0
- package/lib/cjs/icons/generated/heroIcons.js +1206 -0
- package/lib/cjs/icons/generated/heroIcons.js.map +1 -0
- package/lib/cjs/icons/index.js +15 -7
- package/lib/cjs/icons/index.js.map +1 -1
- package/lib/cjs/index.js +8 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/label/Label.js +16 -11
- package/lib/cjs/label/Label.js.map +1 -1
- package/lib/cjs/loading-spinner/LoadingSpinner.js +6 -2
- package/lib/cjs/loading-spinner/LoadingSpinner.js.map +1 -1
- package/lib/cjs/modal/Modal.js +5 -1
- package/lib/cjs/modal/Modal.js.map +1 -1
- package/lib/cjs/popover/Popover.js +3 -3
- package/lib/cjs/popover/Popover.js.map +1 -1
- package/lib/cjs/portal/Portal.js +2 -25
- package/lib/cjs/portal/Portal.js.map +1 -1
- package/lib/cjs/progress-bar/ProgressBar.js +5 -2
- package/lib/cjs/progress-bar/ProgressBar.js.map +1 -1
- package/lib/cjs/side-navigation/SideNavigation.js +154 -0
- package/lib/cjs/side-navigation/SideNavigation.js.map +1 -0
- package/lib/cjs/side-navigation/index.js +38 -0
- package/lib/cjs/side-navigation/index.js.map +1 -0
- package/lib/cjs/table/Components.js +203 -0
- package/lib/cjs/table/Components.js.map +1 -0
- package/lib/cjs/table/Table.js +45 -117
- package/lib/cjs/table/Table.js.map +1 -1
- package/lib/cjs/table/TableContext.js +34 -0
- package/lib/cjs/table/TableContext.js.map +1 -0
- package/lib/cjs/table/helpers.js +28 -70
- package/lib/cjs/table/helpers.js.map +1 -1
- package/lib/cjs/table/index.js +14 -4
- package/lib/cjs/table/index.js.map +1 -1
- package/lib/cjs/table-deprecated/Table.js +157 -0
- package/lib/cjs/table-deprecated/Table.js.map +1 -0
- package/lib/cjs/{table → table-deprecated}/TableNavigation.js +3 -3
- package/lib/cjs/table-deprecated/TableNavigation.js.map +1 -0
- package/lib/cjs/table-deprecated/helpers.js +123 -0
- package/lib/cjs/table-deprecated/helpers.js.map +1 -0
- package/lib/cjs/{table → table-deprecated}/hooks/hookCallbackTypes.js +0 -0
- package/lib/cjs/table-deprecated/hooks/hookCallbackTypes.js.map +1 -0
- package/lib/cjs/{table → table-deprecated}/hooks/index.js +0 -0
- package/lib/cjs/table-deprecated/hooks/index.js.map +1 -0
- package/lib/cjs/{table → table-deprecated}/hooks/useMultiRowSelect.js +0 -0
- package/lib/cjs/table-deprecated/hooks/useMultiRowSelect.js.map +1 -0
- package/lib/cjs/{table → table-deprecated}/hooks/useSingleRowSelect.js +0 -0
- package/lib/cjs/table-deprecated/hooks/useSingleRowSelect.js.map +1 -0
- package/lib/cjs/table-deprecated/index.js +44 -0
- package/lib/cjs/table-deprecated/index.js.map +1 -0
- package/lib/cjs/tabs/Tabs.js +7 -7
- package/lib/cjs/tabs/Tabs.js.map +1 -1
- package/lib/cjs/tag/Tag.js +8 -5
- package/lib/cjs/tag/Tag.js.map +1 -1
- package/lib/cjs/tag/index.js +14 -5
- package/lib/cjs/tag/index.js.map +1 -1
- package/lib/cjs/text-input/TextInput.js +11 -10
- package/lib/cjs/text-input/TextInput.js.map +1 -1
- package/lib/cjs/tooltip/SmartTooltip.js +114 -0
- package/lib/cjs/tooltip/SmartTooltip.js.map +1 -0
- package/lib/cjs/tooltip/Tooltip.js +10 -2
- package/lib/cjs/tooltip/Tooltip.js.map +1 -1
- package/lib/cjs/tooltip/index.js +3 -1
- package/lib/cjs/tooltip/index.js.map +1 -1
- package/lib/cjs/typography/Typography.js +58 -0
- package/lib/cjs/typography/Typography.js.map +1 -0
- package/lib/cjs/typography/index.js +38 -0
- package/lib/cjs/typography/index.js.map +1 -0
- package/lib/cjs/typography/types.js +52 -0
- package/lib/cjs/typography/types.js.map +1 -0
- package/lib/cjs/view-selector/ViewSelector.js +8 -3
- package/lib/cjs/view-selector/ViewSelector.js.map +1 -1
- package/lib/cjs/wizard/Wizard.js +20 -2
- package/lib/cjs/wizard/Wizard.js.map +1 -1
- package/lib/esm/_common/input/RadioAndCheckboxWrapper.js +13 -6
- package/lib/esm/_common/input/RadioAndCheckboxWrapper.js.map +1 -1
- package/lib/esm/alert/Alert.js +15 -15
- package/lib/esm/alert/Alert.js.map +1 -1
- package/lib/esm/alert/index.js +1 -1
- package/lib/esm/alert/index.js.map +1 -1
- package/lib/esm/button/Button.js +11 -6
- package/lib/esm/button/Button.js.map +1 -1
- package/lib/esm/button/IconButton.js +12 -8
- package/lib/esm/button/IconButton.js.map +1 -1
- package/lib/esm/button/IconButtonArray.js +2 -2
- package/lib/esm/button/IconButtonArray.js.map +1 -1
- package/lib/esm/code-block/CodeBlock.js +11 -7
- package/lib/esm/code-block/CodeBlock.js.map +1 -1
- package/lib/esm/context-menu/ContextMenu.js +19 -12
- package/lib/esm/context-menu/ContextMenu.js.map +1 -1
- package/lib/esm/dialog/Dialog.js +10 -10
- package/lib/esm/dialog/Dialog.js.map +1 -1
- package/lib/esm/drag-and-drop/DragAndDrop.js +5 -5
- package/lib/esm/drag-and-drop/DragAndDrop.js.map +1 -1
- package/lib/esm/dropdown/Dropdown.js +6 -4
- package/lib/esm/dropdown/Dropdown.js.map +1 -1
- package/lib/esm/dropdown/Overrides.js +13 -7
- package/lib/esm/dropdown/Overrides.js.map +1 -1
- package/lib/esm/graph-label/GraphLabel.js +12 -8
- package/lib/esm/graph-label/GraphLabel.js.map +1 -1
- package/lib/esm/graph-label/color.js +1 -1
- package/lib/esm/graph-label/color.js.map +1 -1
- package/lib/esm/icons/{custom → generated/custom}/Circle.js +0 -0
- package/lib/esm/icons/generated/custom/Circle.js.map +1 -0
- package/lib/esm/icons/{custom → generated/custom}/CollapseExpand.js +0 -0
- package/lib/esm/icons/generated/custom/CollapseExpand.js.map +1 -0
- package/lib/esm/icons/{custom → generated/custom}/CollapseExpandLeft.js +0 -0
- package/lib/esm/icons/generated/custom/CollapseExpandLeft.js.map +1 -0
- package/lib/esm/icons/{custom → generated/custom}/CollapseExpandRight.js +0 -0
- package/lib/esm/icons/generated/custom/CollapseExpandRight.js.map +1 -0
- package/lib/esm/icons/{custom → generated/custom}/Configure.js +0 -0
- package/lib/esm/icons/generated/custom/Configure.js.map +1 -0
- package/lib/esm/icons/{custom → generated/custom}/DatabaseAddCircle.js +0 -0
- package/lib/esm/icons/generated/custom/DatabaseAddCircle.js.map +1 -0
- package/lib/esm/icons/{custom → generated/custom}/Dbms.js +0 -0
- package/lib/esm/icons/generated/custom/Dbms.js.map +1 -0
- package/lib/esm/icons/{custom → generated/custom}/Drag.js +0 -0
- package/lib/esm/icons/generated/custom/Drag.js.map +1 -0
- package/lib/esm/icons/{custom → generated/custom}/Expand.js +0 -0
- package/lib/esm/icons/generated/custom/Expand.js.map +1 -0
- package/lib/esm/icons/{custom → generated/custom}/ExternalLink.js +0 -0
- package/lib/esm/icons/generated/custom/ExternalLink.js.map +1 -0
- package/lib/esm/icons/{custom → generated/custom}/FitToScreen.js +0 -0
- package/lib/esm/icons/generated/custom/FitToScreen.js.map +1 -0
- package/lib/esm/icons/{custom → generated/custom}/FolderBookmark.js +0 -0
- package/lib/esm/icons/generated/custom/FolderBookmark.js.map +1 -0
- package/lib/esm/icons/{custom → generated/custom}/Heirarchy2.js +0 -0
- package/lib/esm/icons/generated/custom/Heirarchy2.js.map +1 -0
- package/lib/esm/icons/{custom → generated/custom}/Hierarchy1.js +0 -0
- package/lib/esm/icons/generated/custom/Hierarchy1.js.map +1 -0
- package/lib/esm/icons/{custom → generated/custom}/Hierarchy2.js +0 -0
- package/lib/esm/icons/generated/custom/Hierarchy2.js.map +1 -0
- package/lib/esm/icons/{custom → generated/custom}/NomLevel.js +0 -0
- package/lib/esm/icons/generated/custom/NomLevel.js.map +1 -0
- package/lib/esm/icons/{custom → generated/custom}/Pin.js +0 -0
- package/lib/esm/icons/generated/custom/Pin.js.map +1 -0
- package/lib/esm/icons/{custom → generated/custom}/Presentation.js +0 -0
- package/lib/esm/icons/generated/custom/Presentation.js.map +1 -0
- package/lib/esm/icons/{custom → generated/custom}/QueryBrowser.js +0 -0
- package/lib/esm/icons/generated/custom/QueryBrowser.js.map +1 -0
- package/lib/esm/icons/{custom → generated/custom}/Rhombus.js +0 -0
- package/lib/esm/icons/generated/custom/Rhombus.js.map +1 -0
- package/lib/esm/icons/{custom → generated/custom}/ScienceMolecule.js +0 -0
- package/lib/esm/icons/generated/custom/ScienceMolecule.js.map +1 -0
- package/lib/esm/icons/{custom → generated/custom}/Shrink.js +0 -0
- package/lib/esm/icons/generated/custom/Shrink.js.map +1 -0
- package/lib/esm/icons/{custom → generated/custom}/Status.js +0 -0
- package/lib/esm/icons/generated/custom/Status.js.map +1 -0
- package/lib/esm/icons/{custom → generated/custom}/Text.js +0 -0
- package/lib/esm/icons/generated/custom/Text.js.map +1 -0
- package/lib/esm/icons/{custom → generated/custom}/Triangle.js +0 -0
- package/lib/esm/icons/generated/custom/Triangle.js.map +1 -0
- package/lib/esm/icons/{custom → generated/custom}/VisualizeBloom.js +0 -0
- package/lib/esm/icons/generated/custom/VisualizeBloom.js.map +1 -0
- package/lib/esm/icons/{custom → generated/custom}/index.js +0 -0
- package/lib/esm/icons/generated/custom/index.js.map +1 -0
- package/lib/esm/icons/generated/heroIcons.js +605 -0
- package/lib/esm/icons/generated/heroIcons.js.map +1 -0
- package/lib/esm/icons/index.js +2 -2
- package/lib/esm/icons/index.js.map +1 -1
- package/lib/esm/index.js +8 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/label/Label.js +13 -8
- package/lib/esm/label/Label.js.map +1 -1
- package/lib/esm/loading-spinner/LoadingSpinner.js +6 -2
- package/lib/esm/loading-spinner/LoadingSpinner.js.map +1 -1
- package/lib/esm/modal/Modal.js +5 -1
- package/lib/esm/modal/Modal.js.map +1 -1
- package/lib/esm/popover/Popover.js +3 -3
- package/lib/esm/popover/Popover.js.map +1 -1
- package/lib/esm/portal/Portal.js +2 -2
- package/lib/esm/portal/Portal.js.map +1 -1
- package/lib/esm/progress-bar/ProgressBar.js +5 -2
- package/lib/esm/progress-bar/ProgressBar.js.map +1 -1
- package/lib/esm/side-navigation/SideNavigation.js +125 -0
- package/lib/esm/side-navigation/SideNavigation.js.map +1 -0
- package/lib/esm/side-navigation/index.js +22 -0
- package/lib/esm/side-navigation/index.js.map +1 -0
- package/lib/esm/table/Components.js +181 -0
- package/lib/esm/table/Components.js.map +1 -0
- package/lib/esm/table/Table.js +45 -116
- package/lib/esm/table/Table.js.map +1 -1
- package/lib/esm/table/TableContext.js +30 -0
- package/lib/esm/table/TableContext.js.map +1 -0
- package/lib/esm/table/helpers.js +25 -65
- package/lib/esm/table/helpers.js.map +1 -1
- package/lib/esm/table/index.js +2 -2
- package/lib/esm/table/index.js.map +1 -1
- package/lib/esm/table-deprecated/Table.js +150 -0
- package/lib/esm/table-deprecated/Table.js.map +1 -0
- package/lib/esm/{table → table-deprecated}/TableNavigation.js +4 -4
- package/lib/esm/table-deprecated/TableNavigation.js.map +1 -0
- package/lib/esm/table-deprecated/helpers.js +116 -0
- package/lib/esm/table-deprecated/helpers.js.map +1 -0
- package/lib/esm/{table → table-deprecated}/hooks/hookCallbackTypes.js +0 -0
- package/lib/esm/table-deprecated/hooks/hookCallbackTypes.js.map +1 -0
- package/lib/esm/{table → table-deprecated}/hooks/index.js +0 -0
- package/lib/esm/table-deprecated/hooks/index.js.map +1 -0
- package/lib/esm/{table → table-deprecated}/hooks/useMultiRowSelect.js +0 -0
- package/lib/esm/table-deprecated/hooks/useMultiRowSelect.js.map +1 -0
- package/lib/esm/{table → table-deprecated}/hooks/useSingleRowSelect.js +0 -0
- package/lib/esm/table-deprecated/hooks/useSingleRowSelect.js.map +1 -0
- package/lib/esm/table-deprecated/index.js +23 -0
- package/lib/esm/table-deprecated/index.js.map +1 -0
- package/lib/esm/tabs/Tabs.js +7 -7
- package/lib/esm/tabs/Tabs.js.map +1 -1
- package/lib/esm/tag/Tag.js +7 -5
- package/lib/esm/tag/Tag.js.map +1 -1
- package/lib/esm/tag/index.js +1 -1
- package/lib/esm/tag/index.js.map +1 -1
- package/lib/esm/text-input/TextInput.js +12 -11
- package/lib/esm/text-input/TextInput.js.map +1 -1
- package/lib/esm/tooltip/SmartTooltip.js +86 -0
- package/lib/esm/tooltip/SmartTooltip.js.map +1 -0
- package/lib/esm/tooltip/Tooltip.js +10 -2
- package/lib/esm/tooltip/Tooltip.js.map +1 -1
- package/lib/esm/tooltip/index.js +1 -0
- package/lib/esm/tooltip/index.js.map +1 -1
- package/lib/esm/{icons/Custom.js → typography/Typography.js} +20 -10
- package/lib/esm/typography/Typography.js.map +1 -0
- package/lib/esm/typography/index.js +22 -0
- package/lib/esm/typography/index.js.map +1 -0
- package/lib/esm/typography/types.js +49 -0
- package/lib/esm/typography/types.js.map +1 -0
- package/lib/esm/view-selector/ViewSelector.js +8 -3
- package/lib/esm/view-selector/ViewSelector.js.map +1 -1
- package/lib/esm/wizard/Wizard.js +24 -6
- package/lib/esm/wizard/Wizard.js.map +1 -1
- package/lib/types/_common/input/RadioAndCheckboxWrapper.d.ts +12 -2
- package/lib/types/_common/input/types.d.ts +1 -1
- package/lib/types/alert/Alert.d.ts +3 -2
- package/lib/types/alert/index.d.ts +1 -1
- package/lib/types/button/Button.d.ts +1 -3
- package/lib/types/button/IconButton.d.ts +2 -0
- package/lib/types/checkbox/Checkbox.d.ts +1 -1
- package/lib/types/context-menu/ContextMenu.d.ts +11 -12
- package/lib/types/dropdown/Overrides.d.ts +0 -21
- package/lib/types/dropdown/types.d.ts +0 -1
- package/lib/types/icons/{custom → generated/custom}/Circle.d.ts +0 -0
- package/lib/types/icons/{custom → generated/custom}/CollapseExpand.d.ts +0 -0
- package/lib/types/icons/{custom → generated/custom}/CollapseExpandLeft.d.ts +0 -0
- package/lib/types/icons/{custom → generated/custom}/CollapseExpandRight.d.ts +0 -0
- package/lib/types/icons/{custom → generated/custom}/Configure.d.ts +0 -0
- package/lib/types/icons/{custom → generated/custom}/DatabaseAddCircle.d.ts +0 -0
- package/lib/types/icons/{custom → generated/custom}/Dbms.d.ts +0 -0
- package/lib/types/icons/{custom → generated/custom}/Drag.d.ts +0 -0
- package/lib/types/icons/{custom → generated/custom}/Expand.d.ts +0 -0
- package/lib/types/icons/{custom → generated/custom}/ExternalLink.d.ts +0 -0
- package/lib/types/icons/{custom → generated/custom}/FitToScreen.d.ts +0 -0
- package/lib/types/icons/{custom → generated/custom}/FolderBookmark.d.ts +0 -0
- package/lib/types/icons/{custom → generated/custom}/Heirarchy2.d.ts +0 -0
- package/lib/types/icons/{custom → generated/custom}/Hierarchy1.d.ts +0 -0
- package/lib/types/icons/{custom → generated/custom}/Hierarchy2.d.ts +0 -0
- package/lib/types/icons/{custom → generated/custom}/NomLevel.d.ts +0 -0
- package/lib/types/icons/{custom → generated/custom}/Pin.d.ts +0 -0
- package/lib/types/icons/{custom → generated/custom}/Presentation.d.ts +0 -0
- package/lib/types/icons/{custom → generated/custom}/QueryBrowser.d.ts +0 -0
- package/lib/types/icons/{custom → generated/custom}/Rhombus.d.ts +0 -0
- package/lib/types/icons/{custom → generated/custom}/ScienceMolecule.d.ts +0 -0
- package/lib/types/icons/{custom → generated/custom}/Shrink.d.ts +0 -0
- package/lib/types/icons/{custom → generated/custom}/Status.d.ts +0 -0
- package/lib/types/icons/{custom → generated/custom}/Text.d.ts +0 -0
- package/lib/types/icons/{custom → generated/custom}/Triangle.d.ts +0 -0
- package/lib/types/icons/{custom → generated/custom}/VisualizeBloom.d.ts +0 -0
- package/lib/types/icons/{custom → generated/custom}/index.d.ts +0 -0
- package/lib/types/icons/generated/heroIcons.d.ts +604 -0
- package/lib/types/icons/index.d.ts +2 -2
- package/lib/types/index.d.ts +4 -1
- package/lib/types/label/Label.d.ts +3 -2
- package/lib/types/popover/Popover.d.ts +1 -1
- package/lib/types/portal/Portal.d.ts +1 -1
- package/lib/types/progress-bar/ProgressBar.d.ts +1 -1
- package/lib/types/radio/Radio.d.ts +1 -1
- package/lib/types/side-navigation/SideNavigation.d.ts +49 -0
- package/lib/types/side-navigation/index.d.ts +21 -0
- package/lib/types/switch/Switch.d.ts +1 -1
- package/lib/types/table/Components.d.ts +54 -0
- package/lib/types/table/Table.d.ts +28 -49
- package/lib/types/table/TableContext.d.ts +61 -0
- package/lib/types/table/helpers.d.ts +9 -21
- package/lib/types/table/index.d.ts +2 -2
- package/lib/types/table-deprecated/Table.d.ts +75 -0
- package/lib/types/{table → table-deprecated}/TableNavigation.d.ts +0 -1
- package/lib/types/table-deprecated/helpers.d.ts +51 -0
- package/lib/types/{table → table-deprecated}/hooks/hookCallbackTypes.d.ts +0 -0
- package/lib/types/{table → table-deprecated}/hooks/index.d.ts +0 -0
- package/lib/types/{table → table-deprecated}/hooks/useMultiRowSelect.d.ts +0 -0
- package/lib/types/{table → table-deprecated}/hooks/useSingleRowSelect.d.ts +0 -0
- package/lib/types/table-deprecated/index.d.ts +22 -0
- package/lib/types/tag/Tag.d.ts +4 -4
- package/lib/types/tag/index.d.ts +1 -1
- package/lib/types/text-input/TextInput.d.ts +1 -1
- package/lib/types/text-link/TextLink.d.ts +1 -1
- package/lib/types/tooltip/SmartTooltip.d.ts +31 -0
- package/lib/types/tooltip/Tooltip.d.ts +1 -1
- package/lib/types/tooltip/index.d.ts +1 -0
- package/lib/types/trap-focus/TrapFocus.d.ts +0 -1
- package/lib/types/{icons/Custom.d.ts → typography/Typography.d.ts} +5 -7
- package/lib/types/typography/index.d.ts +21 -0
- package/lib/types/typography/types.d.ts +34 -0
- package/lib/types/wizard/Wizard.d.ts +0 -1
- package/package.json +22 -9
- package/CHANGELOG.md +0 -546
- package/lib/cjs/icons/Custom.js +0 -67
- package/lib/cjs/icons/Custom.js.map +0 -1
- package/lib/cjs/icons/Hero.js +0 -59
- package/lib/cjs/icons/Hero.js.map +0 -1
- package/lib/cjs/icons/custom/Circle.js.map +0 -1
- package/lib/cjs/icons/custom/CollapseExpand.js.map +0 -1
- package/lib/cjs/icons/custom/CollapseExpandLeft.js.map +0 -1
- package/lib/cjs/icons/custom/CollapseExpandRight.js.map +0 -1
- package/lib/cjs/icons/custom/Configure.js.map +0 -1
- package/lib/cjs/icons/custom/DatabaseAddCircle.js.map +0 -1
- package/lib/cjs/icons/custom/Dbms.js.map +0 -1
- package/lib/cjs/icons/custom/Drag.js.map +0 -1
- package/lib/cjs/icons/custom/Expand.js.map +0 -1
- package/lib/cjs/icons/custom/ExternalLink.js.map +0 -1
- package/lib/cjs/icons/custom/FitToScreen.js.map +0 -1
- package/lib/cjs/icons/custom/FolderBookmark.js.map +0 -1
- package/lib/cjs/icons/custom/Heirarchy2.js.map +0 -1
- package/lib/cjs/icons/custom/Hierarchy1.js.map +0 -1
- package/lib/cjs/icons/custom/Hierarchy2.js.map +0 -1
- package/lib/cjs/icons/custom/NomLevel.js.map +0 -1
- package/lib/cjs/icons/custom/Pin.js.map +0 -1
- package/lib/cjs/icons/custom/Presentation.js.map +0 -1
- package/lib/cjs/icons/custom/QueryBrowser.js.map +0 -1
- package/lib/cjs/icons/custom/Rhombus.js.map +0 -1
- package/lib/cjs/icons/custom/ScienceMolecule.js.map +0 -1
- package/lib/cjs/icons/custom/Shrink.js.map +0 -1
- package/lib/cjs/icons/custom/Status.js.map +0 -1
- package/lib/cjs/icons/custom/Text.js.map +0 -1
- package/lib/cjs/icons/custom/Triangle.js.map +0 -1
- package/lib/cjs/icons/custom/VisualizeBloom.js.map +0 -1
- package/lib/cjs/icons/custom/index.js.map +0 -1
- package/lib/cjs/table/TableNavigation.js.map +0 -1
- package/lib/cjs/table/hooks/hookCallbackTypes.js.map +0 -1
- package/lib/cjs/table/hooks/index.js.map +0 -1
- package/lib/cjs/table/hooks/useMultiRowSelect.js.map +0 -1
- package/lib/cjs/table/hooks/useSingleRowSelect.js.map +0 -1
- package/lib/esm/icons/Custom.js.map +0 -1
- package/lib/esm/icons/Hero.js +0 -33
- package/lib/esm/icons/Hero.js.map +0 -1
- package/lib/esm/icons/custom/Circle.js.map +0 -1
- package/lib/esm/icons/custom/CollapseExpand.js.map +0 -1
- package/lib/esm/icons/custom/CollapseExpandLeft.js.map +0 -1
- package/lib/esm/icons/custom/CollapseExpandRight.js.map +0 -1
- package/lib/esm/icons/custom/Configure.js.map +0 -1
- package/lib/esm/icons/custom/DatabaseAddCircle.js.map +0 -1
- package/lib/esm/icons/custom/Dbms.js.map +0 -1
- package/lib/esm/icons/custom/Drag.js.map +0 -1
- package/lib/esm/icons/custom/Expand.js.map +0 -1
- package/lib/esm/icons/custom/ExternalLink.js.map +0 -1
- package/lib/esm/icons/custom/FitToScreen.js.map +0 -1
- package/lib/esm/icons/custom/FolderBookmark.js.map +0 -1
- package/lib/esm/icons/custom/Heirarchy2.js.map +0 -1
- package/lib/esm/icons/custom/Hierarchy1.js.map +0 -1
- package/lib/esm/icons/custom/Hierarchy2.js.map +0 -1
- package/lib/esm/icons/custom/NomLevel.js.map +0 -1
- package/lib/esm/icons/custom/Pin.js.map +0 -1
- package/lib/esm/icons/custom/Presentation.js.map +0 -1
- package/lib/esm/icons/custom/QueryBrowser.js.map +0 -1
- package/lib/esm/icons/custom/Rhombus.js.map +0 -1
- package/lib/esm/icons/custom/ScienceMolecule.js.map +0 -1
- package/lib/esm/icons/custom/Shrink.js.map +0 -1
- package/lib/esm/icons/custom/Status.js.map +0 -1
- package/lib/esm/icons/custom/Text.js.map +0 -1
- package/lib/esm/icons/custom/Triangle.js.map +0 -1
- package/lib/esm/icons/custom/VisualizeBloom.js.map +0 -1
- package/lib/esm/icons/custom/index.js.map +0 -1
- package/lib/esm/table/TableNavigation.js.map +0 -1
- package/lib/esm/table/hooks/hookCallbackTypes.js.map +0 -1
- package/lib/esm/table/hooks/index.js.map +0 -1
- package/lib/esm/table/hooks/useMultiRowSelect.js.map +0 -1
- package/lib/esm/table/hooks/useSingleRowSelect.js.map +0 -1
- package/lib/types/icons/Hero.d.ts +0 -28
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { createElement as _createElement } from "react";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { flexRender } from '@tanstack/react-table';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import { useMemo } from 'react';
|
|
6
|
+
import { Bars3CenterLeftIconOutline, BarsArrowDownIconOutline, BarsArrowUpIconOutline, ChevronLeftIconOutline, ChevronRightIconOutline, } from '../icons';
|
|
7
|
+
import { LoadingSpinner } from '../loading-spinner';
|
|
8
|
+
import { gridGenerator, userFriendlyPagination } from './helpers';
|
|
9
|
+
import { useTableContext } from './TableContext';
|
|
10
|
+
/** Table results per page, with the first option being the default */
|
|
11
|
+
const TABLE_RESULTS = {
|
|
12
|
+
DEFAULT: 10,
|
|
13
|
+
values: [10, 25, 50, 100],
|
|
14
|
+
};
|
|
15
|
+
const ResizingBar = ({ header, children, innerProps, }) => {
|
|
16
|
+
const { className = undefined } = innerProps || {};
|
|
17
|
+
return (_jsx(_Fragment, { children: children || (_jsx("button", Object.assign({}, innerProps, { type: "button", "aria-label": "resizing bar", onMouseDown: header.getResizeHandler(), onTouchStart: header.getResizeHandler(), className: classNames('ndl-resizer', className, {
|
|
18
|
+
'ndl-is-resizing': header.column.getIsResizing(),
|
|
19
|
+
}) }))) }));
|
|
20
|
+
};
|
|
21
|
+
const Header = ({ children, innerProps }) => {
|
|
22
|
+
const { tableProps, components } = useTableContext();
|
|
23
|
+
const { getHeaderGroups, getState } = tableProps;
|
|
24
|
+
const { className = undefined } = innerProps || {};
|
|
25
|
+
const commonStyle = {
|
|
26
|
+
display: 'grid',
|
|
27
|
+
gridTemplateColumns: gridGenerator(tableProps),
|
|
28
|
+
};
|
|
29
|
+
return (_jsx("div", Object.assign({}, innerProps, { role: "rowgroup", className: classNames('ndl-table-thead', className, {
|
|
30
|
+
resizing: getState().columnSizingInfo.isResizingColumn,
|
|
31
|
+
}) }, { children: children || (_jsx(_Fragment, { children: getHeaderGroups().map((headerGroup) => (_jsx("div", Object.assign({ className: "ndl-table-tr", style: commonStyle, role: "row" }, { children: headerGroup.headers.map((header) => components.HeaderCell && (_jsx(components.HeaderCell, { cell: header }, header.id))) }), headerGroup.id))) })) })));
|
|
32
|
+
};
|
|
33
|
+
export const SortingButton = ({ sortDirection, children, innerProps, }) => {
|
|
34
|
+
let icon;
|
|
35
|
+
const { className, style, onClick } = innerProps || {};
|
|
36
|
+
const commonProps = Object.assign(Object.assign({}, innerProps), { className: classNames('ndl-header-icon', className), style: Object.assign(Object.assign({}, style), (sortDirection && { display: 'inline-block' })), onClick: (e) => onClick && onClick(e), onKeyDown: (e) => {
|
|
37
|
+
if (e.key === ' ' && typeof onClick === 'function')
|
|
38
|
+
onClick(e);
|
|
39
|
+
}, tabIndex: 0 });
|
|
40
|
+
switch (sortDirection) {
|
|
41
|
+
case 'desc':
|
|
42
|
+
icon = _jsx(BarsArrowDownIconOutline, Object.assign({}, commonProps));
|
|
43
|
+
break;
|
|
44
|
+
case 'asc':
|
|
45
|
+
icon = _jsx(BarsArrowUpIconOutline, Object.assign({}, commonProps));
|
|
46
|
+
break;
|
|
47
|
+
default:
|
|
48
|
+
icon = _jsx(Bars3CenterLeftIconOutline, Object.assign({}, commonProps));
|
|
49
|
+
}
|
|
50
|
+
return _jsx(_Fragment, { children: children || icon });
|
|
51
|
+
};
|
|
52
|
+
export const ColumnControls = ({ cell, children, innerProps, }) => {
|
|
53
|
+
const { className } = innerProps || {};
|
|
54
|
+
return (_jsx("div", Object.assign({}, innerProps, { className: classNames('ndl-header-action-group', className) }, { children: children || (_jsx(_Fragment, { children: cell.column.getCanSort() && (_jsx(SortingButton, { sortDirection: cell.column.getIsSorted(), innerProps: {
|
|
55
|
+
onClick: () => cell.column.toggleSorting(),
|
|
56
|
+
} })) })) })));
|
|
57
|
+
};
|
|
58
|
+
const HeaderCell = ({ cell, children, innerProps, }) => {
|
|
59
|
+
const { components, resizable } = useTableContext();
|
|
60
|
+
const { className } = innerProps || {};
|
|
61
|
+
const sort = cell.column.getIsSorted();
|
|
62
|
+
const ariaSortRole = useMemo(() => {
|
|
63
|
+
switch (sort) {
|
|
64
|
+
case 'asc':
|
|
65
|
+
return 'ascending';
|
|
66
|
+
case 'desc':
|
|
67
|
+
return 'descending';
|
|
68
|
+
default:
|
|
69
|
+
return 'none';
|
|
70
|
+
}
|
|
71
|
+
}, [sort]);
|
|
72
|
+
const title = typeof cell.column.columnDef.header === 'string'
|
|
73
|
+
? cell.column.columnDef.header
|
|
74
|
+
: cell.id;
|
|
75
|
+
return (_createElement("div", Object.assign({}, innerProps, { key: cell.id, className: classNames('ndl-table-th', className), role: "columnheader", "aria-sort": ariaSortRole, tabIndex: 0 }), children || (_jsxs(_Fragment, { children: [_jsxs("div", Object.assign({ className: "ndl-header-group" }, { children: [_jsx("div", Object.assign({ className: "ndl-header-cell", title: title }, { children: cell.isPlaceholder
|
|
76
|
+
? null
|
|
77
|
+
: flexRender(cell.column.columnDef.header, cell.getContext()) })), components.ColumnControls && (_jsx(components.ColumnControls, { cell: cell }))] })), resizable && components.ResizingBar && (_jsx(components.ResizingBar, { header: cell }))] }))));
|
|
78
|
+
};
|
|
79
|
+
const Body = ({ children, innerProps }) => {
|
|
80
|
+
const { tableProps, components, loading } = useTableContext();
|
|
81
|
+
const { getRowModel } = tableProps;
|
|
82
|
+
const { className } = innerProps || {};
|
|
83
|
+
return (_jsx("div", Object.assign({}, innerProps, { className: classNames('ndl-table-tbody', className), role: "rowgroup", "aria-busy": loading ? 'true' : 'false',
|
|
84
|
+
// If we have a vertical scrolling table
|
|
85
|
+
// we need to make it focusable, so we can scroll with the keyboard
|
|
86
|
+
tabIndex: 0 }, { children: children || (_jsxs(_Fragment, { children: [loading && components.LoadingPlaceholder && (_jsx(components.LoadingPlaceholder, {})), !loading &&
|
|
87
|
+
getRowModel().rows.length === 0 &&
|
|
88
|
+
components.NoDataPlaceholder && _jsx(components.NoDataPlaceholder, {}), !loading &&
|
|
89
|
+
getRowModel().rows.map((row, idx) => components.BodyRow && (_jsx(components.BodyRow, { row: row }, `table-row-${idx}`)))] })) })));
|
|
90
|
+
};
|
|
91
|
+
const BodyCell = ({ cell, children, innerProps, }) => {
|
|
92
|
+
const isResizing = cell.column.getIsResizing();
|
|
93
|
+
const { className } = innerProps || {};
|
|
94
|
+
return (_jsx("div", Object.assign({}, innerProps, { className: classNames('ndl-table-td', className, {
|
|
95
|
+
'ndl-resizing': isResizing,
|
|
96
|
+
}), role: "cell", tabIndex: 0 }, { children: children || flexRender(cell.column.columnDef.cell, cell.getContext()) }), cell.id));
|
|
97
|
+
};
|
|
98
|
+
const BodyRow = ({ row, children, innerProps, }) => {
|
|
99
|
+
const { components, tableProps } = useTableContext();
|
|
100
|
+
const { className } = innerProps || {};
|
|
101
|
+
const commonStyle = {
|
|
102
|
+
display: 'grid',
|
|
103
|
+
gridTemplateColumns: gridGenerator(tableProps),
|
|
104
|
+
};
|
|
105
|
+
return (_createElement("div", Object.assign({}, innerProps, { key: row.id, className: classNames('ndl-table-tr', className), style: commonStyle, role: "row", tabIndex: 0 }), children || (_jsx(_Fragment, { children: row
|
|
106
|
+
.getVisibleCells()
|
|
107
|
+
.map((cell) => components.BodyCell && (_jsx(components.BodyCell, { cell: cell }, cell.id))) }))));
|
|
108
|
+
};
|
|
109
|
+
const TableResults = ({ children, innerProps, }) => {
|
|
110
|
+
const { tableProps } = useTableContext();
|
|
111
|
+
const { getState, getRowModel, getCoreRowModel } = tableProps;
|
|
112
|
+
const { pagination: { pageSize, pageIndex }, } = getState();
|
|
113
|
+
const { rows } = getRowModel();
|
|
114
|
+
const { rows: totalRows } = getCoreRowModel();
|
|
115
|
+
const from = 1 + pageIndex * pageSize;
|
|
116
|
+
const to = rows.length + pageIndex * pageSize;
|
|
117
|
+
const { className } = innerProps || {};
|
|
118
|
+
return (_jsx("span", Object.assign({}, innerProps, { className: classNames('ndl-table-results', className) }, { children: children || (_jsxs("span", { children: ["Showing", ' ', _jsxs("b", { children: [from, to !== from && `-${to}`] }), ' ', "of ", _jsx("b", { children: totalRows.length }), " results"] })) })));
|
|
119
|
+
};
|
|
120
|
+
const RowsPerPage = ({ children, innerProps, }) => {
|
|
121
|
+
const { tableProps } = useTableContext();
|
|
122
|
+
const { setPageSize, getState } = tableProps;
|
|
123
|
+
const { className } = innerProps || {};
|
|
124
|
+
const { pagination: { pageSize }, } = getState();
|
|
125
|
+
return (_jsx("div", Object.assign({}, innerProps, { className: classNames('ndl-table-rows-per-page', className) }, { children: children || (_jsxs(_Fragment, { children: ["Show", _jsx("select", Object.assign({ onChange: (e) => setPageSize(parseInt(e.target.value, 10)), className: "ndl-table-select", value: pageSize, "aria-label": "Select page size" }, { children: [...new Set([...TABLE_RESULTS.values, pageSize])]
|
|
126
|
+
.sort((a, b) => a - b)
|
|
127
|
+
.map((option) => (_jsx("option", Object.assign({ value: `${option}` }, { children: option }), `${option}`))) }))] })) })));
|
|
128
|
+
};
|
|
129
|
+
const PaginationArrowButton = ({ action, children, innerProps, }) => {
|
|
130
|
+
const { className } = innerProps || {};
|
|
131
|
+
return (_jsx("button", Object.assign({}, innerProps, { type: "button", className: classNames('ndl-table-pagination-icon-button', className) }, { children: children || (_jsxs(_Fragment, { children: [action === 'previous' && (_jsxs(_Fragment, { children: [_jsx("span", Object.assign({ className: "n-sr-only" }, { children: "Previous table page" })), _jsx(ChevronLeftIconOutline, { className: "ndl-table-pagination-icon" })] })), action === 'next' && (_jsxs(_Fragment, { children: [_jsx("span", Object.assign({ className: "n-sr-only" }, { children: "Next table page" })), _jsx(ChevronRightIconOutline, { className: "ndl-table-pagination-icon" })] }))] })) })));
|
|
132
|
+
};
|
|
133
|
+
const PaginationNumericButton = ({ currentIndex, isSelected, children, innerProps, }) => {
|
|
134
|
+
const { className, onClick } = innerProps || {};
|
|
135
|
+
return (_jsx("button", Object.assign({}, innerProps, { type: "button", "data-testid": `table-${currentIndex}`, className: classNames('ndl-table-pagination-numeric-button', className, {
|
|
136
|
+
'ndl-not-selected-numeric': typeof currentIndex === 'number' && !isSelected,
|
|
137
|
+
'ndl-is-selected': isSelected,
|
|
138
|
+
'ndl-not-selected': !isSelected,
|
|
139
|
+
}), onClick: (e) => typeof currentIndex === 'number' && onClick && onClick(e) }, { children: children || currentIndex })));
|
|
140
|
+
};
|
|
141
|
+
const PaginationNumericButtons = () => {
|
|
142
|
+
const { tableProps, components } = useTableContext();
|
|
143
|
+
const { getState, setPageIndex, getPageCount } = tableProps;
|
|
144
|
+
const { pagination: { pageIndex }, } = getState();
|
|
145
|
+
return (_jsx(_Fragment, { children: userFriendlyPagination(pageIndex + 1, getPageCount()).map((option, idx) => components.PaginationNumericButton && (_jsx(components.PaginationNumericButton
|
|
146
|
+
/** Use index to avoid situations where two "..." values will appear, causing a key conflict */
|
|
147
|
+
, { innerProps: {
|
|
148
|
+
onClick: () => typeof option === 'number' && setPageIndex(option - 1),
|
|
149
|
+
}, currentIndex: option, isSelected: option === pageIndex + 1 }, `${option}-${idx}`))) }));
|
|
150
|
+
};
|
|
151
|
+
const Pagination = ({ children, innerProps, }) => {
|
|
152
|
+
const { tableProps, components } = useTableContext();
|
|
153
|
+
const { getCanPreviousPage, getCanNextPage, previousPage, nextPage } = tableProps;
|
|
154
|
+
const { className } = innerProps || {};
|
|
155
|
+
return (_jsx("nav", Object.assign({}, innerProps, { className: classNames('ndl-table-nav', className), "aria-label": "Pagination" }, { children: children || (_jsxs(_Fragment, { children: [getCanPreviousPage()
|
|
156
|
+
? components.PaginationArrowButton && (_jsx(components.PaginationArrowButton, { action: "previous", innerProps: {
|
|
157
|
+
onClick: previousPage,
|
|
158
|
+
} }))
|
|
159
|
+
: null, components.PaginationNumericButtons && (_jsx(components.PaginationNumericButtons, {})), getCanNextPage()
|
|
160
|
+
? components.PaginationArrowButton && (_jsx(components.PaginationArrowButton, { action: "next", innerProps: {
|
|
161
|
+
onClick: nextPage,
|
|
162
|
+
} }))
|
|
163
|
+
: null] })) })));
|
|
164
|
+
};
|
|
165
|
+
const Navigation = ({ children, innerProps, }) => {
|
|
166
|
+
const { tableProps, components } = useTableContext();
|
|
167
|
+
const { getPageCount } = tableProps;
|
|
168
|
+
const pageCount = useMemo(() => getPageCount(), [getPageCount]);
|
|
169
|
+
const { className } = innerProps || {};
|
|
170
|
+
return (_jsx("div", Object.assign({}, innerProps, { className: classNames('ndl-table-navigation', className) }, { children: _jsx(_Fragment, { children: children || (_jsxs(_Fragment, { children: [components.TableResults && _jsx(components.TableResults, {}), _jsxs("div", Object.assign({ className: "ndl-table-navigation-right-items" }, { children: [pageCount > 1 && components.Pagination && (_jsx(components.Pagination, {})), components.RowsPerPage && _jsx(components.RowsPerPage, {})] }))] })) }) })));
|
|
171
|
+
};
|
|
172
|
+
const LoadingPlaceholder = ({ children, innerProps, }) => {
|
|
173
|
+
const { className } = innerProps || {};
|
|
174
|
+
return (_jsx("div", Object.assign({}, innerProps, { className: classNames('nld-table-placeholder', className), role: "row" }, { children: children || (_jsxs("div", Object.assign({ role: "cell", className: "nld-table-placeholder" }, { children: [_jsx(LoadingSpinner, {}), _jsx("h6", { children: "Loading data" })] }))) })));
|
|
175
|
+
};
|
|
176
|
+
const NoDataPlaceholder = ({ children, innerProps, }) => {
|
|
177
|
+
const { className } = innerProps || {};
|
|
178
|
+
return (_jsx("div", Object.assign({}, innerProps, { className: classNames('nld-table-placeholder', className), role: "row" }, { children: children || (_jsx("div", Object.assign({ role: "cell" }, { children: _jsx("h6", { children: "No data present" }) }))) })));
|
|
179
|
+
};
|
|
180
|
+
export { ResizingBar, Header, Body, BodyCell, BodyRow, HeaderCell, Navigation, TableResults, RowsPerPage, Pagination, PaginationNumericButtons, PaginationArrowButton, PaginationNumericButton, NoDataPlaceholder, LoadingPlaceholder, };
|
|
181
|
+
//# sourceMappingURL=Components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Components.js","sourceRoot":"","sources":["../../../src/table/Components.tsx"],"names":[],"mappings":";;AA2BA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAIjD,sEAAsE;AACtE,MAAM,aAAa,GAAG;IACpB,OAAO,EAAE,EAAE;I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15 @@
|
|
|
1
|
-
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
13
|
/**
|
|
3
14
|
*
|
|
4
15
|
* Copyright (c) "Neo4j"
|
|
@@ -20,126 +31,44 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
20
31
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
32
|
*/
|
|
22
33
|
import classNames from 'classnames';
|
|
23
|
-
import {
|
|
24
|
-
import
|
|
25
|
-
import {
|
|
26
|
-
/** Table results per page, with the first option being the default */
|
|
27
|
-
const TABLE_RESULTS = {
|
|
28
|
-
DEFAULT: 10,
|
|
29
|
-
values: [10, 25, 50, 100],
|
|
30
|
-
};
|
|
34
|
+
import { useMemo, useRef } from 'react';
|
|
35
|
+
import { TableContext, } from './TableContext';
|
|
36
|
+
import { Body, BodyCell, Header, ColumnControls, ResizingBar, BodyRow, HeaderCell, Navigation, TableResults, RowsPerPage, Pagination, PaginationNumericButtons, PaginationArrowButton, PaginationNumericButton, LoadingPlaceholder, NoDataPlaceholder, SortingButton, } from './Components';
|
|
31
37
|
/**
|
|
32
38
|
*
|
|
33
|
-
*
|
|
34
|
-
* for table styling and functionality
|
|
39
|
+
* Helping functions
|
|
35
40
|
*
|
|
36
41
|
*/
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
sortable,
|
|
56
|
-
});
|
|
57
|
-
return (
|
|
58
|
-
// Apply the header cell props
|
|
59
|
-
// Key is defined from getHeaderGroupProps so we can ignore the false-negative
|
|
60
|
-
// eslint-disable-next-line react/jsx-key
|
|
61
|
-
_jsxs("th", Object.assign({}, castedColumn.getHeaderProps(), { style: Object.assign(Object.assign({}, castedColumn.getHeaderProps([
|
|
62
|
-
{
|
|
63
|
-
style: castedColumn.style,
|
|
64
|
-
className: castedColumn.className,
|
|
65
|
-
},
|
|
66
|
-
]).style), {
|
|
67
|
-
/** 0.25px */
|
|
68
|
-
letterSpacing: '0.25px' }), scope: "col", className: `${headerClasses} ${castedColumn.getHeaderProps([
|
|
69
|
-
{
|
|
70
|
-
style: castedColumn.style,
|
|
71
|
-
className: castedColumn.className,
|
|
72
|
-
},
|
|
73
|
-
]).className}` }, { children: [_jsxs("div", Object.assign({ className: "table-header-cell" }, { children: [castedColumn.render('Header'), castedColumn.canSort && (_jsx(SortIcon, Object.assign({}, castedColumn.getSortByToggleProps(), { isSortedDesc: castedColumn.isSortedDesc })))] })), 'canResize' in castedColumn &&
|
|
74
|
-
'getResizerProps' in castedColumn && (_jsx(ResizingBar, Object.assign({}, castedColumn.getResizerProps())))] })));
|
|
75
|
-
}) })))) }));
|
|
76
|
-
const DefaultBody = ({ getTableBodyProps, page, prepareRow, actionsButtons, headerGroups, rows, loading = false, }) => {
|
|
77
|
-
// Page is defined when using the usePagination plugin, otherwise rows is defined
|
|
78
|
-
const iterable = page !== null && page !== void 0 ? page : rows;
|
|
79
|
-
if (loading) {
|
|
80
|
-
return (_jsx(_Fragment, { children: _jsx("tbody", Object.assign({}, getTableBodyProps(), { className: "n-bg-light-neutral-bg-weak" }, { children: _jsx("tr", { children: _jsx("td", Object.assign({ colSpan: headerGroups[0].headers.length }, { children: _jsx("div", Object.assign({
|
|
81
|
-
// Minimum height of the table's body
|
|
82
|
-
// so placeholders are visible
|
|
83
|
-
style: { height: '100px' }, className: "n-flex n-flex-row n-justify-center n-items-center n-gap-2" }, { children: _jsxs("span", Object.assign({ className: "ndl-table-placeholder" }, { children: [_jsx(LoadingSpinner, {}), _jsx("h6", Object.assign({ className: "n-my-5 n-text-center" }, { children: "Loading data" }))] })) })) })) }) })) }));
|
|
84
|
-
}
|
|
85
|
-
return (_jsx(_Fragment, { children: iterable.length > 0 ? (_jsx("tbody", Object.assign({}, getTableBodyProps(), { className: "n-bg-light-neutral-bg-weak" }, { children: iterable.length > 0 &&
|
|
86
|
-
iterable.map((row) => {
|
|
87
|
-
prepareRow(row);
|
|
88
|
-
return (
|
|
89
|
-
// Key is defined from getHeaderGroupProps so we can ignore the false-negative
|
|
90
|
-
// eslint-disable-next-line react/jsx-key
|
|
91
|
-
_jsxs("tr", Object.assign({ className: "ndl-table-row" }, row.getRowProps(), { children: [row.cells.map((cell) => {
|
|
92
|
-
const castedColumn = cell.column;
|
|
93
|
-
return (
|
|
94
|
-
// Key is defined from getHeaderGroupProps so we can ignore the false-negative
|
|
95
|
-
// eslint-disable-next-line react/jsx-key
|
|
96
|
-
_jsx("td", Object.assign({ className: "ndl-table-cell" }, cell.getCellProps([
|
|
97
|
-
{
|
|
98
|
-
className: castedColumn.className,
|
|
99
|
-
style: castedColumn.style,
|
|
100
|
-
},
|
|
101
|
-
]), { children: cell.render('Cell') })));
|
|
102
|
-
}), actionsButtons && actionsButtons(row)] })));
|
|
103
|
-
}) }))) : (_jsx("tbody", Object.assign({}, getTableBodyProps(), { className: "n-bg-light-neutral-bg-weak" }, { children: _jsx("tr", { children: _jsx("td", Object.assign({ colSpan: headerGroups[0].headers.length }, { children: _jsx("div", Object.assign({
|
|
104
|
-
// Minimum height of the table's body
|
|
105
|
-
// so placeholders are visible
|
|
106
|
-
style: { height: '100px' }, className: "n-flex n-flex-row n-justify-center n-items-center n-gap-2" }, { children: _jsx("span", Object.assign({ className: "ndl-table-placeholder" }, { children: _jsx("h6", Object.assign({ className: "n-my-5 n-text-center n-h-10" }, { children: "No data present" })) })) })) })) }) }))) }));
|
|
42
|
+
export const TableComponents = {
|
|
43
|
+
ResizingBar: ResizingBar,
|
|
44
|
+
Header: Header,
|
|
45
|
+
Body: Body,
|
|
46
|
+
BodyCell: BodyCell,
|
|
47
|
+
BodyRow: BodyRow,
|
|
48
|
+
HeaderCell: HeaderCell,
|
|
49
|
+
ColumnControls: ColumnControls,
|
|
50
|
+
Navigation: Navigation,
|
|
51
|
+
TableResults: TableResults,
|
|
52
|
+
RowsPerPage: RowsPerPage,
|
|
53
|
+
Pagination: Pagination,
|
|
54
|
+
PaginationNumericButtons: PaginationNumericButtons,
|
|
55
|
+
PaginationNumericButton: PaginationNumericButton,
|
|
56
|
+
PaginationArrowButton: PaginationArrowButton,
|
|
57
|
+
LoadingPlaceholder: LoadingPlaceholder,
|
|
58
|
+
NoDataPlaceholder: NoDataPlaceholder,
|
|
59
|
+
SortingButton: SortingButton,
|
|
107
60
|
};
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
return (
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
*
|
|
120
|
-
* How the table component is divided into sections:
|
|
121
|
-
*
|
|
122
|
-
* @example
|
|
123
|
-
* +----------------+
|
|
124
|
-
* | Table Controls |
|
|
125
|
-
* | (ex: Search) |
|
|
126
|
-
* +----------------+
|
|
127
|
-
* | Header |
|
|
128
|
-
* +----------------+
|
|
129
|
-
* | Body (data) |
|
|
130
|
-
* +----------------+
|
|
131
|
-
* | Navigation |
|
|
132
|
-
* +----------------+
|
|
133
|
-
*
|
|
134
|
-
*/
|
|
135
|
-
const Table = (props
|
|
136
|
-
// props: any
|
|
137
|
-
) => {
|
|
138
|
-
const { controls, getTableProps, header, body, navigation, className = '', style = {}, tableStyles, role, } = props;
|
|
139
|
-
if (!getTableProps) {
|
|
140
|
-
throw new Error('getTableProps is required');
|
|
141
|
-
}
|
|
142
|
-
return (_jsxs("div", Object.assign({ className: classNames('ndl-table n-overflow-hidden n-flex n-flex-col n-divide-y n-divide-light-neutral-border-weak n-bg-light-neutral-bg-weak n-relative', className), style: style, role: role }, { children: [controls && (_jsx("div", Object.assign({ className: "n-px-7 n-py-6 n-flex n-flex-row n-items-center" }, { children: controls }))), _jsx("div", Object.assign({ className: "n-overflow-x-auto" }, { children: _jsxs("table", Object.assign({}, getTableProps(), { className: "n-w-full n-min-w-full n-divide-y n-divide-light-neutral-border-weak n-bg-light-neutral-bg-weak", style: tableStyles }, { children: [header || _jsx(DefaultHeader, Object.assign({}, props)), body || _jsx(DefaultBody, Object.assign({}, props))] })) })), navigation || (_jsx(DefaultNavigation, Object.assign({}, props)))] })));
|
|
61
|
+
const Table = (_a) => {
|
|
62
|
+
var { resizable = true, loading = false, tableProps, components } = _a, props = __rest(_a, ["resizable", "loading", "tableProps", "components"]);
|
|
63
|
+
const { className = '', style = {} } = props;
|
|
64
|
+
const tableRootRef = useRef(null);
|
|
65
|
+
const Components = useMemo(() => (Object.assign(Object.assign({}, TableComponents), components)), [components]);
|
|
66
|
+
return (_jsx(TableContext.Provider, Object.assign({ value: {
|
|
67
|
+
resizable,
|
|
68
|
+
tableProps,
|
|
69
|
+
loading,
|
|
70
|
+
components: Components,
|
|
71
|
+
} }, { children: _jsxs("div", Object.assign({}, props, { className: classNames('ndl-table-root', className), style: style, ref: tableRootRef }, { children: [_jsx("div", Object.assign({ className: "n-overflow-x-auto" }, { children: _jsxs("div", Object.assign({ className: "ndl-div-table", role: "table", "aria-busy": loading ? 'true' : 'false' }, { children: [(Components === null || Components === void 0 ? void 0 : Components.Header) && _jsx(Components.Header, {}), (Components === null || Components === void 0 ? void 0 : Components.Body) && _jsx(Components.Body, {})] })) })), (Components === null || Components === void 0 ? void 0 : Components.Navigation) && _jsx(Components.Navigation, {})] })) })));
|
|
143
72
|
};
|
|
144
73
|
/**
|
|
145
74
|
* Easy Actions wrapper for each row
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.js","sourceRoot":"","sources":["../../../src/table/Table.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Table.js","sourceRoot":"","sources":["../../../src/table/Table.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,UAAU,MAAM,YAAY,CAAC;AAGpC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAEL,YAAY,GAEb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,cAAc,EACd,WAAW,EACX,OAAO,EACP,UAAU,EACV,UAAU,EACV,YAAY,EACZ,WAAW,EACX,UAAU,EACV,wBAAwB,EACxB,qBAAqB,EACrB,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,GACd,MAAM,cAAc,CAAC;AAGtB;;;;GAIG;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,WAAW,EAAE,WAAW;IACxB,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,IAAI;IACV,QAAQ,EAAE,QAAQ;IAClB,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,UAAU;IACtB,cAAc,EAAE,cAAc;IAC9B,UAAU,EAAE,UAAU;IACtB,YAAY,EAAE,YAAY;IAC1B,WAAW,EAAE,WAAW;IACxB,UAAU,EAAE,UAAU;IACtB,wBAAwB,EAAE,wBAAwB;IAClD,uBAAuB,EAAE,uBAAuB;IAChD,qBAAqB,EAAE,qBAAqB;IAC5C,kBAAkB,EAAE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AC;AAEF;;GAEG;AACH,MAAM,UAAU,GAAG,CAAC,KAAkC,EAAE,EAAE,CAAC,CACzD,8BACM,KAAK,IACT,SAAS,EAAE,UAAU,CAAC,uBAAuB,EAAE,KAAK,CAAC,SAAS,CAAC,IAC/D,CACH,CAAC;AACF,KAAK,CAAC,UAAU,GAAG,UAAU,CAAC;AAE9B,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
import { useContext, createContext } from 'react';
|
|
22
|
+
export const TableContext = createContext(null);
|
|
23
|
+
export function useTableContext() {
|
|
24
|
+
const context = useContext(TableContext);
|
|
25
|
+
if (!context) {
|
|
26
|
+
throw new Error('useTableContext be used under Table component provider');
|
|
27
|
+
}
|
|
28
|
+
return context;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=TableContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableContext.js","sourceRoot":"","sources":["../../../src/table/TableContext.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AA2DlD,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAwB,IAAK,CAAC,CAAC;AAExE,MAAM,UAAU,eAAe;IAC7B,MAAM,OAAO,GAAG,UAAU,CAAsB,YAAY,CAAC,CAAC;IAC9D,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;KAC3E;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/lib/esm/table/helpers.js
CHANGED
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
1
|
/**
|
|
14
2
|
*
|
|
15
3
|
* Copyright (c) "Neo4j"
|
|
@@ -30,43 +18,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
30
18
|
* You should have received a copy of the GNU General Public License
|
|
31
19
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
32
20
|
*/
|
|
33
|
-
import { HeroIcon } from '../icons';
|
|
34
|
-
import { memo } from 'react';
|
|
35
|
-
/**
|
|
36
|
-
*
|
|
37
|
-
* React Table helper to display sorting icon
|
|
38
|
-
* Source:
|
|
39
|
-
* https://react-table.tanstack.com/docs/api/useSortBy#column-properties
|
|
40
|
-
*
|
|
41
|
-
*/
|
|
42
|
-
export const SortIcon = (_a) => {
|
|
43
|
-
var { isSortedDesc } = _a, props = __rest(_a, ["isSortedDesc"]);
|
|
44
|
-
switch (true) {
|
|
45
|
-
case isSortedDesc === true:
|
|
46
|
-
return (_jsx(HeroIcon, Object.assign({}, props, { className: "n-w-4 n-h-4", type: "outline", iconName: "SortDescendingIcon" })));
|
|
47
|
-
case isSortedDesc === false:
|
|
48
|
-
return (_jsx(HeroIcon, Object.assign({}, props, { className: "n-w-4 n-h-4", type: "outline", iconName: "SortAscendingIcon" })));
|
|
49
|
-
default:
|
|
50
|
-
return (_jsx(HeroIcon, Object.assign({}, props, { className: "n-w-4 n-h-4", type: "outline", iconName: "MenuAlt1Icon" })));
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
export const ResizingBar = memo(function ResizingBarMemoed(props) {
|
|
54
|
-
return (_jsx("div", Object.assign({}, props, { className: "table-resizing-bar", style: {
|
|
55
|
-
width: '4px',
|
|
56
|
-
zIndex: 1,
|
|
57
|
-
// prevents from scrolling while dragging on touch devices
|
|
58
|
-
touchAction: 'none',
|
|
59
|
-
} })));
|
|
60
|
-
});
|
|
61
|
-
/**
|
|
62
|
-
* The left section of the bottom navigation
|
|
63
|
-
* that is showing the current page and how many results we can see
|
|
64
|
-
*/
|
|
65
|
-
export const TableResults = ({ pageIndex, pageLength, rowsLength, }) => {
|
|
66
|
-
const from = Math.min(rowsLength, 1 + (pageIndex * pageLength));
|
|
67
|
-
const to = Math.min(rowsLength, pageIndex * pageLength + pageLength);
|
|
68
|
-
return (_jsx("span", Object.assign({ className: "n-text-light-neutral-text-weaker body-medium n-whitespace-nowrap" }, { children: _jsxs("span", { children: ["Showing ", _jsxs("b", { children: [from, to !== from && `-${to}`] }), " of ", _jsx("b", { children: rowsLength }), " results"] }) })));
|
|
69
|
-
};
|
|
70
21
|
/**
|
|
71
22
|
* Modified from here: https://gist.github.com/kottenator/9d936eb3e4e3c3e02598
|
|
72
23
|
*
|
|
@@ -76,41 +27,50 @@ export const TableResults = ({ pageIndex, pageLength, rowsLength, }) => {
|
|
|
76
27
|
*/
|
|
77
28
|
export const userFriendlyPagination = (current, max) => {
|
|
78
29
|
const last = max;
|
|
79
|
-
const delta =
|
|
30
|
+
const delta = 1;
|
|
80
31
|
const left = current - delta;
|
|
81
32
|
const right = current + delta + 1;
|
|
82
33
|
const range = [];
|
|
83
34
|
const rangeWithDots = [];
|
|
84
|
-
let
|
|
35
|
+
let length;
|
|
85
36
|
for (let i = 1; i <= last; i += 1) {
|
|
86
37
|
if (i === 1 || i === last || (i >= left && i < right)) {
|
|
87
38
|
range.push(i);
|
|
88
39
|
}
|
|
89
40
|
}
|
|
90
41
|
for (let i = 0; i < range.length; i += 1) {
|
|
91
|
-
if (
|
|
92
|
-
if (range[i] -
|
|
93
|
-
rangeWithDots.push(
|
|
42
|
+
if (length) {
|
|
43
|
+
if (range[i] - length === 2) {
|
|
44
|
+
rangeWithDots.push(length + 1);
|
|
94
45
|
}
|
|
95
|
-
else if (range[i] -
|
|
46
|
+
else if (range[i] - length !== 1) {
|
|
96
47
|
rangeWithDots.push('...');
|
|
97
48
|
}
|
|
98
49
|
}
|
|
99
50
|
rangeWithDots.push(range[i]);
|
|
100
|
-
|
|
51
|
+
length = range[i];
|
|
101
52
|
}
|
|
102
53
|
return rangeWithDots;
|
|
103
54
|
};
|
|
104
55
|
/**
|
|
105
|
-
*
|
|
106
|
-
*
|
|
56
|
+
* Simple helper to generate inline grid style
|
|
57
|
+
* to be responsive.
|
|
58
|
+
*
|
|
59
|
+
* Secret sauce:
|
|
60
|
+
* The last element takes an "auto" width, so it will
|
|
61
|
+
* fill the available space, and the result till be for 4 columns:
|
|
62
|
+
* minmax(min column1Sizepx,column1Sizepx) minmax(min column2Sizepx,column2Sizepx) ... minmax(columnNSizepx, auto)
|
|
107
63
|
*/
|
|
108
|
-
export const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
64
|
+
export const gridGenerator = (table) => {
|
|
65
|
+
const visibleColumns = table.getVisibleFlatColumns();
|
|
66
|
+
const defaultMin = table._getDefaultColumnDef().minSize;
|
|
67
|
+
return visibleColumns
|
|
68
|
+
.map((i, idx) => {
|
|
69
|
+
var _a;
|
|
70
|
+
return visibleColumns.length === idx + 1
|
|
71
|
+
? `minmax(${i.getSize()}px ,auto)`
|
|
72
|
+
: `minmax(${((_a = table.getColumn(i.id)) === null || _a === void 0 ? void 0 : _a.columnDef.minSize) || defaultMin}px,${i.getSize()}px)`;
|
|
73
|
+
})
|
|
74
|
+
.join(' ');
|
|
115
75
|
};
|
|
116
76
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/table/helpers.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/table/helpers.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,OAAe,EAAE,GAAW,EAAE,EAAE;IACrE,MAAM,IAAI,GAAG,GAAG,CAAC;IACjB,MAAM,KAAK,GAAG,CAAC,CAAC;IAChB,MAAM,IAAI,GAAG,OAAO,GAAG,KAAK,CAAC;IAC7B,MAAM,KAAK,GAAG,OAAO,GAAG,KAAK,GAAG,CAAC,CAAC;IAClC,MAAM,KAAK,GAAG,EAAE,CAAC;IACjB,MAAM,aAAa,GAAG,EAAE,CAAC;IACzB,IAAI,MAA0B,CAAC;IAE/B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE;QACjC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAA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IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC,CAAC"}
|
package/lib/esm/table/index.js
CHANGED
|
@@ -18,6 +18,6 @@
|
|
|
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 { default as Table } from './Table';
|
|
22
|
-
export * from './
|
|
21
|
+
export { default as Table, TableComponents } from './Table';
|
|
22
|
+
export * as tableUtils from './helpers';
|
|
23
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/table/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/table/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,KAAK,UAAU,MAAM,WAAW,CAAC"}
|