@carbon/ibm-products 2.43.2-canary.11 → 2.43.2-canary.111
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-full-carbon.css +1780 -443
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +1 -1
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +219 -9
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +1 -1
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +1439 -244
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +1 -1
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +1490 -218
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/css/index.min.css.map +1 -1
- package/es/components/ActionBar/ActionBar.d.ts +58 -2
- package/es/components/ActionBar/ActionBar.js +14 -9
- package/es/components/ActionBar/ActionBarItem.d.ts +36 -2
- package/es/components/ActionBar/ActionBarItem.js +8 -5
- package/es/components/ActionBar/ActionBarOverflowItems.d.ts +55 -16
- package/es/components/ActionBar/ActionBarOverflowItems.js +8 -4
- package/es/components/Card/Card.d.ts +68 -2
- package/es/components/Card/Card.js +28 -35
- package/es/components/Card/CardFooter.d.ts +51 -48
- package/es/components/Card/CardFooter.js +4 -2
- package/es/components/Card/CardHeader.d.ts +67 -49
- package/es/components/Card/CardHeader.js +4 -2
- package/es/components/Coachmark/Coachmark.d.ts +6 -1
- package/es/components/Coachmark/Coachmark.js +47 -11
- package/es/components/Coachmark/CoachmarkOverlay.js +2 -4
- package/es/components/CoachmarkBeacon/CoachmarkBeacon.js +1 -7
- package/es/components/CoachmarkFixed/CoachmarkFixed.js +13 -11
- package/es/components/CoachmarkStack/CoachmarkStack.js +7 -3
- package/es/components/CoachmarkStack/CoachmarkStackHome.js +8 -4
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +1 -0
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +90 -56
- package/es/components/ConditionBuilder/ConditionBuilder.js +82 -25
- package/es/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.d.ts +15 -0
- package/es/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +154 -0
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +3 -1
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +29 -13
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +8 -1
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +35 -11
- package/es/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +18 -10
- package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +19 -11
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +9 -13
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +83 -64
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +13 -7
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +31 -8
- package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +8 -2
- package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +35 -24
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +43 -36
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +43 -36
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +6 -2
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +114 -40
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.d.ts +3 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +24 -9
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +27 -9
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +13 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +114 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.d.ts → ItemOptionForValueField.d.ts} +2 -2
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.js → ItemOptionForValueField.js} +71 -38
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.d.ts +5 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +22 -9
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +1 -1
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts +1 -3
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +131 -42
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +5 -1
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +51 -19
- package/es/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +2 -1
- package/es/components/ConditionBuilder/utils/handleKeyboardEvents.js +152 -42
- package/es/components/ConditionBuilder/utils/useTranslations.d.ts +1 -0
- package/es/components/ConditionBuilder/utils/useTranslations.js +26 -0
- package/es/components/ConditionBuilder/utils/util.d.ts +6 -4
- package/es/components/ConditionBuilder/utils/util.js +42 -17
- package/es/components/CreateFullPage/CreateFullPage.js +2 -2
- package/es/components/DataSpreadsheet/DataSpreadsheet.d.ts +26 -0
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +129 -53
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +16 -0
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +32 -7
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +8 -0
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +16 -3
- package/es/components/DataSpreadsheet/types/index.d.ts +1 -0
- package/es/components/Datagrid/Datagrid/Datagrid.d.ts +0 -4
- package/es/components/Datagrid/Datagrid/Datagrid.js +4 -9
- package/es/components/Datagrid/Datagrid/DatagridContent.js +4 -3
- package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +23 -8
- package/es/components/Datagrid/Datagrid/DatagridRow.js +21 -8
- package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +6 -6
- package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +3 -2
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +34 -10
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +6 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +6 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +6 -3
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +20 -12
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.d.ts +1 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +54 -17
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +2 -3
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +75 -12
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +10 -2
- package/es/components/Datagrid/types/index.d.ts +57 -9
- package/es/components/Datagrid/useActionsColumn.d.ts +8 -1
- package/es/components/Datagrid/useActionsColumn.js +7 -6
- package/es/components/Datagrid/useColumnRightAlign.d.ts +8 -1
- package/es/components/Datagrid/useColumnRightAlign.js +4 -3
- package/es/components/Datagrid/useCustomizeColumns.d.ts +8 -1
- package/es/components/Datagrid/useCustomizeColumns.js +4 -3
- package/es/components/Datagrid/useDefaultStringRenderer.js +0 -1
- package/es/components/Datagrid/useDisableSelectRows.d.ts +2 -1
- package/es/components/Datagrid/useDisableSelectRows.js +27 -22
- package/es/components/Datagrid/useInlineEdit.js +12 -2
- package/es/components/Datagrid/useNestedRowExpander.js +1 -3
- package/es/components/Datagrid/useNestedRows.js +32 -13
- package/es/components/Datagrid/useRowExpander.js +1 -3
- package/es/components/Datagrid/useSelectRows.js +2 -1
- package/es/components/Datagrid/useStickyColumn.d.ts +8 -1
- package/es/components/Datagrid/useStickyColumn.js +12 -9
- package/es/components/EditInPlace/EditInPlace.d.ts +4 -0
- package/es/components/EditInPlace/EditInPlace.js +21 -10
- package/es/components/EditTearsheet/EditTearsheet.d.ts +7 -2
- package/es/components/EditTearsheet/EditTearsheet.js +44 -10
- package/es/components/EditTearsheet/EditTearsheetForm.d.ts +45 -2
- package/es/components/EditTearsheet/EditTearsheetForm.js +3 -0
- package/es/components/EmptyStates/EmptyState.d.ts +72 -5
- package/es/components/EmptyStates/EmptyState.js +8 -5
- package/es/components/EmptyStates/EmptyStateV2.d.ts +63 -2
- package/es/components/EmptyStates/EmptyStateV2.js +3 -2
- package/es/components/FullPageError/FullPageError.d.ts +36 -2
- package/es/components/FullPageError/FullPageError.js +0 -3
- package/es/components/GetStartedCard/GetStartedCard.d.ts +60 -2
- package/es/components/GetStartedCard/GetStartedCard.js +11 -10
- package/es/components/HTTPErrors/HTTPError403/HTTPError403.js +6 -0
- package/es/components/HTTPErrors/HTTPError404/HTTPError404.js +6 -0
- package/es/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +6 -0
- package/es/components/HTTPErrors/assets/HTTPErrorSvg403.js +204 -200
- package/es/components/HTTPErrors/assets/HTTPErrorSvg404.js +116 -112
- package/es/components/HTTPErrors/assets/HTTPErrorSvgOther.js +110 -106
- package/es/components/Nav/NavItem.js +12 -3
- package/es/components/OptionsTile/OptionsTile.js +11 -6
- package/es/components/PageHeader/PageHeader.js +1 -0
- package/es/components/PageHeader/PageHeaderUtils.js +1 -1
- package/es/components/RemoveModal/RemoveModal.d.ts +4 -0
- package/es/components/RemoveModal/RemoveModal.js +7 -1
- package/es/components/SearchBar/SearchBar.d.ts +1 -1
- package/es/components/SearchBar/SearchBar.js +2 -2
- package/es/components/SidePanel/SidePanel.js +17 -21
- package/es/components/SidePanel/motion/variants.d.ts +4 -6
- package/es/components/SidePanel/motion/variants.js +10 -11
- package/es/components/StatusIndicator/StatusIndicatorStep.js +87 -0
- package/es/components/StringFormatter/StringFormatter.js +14 -3
- package/es/components/StringFormatter/utils/enums.d.ts +20 -1
- package/es/components/StringFormatter/utils/enums.js +22 -2
- package/es/components/TagOverflow/TagOverflow.d.ts +35 -4
- package/es/components/TagOverflow/TagOverflow.js +47 -64
- package/es/components/TagOverflow/TagOverflowModal.js +4 -6
- package/es/components/TagOverflow/TagOverflowPopover.d.ts +13 -1
- package/es/components/TagOverflow/TagOverflowPopover.js +38 -41
- package/es/components/Tearsheet/Tearsheet.d.ts +8 -1
- package/es/components/Tearsheet/Tearsheet.js +9 -1
- package/es/components/Tearsheet/TearsheetNarrow.d.ts +11 -0
- package/es/components/Tearsheet/TearsheetNarrow.js +12 -0
- package/es/components/Tearsheet/TearsheetShell.d.ts +11 -1
- package/es/components/Tearsheet/TearsheetShell.js +28 -7
- package/es/components/Toolbar/ToolbarButton.js +1 -1
- package/es/components/UserAvatar/UserAvatar.d.ts +59 -1
- package/es/components/UserAvatar/UserAvatar.js +7 -23
- package/es/components/WebTerminal/WebTerminal.js +10 -12
- package/es/components/index.d.ts +1 -1
- package/es/global/js/hooks/useFocus.d.ts +1 -0
- package/es/global/js/hooks/useFocus.js +5 -2
- package/es/global/js/hooks/usePrefersReducedMotion.js +14 -8
- package/es/global/js/package-settings.d.ts +1 -1
- package/es/global/js/package-settings.js +1 -1
- package/es/index.js +1 -0
- package/es/node_modules/@carbon/icon-helpers/es/index.js +49 -62
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-2.js +1020 -1058
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-9.js +881 -758
- package/es/settings.d.ts +1 -1
- package/lib/components/ActionBar/ActionBar.d.ts +58 -2
- package/lib/components/ActionBar/ActionBar.js +14 -9
- package/lib/components/ActionBar/ActionBarItem.d.ts +36 -2
- package/lib/components/ActionBar/ActionBarItem.js +7 -4
- package/lib/components/ActionBar/ActionBarOverflowItems.d.ts +55 -16
- package/lib/components/ActionBar/ActionBarOverflowItems.js +8 -4
- package/lib/components/Card/Card.d.ts +68 -2
- package/lib/components/Card/Card.js +28 -35
- package/lib/components/Card/CardFooter.d.ts +51 -48
- package/lib/components/Card/CardFooter.js +4 -2
- package/lib/components/Card/CardHeader.d.ts +67 -49
- package/lib/components/Card/CardHeader.js +4 -2
- package/lib/components/Coachmark/Coachmark.d.ts +6 -1
- package/lib/components/Coachmark/Coachmark.js +46 -10
- package/lib/components/Coachmark/CoachmarkOverlay.js +2 -4
- package/lib/components/CoachmarkBeacon/CoachmarkBeacon.js +1 -7
- package/lib/components/CoachmarkFixed/CoachmarkFixed.js +13 -11
- package/lib/components/CoachmarkStack/CoachmarkStack.js +7 -3
- package/lib/components/CoachmarkStack/CoachmarkStackHome.js +8 -4
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +1 -0
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +87 -53
- package/lib/components/ConditionBuilder/ConditionBuilder.js +82 -25
- package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.d.ts +15 -0
- package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +163 -0
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +3 -1
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +28 -11
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +8 -1
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +33 -9
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +16 -8
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +18 -10
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +9 -13
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +81 -62
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +13 -7
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +31 -8
- package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +8 -2
- package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +34 -24
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +43 -36
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +43 -36
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +6 -2
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +112 -38
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.d.ts +3 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +24 -9
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +28 -10
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +13 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +122 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.d.ts → ItemOptionForValueField.d.ts} +2 -2
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.js → ItemOptionForValueField.js} +68 -35
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.d.ts +5 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +21 -8
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +1 -1
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts +1 -3
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +128 -39
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +5 -1
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +50 -17
- package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +2 -1
- package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.js +152 -41
- package/lib/components/ConditionBuilder/utils/useTranslations.d.ts +1 -0
- package/lib/components/ConditionBuilder/utils/useTranslations.js +30 -0
- package/lib/components/ConditionBuilder/utils/util.d.ts +6 -4
- package/lib/components/ConditionBuilder/utils/util.js +44 -16
- package/lib/components/CreateFullPage/CreateFullPage.js +2 -2
- package/lib/components/DataSpreadsheet/DataSpreadsheet.d.ts +26 -0
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +129 -53
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +16 -0
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +32 -7
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +8 -0
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +16 -3
- package/lib/components/DataSpreadsheet/types/index.d.ts +1 -0
- package/lib/components/Datagrid/Datagrid/Datagrid.d.ts +0 -4
- package/lib/components/Datagrid/Datagrid/Datagrid.js +4 -9
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +4 -3
- package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +23 -8
- package/lib/components/Datagrid/Datagrid/DatagridRow.js +21 -8
- package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +6 -6
- package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +3 -2
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +34 -10
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +6 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +6 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +6 -3
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +20 -12
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.d.ts +1 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +53 -16
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +2 -3
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +74 -11
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +10 -2
- package/lib/components/Datagrid/types/index.d.ts +57 -9
- package/lib/components/Datagrid/useActionsColumn.d.ts +8 -1
- package/lib/components/Datagrid/useActionsColumn.js +7 -6
- package/lib/components/Datagrid/useColumnRightAlign.d.ts +8 -1
- package/lib/components/Datagrid/useColumnRightAlign.js +4 -3
- package/lib/components/Datagrid/useCustomizeColumns.d.ts +8 -1
- package/lib/components/Datagrid/useCustomizeColumns.js +4 -3
- package/lib/components/Datagrid/useDefaultStringRenderer.js +0 -1
- package/lib/components/Datagrid/useDisableSelectRows.d.ts +2 -1
- package/lib/components/Datagrid/useDisableSelectRows.js +27 -22
- package/lib/components/Datagrid/useInlineEdit.js +12 -2
- package/lib/components/Datagrid/useNestedRowExpander.js +1 -3
- package/lib/components/Datagrid/useNestedRows.js +32 -13
- package/lib/components/Datagrid/useRowExpander.js +1 -3
- package/lib/components/Datagrid/useSelectRows.js +2 -1
- package/lib/components/Datagrid/useStickyColumn.d.ts +8 -1
- package/lib/components/Datagrid/useStickyColumn.js +12 -9
- package/lib/components/EditInPlace/EditInPlace.d.ts +4 -0
- package/lib/components/EditInPlace/EditInPlace.js +21 -10
- package/lib/components/EditTearsheet/EditTearsheet.d.ts +7 -2
- package/lib/components/EditTearsheet/EditTearsheet.js +43 -9
- package/lib/components/EditTearsheet/EditTearsheetForm.d.ts +45 -2
- package/lib/components/EditTearsheet/EditTearsheetForm.js +3 -0
- package/lib/components/EmptyStates/EmptyState.d.ts +72 -5
- package/lib/components/EmptyStates/EmptyState.js +8 -5
- package/lib/components/EmptyStates/EmptyStateV2.d.ts +63 -2
- package/lib/components/EmptyStates/EmptyStateV2.js +3 -2
- package/lib/components/FullPageError/FullPageError.d.ts +36 -2
- package/lib/components/FullPageError/FullPageError.js +0 -3
- package/lib/components/GetStartedCard/GetStartedCard.d.ts +60 -2
- package/lib/components/GetStartedCard/GetStartedCard.js +10 -9
- package/lib/components/HTTPErrors/HTTPError403/HTTPError403.js +6 -0
- package/lib/components/HTTPErrors/HTTPError404/HTTPError404.js +6 -0
- package/lib/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +6 -0
- package/lib/components/HTTPErrors/assets/HTTPErrorSvg403.js +204 -200
- package/lib/components/HTTPErrors/assets/HTTPErrorSvg404.js +116 -112
- package/lib/components/HTTPErrors/assets/HTTPErrorSvgOther.js +110 -106
- package/lib/components/Nav/NavItem.js +10 -1
- package/lib/components/OptionsTile/OptionsTile.js +11 -6
- package/lib/components/PageHeader/PageHeader.js +1 -0
- package/lib/components/PageHeader/PageHeaderUtils.js +1 -1
- package/lib/components/RemoveModal/RemoveModal.d.ts +4 -0
- package/lib/components/RemoveModal/RemoveModal.js +7 -1
- package/lib/components/SearchBar/SearchBar.d.ts +1 -1
- package/lib/components/SearchBar/SearchBar.js +2 -2
- package/lib/components/SidePanel/SidePanel.js +16 -20
- package/lib/components/SidePanel/motion/variants.d.ts +4 -6
- package/lib/components/SidePanel/motion/variants.js +10 -11
- package/lib/components/StatusIndicator/StatusIndicatorStep.js +94 -0
- package/lib/components/StringFormatter/StringFormatter.js +13 -2
- package/lib/components/StringFormatter/utils/enums.d.ts +20 -1
- package/lib/components/StringFormatter/utils/enums.js +23 -1
- package/lib/components/TagOverflow/TagOverflow.d.ts +35 -4
- package/lib/components/TagOverflow/TagOverflow.js +46 -63
- package/lib/components/TagOverflow/TagOverflowModal.js +4 -6
- package/lib/components/TagOverflow/TagOverflowPopover.d.ts +13 -1
- package/lib/components/TagOverflow/TagOverflowPopover.js +37 -40
- package/lib/components/Tearsheet/Tearsheet.d.ts +8 -1
- package/lib/components/Tearsheet/Tearsheet.js +9 -1
- package/lib/components/Tearsheet/TearsheetNarrow.d.ts +11 -0
- package/lib/components/Tearsheet/TearsheetNarrow.js +12 -0
- package/lib/components/Tearsheet/TearsheetShell.d.ts +11 -1
- package/lib/components/Tearsheet/TearsheetShell.js +26 -5
- package/lib/components/Toolbar/ToolbarButton.js +1 -1
- package/lib/components/UserAvatar/UserAvatar.d.ts +59 -1
- package/lib/components/UserAvatar/UserAvatar.js +7 -23
- package/lib/components/WebTerminal/WebTerminal.js +10 -12
- package/lib/components/index.d.ts +1 -1
- package/lib/global/js/hooks/useFocus.d.ts +1 -0
- package/lib/global/js/hooks/useFocus.js +5 -1
- package/lib/global/js/hooks/usePrefersReducedMotion.js +13 -7
- package/lib/global/js/package-settings.d.ts +1 -1
- package/lib/global/js/package-settings.js +1 -1
- package/lib/index.js +5 -0
- package/lib/node_modules/@carbon/icon-helpers/es/index.js +49 -62
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-2.js +1036 -1074
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-9.js +946 -823
- package/lib/settings.d.ts +1 -1
- package/package.json +8 -7
- package/scss/components/Coachmark/_coachmark-overlay.scss +6 -70
- package/scss/components/Coachmark/_coachmark.scss +5 -4
- package/scss/components/CoachmarkBeacon/_coachmark-beacon.scss +1 -3
- package/scss/components/ConditionBuilder/_condition-builder.scss +8 -1
- package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +31 -5
- package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +61 -22
- package/scss/components/CreateModal/_create-modal.scss +0 -4
- package/scss/components/DataSpreadsheet/_data-spreadsheet.scss +16 -2
- package/scss/components/Datagrid/_datagrid.scss +0 -4
- package/scss/components/Datagrid/styles/_datagrid.scss +1 -0
- package/scss/components/Datagrid/styles/_useInlineEdit.scss +13 -0
- package/scss/components/Datagrid/styles/addons/_CustomizeColumnsTearsheet.scss +7 -5
- package/scss/components/Datagrid/styles/addons/_FilterFlyout.scss +5 -4
- package/scss/components/HTTPErrors/_http-errors.scss +77 -0
- package/scss/components/OptionsTile/_options-tile.scss +6 -6
- package/scss/components/SidePanel/_side-panel.scss +1 -1
- package/scss/components/_index-released-only.scss +1 -0
- package/telemetry.yml +32 -19
- package/es/components/ConditionBuilder/utils/checkForHoldingKey.d.ts +0 -1
- package/es/components/ConditionBuilder/utils/checkForHoldingKey.js +0 -16
- package/es/global/js/utils/window.d.ts +0 -2
- package/es/global/js/utils/window.js +0 -12
- package/lib/components/ConditionBuilder/utils/checkForHoldingKey.d.ts +0 -1
- package/lib/components/ConditionBuilder/utils/checkForHoldingKey.js +0 -20
- package/lib/global/js/utils/window.d.ts +0 -2
- package/lib/global/js/utils/window.js +0 -16
@@ -32,7 +32,7 @@ import { useSpreadsheetOutsideClick } from './hooks/useSpreadsheetOutsideClick.j
|
|
32
32
|
import { useMoveActiveCell } from './hooks/useMoveActiveCell.js';
|
33
33
|
import { useSpreadsheetEdit } from './hooks/useSpreadsheetEdit.js';
|
34
34
|
|
35
|
-
var _excluded = ["cellSize", "className", "columns", "data", "defaultEmptyRowCount", "onDataUpdate", "id", "onActiveCellChange", "onSelectionAreaChange", "selectAllAriaLabel", "spreadsheetAriaLabel", "theme", "totalVisibleColumns"];
|
35
|
+
var _excluded = ["cellSize", "className", "columns", "data", "defaultEmptyRowCount", "onDataUpdate", "onColDrag", "id", "onActiveCellChange", "onSelectionAreaChange", "renderRowHeader", "renderRowHeaderDirection", "disableColumnSwapping", "readOnlyTable", "selectAllAriaLabel", "spreadsheetAriaLabel", "theme", "totalVisibleColumns"];
|
36
36
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
37
37
|
var blockClass = "".concat(pkg.prefix, "--data-spreadsheet");
|
38
38
|
var componentName = 'DataSpreadsheet';
|
@@ -43,6 +43,7 @@ var defaults = {
|
|
43
43
|
data: Object.freeze([]),
|
44
44
|
defaultEmptyRowCount: 16,
|
45
45
|
onDataUpdate: Object.freeze(function () {}),
|
46
|
+
onColDrag: Object.freeze(function () {}),
|
46
47
|
onActiveCellChange: Object.freeze(function () {}),
|
47
48
|
onSelectionAreaChange: Object.freeze(function () {}),
|
48
49
|
theme: 'light'
|
@@ -62,11 +63,19 @@ var DataSpreadsheet = /*#__PURE__*/React__default.forwardRef(function (_ref, ref
|
|
62
63
|
defaultEmptyRowCount = _ref$defaultEmptyRowC === void 0 ? defaults.defaultEmptyRowCount : _ref$defaultEmptyRowC,
|
63
64
|
_ref$onDataUpdate = _ref.onDataUpdate,
|
64
65
|
onDataUpdate = _ref$onDataUpdate === void 0 ? defaults.onDataUpdate : _ref$onDataUpdate,
|
66
|
+
_ref$onColDrag = _ref.onColDrag,
|
67
|
+
onColDrag = _ref$onColDrag === void 0 ? defaults.onColDrag : _ref$onColDrag,
|
65
68
|
id = _ref.id,
|
66
69
|
_ref$onActiveCellChan = _ref.onActiveCellChange,
|
67
70
|
onActiveCellChange = _ref$onActiveCellChan === void 0 ? defaults.onActiveCellChange : _ref$onActiveCellChan,
|
68
71
|
_ref$onSelectionAreaC = _ref.onSelectionAreaChange,
|
69
72
|
onSelectionAreaChange = _ref$onSelectionAreaC === void 0 ? defaults.onSelectionAreaChange : _ref$onSelectionAreaC,
|
73
|
+
renderRowHeader = _ref.renderRowHeader,
|
74
|
+
renderRowHeaderDirection = _ref.renderRowHeaderDirection,
|
75
|
+
_ref$disableColumnSwa = _ref.disableColumnSwapping,
|
76
|
+
disableColumnSwapping = _ref$disableColumnSwa === void 0 ? false : _ref$disableColumnSwa,
|
77
|
+
_ref$readOnlyTable = _ref.readOnlyTable,
|
78
|
+
readOnlyTable = _ref$readOnlyTable === void 0 ? false : _ref$readOnlyTable,
|
70
79
|
selectAllAriaLabel = _ref.selectAllAriaLabel,
|
71
80
|
spreadsheetAriaLabel = _ref.spreadsheetAriaLabel,
|
72
81
|
theme = _ref.theme,
|
@@ -76,75 +85,86 @@ var DataSpreadsheet = /*#__PURE__*/React__default.forwardRef(function (_ref, ref
|
|
76
85
|
var localRef = useRef();
|
77
86
|
var spreadsheetRef = ref || localRef;
|
78
87
|
var focusedElement = useActiveElement();
|
79
|
-
var _useState = useState(
|
88
|
+
var _useState = useState(columns),
|
80
89
|
_useState2 = _slicedToArray(_useState, 2),
|
81
|
-
|
82
|
-
|
83
|
-
var _useState3 = useState(
|
90
|
+
currentColumns = _useState2[0],
|
91
|
+
setCurrentColumns = _useState2[1];
|
92
|
+
var _useState3 = useState([]),
|
84
93
|
_useState4 = _slicedToArray(_useState3, 2),
|
85
|
-
|
86
|
-
|
87
|
-
var _useState5 = useState(
|
94
|
+
pastColumns = _useState4[0],
|
95
|
+
setPastColumns = _useState4[1];
|
96
|
+
var _useState5 = useState(false),
|
88
97
|
_useState6 = _slicedToArray(_useState5, 2),
|
89
|
-
|
90
|
-
|
91
|
-
var _useState7 = useState(
|
98
|
+
containerHasFocus = _useState6[0],
|
99
|
+
setContainerHasFocus = _useState6[1];
|
100
|
+
var _useState7 = useState(null),
|
92
101
|
_useState8 = _slicedToArray(_useState7, 2),
|
93
|
-
|
94
|
-
|
95
|
-
var _useState9 = useState(
|
102
|
+
activeCellCoordinates = _useState8[0],
|
103
|
+
setActiveCellCoordinates = _useState8[1];
|
104
|
+
var _useState9 = useState([]),
|
96
105
|
_useState10 = _slicedToArray(_useState9, 2),
|
97
|
-
|
98
|
-
|
99
|
-
var _useState11 = useState(
|
106
|
+
selectionAreas = _useState10[0],
|
107
|
+
setSelectionAreas = _useState10[1];
|
108
|
+
var _useState11 = useState([]),
|
100
109
|
_useState12 = _slicedToArray(_useState11, 2),
|
101
|
-
|
102
|
-
|
110
|
+
selectionAreaData = _useState12[0],
|
111
|
+
setSelectionAreaData = _useState12[1];
|
103
112
|
var _useState13 = useState(false),
|
104
113
|
_useState14 = _slicedToArray(_useState13, 2),
|
105
|
-
|
106
|
-
|
114
|
+
clickAndHoldActive = _useState14[0],
|
115
|
+
setClickAndHoldActive = _useState14[1];
|
107
116
|
var _useState15 = useState(''),
|
108
117
|
_useState16 = _slicedToArray(_useState15, 2),
|
109
|
-
|
110
|
-
|
118
|
+
currentMatcher = _useState16[0],
|
119
|
+
setCurrentMatcher = _useState16[1];
|
111
120
|
var _useState17 = useState(false),
|
112
121
|
_useState18 = _slicedToArray(_useState17, 2),
|
113
|
-
|
114
|
-
|
115
|
-
var _useState19 = useState(
|
122
|
+
isEditing = _useState18[0],
|
123
|
+
setIsEditing = _useState18[1];
|
124
|
+
var _useState19 = useState(''),
|
116
125
|
_useState20 = _slicedToArray(_useState19, 2),
|
117
|
-
|
118
|
-
|
119
|
-
var isBlurSpreadsheet = useRef(false);
|
126
|
+
cellEditorValue = _useState20[0],
|
127
|
+
setCellEditorValue = _useState20[1];
|
120
128
|
var _useState21 = useState(false),
|
121
129
|
_useState22 = _slicedToArray(_useState21, 2),
|
122
|
-
|
123
|
-
|
130
|
+
headerCellHoldActive = _useState22[0],
|
131
|
+
setHeaderCellHoldActive = _useState22[1];
|
124
132
|
var _useState23 = useState(false),
|
125
133
|
_useState24 = _slicedToArray(_useState23, 2),
|
126
|
-
|
127
|
-
|
134
|
+
selectedHeaderReorderActive = _useState24[0],
|
135
|
+
setSelectedHeaderReorderActive = _useState24[1];
|
136
|
+
var isBlurSpreadsheet = useRef(false);
|
137
|
+
var _useState25 = useState(false),
|
138
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
139
|
+
isActiveHeaderCellChanged = _useState26[0],
|
140
|
+
setIsActiveHeaderCellChanged = _useState26[1];
|
141
|
+
var _useState27 = useState(false),
|
142
|
+
_useState28 = _slicedToArray(_useState27, 2),
|
143
|
+
activeCellInsideSelectionArea = _useState28[0],
|
144
|
+
setActiveCellInsideSelectionArea = _useState28[1];
|
128
145
|
var previousState = usePreviousValue({
|
129
146
|
activeCellCoordinates: activeCellCoordinates,
|
130
147
|
isEditing: isEditing,
|
131
|
-
cellEditorValue: cellEditorValue
|
148
|
+
cellEditorValue: cellEditorValue,
|
149
|
+
selectedHeaderReorderActive: selectedHeaderReorderActive
|
132
150
|
}) || {};
|
133
151
|
var cellSizeValue = getCellSize(cellSize);
|
134
152
|
var cellEditorRef = useRef();
|
135
|
-
var
|
136
|
-
|
137
|
-
activeCellContent =
|
138
|
-
setActiveCellContent =
|
153
|
+
var _useState29 = useState(),
|
154
|
+
_useState30 = _slicedToArray(_useState29, 2),
|
155
|
+
activeCellContent = _useState30[0],
|
156
|
+
setActiveCellContent = _useState30[1];
|
139
157
|
var activeCellRef = useRef();
|
140
158
|
var cellEditorRulerRef = useRef();
|
159
|
+
var hasCustomRowHeader = typeof renderRowHeader === 'function';
|
160
|
+
var maxNumRowsCount = data.length.toString().length;
|
141
161
|
var defaultColumn = useMemo(function () {
|
142
162
|
return {
|
143
163
|
width: 150,
|
144
|
-
rowHeaderWidth: 64,
|
164
|
+
rowHeaderWidth: hasCustomRowHeader ? 40 + maxNumRowsCount * 8.56 : 64,
|
145
165
|
rowHeight: cellSizeValue
|
146
166
|
};
|
147
|
-
}, [cellSizeValue]);
|
167
|
+
}, [cellSizeValue, hasCustomRowHeader, maxNumRowsCount]);
|
148
168
|
var _useMultipleKeyTracki = useMultipleKeyTracking({
|
149
169
|
ref: multiKeyTrackingRef,
|
150
170
|
containerHasFocus: containerHasFocus,
|
@@ -180,6 +200,28 @@ var DataSpreadsheet = /*#__PURE__*/React__default.forwardRef(function (_ref, ref
|
|
180
200
|
});
|
181
201
|
});
|
182
202
|
}, [cellEditorValue, onDataUpdate]);
|
203
|
+
useEffect(function () {
|
204
|
+
var currentHeaders = [];
|
205
|
+
if (Object.keys(currentColumns).length > 0) {
|
206
|
+
Object.keys(currentColumns).forEach(function (itemIndex) {
|
207
|
+
if (currentColumns[itemIndex].Header) {
|
208
|
+
currentHeaders.push(currentColumns[itemIndex].Header);
|
209
|
+
}
|
210
|
+
});
|
211
|
+
}
|
212
|
+
if (previousState.selectedHeaderReorderActive) {
|
213
|
+
setPastColumns(currentHeaders);
|
214
|
+
}
|
215
|
+
if (!previousState.selectedHeaderReorderActive && pastColumns.length > 0 && !headerCellHoldActive && JSON.stringify(currentHeaders) !== JSON.stringify(pastColumns)) {
|
216
|
+
onColDrag({
|
217
|
+
headers: currentHeaders,
|
218
|
+
data: activeCellContent.props.data
|
219
|
+
});
|
220
|
+
if (currentHeaders.length === 0) {
|
221
|
+
setPastColumns([]);
|
222
|
+
}
|
223
|
+
}
|
224
|
+
}, [previousState === null || previousState === void 0 ? void 0 : previousState.selectedHeaderReorderActive, currentColumns, headerCellHoldActive, columns, activeCellContent, onColDrag, pastColumns]);
|
183
225
|
|
184
226
|
// Removes the active cell element
|
185
227
|
var removeActiveCell = useCallback(function () {
|
@@ -211,9 +253,12 @@ var DataSpreadsheet = /*#__PURE__*/React__default.forwardRef(function (_ref, ref
|
|
211
253
|
}
|
212
254
|
if ((prevCoords === null || prevCoords === void 0 ? void 0 : prevCoords.row) !== (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) || (prevCoords === null || prevCoords === void 0 ? void 0 : prevCoords.column) !== (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column)) {
|
213
255
|
if (activeCellCoordinates && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) !== 'header' && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) !== 'header') {
|
214
|
-
var _activeCellFullData$r;
|
215
256
|
var activeCellFullData = typeof (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'number' && typeof (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'number' ? rows[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row].cells[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column] : null;
|
216
|
-
|
257
|
+
if (activeCellFullData) {
|
258
|
+
setActiveCellContent(activeCellFullData.render('Cell'));
|
259
|
+
} else {
|
260
|
+
setActiveCellContent(null);
|
261
|
+
}
|
217
262
|
}
|
218
263
|
if (activeCellCoordinates && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'header' || (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'header') {
|
219
264
|
setActiveCellContent(null);
|
@@ -420,17 +465,14 @@ var DataSpreadsheet = /*#__PURE__*/React__default.forwardRef(function (_ref, ref
|
|
420
465
|
}
|
421
466
|
}, [handleInitialArrowPress, updateActiveCellCoordinates, activeCellCoordinates, columns, rows]);
|
422
467
|
var handleKeyPressEvent = useCallback(function (event) {
|
423
|
-
handleKeyPress(event, activeCellInsideSelectionArea, updateActiveCellCoordinates, activeCellCoordinates, removeActiveCell, columns, rows, spreadsheetRef, currentMatcher, removeCellEditor, selectionAreas, handleHomeEndKey, keysPressedList, usingMac, updateData, checkForReturnCondition, handleArrowKeyPress, setSelectionAreas, setSelectionAreaData, setCurrentMatcher, activeCellRef, setActiveCellCoordinates, setContainerHasFocus, setActiveCellContent);
|
424
|
-
}, [activeCellInsideSelectionArea, updateActiveCellCoordinates, activeCellCoordinates, removeActiveCell, columns, rows, spreadsheetRef, currentMatcher, removeCellEditor, selectionAreas, handleHomeEndKey, keysPressedList, usingMac, updateData, checkForReturnCondition, handleArrowKeyPress]);
|
468
|
+
handleKeyPress(event, activeCellInsideSelectionArea, updateActiveCellCoordinates, activeCellCoordinates, removeActiveCell, columns, rows, spreadsheetRef, currentMatcher, removeCellEditor, selectionAreas, handleHomeEndKey, keysPressedList, usingMac, updateData, checkForReturnCondition, handleArrowKeyPress, setSelectionAreas, setSelectionAreaData, setCurrentMatcher, activeCellRef, setActiveCellCoordinates, setContainerHasFocus, setActiveCellContent, readOnlyTable);
|
469
|
+
}, [activeCellInsideSelectionArea, updateActiveCellCoordinates, activeCellCoordinates, removeActiveCell, columns, rows, spreadsheetRef, currentMatcher, removeCellEditor, selectionAreas, handleHomeEndKey, keysPressedList, usingMac, updateData, checkForReturnCondition, handleArrowKeyPress, readOnlyTable]);
|
425
470
|
var startEditMode = function startEditMode() {
|
471
|
+
var _activeCellFullData$r;
|
426
472
|
setIsEditing(true);
|
427
473
|
setClickAndHoldActive(false);
|
428
474
|
var activeCellFullData = typeof (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'number' && typeof (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'number' ? rows[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row].cells[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column] : null;
|
429
|
-
var activeCellValue;
|
430
|
-
if (activeCellFullData && activeCellCoordinates !== null && activeCellCoordinates !== void 0 && activeCellCoordinates.column) {
|
431
|
-
var _activeCellFullData$r2;
|
432
|
-
activeCellValue = activeCellFullData ? (_activeCellFullData$r2 = activeCellFullData.row.cells) === null || _activeCellFullData$r2 === void 0 || (_activeCellFullData$r2 = _activeCellFullData$r2[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column]) === null || _activeCellFullData$r2 === void 0 ? void 0 : _activeCellFullData$r2.value : null;
|
433
|
-
}
|
475
|
+
var activeCellValue = activeCellFullData === null || activeCellFullData === void 0 || (_activeCellFullData$r = activeCellFullData.row) === null || _activeCellFullData$r === void 0 || (_activeCellFullData$r = _activeCellFullData$r.cells) === null || _activeCellFullData$r === void 0 || (_activeCellFullData$r = _activeCellFullData$r[Number(activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column)]) === null || _activeCellFullData$r === void 0 ? void 0 : _activeCellFullData$r.value;
|
434
476
|
setCellEditorValue(activeCellValue || '');
|
435
477
|
if (cellEditorRulerRef !== null && cellEditorRulerRef !== void 0 && cellEditorRulerRef.current) {
|
436
478
|
cellEditorRulerRef.current.textContent = activeCellValue;
|
@@ -492,7 +534,7 @@ var DataSpreadsheet = /*#__PURE__*/React__default.forwardRef(function (_ref, ref
|
|
492
534
|
// Go into edit mode if 'Enter' key is pressed on activeCellRef
|
493
535
|
var handleActiveCellKeyDown = function handleActiveCellKeyDown(event) {
|
494
536
|
var key = event.key;
|
495
|
-
if (key === 'Enter' && !activeCellInsideSelectionArea) {
|
537
|
+
if (key === 'Enter' && !activeCellInsideSelectionArea && !readOnlyTable) {
|
496
538
|
if ((activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) !== 'header' && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) !== 'header') {
|
497
539
|
startEditMode();
|
498
540
|
}
|
@@ -548,8 +590,10 @@ var DataSpreadsheet = /*#__PURE__*/React__default.forwardRef(function (_ref, ref
|
|
548
590
|
};
|
549
591
|
|
550
592
|
// Go into edit mode if double click is detected on activeCellRef
|
551
|
-
var handleActiveCellDoubleClick = function handleActiveCellDoubleClick() {
|
552
|
-
|
593
|
+
var handleActiveCellDoubleClick = function handleActiveCellDoubleClick(readOnlyTable) {
|
594
|
+
if (!readOnlyTable) {
|
595
|
+
startEditMode();
|
596
|
+
}
|
553
597
|
};
|
554
598
|
useSpreadsheetEdit({
|
555
599
|
isEditing: isEditing,
|
@@ -629,6 +673,8 @@ var DataSpreadsheet = /*#__PURE__*/React__default.forwardRef(function (_ref, ref
|
|
629
673
|
setSelectionAreas: setSelectionAreas,
|
630
674
|
setCurrentMatcher: setCurrentMatcher,
|
631
675
|
setSelectionAreaData: setSelectionAreaData,
|
676
|
+
disableColumnSwapping: disableColumnSwapping,
|
677
|
+
readOnlyTable: readOnlyTable,
|
632
678
|
totalVisibleColumns: totalVisibleColumns,
|
633
679
|
updateActiveCellCoordinates: updateActiveCellCoordinates,
|
634
680
|
setHeaderCellHoldActive: setHeaderCellHoldActive,
|
@@ -638,6 +684,7 @@ var DataSpreadsheet = /*#__PURE__*/React__default.forwardRef(function (_ref, ref
|
|
638
684
|
}), /*#__PURE__*/React__default.createElement(DataSpreadsheetBody, {
|
639
685
|
activeCellRef: activeCellRef,
|
640
686
|
activeCellCoordinates: activeCellCoordinates,
|
687
|
+
setCurrentColumns: setCurrentColumns,
|
641
688
|
ref: spreadsheetRef,
|
642
689
|
clickAndHoldActive: clickAndHoldActive,
|
643
690
|
setClickAndHoldActive: setClickAndHoldActive,
|
@@ -651,7 +698,10 @@ var DataSpreadsheet = /*#__PURE__*/React__default.forwardRef(function (_ref, ref
|
|
651
698
|
headerGroups: headerGroups,
|
652
699
|
defaultColumn: defaultColumn,
|
653
700
|
getTableBodyProps: getTableBodyProps,
|
701
|
+
hasCustomRowHeader: hasCustomRowHeader,
|
654
702
|
onDataUpdate: onDataUpdate,
|
703
|
+
renderRowHeaderDirection: renderRowHeaderDirection,
|
704
|
+
renderRowHeader: renderRowHeader,
|
655
705
|
onActiveCellChange: onActiveCellChange,
|
656
706
|
onSelectionAreaChange: onSelectionAreaChange,
|
657
707
|
prepareRow: prepareRow,
|
@@ -674,7 +724,9 @@ var DataSpreadsheet = /*#__PURE__*/React__default.forwardRef(function (_ref, ref
|
|
674
724
|
onMouseUp: handleActiveCellMouseUp,
|
675
725
|
onClick: handleActiveCellClick,
|
676
726
|
onKeyDown: handleActiveCellKeyDown,
|
677
|
-
onDoubleClick:
|
727
|
+
onDoubleClick: function onDoubleClick() {
|
728
|
+
return handleActiveCellDoubleClick(readOnlyTable);
|
729
|
+
},
|
678
730
|
onMouseEnter: handleActiveCellMouseEnter,
|
679
731
|
ref: activeCellRef,
|
680
732
|
className: cx("".concat(blockClass, "--interactive-cell-element"), "".concat(blockClass, "__active-cell--highlight"), _defineProperty({}, "".concat(blockClass, "__active-cell--with-selection"), activeCellInsideSelectionArea)),
|
@@ -750,6 +802,14 @@ DataSpreadsheet.propTypes = {
|
|
750
802
|
* Sets the number of empty rows to be created when there is no data provided
|
751
803
|
*/
|
752
804
|
defaultEmptyRowCount: PropTypes.number,
|
805
|
+
/**
|
806
|
+
* Disable column swapping, default false
|
807
|
+
*/
|
808
|
+
disableColumnSwapping: PropTypes.bool,
|
809
|
+
/**
|
810
|
+
* Check if spreadsheet is using custom row header component attached
|
811
|
+
*/
|
812
|
+
hasCustomRowHeader: PropTypes.bool,
|
753
813
|
/**
|
754
814
|
* The spreadsheet id
|
755
815
|
*/
|
@@ -758,6 +818,10 @@ DataSpreadsheet.propTypes = {
|
|
758
818
|
* The event handler that is called when the active cell changes
|
759
819
|
*/
|
760
820
|
onActiveCellChange: PropTypes.func,
|
821
|
+
/**
|
822
|
+
* Callback for when columns are dropped after dragged
|
823
|
+
*/
|
824
|
+
onColDrag: PropTypes.func,
|
761
825
|
/**
|
762
826
|
* The setter fn for the data prop
|
763
827
|
*/
|
@@ -766,6 +830,18 @@ DataSpreadsheet.propTypes = {
|
|
766
830
|
* The event handler that is called when the selection area values change
|
767
831
|
*/
|
768
832
|
onSelectionAreaChange: PropTypes.func,
|
833
|
+
/**
|
834
|
+
* Read-only table
|
835
|
+
*/
|
836
|
+
readOnlyTable: PropTypes.bool,
|
837
|
+
/**
|
838
|
+
* Component next to numbering rows
|
839
|
+
*/
|
840
|
+
renderRowHeader: PropTypes.func,
|
841
|
+
/**
|
842
|
+
* Component next to numbering rows
|
843
|
+
*/
|
844
|
+
renderRowHeaderDirection: PropTypes.oneOf(['left', 'right']),
|
769
845
|
/**
|
770
846
|
* The aria label applied to the Select all button
|
771
847
|
*/
|
@@ -48,10 +48,26 @@ interface DataSpreadsheetBodyProps {
|
|
48
48
|
* The spreadsheet id
|
49
49
|
*/
|
50
50
|
id?: number | string;
|
51
|
+
/**
|
52
|
+
* Set current columns after drag drop
|
53
|
+
*/
|
54
|
+
setCurrentColumns?: Dispatch<SetStateAction<object[]>>;
|
51
55
|
/**
|
52
56
|
* The event handler that is called when the active cell changes
|
53
57
|
*/
|
54
58
|
onActiveCellChange?: () => void;
|
59
|
+
/**
|
60
|
+
* Check if user is using custom component
|
61
|
+
*/
|
62
|
+
hasCustomRowHeader?: boolean;
|
63
|
+
/**
|
64
|
+
* Component next to numbering rows
|
65
|
+
*/
|
66
|
+
renderRowHeader?: (index: number) => any[];
|
67
|
+
/**
|
68
|
+
* Component next to numbering rows
|
69
|
+
*/
|
70
|
+
renderRowHeaderDirection?: string;
|
55
71
|
/**
|
56
72
|
* The event handler that is called to set the rows for the empty spreadsheet
|
57
73
|
*/
|
@@ -33,8 +33,12 @@ var DataSpreadsheetBody = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
33
33
|
defaultEmptyRowCount = _ref.defaultEmptyRowCount,
|
34
34
|
getTableBodyProps = _ref.getTableBodyProps,
|
35
35
|
headerGroups = _ref.headerGroups,
|
36
|
+
setCurrentColumns = _ref.setCurrentColumns,
|
36
37
|
id = _ref.id,
|
37
38
|
onDataUpdate = _ref.onDataUpdate,
|
39
|
+
renderRowHeader = _ref.renderRowHeader,
|
40
|
+
renderRowHeaderDirection = _ref.renderRowHeaderDirection,
|
41
|
+
hasCustomRowHeader = _ref.hasCustomRowHeader,
|
38
42
|
prepareRow = _ref.prepareRow,
|
39
43
|
rows = _ref.rows,
|
40
44
|
selectionAreaData = _ref.selectionAreaData,
|
@@ -138,7 +142,7 @@ var DataSpreadsheetBody = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
138
142
|
return;
|
139
143
|
});
|
140
144
|
}
|
141
|
-
}, [selectionAreas, setSelectionAreas, defaultColumn, onSelectionAreaChange, setSelectionAreaData, ref, activeCellCoordinates, setActiveCellInsideSelectionArea, visibleColumns]);
|
145
|
+
}, [selectionAreas, setSelectionAreas, defaultColumn, onSelectionAreaChange, setSelectionAreaData, ref, activeCellCoordinates, setActiveCellInsideSelectionArea, visibleColumns, hasCustomRowHeader]);
|
142
146
|
var populateSelectionAreaCellData = function populateSelectionAreaCellData(_ref2) {
|
143
147
|
var rowStart = _ref2.rowStart,
|
144
148
|
rowEnd = _ref2.rowEnd,
|
@@ -212,7 +216,7 @@ var DataSpreadsheetBody = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
212
216
|
});
|
213
217
|
}
|
214
218
|
}
|
215
|
-
}, [defaultColumn, ref, activeCellCoordinates, previousState === null || previousState === void 0 ? void 0 : previousState.rowHeight, selectionAreas, setActiveCellInsideSelectionArea, setSelectionAreas, visibleColumns]);
|
219
|
+
}, [defaultColumn, ref, activeCellCoordinates, previousState === null || previousState === void 0 ? void 0 : previousState.rowHeight, selectionAreas, setActiveCellInsideSelectionArea, setSelectionAreas, visibleColumns, hasCustomRowHeader]);
|
216
220
|
|
217
221
|
//this method will check for any duplicate selection area and remove.
|
218
222
|
//same selections are those have the same height, width, top, left styles. These inline styles are being set in createCellSelection util.
|
@@ -306,7 +310,11 @@ var DataSpreadsheetBody = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
306
310
|
};
|
307
311
|
buildEmptyRows();
|
308
312
|
}
|
309
|
-
|
313
|
+
if (headerGroups !== null && headerGroups !== void 0 && headerGroups[0] && typeof setCurrentColumns === 'function') {
|
314
|
+
var headers = headerGroups[0].headers;
|
315
|
+
setCurrentColumns(headers);
|
316
|
+
}
|
317
|
+
}, [rows, headerGroups, defaultEmptyRowCount, onDataUpdate, setCurrentColumns]);
|
310
318
|
var RenderEmptyRows = function RenderEmptyRows() {
|
311
319
|
return _div || (_div = /*#__PURE__*/React__default.createElement("div", null));
|
312
320
|
};
|
@@ -338,11 +346,12 @@ var DataSpreadsheetBody = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
338
346
|
"data-column-index": "header",
|
339
347
|
type: "button",
|
340
348
|
onClick: handleRowHeaderClickEvent(index),
|
341
|
-
className: cx("".concat(blockClass, "__td"), "".concat(blockClass, "__td-th"), "".concat(blockClass, "--interactive-cell-element"), _defineProperty(_defineProperty({}, "".concat(blockClass, "__td-th--active-header"), (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === index || checkActiveHeaderCell(index, selectionAreas, 'row')), "".concat(blockClass, "__td-th--selected-header"), checkSelectedHeaderCell(index, selectionAreas, 'row', columns))),
|
349
|
+
className: cx("".concat(blockClass, "__td"), "".concat(blockClass, "__td-th"), "".concat(blockClass, "--interactive-cell-element"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(blockClass, "__td_custom"), hasCustomRowHeader ? true : false), "".concat(blockClass, "__td-th--active-header"), !hasCustomRowHeader && ((activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === index || checkActiveHeaderCell(index, selectionAreas, 'row'))), "".concat(blockClass, "__td-th--selected-header"), !hasCustomRowHeader && checkSelectedHeaderCell(index, selectionAreas, 'row', columns))),
|
342
350
|
style: {
|
343
|
-
width: defaultColumn === null || defaultColumn === void 0 ? void 0 : defaultColumn.rowHeaderWidth
|
351
|
+
width: defaultColumn === null || defaultColumn === void 0 ? void 0 : defaultColumn.rowHeaderWidth,
|
352
|
+
flexDirection: hasCustomRowHeader ? renderRowHeaderDirection === 'Left' ? 'row-reverse' : row : undefined
|
344
353
|
}
|
345
|
-
}, index + 1)), row.cells.map(function (cell, index) {
|
354
|
+
}, index + 1, hasCustomRowHeader && typeof renderRowHeader === 'function' && renderRowHeader(index))), row.cells.map(function (cell, index) {
|
346
355
|
var _cell$column;
|
347
356
|
var cellProps = prepareProps(cell.getCellProps(), 'key');
|
348
357
|
return /*#__PURE__*/React__default.createElement("div", _extends({
|
@@ -367,7 +376,7 @@ var DataSpreadsheetBody = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
367
376
|
}, cell.render('Cell')));
|
368
377
|
}));
|
369
378
|
}
|
370
|
-
}, [prepareRow, rows, activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row, selectionAreas, handleRowHeaderClickEvent, handleBodyCellClickEvent, handleBodyCellHoverEvent, defaultColumn, columns]);
|
379
|
+
}, [prepareRow, renderRowHeader, renderRowHeaderDirection, rows, hasCustomRowHeader, activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row, selectionAreas, handleRowHeaderClickEvent, handleBodyCellClickEvent, handleBodyCellHoverEvent, defaultColumn, columns]);
|
371
380
|
var spreadsheetBodyRef = useRef();
|
372
381
|
return /*#__PURE__*/React__default.createElement("div", _extends({
|
373
382
|
ref: spreadsheetBodyRef,
|
@@ -433,6 +442,10 @@ DataSpreadsheetBody.propTypes = {
|
|
433
442
|
*/
|
434
443
|
/**@ts-ignore */
|
435
444
|
getTableBodyProps: PropTypes.func,
|
445
|
+
/**
|
446
|
+
* Check if spreadsheet is using custom row header component attached
|
447
|
+
*/
|
448
|
+
hasCustomRowHeader: PropTypes.bool,
|
436
449
|
/**
|
437
450
|
* Headers provided from useTable hook
|
438
451
|
*/
|
@@ -457,6 +470,14 @@ DataSpreadsheetBody.propTypes = {
|
|
457
470
|
* Prepare row function from react-table
|
458
471
|
*/
|
459
472
|
prepareRow: PropTypes.func,
|
473
|
+
/**
|
474
|
+
* Component next to numbering rows
|
475
|
+
*/
|
476
|
+
renderRowHeader: PropTypes.func,
|
477
|
+
/**
|
478
|
+
* Component next to numbering rows
|
479
|
+
*/
|
480
|
+
renderRowHeaderDirection: PropTypes.string,
|
460
481
|
/**
|
461
482
|
* All of the spreadsheet row data
|
462
483
|
*/
|
@@ -497,6 +518,10 @@ DataSpreadsheetBody.propTypes = {
|
|
497
518
|
* Setter fn for containerHasFocus state value
|
498
519
|
*/
|
499
520
|
setContainerHasFocus: PropTypes.func,
|
521
|
+
/**
|
522
|
+
* Set current columns after drag drop
|
523
|
+
*/
|
524
|
+
setCurrentColumns: PropTypes.func,
|
500
525
|
/**
|
501
526
|
* Setter fn for currentMatcher state value
|
502
527
|
*/
|
@@ -16,6 +16,10 @@ interface DataSpreadsheetHeaderProps {
|
|
16
16
|
* Specifies the cell height
|
17
17
|
*/
|
18
18
|
cellSize?: Size;
|
19
|
+
/**
|
20
|
+
* Disable column swapping, default false
|
21
|
+
*/
|
22
|
+
disableColumnSwapping?: boolean;
|
19
23
|
/**
|
20
24
|
* All of the spreadsheet columns
|
21
25
|
*/
|
@@ -36,6 +40,10 @@ interface DataSpreadsheetHeaderProps {
|
|
36
40
|
* Headers provided from useTable hook
|
37
41
|
*/
|
38
42
|
headerGroups?: any[];
|
43
|
+
/**
|
44
|
+
* Read-only table
|
45
|
+
*/
|
46
|
+
readOnlyTable?: boolean;
|
39
47
|
/**
|
40
48
|
* All of the spreadsheet row data
|
41
49
|
*/
|
@@ -36,6 +36,8 @@ var DataSpreadsheetHeader = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
36
36
|
setActiveCellCoordinates = _ref.setActiveCellCoordinates,
|
37
37
|
setCurrentMatcher = _ref.setCurrentMatcher,
|
38
38
|
setSelectionAreas = _ref.setSelectionAreas,
|
39
|
+
readOnlyTable = _ref.readOnlyTable,
|
40
|
+
disableColumnSwapping = _ref.disableColumnSwapping,
|
39
41
|
setSelectionAreaData = _ref.setSelectionAreaData,
|
40
42
|
rows = _ref.rows,
|
41
43
|
totalVisibleColumns = _ref.totalVisibleColumns,
|
@@ -175,6 +177,9 @@ var DataSpreadsheetHeader = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
175
177
|
"data-row-index": "header",
|
176
178
|
"data-column-index": "header",
|
177
179
|
type: "button",
|
180
|
+
style: {
|
181
|
+
width: defaultColumn === null || defaultColumn === void 0 ? void 0 : defaultColumn.rowHeaderWidth
|
182
|
+
},
|
178
183
|
tabIndex: -1,
|
179
184
|
"aria-label": selectAllAriaLabel,
|
180
185
|
onClick: handleSelectAllClick,
|
@@ -191,8 +196,8 @@ var DataSpreadsheetHeader = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
191
196
|
"data-row-index": "header",
|
192
197
|
"data-column-index": index,
|
193
198
|
tabIndex: -1,
|
194
|
-
onMouseDown: selectedHeader ? handleHeaderMouseDown(index) : undefined,
|
195
|
-
onMouseUp: selectedHeader && typeof setSelectedHeaderReorderActive === 'function' ? function () {
|
199
|
+
onMouseDown: selectedHeader && !readOnlyTable && !disableColumnSwapping ? handleHeaderMouseDown(index) : undefined,
|
200
|
+
onMouseUp: selectedHeader && !readOnlyTable && !disableColumnSwapping && typeof setSelectedHeaderReorderActive === 'function' ? function () {
|
196
201
|
return setSelectedHeaderReorderActive(false);
|
197
202
|
} : undefined,
|
198
203
|
onClick: !selectedHeader ? handleColumnHeaderClick(index) : undefined,
|
@@ -200,7 +205,7 @@ var DataSpreadsheetHeader = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
200
205
|
height: defaultColumn === null || defaultColumn === void 0 ? void 0 : defaultColumn.rowHeight,
|
201
206
|
width: (column === null || column === void 0 ? void 0 : column.width) || (defaultColumn === null || defaultColumn === void 0 ? void 0 : defaultColumn.width)
|
202
207
|
},
|
203
|
-
className: cx("".concat(blockClass, "__th"), "".concat(blockClass, "--interactive-cell-element"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(blockClass, "__th--active-header"), (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === index || checkActiveHeaderCell(index, selectionAreas, 'column')), "".concat(blockClass, "__th--selected-header"), selectedHeader), "".concat(blockClass, "__th--selected-header-reorder-active"), selectedHeaderReorderActive)),
|
208
|
+
className: cx("".concat(blockClass, "__th"), "".concat(blockClass, "--interactive-cell-element"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(blockClass, "__th--active-header"), (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === index || checkActiveHeaderCell(index, selectionAreas, 'column')), "".concat(blockClass, "__th--active-header-disabledSwapping"), disableColumnSwapping || readOnlyTable), "".concat(blockClass, "__th--selected-header"), selectedHeader), "".concat(blockClass, "__th--selected-header-reorder-active"), selectedHeaderReorderActive)),
|
204
209
|
type: "button"
|
205
210
|
}, column.render('Header')));
|
206
211
|
}));
|
@@ -236,6 +241,10 @@ DataSpreadsheetHeader.propTypes = {
|
|
236
241
|
rowHeaderWidth: PropTypes.number,
|
237
242
|
width: PropTypes.number
|
238
243
|
}),
|
244
|
+
/**
|
245
|
+
* Disable column swapping, default false
|
246
|
+
*/
|
247
|
+
disableColumnSwapping: PropTypes.bool,
|
239
248
|
/**
|
240
249
|
* Whether or not a click/hold is active on a header cell
|
241
250
|
*/
|
@@ -244,6 +253,10 @@ DataSpreadsheetHeader.propTypes = {
|
|
244
253
|
* Headers provided from useTable hook
|
245
254
|
*/
|
246
255
|
headerGroups: PropTypes.arrayOf(PropTypes.object),
|
256
|
+
/**
|
257
|
+
* Read-only table
|
258
|
+
*/
|
259
|
+
readOnlyTable: PropTypes.bool,
|
247
260
|
/**
|
248
261
|
* All of the spreadsheet row data
|
249
262
|
*/
|
@@ -16,10 +16,6 @@ export interface DatagridProps {
|
|
16
16
|
* The data grid state, much of it being supplied by the useDatagrid hook
|
17
17
|
*/
|
18
18
|
datagridState: DataGridState;
|
19
|
-
/**
|
20
|
-
* Table title
|
21
|
-
*/
|
22
|
-
title?: string;
|
23
19
|
}
|
24
20
|
/**
|
25
21
|
* The `Datagrid` component is an extension of Carbon's DataTable component. At the most basic level, the `Datagrid` component takes in columns and rows and renders a data table. There is a set of data table extensions which this component provides support for, these can be found [here](https://pages.github.ibm.com/cdai-design/pal/components/data-table/overview/). This component is data driven and allows you to choose what pieces will be included based on the hooks/plugins that are provided.
|
@@ -16,7 +16,7 @@ import { DatagridContent } from './DatagridContent.js';
|
|
16
16
|
import { FilterProvider } from './addons/Filtering/FilterProvider.js';
|
17
17
|
import { InlineEditProvider } from './addons/InlineEdit/InlineEditContext/InlineEditContext.js';
|
18
18
|
|
19
|
-
var _excluded = ["datagridState", "
|
19
|
+
var _excluded = ["datagridState", "ariaToolbarLabel"];
|
20
20
|
var blockClass = "".concat(pkg.prefix, "--datagrid");
|
21
21
|
var componentName = 'Datagrid';
|
22
22
|
/**
|
@@ -24,7 +24,6 @@ var componentName = 'Datagrid';
|
|
24
24
|
*/
|
25
25
|
var Datagrid = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
26
26
|
var datagridState = _ref.datagridState,
|
27
|
-
title = _ref.title,
|
28
27
|
ariaToolbarLabel = _ref.ariaToolbarLabel,
|
29
28
|
rest = _objectWithoutProperties(_ref, _excluded);
|
30
29
|
if (!datagridState) {
|
@@ -40,13 +39,13 @@ var Datagrid = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
40
39
|
state = datagridState.state;
|
41
40
|
var rows = DatagridPagination && datagridState.page || datagridState.rows;
|
42
41
|
var props = {
|
43
|
-
title: title,
|
44
42
|
datagridState: datagridState,
|
45
43
|
ariaToolbarLabel: ariaToolbarLabel
|
46
44
|
};
|
47
45
|
return /*#__PURE__*/React__default.createElement(FilterProvider, {
|
48
46
|
filters: state === null || state === void 0 ? void 0 : state.filters,
|
49
|
-
filterProps: filterProps
|
47
|
+
filterProps: filterProps,
|
48
|
+
tableId: tableId
|
50
49
|
}, /*#__PURE__*/React__default.createElement(InlineEditProvider, null, /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
51
50
|
id: tableId,
|
52
51
|
ref: ref,
|
@@ -72,11 +71,7 @@ Datagrid.propTypes = {
|
|
72
71
|
* The data grid state, much of it being supplied by the useDatagrid hook
|
73
72
|
*/
|
74
73
|
/**@ts-ignore */
|
75
|
-
datagridState: PropTypes.object.isRequired
|
76
|
-
/**
|
77
|
-
* Table title
|
78
|
-
*/
|
79
|
-
title: PropTypes.string
|
74
|
+
datagridState: PropTypes.object.isRequired
|
80
75
|
};
|
81
76
|
|
82
77
|
export { Datagrid };
|
@@ -40,7 +40,8 @@ var DatagridContent = function DatagridContent(_ref) {
|
|
40
40
|
var _useContext2 = useContext(FilterContext),
|
41
41
|
filterTags = _useContext2.filterTags,
|
42
42
|
EventEmitter = _useContext2.EventEmitter,
|
43
|
-
panelOpen = _useContext2.panelOpen
|
43
|
+
panelOpen = _useContext2.panelOpen,
|
44
|
+
contextTableId = _useContext2.tableId;
|
44
45
|
var activeCellId = inlineEditState.activeCellId,
|
45
46
|
gridActive = inlineEditState.gridActive,
|
46
47
|
editId = inlineEditState.editId,
|
@@ -151,14 +152,14 @@ var DatagridContent = function DatagridContent(_ref) {
|
|
151
152
|
}
|
152
153
|
}, [withInlineEdit, tableId, totalColumnsWidth, datagridState, gridActive]);
|
153
154
|
useSubscribeToEventEmitter(CLEAR_SINGLE_FILTER, function (id) {
|
154
|
-
return clearSingleFilter(id, setAllFilters, state);
|
155
|
+
return clearSingleFilter(id, setAllFilters, state, contextTableId);
|
155
156
|
});
|
156
157
|
var renderFilterSummary = function renderFilterSummary() {
|
157
158
|
return state.filters.length > 0 && /*#__PURE__*/React__default.createElement(FilterSummary, {
|
158
159
|
className: "".concat(blockClass, "__filter-summary"),
|
159
160
|
filters: filterTags,
|
160
161
|
clearFilters: function clearFilters() {
|
161
|
-
return EventEmitter.dispatch(CLEAR_FILTERS);
|
162
|
+
return EventEmitter.dispatch(CLEAR_FILTERS, tableId);
|
162
163
|
},
|
163
164
|
renderLabel: filterProps === null || filterProps === void 0 ? void 0 : filterProps.renderLabel,
|
164
165
|
overflowType: "tag"
|