@carbon/ibm-products 2.43.1 → 2.43.2-canary.100
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-full-carbon.css +428 -143
- 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 +218 -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 +248 -105
- 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 +349 -129
- 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/ActionBarItem.js +1 -1
- 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.js +76 -55
- 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 +30 -8
- package/es/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +14 -9
- 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 +75 -62
- 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 +40 -36
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +40 -36
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +6 -2
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +98 -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 +121 -40
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +45 -19
- package/es/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +2 -1
- package/es/components/ConditionBuilder/utils/handleKeyboardEvents.js +137 -40
- 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 +149 -54
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +25 -1
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +50 -9
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +16 -0
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +32 -8
- package/es/components/DataSpreadsheet/hooks/useSpreadsheetMouseMove.js +4 -1
- package/es/components/DataSpreadsheet/hooks/useSpreadsheetMouseUp.d.ts +3 -1
- package/es/components/DataSpreadsheet/hooks/useSpreadsheetMouseUp.js +15 -3
- package/es/components/DataSpreadsheet/hooks/useSpreadsheetOutsideClick.d.ts +2 -1
- package/es/components/DataSpreadsheet/hooks/useSpreadsheetOutsideClick.js +4 -3
- package/es/components/DataSpreadsheet/types/index.d.ts +3 -1
- package/es/components/DataSpreadsheet/utils/moveColumnIndicatorLine.js +34 -2
- 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 +1 -1
- 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 +2 -1
- 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 +3 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +7 -4
- 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 +61 -9
- package/es/components/Datagrid/useActionsColumn.d.ts +8 -1
- package/es/components/Datagrid/useActionsColumn.js +7 -6
- package/es/components/Datagrid/useColumnCenterAlign.d.ts +8 -1
- package/es/components/Datagrid/useColumnCenterAlign.js +1 -1
- 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.d.ts +8 -1
- package/es/components/Datagrid/useInlineEdit.js +13 -3
- 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/Decorator/Decorator.js +2 -1
- package/es/components/DecoratorBase/DecoratorBase.js +3 -5
- package/es/components/DecoratorDualButton/DecoratorDualButton.js +2 -1
- package/es/components/DecoratorLink/DecoratorLink.js +2 -1
- package/es/components/DecoratorSingleButton/DecoratorSingleButton.js +2 -1
- 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/EmptyStateV2.d.ts +63 -2
- package/es/components/EmptyStates/EmptyStateV2.js +2 -1
- package/es/components/FullPageError/FullPageError.d.ts +36 -2
- package/es/components/FullPageError/FullPageError.js +0 -3
- package/es/components/GetStartedCard/GetStartedCard.d.ts +61 -2
- package/es/components/GetStartedCard/GetStartedCard.js +9 -8
- 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/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/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/ActionBarItem.js +1 -1
- 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.js +74 -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 +29 -7
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +12 -7
- 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 +73 -60
- 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 +40 -36
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +40 -36
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +6 -2
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +96 -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 +118 -37
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +44 -17
- package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +2 -1
- package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.js +137 -39
- 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 +149 -54
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +25 -1
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +50 -9
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +16 -0
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +32 -8
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetMouseMove.js +4 -1
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetMouseUp.d.ts +3 -1
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetMouseUp.js +15 -3
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetOutsideClick.d.ts +2 -1
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetOutsideClick.js +4 -3
- package/lib/components/DataSpreadsheet/types/index.d.ts +3 -1
- package/lib/components/DataSpreadsheet/utils/moveColumnIndicatorLine.js +34 -2
- 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 +1 -1
- 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 +2 -1
- 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 +3 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +7 -4
- 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 +61 -9
- package/lib/components/Datagrid/useActionsColumn.d.ts +8 -1
- package/lib/components/Datagrid/useActionsColumn.js +7 -6
- package/lib/components/Datagrid/useColumnCenterAlign.d.ts +8 -1
- package/lib/components/Datagrid/useColumnCenterAlign.js +1 -1
- 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.d.ts +8 -1
- package/lib/components/Datagrid/useInlineEdit.js +13 -3
- 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/Decorator/Decorator.js +2 -1
- package/lib/components/DecoratorBase/DecoratorBase.js +3 -5
- package/lib/components/DecoratorDualButton/DecoratorDualButton.js +2 -1
- package/lib/components/DecoratorLink/DecoratorLink.js +2 -1
- package/lib/components/DecoratorSingleButton/DecoratorSingleButton.js +2 -1
- 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/EmptyStateV2.d.ts +63 -2
- package/lib/components/EmptyStates/EmptyStateV2.js +2 -1
- package/lib/components/FullPageError/FullPageError.d.ts +36 -2
- package/lib/components/FullPageError/FullPageError.js +0 -3
- package/lib/components/GetStartedCard/GetStartedCard.d.ts +61 -2
- package/lib/components/GetStartedCard/GetStartedCard.js +8 -7
- 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/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/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 +9 -8
- 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 +5 -1
- package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +20 -3
- package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +32 -3
- package/scss/components/CreateModal/_create-modal.scss +0 -4
- package/scss/components/DataSpreadsheet/_data-spreadsheet.scss +17 -2
- package/scss/components/Datagrid/_datagrid.scss +0 -4
- 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/StatusIcon/_status-icon.scss +4 -4
- package/scss/components/StringFormatter/_string-formatter.scss +2 -2
- package/scss/components/UserProfileImage/_user-profile-image.scss +6 -2
- 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
@@ -40,9 +40,13 @@ var DataSpreadsheetHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
40
40
|
headerGroups = _ref.headerGroups,
|
41
41
|
scrollBarSize = _ref.scrollBarSize,
|
42
42
|
selectionAreas = _ref.selectionAreas,
|
43
|
+
selectedHeaderReorderActive = _ref.selectedHeaderReorderActive,
|
44
|
+
setSelectedHeaderReorderActive = _ref.setSelectedHeaderReorderActive,
|
43
45
|
setActiveCellCoordinates = _ref.setActiveCellCoordinates,
|
44
46
|
setCurrentMatcher = _ref.setCurrentMatcher,
|
45
47
|
setSelectionAreas = _ref.setSelectionAreas,
|
48
|
+
readOnlyTable = _ref.readOnlyTable,
|
49
|
+
disableColumnSwapping = _ref.disableColumnSwapping,
|
46
50
|
setSelectionAreaData = _ref.setSelectionAreaData,
|
47
51
|
rows = _ref.rows,
|
48
52
|
totalVisibleColumns = _ref.totalVisibleColumns,
|
@@ -55,10 +59,6 @@ var DataSpreadsheetHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
55
59
|
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
56
60
|
scrollBarSizeValue = _useState2[0],
|
57
61
|
setScrollBarSizeValue = _useState2[1];
|
58
|
-
var _useState3 = React.useState(false),
|
59
|
-
_useState4 = _rollupPluginBabelHelpers.slicedToArray(_useState3, 2),
|
60
|
-
selectedHeaderReorderActive = _useState4[0],
|
61
|
-
setSelectedHeaderReorderActive = _useState4[1];
|
62
62
|
var previousState = usePreviousValue.usePreviousValue({
|
63
63
|
cellSize: cellSize
|
64
64
|
}) || {};
|
@@ -116,11 +116,16 @@ var DataSpreadsheetHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
116
116
|
// Remove columns, need to call handleHeaderCellSelection
|
117
117
|
return;
|
118
118
|
}
|
119
|
-
setSelectedHeaderReorderActive(true);
|
120
119
|
var selectionAreaToClone = selectionAreas === null || selectionAreas === void 0 ? void 0 : selectionAreas.filter(function (item) {
|
121
120
|
return (item === null || item === void 0 ? void 0 : item.matcher) === currentMatcher;
|
122
121
|
});
|
123
122
|
var selectionAreaElement = ref.current.querySelector("[data-matcher-id=\"".concat(selectionAreaToClone === null || selectionAreaToClone === void 0 || (_selectionAreaToClone = selectionAreaToClone[0]) === null || _selectionAreaToClone === void 0 ? void 0 : _selectionAreaToClone.matcher, "\"]"));
|
123
|
+
if (selectionAreaElement) {
|
124
|
+
selectionAreaElement.classList.add("".concat(blockClass, "__selection-area--element"));
|
125
|
+
}
|
126
|
+
if (typeof setSelectedHeaderReorderActive === 'function') {
|
127
|
+
setSelectedHeaderReorderActive(true);
|
128
|
+
}
|
124
129
|
var clickXPosition = event.clientX;
|
125
130
|
var headerButtonCoords = event.target.getBoundingClientRect();
|
126
131
|
var headerIndex = event.target.getAttribute('data-column-index');
|
@@ -181,6 +186,9 @@ var DataSpreadsheetHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
181
186
|
"data-row-index": "header",
|
182
187
|
"data-column-index": "header",
|
183
188
|
type: "button",
|
189
|
+
style: {
|
190
|
+
width: defaultColumn === null || defaultColumn === void 0 ? void 0 : defaultColumn.rowHeaderWidth
|
191
|
+
},
|
184
192
|
tabIndex: -1,
|
185
193
|
"aria-label": selectAllAriaLabel,
|
186
194
|
onClick: handleSelectAllClick,
|
@@ -197,8 +205,8 @@ var DataSpreadsheetHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
197
205
|
"data-row-index": "header",
|
198
206
|
"data-column-index": index,
|
199
207
|
tabIndex: -1,
|
200
|
-
onMouseDown: selectedHeader ? handleHeaderMouseDown(index) : undefined,
|
201
|
-
onMouseUp: selectedHeader ? function () {
|
208
|
+
onMouseDown: selectedHeader && !readOnlyTable && !disableColumnSwapping ? handleHeaderMouseDown(index) : undefined,
|
209
|
+
onMouseUp: selectedHeader && !readOnlyTable && !disableColumnSwapping && typeof setSelectedHeaderReorderActive === 'function' ? function () {
|
202
210
|
return setSelectedHeaderReorderActive(false);
|
203
211
|
} : undefined,
|
204
212
|
onClick: !selectedHeader ? handleColumnHeaderClick(index) : undefined,
|
@@ -206,7 +214,7 @@ var DataSpreadsheetHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
206
214
|
height: defaultColumn === null || defaultColumn === void 0 ? void 0 : defaultColumn.rowHeight,
|
207
215
|
width: (column === null || column === void 0 ? void 0 : column.width) || (defaultColumn === null || defaultColumn === void 0 ? void 0 : defaultColumn.width)
|
208
216
|
},
|
209
|
-
className: cx__default["default"]("".concat(blockClass, "__th"), "".concat(blockClass, "--interactive-cell-element"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__th--active-header"), (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === index || checkActiveHeaderCell.checkActiveHeaderCell(index, selectionAreas, 'column')), "".concat(blockClass, "__th--selected-header"), selectedHeader), "".concat(blockClass, "__th--selected-header-reorder-active"), selectedHeaderReorderActive)),
|
217
|
+
className: cx__default["default"]("".concat(blockClass, "__th"), "".concat(blockClass, "--interactive-cell-element"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__th--active-header"), (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === index || checkActiveHeaderCell.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)),
|
210
218
|
type: "button"
|
211
219
|
}, column.render('Header')));
|
212
220
|
}));
|
@@ -242,6 +250,10 @@ DataSpreadsheetHeader.propTypes = {
|
|
242
250
|
rowHeaderWidth: index["default"].number,
|
243
251
|
width: index["default"].number
|
244
252
|
}),
|
253
|
+
/**
|
254
|
+
* Disable column swapping, default false
|
255
|
+
*/
|
256
|
+
disableColumnSwapping: index["default"].bool,
|
245
257
|
/**
|
246
258
|
* Whether or not a click/hold is active on a header cell
|
247
259
|
*/
|
@@ -250,6 +262,10 @@ DataSpreadsheetHeader.propTypes = {
|
|
250
262
|
* Headers provided from useTable hook
|
251
263
|
*/
|
252
264
|
headerGroups: index["default"].arrayOf(index["default"].object),
|
265
|
+
/**
|
266
|
+
* Read-only table
|
267
|
+
*/
|
268
|
+
readOnlyTable: index["default"].bool,
|
253
269
|
/**
|
254
270
|
* All of the spreadsheet row data
|
255
271
|
*/
|
@@ -263,6 +279,10 @@ DataSpreadsheetHeader.propTypes = {
|
|
263
279
|
* The aria label applied to the Select all button
|
264
280
|
*/
|
265
281
|
selectAllAriaLabel: index["default"].string.isRequired,
|
282
|
+
/**
|
283
|
+
* Header reordering is active
|
284
|
+
*/
|
285
|
+
selectedHeaderReorderActive: index["default"].bool,
|
266
286
|
/**
|
267
287
|
* All of the cell selection area items
|
268
288
|
*/
|
@@ -280,6 +300,10 @@ DataSpreadsheetHeader.propTypes = {
|
|
280
300
|
* Setter fn for header cell hold active value
|
281
301
|
*/
|
282
302
|
setHeaderCellHoldActive: index["default"].func,
|
303
|
+
/**
|
304
|
+
* Set header reordering active or not
|
305
|
+
*/
|
306
|
+
setSelectedHeaderReorderActive: index["default"].func,
|
283
307
|
/**
|
284
308
|
* Setter fn for selectionAreaData state value
|
285
309
|
*/
|
@@ -44,9 +44,12 @@ var useSpreadsheetMouseMove = function useSpreadsheetMouseMove(_ref) {
|
|
44
44
|
var totalSpreadsheetScrollingWidth = listContainer.scrollWidth;
|
45
45
|
var clonedSelectionWidth = clonedSelectionElement.offsetWidth;
|
46
46
|
var clonePlacement = Math.max(xPositionRelativeToSpreadsheet - offsetXValue, defaultColumn === null || defaultColumn === void 0 ? void 0 : defaultColumn.rowHeaderWidth);
|
47
|
+
var leftPosition = totalSpreadsheetScrollingWidth - clonedSelectionWidth >= clonePlacement ? clonePlacement + scrollAmount : totalSpreadsheetScrollingWidth - clonedSelectionWidth;
|
47
48
|
// Moves the position of the cloned selection area to follow mouse, and
|
48
49
|
// add the amount horizontally scrolled
|
49
|
-
|
50
|
+
if (leftPosition < spreadsheetCoords.right - 40) {
|
51
|
+
clonedSelectionElement.style.left = layout.px(leftPosition);
|
52
|
+
}
|
50
53
|
};
|
51
54
|
if (headerCellHoldActive) {
|
52
55
|
ref.current.addEventListener('mousemove', handleMouseMove);
|
@@ -1,6 +1,8 @@
|
|
1
|
-
export function useSpreadsheetMouseUp({ currentMatcher, setSelectionAreas, setClickAndHoldActive, setValidStartingPoint, validStartingPoint, blockClass, ref, setHeaderCellHoldActive, setColumnOrder, visibleColumns, setActiveCellCoordinates, activeCellCoordinates, rows, defaultColumn, selectionAreas, }: {
|
1
|
+
export function useSpreadsheetMouseUp({ currentMatcher, setSelectionAreas, selectedHeaderReorderActive, setSelectedHeaderReorderActive, setClickAndHoldActive, setValidStartingPoint, validStartingPoint, blockClass, ref, setHeaderCellHoldActive, setColumnOrder, visibleColumns, setActiveCellCoordinates, activeCellCoordinates, rows, defaultColumn, selectionAreas, }: {
|
2
2
|
currentMatcher: any;
|
3
3
|
setSelectionAreas: any;
|
4
|
+
selectedHeaderReorderActive: any;
|
5
|
+
setSelectedHeaderReorderActive: any;
|
4
6
|
setClickAndHoldActive: any;
|
5
7
|
setValidStartingPoint: any;
|
6
8
|
validStartingPoint: any;
|
@@ -18,6 +18,8 @@ var deepCloneObject = require('../../../global/js/utils/deepCloneObject.js');
|
|
18
18
|
var useSpreadsheetMouseUp = function useSpreadsheetMouseUp(_ref) {
|
19
19
|
var currentMatcher = _ref.currentMatcher,
|
20
20
|
setSelectionAreas = _ref.setSelectionAreas,
|
21
|
+
selectedHeaderReorderActive = _ref.selectedHeaderReorderActive,
|
22
|
+
setSelectedHeaderReorderActive = _ref.setSelectedHeaderReorderActive,
|
21
23
|
setClickAndHoldActive = _ref.setClickAndHoldActive,
|
22
24
|
setValidStartingPoint = _ref.setValidStartingPoint,
|
23
25
|
validStartingPoint = _ref.validStartingPoint,
|
@@ -34,15 +36,22 @@ var useSpreadsheetMouseUp = function useSpreadsheetMouseUp(_ref) {
|
|
34
36
|
selectionAreas = _ref.selectionAreas;
|
35
37
|
React.useEffect(function () {
|
36
38
|
var handleMouseUp = function handleMouseUp(event) {
|
39
|
+
var _selectionAreas$;
|
40
|
+
var isHoldingColumn = false;
|
41
|
+
if (selectionAreas !== null && selectionAreas !== void 0 && (_selectionAreas$ = selectionAreas[0]) !== null && _selectionAreas$ !== void 0 && _selectionAreas$.header && selectionAreas[0].header.type === 'column') {
|
42
|
+
isHoldingColumn = true;
|
43
|
+
}
|
37
44
|
// Remove the cloned selection area on mouse up
|
38
|
-
if (!validStartingPoint) {
|
45
|
+
if (!validStartingPoint && isHoldingColumn) {
|
39
46
|
setHeaderCellHoldActive(false);
|
47
|
+
var selectionAreaElement = ref.current.querySelector(".".concat(blockClass, "__selection-area--element"));
|
40
48
|
var selectionAreaCloneElement = ref.current.querySelector(".".concat(blockClass, "__selection-area--element-cloned"));
|
41
49
|
if (!selectionAreaCloneElement) {
|
42
50
|
return;
|
43
51
|
}
|
44
52
|
// Mouse up while a cloned selection area exists/a column is being reordered
|
45
53
|
if (selectionAreaCloneElement) {
|
54
|
+
var _selectionAreaElement;
|
46
55
|
var closestCell = event.target.closest(".".concat(blockClass, "--interactive-cell-element"));
|
47
56
|
var newColumnIndex = parseInt === null || parseInt === void 0 ? void 0 : parseInt(closestCell === null || closestCell === void 0 ? void 0 : closestCell.getAttribute('data-column-index'));
|
48
57
|
var originalColumnIndex = parseInt === null || parseInt === void 0 ? void 0 : parseInt(selectionAreaCloneElement === null || selectionAreaCloneElement === void 0 ? void 0 : selectionAreaCloneElement.getAttribute('data-column-index-original'));
|
@@ -85,6 +94,7 @@ var useSpreadsheetMouseUp = function useSpreadsheetMouseUp(_ref) {
|
|
85
94
|
selectionAreaClone[indexOfItemToUpdate].point1.column = Math.min.apply(Math, _rollupPluginBabelHelpers.toConsumableArray(newIndexArray));
|
86
95
|
selectionAreaClone[indexOfItemToUpdate].point2.column = Math.max.apply(Math, _rollupPluginBabelHelpers.toConsumableArray(newIndexArray));
|
87
96
|
}
|
97
|
+
selectionAreaClone[indexOfItemToUpdate].areaCreated = false;
|
88
98
|
return selectionAreaClone;
|
89
99
|
});
|
90
100
|
// Only reorder columns if the new index is _not_ part of the
|
@@ -129,11 +139,13 @@ var useSpreadsheetMouseUp = function useSpreadsheetMouseUp(_ref) {
|
|
129
139
|
var indicatorLineElement = ref.current.querySelector(".".concat(blockClass, "__reorder-indicator-line"));
|
130
140
|
indicatorLineElement === null || indicatorLineElement === void 0 || indicatorLineElement.remove();
|
131
141
|
selectionAreaCloneElement === null || selectionAreaCloneElement === void 0 || selectionAreaCloneElement.remove();
|
142
|
+
selectionAreaElement === null || selectionAreaElement === void 0 || (_selectionAreaElement = selectionAreaElement.classList) === null || _selectionAreaElement === void 0 || _selectionAreaElement.remove("".concat(blockClass, "__selection-area--element"));
|
143
|
+
setSelectedHeaderReorderActive(false);
|
132
144
|
}
|
133
145
|
}
|
134
146
|
// Mouse up was on a spreadsheet body cell which is a valid
|
135
147
|
// start/end point for creating a selection area
|
136
|
-
if (validStartingPoint) {
|
148
|
+
if (validStartingPoint || event.type === 'mouseup') {
|
137
149
|
setClickAndHoldActive(false);
|
138
150
|
setValidStartingPoint(false);
|
139
151
|
var cellButton = event.target.closest(".".concat(blockClass, "__body--td"));
|
@@ -162,7 +174,7 @@ var useSpreadsheetMouseUp = function useSpreadsheetMouseUp(_ref) {
|
|
162
174
|
return function () {
|
163
175
|
document.removeEventListener('mouseup', handleMouseUp);
|
164
176
|
};
|
165
|
-
}, [blockClass, currentMatcher, setSelectionAreas, setClickAndHoldActive, setValidStartingPoint, validStartingPoint, ref, setHeaderCellHoldActive, setColumnOrder, visibleColumns, setActiveCellCoordinates, activeCellCoordinates, rows, defaultColumn, selectionAreas]);
|
177
|
+
}, [blockClass, currentMatcher, setSelectionAreas, setClickAndHoldActive, setValidStartingPoint, validStartingPoint, selectedHeaderReorderActive, setSelectedHeaderReorderActive, ref, setHeaderCellHoldActive, setColumnOrder, visibleColumns, setActiveCellCoordinates, activeCellCoordinates, rows, defaultColumn, selectionAreas]);
|
166
178
|
};
|
167
179
|
|
168
180
|
exports.useSpreadsheetMouseUp = useSpreadsheetMouseUp;
|
@@ -1,4 +1,5 @@
|
|
1
|
-
export function useSpreadsheetOutsideClick({ spreadsheetRef, blockClass, setActiveCellCoordinates, setSelectionAreas, removeActiveCell, setContainerHasFocus, removeCellEditor, }: {
|
1
|
+
export function useSpreadsheetOutsideClick({ isBlurSpreadsheet, spreadsheetRef, blockClass, setActiveCellCoordinates, setSelectionAreas, removeActiveCell, setContainerHasFocus, removeCellEditor, }: {
|
2
|
+
isBlurSpreadsheet: any;
|
2
3
|
spreadsheetRef: any;
|
3
4
|
blockClass?: string | undefined;
|
4
5
|
setActiveCellCoordinates: any;
|
@@ -15,7 +15,8 @@ var removeCellSelections = require('../utils/removeCellSelections.js');
|
|
15
15
|
|
16
16
|
// Click outside useEffect for spreadsheet
|
17
17
|
var useSpreadsheetOutsideClick = function useSpreadsheetOutsideClick(_ref) {
|
18
|
-
var
|
18
|
+
var isBlurSpreadsheet = _ref.isBlurSpreadsheet,
|
19
|
+
spreadsheetRef = _ref.spreadsheetRef,
|
19
20
|
_ref$blockClass = _ref.blockClass,
|
20
21
|
blockClass = _ref$blockClass === void 0 ? "".concat(settings.pkg.prefix, "--data-spreadsheet") : _ref$blockClass,
|
21
22
|
setActiveCellCoordinates = _ref.setActiveCellCoordinates,
|
@@ -28,6 +29,7 @@ var useSpreadsheetOutsideClick = function useSpreadsheetOutsideClick(_ref) {
|
|
28
29
|
if (!spreadsheetRef.current || spreadsheetRef.current.contains(event.target) || event.target.classList.contains("".concat(blockClass, "__active-cell--highlight")) || event.target.classList.contains("".concat(blockClass, "--interactive-cell-element"))) {
|
29
30
|
return;
|
30
31
|
}
|
32
|
+
isBlurSpreadsheet.current = true;
|
31
33
|
setActiveCellCoordinates(null);
|
32
34
|
setSelectionAreas([]);
|
33
35
|
removeActiveCell();
|
@@ -35,13 +37,12 @@ var useSpreadsheetOutsideClick = function useSpreadsheetOutsideClick(_ref) {
|
|
35
37
|
spreadsheetRef: spreadsheetRef
|
36
38
|
});
|
37
39
|
setContainerHasFocus(false);
|
38
|
-
removeCellEditor();
|
39
40
|
};
|
40
41
|
document.addEventListener('click', handleOutsideClick);
|
41
42
|
return function () {
|
42
43
|
document.removeEventListener('click', handleOutsideClick);
|
43
44
|
};
|
44
|
-
}, [spreadsheetRef, removeActiveCell, blockClass, setActiveCellCoordinates, setContainerHasFocus, setSelectionAreas, removeCellEditor]);
|
45
|
+
}, [isBlurSpreadsheet, spreadsheetRef, removeActiveCell, blockClass, setActiveCellCoordinates, setContainerHasFocus, setSelectionAreas, removeCellEditor]);
|
45
46
|
};
|
46
47
|
|
47
48
|
exports.useSpreadsheetOutsideClick = useSpreadsheetOutsideClick;
|
@@ -10,10 +10,12 @@ export interface ActiveCellCoordinates {
|
|
10
10
|
column?: number | string;
|
11
11
|
}
|
12
12
|
export interface PrevState {
|
13
|
+
cellEditorValue?: string;
|
13
14
|
activeCellCoordinates?: ActiveCellCoordinates;
|
14
15
|
isEditing?: boolean;
|
15
|
-
selectionAreaData?:
|
16
|
+
selectionAreaData?: any[];
|
16
17
|
clickAndHoldActive?: boolean;
|
18
|
+
selectedHeaderReorderActive?: boolean;
|
17
19
|
rowHeight?: number;
|
18
20
|
cellSize?: Size;
|
19
21
|
}
|
@@ -26,11 +26,43 @@ var moveColumnIndicatorLine = function moveColumnIndicatorLine(_ref) {
|
|
26
26
|
var indicatorLineElement = ref.current.querySelector(".".concat(blockClass, "__reorder-indicator-line"));
|
27
27
|
var matcherId = clonedSelectionElement === null || clonedSelectionElement === void 0 ? void 0 : clonedSelectionElement.getAttribute('data-matcher-id');
|
28
28
|
var selectionAreaOrigin = ref.current.querySelector("[data-matcher-id=\"".concat(matcherId, "\"]"));
|
29
|
+
var listContainer = ref.current.querySelector(".".concat(blockClass, "__list--container"));
|
30
|
+
var scrollSpeed = 10; // Scrolling speed
|
31
|
+
var leftEdgeThreshold = 120; // Distance from the left edge to start scrolling
|
32
|
+
var rightEdgeThreshold = 100; // Distance from the right edge to start scrolling
|
33
|
+
|
34
|
+
var _event = event,
|
35
|
+
clientX = _event.clientX;
|
36
|
+
var _listContainer$getBou = listContainer.getBoundingClientRect(),
|
37
|
+
left = _listContainer$getBou.left,
|
38
|
+
right = _listContainer$getBou.right;
|
39
|
+
|
40
|
+
// Is near left side of viewport
|
41
|
+
if (clientX < leftEdgeThreshold) {
|
42
|
+
window.scrollBy(-scrollSpeed, 0);
|
43
|
+
}
|
44
|
+
|
45
|
+
// Is near right side of viewport
|
46
|
+
if (clientX > window.innerWidth - rightEdgeThreshold) {
|
47
|
+
window.scrollBy(scrollSpeed, 0);
|
48
|
+
}
|
49
|
+
|
50
|
+
// Is near left edge of table
|
51
|
+
if (clientX > left && clientX < left + leftEdgeThreshold) {
|
52
|
+
listContainer.scrollBy(-scrollSpeed, 0);
|
53
|
+
}
|
54
|
+
|
55
|
+
// Is near right edge of table
|
56
|
+
if (clientX < right && clientX > right - rightEdgeThreshold) {
|
57
|
+
listContainer.scrollBy(scrollSpeed, 0);
|
58
|
+
}
|
29
59
|
if (Number(newColumnIndex) > Number(originalColumnIndex)) {
|
30
|
-
|
60
|
+
var leftPosition = closestCellCoords.left - spreadsheetCoords.left + closestCell.offsetWidth - 2 + leftScrollAmount;
|
61
|
+
indicatorLineElement.style.left = layout.px(leftPosition);
|
31
62
|
}
|
32
63
|
if (Number(newColumnIndex) < Number(originalColumnIndex)) {
|
33
|
-
|
64
|
+
var _leftPosition = closestCellCoords.left - spreadsheetCoords.left + leftScrollAmount;
|
65
|
+
indicatorLineElement.style.left = layout.px(_leftPosition);
|
34
66
|
}
|
35
67
|
if (Number(newColumnIndex) === Number(originalColumnIndex)) {
|
36
68
|
indicatorLineElement.style.left = selectionAreaOrigin.style.left;
|
@@ -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.
|
@@ -25,7 +25,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
25
25
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
26
26
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
27
27
|
|
28
|
-
var _excluded = ["datagridState", "
|
28
|
+
var _excluded = ["datagridState", "ariaToolbarLabel"];
|
29
29
|
var blockClass = "".concat(settings.pkg.prefix, "--datagrid");
|
30
30
|
var componentName = 'Datagrid';
|
31
31
|
/**
|
@@ -33,7 +33,6 @@ var componentName = 'Datagrid';
|
|
33
33
|
*/
|
34
34
|
exports.Datagrid = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref) {
|
35
35
|
var datagridState = _ref.datagridState,
|
36
|
-
title = _ref.title,
|
37
36
|
ariaToolbarLabel = _ref.ariaToolbarLabel,
|
38
37
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
39
38
|
if (!datagridState) {
|
@@ -49,13 +48,13 @@ exports.Datagrid = /*#__PURE__*/React__default["default"].forwardRef(function (_
|
|
49
48
|
state = datagridState.state;
|
50
49
|
var rows = DatagridPagination && datagridState.page || datagridState.rows;
|
51
50
|
var props = {
|
52
|
-
title: title,
|
53
51
|
datagridState: datagridState,
|
54
52
|
ariaToolbarLabel: ariaToolbarLabel
|
55
53
|
};
|
56
54
|
return /*#__PURE__*/React__default["default"].createElement(FilterProvider.FilterProvider, {
|
57
55
|
filters: state === null || state === void 0 ? void 0 : state.filters,
|
58
|
-
filterProps: filterProps
|
56
|
+
filterProps: filterProps,
|
57
|
+
tableId: tableId
|
59
58
|
}, /*#__PURE__*/React__default["default"].createElement(InlineEditContext.InlineEditProvider, null, /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({}, rest, {
|
60
59
|
id: tableId,
|
61
60
|
ref: ref,
|
@@ -81,9 +80,5 @@ exports.Datagrid.propTypes = {
|
|
81
80
|
* The data grid state, much of it being supplied by the useDatagrid hook
|
82
81
|
*/
|
83
82
|
/**@ts-ignore */
|
84
|
-
datagridState: index["default"].object.isRequired
|
85
|
-
/**
|
86
|
-
* Table title
|
87
|
-
*/
|
88
|
-
title: index["default"].string
|
83
|
+
datagridState: index["default"].object.isRequired
|
89
84
|
};
|
@@ -167,7 +167,7 @@ var DatagridContent = function DatagridContent(_ref) {
|
|
167
167
|
className: "".concat(blockClass, "__filter-summary"),
|
168
168
|
filters: filterTags,
|
169
169
|
clearFilters: function clearFilters() {
|
170
|
-
return EventEmitter.dispatch(constants.CLEAR_FILTERS);
|
170
|
+
return EventEmitter.dispatch(constants.CLEAR_FILTERS, tableId);
|
171
171
|
},
|
172
172
|
renderLabel: filterProps === null || filterProps === void 0 ? void 0 : filterProps.renderLabel,
|
173
173
|
overflowType: "tag"
|
@@ -32,10 +32,8 @@ var _excluded = ["className"],
|
|
32
32
|
var blockClass = "".concat(settings.pkg.prefix, "--datagrid");
|
33
33
|
var getAccessibilityProps = function getAccessibilityProps(header) {
|
34
34
|
var props = {};
|
35
|
-
var
|
36
|
-
if (
|
37
|
-
props.title = title;
|
38
|
-
} else {
|
35
|
+
var content = getNodeTextContent.getNodeTextContent(header.Header);
|
36
|
+
if (!content) {
|
39
37
|
props['aria-hidden'] = true;
|
40
38
|
}
|
41
39
|
return props;
|
@@ -91,6 +89,7 @@ var ResizeHeader = function ResizeHeader(_ref) {
|
|
91
89
|
"aria-label": resizerAriaLabel || 'Resize column',
|
92
90
|
disabled: isFetching
|
93
91
|
})), /*#__PURE__*/React__default["default"].createElement("span", {
|
92
|
+
role: "separator",
|
94
93
|
className: "".concat(blockClass, "__col-resize-indicator")
|
95
94
|
}));
|
96
95
|
};
|
@@ -99,7 +98,8 @@ var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
|
|
99
98
|
var resizerAriaLabel = datagridState.resizerAriaLabel,
|
100
99
|
isTableSortable = datagridState.isTableSortable,
|
101
100
|
rows = datagridState.rows,
|
102
|
-
isFetching = datagridState.isFetching
|
101
|
+
isFetching = datagridState.isFetching,
|
102
|
+
headers = datagridState.headers;
|
103
103
|
useInitialColumnSort.useInitialColumnSort(datagridState);
|
104
104
|
// Used to measure the height of the table and uses that value
|
105
105
|
// to display a vertical line to indicate the column you are resizing
|
@@ -144,7 +144,9 @@ var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
|
|
144
144
|
}
|
145
145
|
onMouseDown === null || onMouseDown === void 0 || onMouseDown(event);
|
146
146
|
};
|
147
|
-
var _headerGroup$getHeade = headerGroup.getHeaderGroupProps(
|
147
|
+
var _headerGroup$getHeade = headerGroup.getHeaderGroupProps({
|
148
|
+
role: undefined
|
149
|
+
}),
|
148
150
|
headerGroupClassName = _headerGroup$getHeade.className,
|
149
151
|
headerGroupProps = _rollupPluginBabelHelpers.objectWithoutProperties(_headerGroup$getHeade, _excluded);
|
150
152
|
var renderSlug = function renderSlug(slug) {
|
@@ -161,6 +163,9 @@ var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
|
|
161
163
|
});
|
162
164
|
var key = headerGroupProps.key,
|
163
165
|
rowProps = _rollupPluginBabelHelpers.objectWithoutProperties(headerGroupProps, _excluded2);
|
166
|
+
var withActionsColumn = headers ? !!headers.filter(function (header) {
|
167
|
+
return header.isAction;
|
168
|
+
}).length : false;
|
164
169
|
return /*#__PURE__*/React__default["default"].createElement(react.TableRow, _rollupPluginBabelHelpers["extends"]({
|
165
170
|
key: key
|
166
171
|
}, rowProps, {
|
@@ -190,9 +195,19 @@ var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
|
|
190
195
|
var _ref5 = columnResizing || {},
|
191
196
|
columnWidths = _ref5.columnWidths;
|
192
197
|
var originalCol = visibleColumns[index];
|
193
|
-
var _header$getHeaderProp = header.getHeaderProps(
|
198
|
+
var _header$getHeaderProp = header.getHeaderProps({
|
199
|
+
role: undefined
|
200
|
+
}),
|
194
201
|
headerProps = _rollupPluginBabelHelpers["extends"]({}, (_rollupPluginBabelHelpers.objectDestructuringEmpty(_header$getHeaderProp), _header$getHeaderProp));
|
195
|
-
var resizerProps = header === null || header === void 0 || (_header$getResizerPro = header.getResizerProps) === null || _header$getResizerPro === void 0 ? void 0 : _header$getResizerPro.call(header
|
202
|
+
var resizerProps = header === null || header === void 0 || (_header$getResizerPro = header.getResizerProps) === null || _header$getResizerPro === void 0 ? void 0 : _header$getResizerPro.call(header, {
|
203
|
+
role: undefined
|
204
|
+
});
|
205
|
+
var headerStyle = headerProps === null || headerProps === void 0 ? void 0 : headerProps.style;
|
206
|
+
var lastVisibleIndex = withActionsColumn ? 2 : 1;
|
207
|
+
var lastVisibleFlexStyle = index === visibleColumns.length - lastVisibleIndex ? '1 1 0' : '0 0 auto';
|
208
|
+
if (headerStyle) {
|
209
|
+
headerStyle.flex = lastVisibleFlexStyle;
|
210
|
+
}
|
196
211
|
return /*#__PURE__*/React__default["default"].createElement(react.TableHeader, _rollupPluginBabelHelpers["extends"]({}, headerProps, {
|
197
212
|
className: cx__default["default"](header === null || header === void 0 ? void 0 : header.className, _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__resizableColumn"), resizerProps), "".concat(blockClass, "__isResizing"), header === null || header === void 0 ? void 0 : header.isResizing), "".concat(blockClass, "__sortableColumn"), datagridState.isTableSortable && header.id !== 'spacer'), "".concat(blockClass, "__isSorted"), header === null || header === void 0 ? void 0 : header.isSorted), "".concat(blockClass, "__header-actions-column"), header === null || header === void 0 ? void 0 : header.isAction), "".concat(blockClass, "__with-slug"), header.slug && /*#__PURE__*/React__default["default"].isValidElement(header === null || header === void 0 ? void 0 : header.slug)), headerProps.className),
|
198
213
|
key: header.id,
|
@@ -25,7 +25,7 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
25
25
|
|
26
26
|
var _SkeletonText;
|
27
27
|
var _excluded = ["className"],
|
28
|
-
_excluded2 = ["children"];
|
28
|
+
_excluded2 = ["style", "children"];
|
29
29
|
var blockClass = "".concat(settings.pkg.prefix, "--datagrid");
|
30
30
|
var rowHeights = {
|
31
31
|
xs: 24,
|
@@ -48,7 +48,8 @@ var DatagridRow = function DatagridRow(datagridState) {
|
|
48
48
|
withExpandedRows = datagridState.withExpandedRows,
|
49
49
|
withMouseHover = datagridState.withMouseHover,
|
50
50
|
setMouseOverRowIndex = datagridState.setMouseOverRowIndex,
|
51
|
-
headers = datagridState.headers
|
51
|
+
headers = datagridState.headers,
|
52
|
+
visibleColumns = datagridState.visibleColumns;
|
52
53
|
var getVisibleNestedRowCount = function getVisibleNestedRowCount(_ref) {
|
53
54
|
var isExpanded = _ref.isExpanded,
|
54
55
|
subRows = _ref.subRows;
|
@@ -116,7 +117,9 @@ var DatagridRow = function DatagridRow(datagridState) {
|
|
116
117
|
}
|
117
118
|
return {};
|
118
119
|
};
|
119
|
-
var _row$getRowProps = row.getRowProps(
|
120
|
+
var _row$getRowProps = row.getRowProps({
|
121
|
+
role: undefined
|
122
|
+
}),
|
120
123
|
className = _row$getRowProps.className,
|
121
124
|
rowProps = _rollupPluginBabelHelpers.objectWithoutProperties(_row$getRowProps, _excluded);
|
122
125
|
var foundAIRow = rows.some(function (r) {
|
@@ -124,6 +127,9 @@ var DatagridRow = function DatagridRow(datagridState) {
|
|
124
127
|
return /*#__PURE__*/React.isValidElement(r === null || r === void 0 || (_r$original = r.original) === null || _r$original === void 0 ? void 0 : _r$original.slug);
|
125
128
|
});
|
126
129
|
var rowClassNames = cx__default["default"]("".concat(blockClass, "__carbon-row"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__carbon-row-expanded"), row.isExpanded), "".concat(blockClass, "__carbon-row-expandable"), row.canExpand), "".concat(settings.carbon.prefix, "--data-table--selected"), row.isSelected), "".concat(blockClass, "__slug--row"), /*#__PURE__*/React.isValidElement(row === null || row === void 0 || (_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.slug)));
|
130
|
+
var withActionsColumn = headers ? !!headers.filter(function (header) {
|
131
|
+
return header.isAction;
|
132
|
+
}).length : false;
|
127
133
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, {
|
128
134
|
key: key
|
129
135
|
}, /*#__PURE__*/React__default["default"].createElement(react.TableRow, _rollupPluginBabelHelpers["extends"]({}, rowProps, {
|
@@ -141,10 +147,13 @@ var DatagridRow = function DatagridRow(datagridState) {
|
|
141
147
|
})) : /*#__PURE__*/React__default["default"].createElement("td", {
|
142
148
|
className: "".concat(blockClass, "__table-row-ai-spacer")
|
143
149
|
}) : null, row.cells.map(function (cell, index) {
|
144
|
-
var _cell$column, _cell$column2,
|
145
|
-
var cellProps = cell.getCellProps(
|
150
|
+
var _cell$column, _cell$column2, _associatedHeader$;
|
151
|
+
var cellProps = cell.getCellProps({
|
152
|
+
role: undefined
|
153
|
+
});
|
146
154
|
// eslint-disable-next-line no-unused-vars
|
147
155
|
var _ref2 = cellProps,
|
156
|
+
style = _ref2.style,
|
148
157
|
children = _ref2.children,
|
149
158
|
restProps = _rollupPluginBabelHelpers.objectWithoutProperties(_ref2, _excluded2);
|
150
159
|
var columnClassname = cell === null || cell === void 0 || (_cell$column = cell.column) === null || _cell$column === void 0 ? void 0 : _cell$column.className;
|
@@ -155,15 +164,19 @@ var DatagridRow = function DatagridRow(datagridState) {
|
|
155
164
|
key: cell.column.id
|
156
165
|
});
|
157
166
|
}
|
158
|
-
var title = content === null || content === void 0 || (_content$props = content.props) === null || _content$props === void 0 || (_content$props = _content$props.children[0]) === null || _content$props === void 0 || (_content$props = _content$props.props) === null || _content$props === void 0 ? void 0 : _content$props.value;
|
159
167
|
var associatedHeader = headers === null || headers === void 0 ? void 0 : headers.filter(function (h) {
|
160
168
|
return h.id === cell.column.id;
|
161
169
|
});
|
170
|
+
var lastVisibleIndex = withActionsColumn ? 2 : 1;
|
171
|
+
var lastVisibleFlexStyle = index === visibleColumns.length - lastVisibleIndex ? '1 1 0' : '0 0 auto';
|
172
|
+
if (style) {
|
173
|
+
style.flex = lastVisibleFlexStyle;
|
174
|
+
}
|
162
175
|
return /*#__PURE__*/React__default["default"].createElement(react.TableCell, _rollupPluginBabelHelpers["extends"]({
|
163
176
|
className: cx__default["default"]("".concat(blockClass, "__cell"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__expandable-row-cell"), row.canExpand && index === 0), "".concat(blockClass, "__expandable-row-cell--is-expanded"), row.isExpanded && index === 0), "".concat(blockClass, "__slug--cell"), associatedHeader && associatedHeader.length && /*#__PURE__*/React.isValidElement((_associatedHeader$ = associatedHeader[0]) === null || _associatedHeader$ === void 0 ? void 0 : _associatedHeader$.slug)), columnClassname)
|
164
177
|
}, restProps, {
|
165
|
-
|
166
|
-
|
178
|
+
style: style,
|
179
|
+
key: cell.column.id
|
167
180
|
}), content);
|
168
181
|
})), (renderExpandedRow === null || renderExpandedRow === void 0 ? void 0 : renderExpandedRow()) || undefined);
|
169
182
|
};
|
@@ -25,11 +25,12 @@ var _excluded = ["onChange"];
|
|
25
25
|
var blockClass = "".concat(settings.pkg.prefix, "--datagrid");
|
26
26
|
var SelectAll = function SelectAll(datagridState) {
|
27
27
|
var _columns$;
|
28
|
-
var _useState = React.useState(
|
28
|
+
var _useState = React.useState(),
|
29
29
|
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
30
30
|
windowSize = _useState2[0],
|
31
31
|
setWindowSize = _useState2[1];
|
32
32
|
React.useLayoutEffect(function () {
|
33
|
+
setWindowSize(window.innerWidth);
|
33
34
|
/* istanbul ignore next */
|
34
35
|
function updateSize() {
|
35
36
|
setWindowSize(window.innerWidth);
|
@@ -52,11 +52,12 @@ var SelectAllWithToggle = function SelectAllWithToggle(_ref) {
|
|
52
52
|
onSelectAllRows(isAllRowsSelected && selectAllMode === SELECT_ALL_ROWS);
|
53
53
|
}
|
54
54
|
}, [isAllRowsSelected, selectAllMode, onSelectAllRows]);
|
55
|
-
var _useState3 = React.useState(
|
55
|
+
var _useState3 = React.useState(),
|
56
56
|
_useState4 = _rollupPluginBabelHelpers.slicedToArray(_useState3, 2),
|
57
57
|
windowSize = _useState4[0],
|
58
58
|
setWindowSize = _useState4[1];
|
59
59
|
React.useLayoutEffect(function () {
|
60
|
+
setWindowSize(window.innerWidth);
|
60
61
|
function updateSize() {
|
61
62
|
setWindowSize(window.innerWidth);
|
62
63
|
}
|
@@ -77,7 +78,7 @@ var SelectAllWithToggle = function SelectAllWithToggle(_ref) {
|
|
77
78
|
var isFirstColumnStickyLeft = (columns === null || columns === void 0 || (_columns$ = columns[0]) === null || _columns$ === void 0 ? void 0 : _columns$.sticky) === 'left' && withStickyColumn;
|
78
79
|
return /*#__PURE__*/React__default["default"].createElement("th", {
|
79
80
|
scope: "col",
|
80
|
-
className: cx__default["default"]("".concat(blockClass, "__select-all-toggle-on"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__select-all-sticky-left"), isFirstColumnStickyLeft && windowSize > 671))
|
81
|
+
className: cx__default["default"]("".concat(blockClass, "__select-all-toggle-on"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__select-all-sticky-left"), isFirstColumnStickyLeft && (windowSize !== null && windowSize !== void 0 ? windowSize : 0) > 671))
|
81
82
|
}, /*#__PURE__*/React__default["default"].createElement("span", null, /*#__PURE__*/React__default["default"].createElement(react.Checkbox, _rollupPluginBabelHelpers["extends"]({}, selectProps, {
|
82
83
|
name: "".concat(tableId, "-select-all-checkbox-name"),
|
83
84
|
onClick: function onClick(e) {
|
package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js
CHANGED
@@ -81,15 +81,39 @@ var CustomizeColumnsTearsheet = function CustomizeColumnsTearsheet(_ref) {
|
|
81
81
|
onSaveColumnPrefs(updatedColumns);
|
82
82
|
};
|
83
83
|
var onCheckboxCheck = function onCheckboxCheck(col, value) {
|
84
|
+
// Update the visibility of columns based on a single column or an array of columns
|
84
85
|
var changedDefinitions = columnObjects.map(function (definition) {
|
85
|
-
|
86
|
-
|
86
|
+
// If select all is clicked
|
87
|
+
if (Array.isArray(col)) {
|
88
|
+
return col.includes(definition) && definition.canFilter && !definition.disabled ? _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, definition), {}, {
|
87
89
|
isVisible: value
|
88
|
-
});
|
90
|
+
}) : definition;
|
89
91
|
}
|
90
|
-
return
|
92
|
+
// If a single checkbox is clicked which is written below as a default return
|
93
|
+
return col.id === definition.id ? _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, definition), {}, {
|
94
|
+
isVisible: value
|
95
|
+
}) : definition;
|
91
96
|
});
|
92
|
-
|
97
|
+
|
98
|
+
// Count the number of visible columns excluding certain IDs after 1st mutation
|
99
|
+
var selectedColumnsCount = changedDefinitions.filter(function (definition) {
|
100
|
+
return definition.isVisible && !['datagridSelection', 'actions'].includes(definition.id);
|
101
|
+
}).length;
|
102
|
+
|
103
|
+
// Ensure special columns are visible if any other columns are visible
|
104
|
+
var finalDefinitions = changedDefinitions.map(function (definition) {
|
105
|
+
// If at least 1 column is visible after mutation, we add selection column and actions column (coming from various extensions)
|
106
|
+
if (selectedColumnsCount > 0) {
|
107
|
+
return ['datagridSelection', 'actions'].includes(definition.id) ? _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, definition), {}, {
|
108
|
+
isVisible: true
|
109
|
+
}) : definition;
|
110
|
+
}
|
111
|
+
// Else we remove selection column and actions column
|
112
|
+
return ['datagridSelection', 'actions'].includes(definition.id) ? _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, definition), {}, {
|
113
|
+
isVisible: false
|
114
|
+
}) : definition;
|
115
|
+
});
|
116
|
+
setColumnObjects(finalDefinitions);
|
93
117
|
setDirty();
|
94
118
|
};
|
95
119
|
var setDirty = function setDirty() {
|
@@ -104,14 +128,14 @@ var CustomizeColumnsTearsheet = function CustomizeColumnsTearsheet(_ref) {
|
|
104
128
|
}, [columnObjects]);
|
105
129
|
var string = searchText.trim().toLowerCase();
|
106
130
|
React.useEffect(function () {
|
107
|
-
var notFilterableCount = columnObjects.filter(function (col) {
|
108
|
-
return !col.canFilter;
|
109
|
-
}).length;
|
110
131
|
var actionCount = columnObjects.filter(function (col) {
|
111
132
|
return col.id === 'actions';
|
112
133
|
}).length;
|
113
|
-
|
114
|
-
|
134
|
+
var datagridSelectionCount = columnObjects.filter(function (col) {
|
135
|
+
return col.id === 'datagridSelection';
|
136
|
+
}).length;
|
137
|
+
setVisibleColumnsCount(getVisibleColumnsCount() - actionCount - datagridSelectionCount < 0 ? 0 : getVisibleColumnsCount() - actionCount - datagridSelectionCount);
|
138
|
+
setTotalColumns(columnObjects.length - actionCount - datagridSelectionCount);
|
115
139
|
}, [getVisibleColumnsCount, columnObjects]);
|
116
140
|
return /*#__PURE__*/React__default["default"].createElement(TearsheetNarrow.TearsheetNarrow, {
|
117
141
|
className: "".concat(blockClass, "__customize-columns-tearsheet"),
|