@carbon/ibm-products 2.65.0 → 2.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/index-full-carbon.css +482 -64
- 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 +14 -20
- 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 +29 -22
- 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 +123 -39
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/css/index.min.css.map +1 -1
- package/es/_virtual/_rollupPluginBabelHelpers.js +1 -510
- package/es/components/APIKeyModal/APIKeyDownloader.js +32 -50
- package/es/components/APIKeyModal/APIKeyModal.js +164 -217
- package/es/components/AboutModal/AboutModal.js +50 -52
- package/es/components/ActionBar/ActionBar.js +62 -56
- package/es/components/ActionBar/ActionBarItem.js +25 -18
- package/es/components/ActionBar/ActionBarOverflowItems.js +21 -19
- package/es/components/ActionSet/ActionSet.js +92 -88
- package/es/components/AddSelect/AddSelect.js +22 -20
- package/es/components/AddSelect/AddSelectBody.js +143 -154
- package/es/components/AddSelect/AddSelectBreadcrumbs.js +21 -14
- package/es/components/AddSelect/AddSelectColumn.js +97 -123
- package/es/components/AddSelect/AddSelectFilter.js +72 -79
- package/es/components/AddSelect/AddSelectFormControl.js +41 -35
- package/es/components/AddSelect/AddSelectList.js +24 -26
- package/es/components/AddSelect/AddSelectMetaPanel.js +24 -26
- package/es/components/AddSelect/AddSelectRow.js +86 -83
- package/es/components/AddSelect/AddSelectSidebar.js +56 -59
- package/es/components/AddSelect/AddSelectSort.js +31 -31
- package/es/components/AddSelect/add-select-utils.js +46 -41
- package/es/components/AddSelect/hooks/useFocus.js +7 -11
- package/es/components/AddSelect/hooks/useItemSort.js +13 -14
- package/es/components/AddSelect/hooks/useParentSelect.js +10 -8
- package/es/components/AddSelect/hooks/usePath.js +33 -36
- package/es/components/BigNumbers/BigNumbers.js +43 -46
- package/es/components/BigNumbers/BigNumbersSkeleton.js +15 -12
- package/es/components/BigNumbers/constants.js +5 -5
- package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +112 -127
- package/es/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +70 -74
- package/es/components/Card/Card.d.ts +15 -11
- package/es/components/Card/Card.js +187 -171
- package/es/components/Card/CardFooter.js +32 -33
- package/es/components/Card/CardHeader.js +59 -46
- package/es/components/Carousel/Carousel.js +102 -118
- package/es/components/Carousel/CarouselItem.js +9 -8
- package/es/components/Cascade/Cascade.js +30 -25
- package/es/components/Checklist/Checklist.js +64 -75
- package/es/components/Checklist/Checklist.types.js +2 -2
- package/es/components/Checklist/ChecklistChart.js +22 -31
- package/es/components/Checklist/ChecklistIcon.js +14 -15
- package/es/components/Coachmark/Coachmark.js +71 -89
- package/es/components/Coachmark/CoachmarkDragbar.js +30 -40
- package/es/components/Coachmark/CoachmarkHeader.js +18 -21
- package/es/components/Coachmark/CoachmarkOverlay.js +70 -79
- package/es/components/Coachmark/CoachmarkTagline.js +19 -21
- package/es/components/Coachmark/utils/constants.js +10 -9
- package/es/components/Coachmark/utils/context.js +2 -2
- package/es/components/Coachmark/utils/enums.js +2 -2
- package/es/components/Coachmark/utils/hooks.js +12 -12
- package/es/components/CoachmarkBeacon/CoachmarkBeacon.js +15 -15
- package/es/components/CoachmarkButton/CoachmarkButton.js +10 -9
- package/es/components/CoachmarkFixed/CoachmarkFixed.js +50 -68
- package/es/components/CoachmarkOverlayElement/CoachmarkOverlayElement.js +16 -15
- package/es/components/CoachmarkOverlayElements/CoachmarkOverlayElements.js +54 -72
- package/es/components/CoachmarkStack/CoachmarkStack.js +64 -82
- package/es/components/CoachmarkStack/CoachmarkStackHome.js +55 -62
- package/es/components/ComboButton/ComboButton.js +45 -52
- package/es/components/ComboButton/ComboButtonItem/index.js +4 -3
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +106 -105
- package/es/components/ConditionBuilder/ConditionBuilder.js +34 -45
- package/es/components/ConditionBuilder/ConditionBuilder.types.d.ts +15 -2
- package/es/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +72 -92
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +3 -1
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +61 -38
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +31 -27
- package/es/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +25 -24
- package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +16 -16
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +101 -108
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +14 -20
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +1 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +59 -72
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +30 -39
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +18 -19
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +40 -51
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +59 -94
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +14 -13
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +19 -30
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +182 -200
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +34 -33
- package/es/components/ConditionBuilder/utils/handleKeyboardEvents.js +52 -65
- package/es/components/ConditionBuilder/utils/useDataConfigs.js +11 -30
- package/es/components/ConditionBuilder/utils/useTranslations.js +7 -6
- package/es/components/ConditionBuilder/utils/util.js +27 -36
- package/es/components/CreateFullPage/CreateFullPage.d.ts +5 -1
- package/es/components/CreateFullPage/CreateFullPage.js +99 -151
- package/es/components/CreateFullPage/CreateFullPageStep.js +65 -59
- package/es/components/CreateInfluencer/CreateInfluencer.js +25 -29
- package/es/components/CreateModal/CreateModal.js +40 -36
- package/es/components/CreateSidePanel/CreateSidePanel.js +40 -39
- package/es/components/CreateTearsheet/CreateTearsheet.d.ts +1 -1
- package/es/components/CreateTearsheet/CreateTearsheet.js +113 -164
- package/es/components/CreateTearsheet/CreateTearsheetDivider.js +9 -7
- package/es/components/CreateTearsheet/CreateTearsheetStep.js +73 -69
- package/es/components/CreateTearsheetNarrow/CreateTearsheetNarrow.js +30 -30
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +296 -339
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +215 -215
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +122 -121
- package/es/components/DataSpreadsheet/hooks/useMoveActiveCell.js +15 -13
- package/es/components/DataSpreadsheet/hooks/useMultipleKeyTracking.js +35 -53
- package/es/components/DataSpreadsheet/hooks/useResetSpreadsheetFocus.js +10 -9
- package/es/components/DataSpreadsheet/hooks/useSpreadsheetEdit.js +40 -46
- package/es/components/DataSpreadsheet/hooks/useSpreadsheetMouseMove.js +29 -28
- package/es/components/DataSpreadsheet/hooks/useSpreadsheetMouseUp.js +73 -88
- package/es/components/DataSpreadsheet/hooks/useSpreadsheetOutsideClick.js +16 -15
- package/es/components/DataSpreadsheet/utils/checkActiveHeaderCell.js +10 -12
- package/es/components/DataSpreadsheet/utils/checkForHoldingKey.js +1 -1
- package/es/components/DataSpreadsheet/utils/checkSelectedHeaderCell.js +11 -12
- package/es/components/DataSpreadsheet/utils/commonEventHandlers.js +75 -124
- package/es/components/DataSpreadsheet/utils/createActiveCellFn.js +25 -25
- package/es/components/DataSpreadsheet/utils/createCellSelectionArea.js +32 -31
- package/es/components/DataSpreadsheet/utils/getCellSize.js +2 -4
- package/es/components/DataSpreadsheet/utils/getSelectionAreaPoints.js +9 -9
- package/es/components/DataSpreadsheet/utils/getSpreadsheetWidth.js +12 -14
- package/es/components/DataSpreadsheet/utils/handleActiveCellInSelectionEnter.js +40 -36
- package/es/components/DataSpreadsheet/utils/handleActiveCellInSelectionTab.js +37 -34
- package/es/components/DataSpreadsheet/utils/handleCellDeletion.js +22 -23
- package/es/components/DataSpreadsheet/utils/handleEditSubmit.js +37 -34
- package/es/components/DataSpreadsheet/utils/handleHeaderCellSelection.js +65 -76
- package/es/components/DataSpreadsheet/utils/handleMultipleKeys.js +94 -88
- package/es/components/DataSpreadsheet/utils/moveColumnIndicatorLine.js +29 -26
- package/es/components/DataSpreadsheet/utils/removeCellSelections.js +9 -11
- package/es/components/DataSpreadsheet/utils/selectAllCells.js +17 -14
- package/es/components/Datagrid/Datagrid/Datagrid.js +27 -24
- package/es/components/Datagrid/Datagrid/DatagridBody.js +7 -6
- package/es/components/Datagrid/Datagrid/DatagridContent.js +130 -112
- package/es/components/Datagrid/Datagrid/DatagridEmptyBody.js +19 -18
- package/es/components/Datagrid/Datagrid/DatagridExpandedRow.js +42 -43
- package/es/components/Datagrid/Datagrid/DatagridHead.js +9 -10
- package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +172 -125
- package/es/components/Datagrid/Datagrid/DatagridRefBody.js +18 -15
- package/es/components/Datagrid/Datagrid/DatagridRow.js +101 -91
- package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +63 -61
- package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +48 -57
- package/es/components/Datagrid/Datagrid/DatagridSimpleBody.js +18 -15
- package/es/components/Datagrid/Datagrid/DatagridToolbar.js +83 -96
- package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +74 -76
- package/es/components/Datagrid/Datagrid/DraggableElement.js +38 -29
- package/es/components/Datagrid/Datagrid/addons/AiLabel/DatagridAiLabel.js +6 -4
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +9 -7
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +18 -20
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +34 -36
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +56 -85
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +88 -106
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/TearsheetWrapper.js +27 -29
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/common.js +1 -3
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +96 -104
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +125 -136
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +90 -106
- package/es/components/Datagrid/Datagrid/addons/Filtering/OverflowCheckboxes.js +41 -46
- package/es/components/Datagrid/Datagrid/addons/Filtering/constants.js +13 -13
- package/es/components/Datagrid/Datagrid/addons/Filtering/handleCheckboxChange.js +23 -30
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.js +2 -2
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +212 -219
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useShouldDisableButtons.js +13 -11
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useSubscribeToEventEmitter.js +4 -3
- package/es/components/Datagrid/Datagrid/addons/Filtering/utils.js +44 -42
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +28 -17
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +196 -191
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +41 -39
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/getCellIdAsObject.js +7 -9
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/returnUpdatedActiveCell.js +18 -15
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridFocus.js +5 -3
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +84 -73
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleMultipleKeys.js +22 -26
- package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +24 -28
- package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +19 -18
- package/es/components/Datagrid/Datagrid/addons/stateReducer.js +211 -173
- package/es/components/Datagrid/common-column-ids.js +1 -1
- package/es/components/Datagrid/useActionsColumn.js +81 -61
- package/es/components/Datagrid/useColumnCenterAlign.js +17 -27
- package/es/components/Datagrid/useColumnRightAlign.js +17 -28
- package/es/components/Datagrid/useCustomizeColumns.js +18 -20
- package/es/components/Datagrid/useDatagrid.js +13 -18
- package/es/components/Datagrid/useDefaultStringRenderer.js +19 -20
- package/es/components/Datagrid/useDisableSelectRows.js +49 -57
- package/es/components/Datagrid/useEditableCell.js +1 -1
- package/es/components/Datagrid/useExpandedRow.js +20 -25
- package/es/components/Datagrid/useFiltering.js +53 -58
- package/es/components/Datagrid/useFlexResize.js +31 -29
- package/es/components/Datagrid/useFloatingScroll.js +40 -38
- package/es/components/Datagrid/useFocusRowExpander.js +16 -15
- package/es/components/Datagrid/useInfiniteScroll.js +22 -20
- package/es/components/Datagrid/useInitialColumnSort.js +22 -21
- package/es/components/Datagrid/useInlineEdit.js +24 -26
- package/es/components/Datagrid/useNestedRowExpander.js +63 -80
- package/es/components/Datagrid/useNestedRows.js +45 -45
- package/es/components/Datagrid/useOnRowClick.js +32 -26
- package/es/components/Datagrid/useParentDimensions.js +35 -37
- package/es/components/Datagrid/useResizeTable.js +11 -9
- package/es/components/Datagrid/useRowExpander.js +30 -27
- package/es/components/Datagrid/useRowIsMouseOver.js +22 -28
- package/es/components/Datagrid/useRowRenderer.js +25 -35
- package/es/components/Datagrid/useRowSize.js +27 -24
- package/es/components/Datagrid/useSelectAllToggle.js +47 -46
- package/es/components/Datagrid/useSelectRows.js +90 -107
- package/es/components/Datagrid/useSkeletonRows.js +14 -25
- package/es/components/Datagrid/useSortableColumns.js +61 -87
- package/es/components/Datagrid/useStickyColumn.js +84 -94
- package/es/components/Datagrid/utils/getAutoSizedColumnWidth.js +5 -16
- package/es/components/Decorator/Decorator.js +3 -3
- package/es/components/DecoratorBase/DecoratorBase.js +94 -88
- package/es/components/DecoratorBase/DecoratorIcon.js +15 -15
- package/es/components/DecoratorBase/utils.js +8 -6
- package/es/components/DecoratorDualButton/DecoratorDualButton.js +4 -4
- package/es/components/DecoratorLink/DecoratorLink.js +4 -4
- package/es/components/DecoratorSingleButton/DecoratorSingleButton.js +4 -4
- package/es/components/DelimitedList/DelimitedList.js +16 -15
- package/es/components/DescriptionList/DescriptionList.js +21 -17
- package/es/components/DescriptionList/DescriptionListBody.js +9 -9
- package/es/components/DescriptionList/DescriptionListCell.js +9 -9
- package/es/components/DescriptionList/DescriptionListRow.js +9 -9
- package/es/components/DescriptionList/constants.js +1 -1
- package/es/components/EditFullPage/EditFullPage.js +16 -10
- package/es/components/EditInPlace/EditInPlace.js +80 -78
- package/es/components/EditSidePanel/EditSidePanel.js +50 -47
- package/es/components/EditTearsheet/EditTearsheet.js +65 -99
- package/es/components/EditTearsheet/EditTearsheetForm.js +36 -28
- package/es/components/EditTearsheetNarrow/EditTearsheetNarrow.js +15 -10
- package/es/components/EditUpdateCards/EditUpdateCards.d.ts +2 -9
- package/es/components/EditUpdateCards/EditUpdateCards.js +42 -31
- package/es/components/EmptyStates/EmptyState.js +38 -34
- package/es/components/EmptyStates/EmptyStateContent.js +29 -21
- package/es/components/EmptyStates/EmptyStateIllustration.js +15 -28
- package/es/components/EmptyStates/EmptyStateV2.js +34 -29
- package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +28 -25
- package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +28 -25
- package/es/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +28 -25
- package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +28 -25
- package/es/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +28 -25
- package/es/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +28 -25
- package/es/components/EmptyStates/assets/ErrorIllustration.js +27 -26
- package/es/components/EmptyStates/assets/NoDataIllustration.js +25 -24
- package/es/components/EmptyStates/assets/NoTagsIllustration.js +54 -53
- package/es/components/EmptyStates/assets/NotFoundIllustration.js +38 -37
- package/es/components/EmptyStates/assets/NotificationsIllustration.js +43 -42
- package/es/components/EmptyStates/assets/UnauthorizedIllustration.js +38 -37
- package/es/components/ExportModal/ExportModal.js +82 -94
- package/es/components/ExpressiveCard/ExpressiveCard.d.ts +2 -10
- package/es/components/ExpressiveCard/ExpressiveCard.js +11 -5
- package/es/components/FeatureFlags/index.js +33 -43
- package/es/components/FilterPanel/FilterPanel.js +12 -12
- package/es/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.js +20 -20
- package/es/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.js +21 -25
- package/es/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.js +13 -13
- package/es/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.js +54 -60
- package/es/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.js +15 -15
- package/es/components/FilterPanel/FilterPanelLabel/FilterPanelLabel.js +13 -13
- package/es/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.js +21 -25
- package/es/components/FilterSummary/FilterSummary.js +60 -67
- package/es/components/FullPageError/FullPageError.js +28 -26
- package/es/components/FullPageError/assets/Error403SVG.js +4 -2
- package/es/components/FullPageError/assets/Error404SVG.js +4 -2
- package/es/components/FullPageError/assets/ErrorGenericSVG.js +4 -2
- package/es/components/GetStartedCard/GetStartedCard.js +6 -6
- package/es/components/Guidebanner/Guidebanner.js +46 -63
- package/es/components/Guidebanner/GuidebannerElement.js +14 -14
- package/es/components/Guidebanner/GuidebannerElementButton.js +15 -17
- package/es/components/Guidebanner/GuidebannerElementLink.js +9 -9
- package/es/components/HTTPErrors/HTTPError403/HTTPError403.js +18 -18
- package/es/components/HTTPErrors/HTTPError404/HTTPError404.js +18 -18
- package/es/components/HTTPErrors/HTTPErrorContent.js +23 -22
- package/es/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +18 -18
- package/es/components/HTTPErrors/assets/HTTPErrorSvg403.js +83 -81
- package/es/components/HTTPErrors/assets/HTTPErrorSvg404.js +87 -85
- package/es/components/HTTPErrors/assets/HTTPErrorSvgOther.js +83 -81
- package/es/components/ImportModal/ImportModal.js +125 -162
- package/es/components/InlineTip/InlineTip.js +46 -61
- package/es/components/InlineTip/InlineTipButton.js +9 -9
- package/es/components/InlineTip/InlineTipLink.js +12 -13
- package/es/components/InlineTip/utils.js +9 -19
- package/es/components/InterstitialScreen/InterstitialScreen.js +62 -83
- package/es/components/InterstitialScreen/InterstitialScreenBody.js +56 -62
- package/es/components/InterstitialScreen/InterstitialScreenFooter.js +87 -118
- package/es/components/InterstitialScreen/InterstitialScreenHeader.js +29 -25
- package/es/components/MultiAddSelect/MultiAddSelect.js +5 -7
- package/es/components/Nav/Nav.js +39 -43
- package/es/components/Nav/NavItem.js +44 -51
- package/es/components/Nav/NavItemLink.js +9 -8
- package/es/components/Nav/NavList.js +57 -66
- package/es/components/NonLinearReading/NonLinearReading.js +18 -23
- package/es/components/NotificationsPanel/NotificationsPanel.js +178 -258
- package/es/components/NotificationsPanel/utils.js +26 -24
- package/es/components/OptionsTile/OptionsTile.js +90 -82
- package/es/components/PageHeader/PageHeader.js +293 -256
- package/es/components/PageHeader/PageHeaderTitle.js +43 -36
- package/es/components/PageHeader/PageHeaderUtils.js +31 -28
- package/es/components/ProductiveCard/ProductiveCard.d.ts +2 -13
- package/es/components/ProductiveCard/ProductiveCard.js +20 -14
- package/es/components/RemoveModal/RemoveModal.js +46 -49
- package/es/components/Saving/Saving.js +54 -59
- package/es/components/ScrollGradient/ScrollGradient.js +63 -66
- package/es/components/ScrollGradient/constants.js +13 -24
- package/es/components/SearchBar/SearchBar.d.ts +5 -6
- package/es/components/SearchBar/SearchBar.js +62 -68
- package/es/components/SidePanel/SidePanel.d.ts +2 -5
- package/es/components/SidePanel/SidePanel.js +242 -245
- package/es/components/SidePanel/constants.js +1 -1
- package/es/components/SimpleHeader/SimpleHeader.js +22 -25
- package/es/components/SingleAddSelect/SingleAddSelect.js +3 -3
- package/es/components/StatusIcon/StatusIcon.js +195 -281
- package/es/components/StatusIndicator/StatusIndicator.js +21 -24
- package/es/components/StatusIndicator/StatusIndicatorStep.js +18 -18
- package/es/components/StringFormatter/StringFormatter.js +62 -38
- package/es/components/StringFormatter/utils/enums.js +13 -13
- package/es/components/TagOverflow/TagOverflow.js +70 -74
- package/es/components/TagOverflow/TagOverflowModal.js +49 -52
- package/es/components/TagOverflow/TagOverflowPopover.js +63 -61
- package/es/components/TagOverflow/constants.js +1 -1
- package/es/components/TagSet/TagSet.js +104 -130
- package/es/components/TagSet/TagSetModal.js +48 -51
- package/es/components/TagSet/TagSetOverflow.js +54 -50
- package/es/components/Tearsheet/Tearsheet.js +22 -22
- package/es/components/Tearsheet/TearsheetNarrow.js +20 -19
- package/es/components/Tearsheet/TearsheetShell.js +160 -156
- package/es/components/Toolbar/Toolbar.js +44 -47
- package/es/components/Toolbar/ToolbarButton.js +25 -24
- package/es/components/Toolbar/ToolbarGroup.js +9 -8
- package/es/components/TooltipTrigger/TooltipTrigger.js +10 -9
- package/es/components/TruncatedList/TruncatedList.js +44 -61
- package/es/components/UserAvatar/UserAvatar.js +49 -48
- package/es/components/UserProfileImage/UserProfileImage.js +59 -74
- package/es/components/WebTerminal/WebTerminal.js +64 -67
- package/es/components/WebTerminal/WebTerminalContentWrapper.js +16 -11
- package/es/components/WebTerminal/hooks/index.js +21 -23
- package/es/components/_Canary/Canary.js +13 -8
- package/es/global/js/hooks/useActiveElement.js +5 -9
- package/es/global/js/hooks/useClickOutside.js +4 -4
- package/es/global/js/hooks/useControllableState.js +3 -7
- package/es/global/js/hooks/useCreateComponentFocus.js +16 -30
- package/es/global/js/hooks/useCreateComponentStepChange.js +99 -190
- package/es/global/js/hooks/useFocus.js +64 -85
- package/es/global/js/hooks/useIsomorphicEffect.js +1 -1
- package/es/global/js/hooks/useOverflowItems/useOverflowItems.js +48 -58
- package/es/global/js/hooks/useOverflowString.js +13 -24
- package/es/global/js/hooks/usePortalTarget.js +5 -11
- package/es/global/js/hooks/usePrefersReducedMotion.js +12 -12
- package/es/global/js/hooks/usePrefix.js +1 -3
- package/es/global/js/hooks/usePresence.js +8 -12
- package/es/global/js/hooks/usePreviousValue.js +3 -3
- package/es/global/js/hooks/useResetCreateComponent.js +15 -13
- package/es/global/js/hooks/useResizeObserver.js +26 -34
- package/es/global/js/hooks/useRetrieveFormTitles.js +10 -9
- package/es/global/js/hooks/useRetrieveStepData.js +21 -20
- package/es/global/js/hooks/useValidCreateStepCount.js +3 -3
- package/es/global/js/hooks/useWindowResize.js +23 -23
- package/es/global/js/hooks/useWindowScroll.js +15 -18
- package/es/global/js/package-settings.js +43 -56
- package/es/global/js/utils/Wrap.js +19 -18
- package/es/global/js/utils/clamp.js +1 -1
- package/es/global/js/utils/debounce.js +6 -6
- package/es/global/js/utils/deepCloneObject.js +7 -16
- package/es/global/js/utils/deepCompareObject.js +9 -18
- package/es/global/js/utils/devtools.js +3 -2
- package/es/global/js/utils/getFocusableElements.js +2 -13
- package/es/global/js/utils/getNodeTextContent.js +6 -15
- package/es/global/js/utils/getNumberOfHiddenSteps.js +3 -3
- package/es/global/js/utils/getScrollbarWidth.js +3 -3
- package/es/global/js/utils/getSupportedLocale.js +3 -3
- package/es/global/js/utils/lastIndexInArray.js +3 -4
- package/es/global/js/utils/pconsole.js +15 -22
- package/es/global/js/utils/props-helper.js +34 -40
- package/es/global/js/utils/rangeWithCallback.js +2 -2
- package/es/global/js/utils/scrollableAncestor.js +8 -17
- package/es/global/js/utils/throttle.js +4 -4
- package/es/global/js/utils/useId.js +11 -3
- package/es/global/js/utils/uuidv4.js +3 -7
- package/es/global/js/utils/wait.js +1 -3
- package/es/node_modules/@carbon/icons-react/es/Icon.js +17 -19
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-10.js +1263 -1136
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-3.js +1330 -1186
- package/es/node_modules/@carbon/icons-react/es/iconPropTypes-4cbeb95d.js +1 -1
- package/es/node_modules/@carbon/icons-react/node_modules/@carbon/icon-helpers/es/index.js +3 -5
- package/es/node_modules/prop-types/checkPropTypes.js +4 -5
- package/es/node_modules/prop-types/factoryWithThrowingShims.js +1 -1
- package/es/node_modules/prop-types/factoryWithTypeCheckers.js +6 -7
- package/es/settings.js +15 -19
- package/lib/_virtual/_rollupPluginBabelHelpers.js +0 -530
- package/lib/components/APIKeyModal/APIKeyDownloader.js +31 -49
- package/lib/components/APIKeyModal/APIKeyModal.js +163 -216
- package/lib/components/AboutModal/AboutModal.js +49 -51
- package/lib/components/ActionBar/ActionBar.js +61 -55
- package/lib/components/ActionBar/ActionBarItem.js +24 -17
- package/lib/components/ActionBar/ActionBarOverflowItems.js +21 -19
- package/lib/components/ActionSet/ActionSet.js +91 -87
- package/lib/components/AddSelect/AddSelect.js +20 -18
- package/lib/components/AddSelect/AddSelectBody.js +140 -151
- package/lib/components/AddSelect/AddSelectBreadcrumbs.js +21 -14
- package/lib/components/AddSelect/AddSelectColumn.js +96 -122
- package/lib/components/AddSelect/AddSelectFilter.js +71 -78
- package/lib/components/AddSelect/AddSelectFormControl.js +41 -35
- package/lib/components/AddSelect/AddSelectList.js +23 -25
- package/lib/components/AddSelect/AddSelectMetaPanel.js +24 -26
- package/lib/components/AddSelect/AddSelectRow.js +85 -82
- package/lib/components/AddSelect/AddSelectSidebar.js +56 -59
- package/lib/components/AddSelect/AddSelectSort.js +30 -30
- package/lib/components/AddSelect/add-select-utils.js +46 -41
- package/lib/components/AddSelect/hooks/useFocus.js +7 -11
- package/lib/components/AddSelect/hooks/useItemSort.js +13 -14
- package/lib/components/AddSelect/hooks/useParentSelect.js +10 -8
- package/lib/components/AddSelect/hooks/usePath.js +33 -36
- package/lib/components/BigNumbers/BigNumbers.js +42 -45
- package/lib/components/BigNumbers/BigNumbersSkeleton.js +14 -11
- package/lib/components/BigNumbers/constants.js +5 -5
- package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +111 -126
- package/lib/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +69 -73
- package/lib/components/Card/Card.d.ts +15 -11
- package/lib/components/Card/Card.js +185 -169
- package/lib/components/Card/CardFooter.js +32 -33
- package/lib/components/Card/CardHeader.js +58 -45
- package/lib/components/Carousel/Carousel.js +101 -117
- package/lib/components/Carousel/CarouselItem.js +8 -7
- package/lib/components/Cascade/Cascade.js +30 -25
- package/lib/components/Checklist/Checklist.js +63 -74
- package/lib/components/Checklist/Checklist.types.js +2 -2
- package/lib/components/Checklist/ChecklistChart.js +21 -30
- package/lib/components/Checklist/ChecklistIcon.js +13 -14
- package/lib/components/Coachmark/Coachmark.js +70 -88
- package/lib/components/Coachmark/CoachmarkDragbar.js +29 -39
- package/lib/components/Coachmark/CoachmarkHeader.js +17 -20
- package/lib/components/Coachmark/CoachmarkOverlay.js +69 -78
- package/lib/components/Coachmark/CoachmarkTagline.js +18 -20
- package/lib/components/Coachmark/utils/constants.js +10 -9
- package/lib/components/Coachmark/utils/context.js +2 -2
- package/lib/components/Coachmark/utils/enums.js +2 -2
- package/lib/components/Coachmark/utils/hooks.js +12 -12
- package/lib/components/CoachmarkBeacon/CoachmarkBeacon.js +14 -14
- package/lib/components/CoachmarkButton/CoachmarkButton.js +9 -8
- package/lib/components/CoachmarkFixed/CoachmarkFixed.js +49 -67
- package/lib/components/CoachmarkOverlayElement/CoachmarkOverlayElement.js +15 -14
- package/lib/components/CoachmarkOverlayElements/CoachmarkOverlayElements.js +53 -71
- package/lib/components/CoachmarkStack/CoachmarkStack.js +63 -81
- package/lib/components/CoachmarkStack/CoachmarkStackHome.js +54 -61
- package/lib/components/ComboButton/ComboButton.js +44 -51
- package/lib/components/ComboButton/ComboButtonItem/index.js +4 -3
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +105 -104
- package/lib/components/ConditionBuilder/ConditionBuilder.js +33 -44
- package/lib/components/ConditionBuilder/ConditionBuilder.types.d.ts +15 -2
- package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +72 -92
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +3 -1
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +59 -36
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +30 -26
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +24 -23
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +16 -16
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +99 -106
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +14 -20
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +58 -71
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +29 -38
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +17 -18
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +40 -51
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +59 -94
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +14 -13
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +19 -30
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +182 -200
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +34 -33
- package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.js +52 -65
- package/lib/components/ConditionBuilder/utils/useDataConfigs.js +11 -30
- package/lib/components/ConditionBuilder/utils/useTranslations.js +7 -6
- package/lib/components/ConditionBuilder/utils/util.js +27 -36
- package/lib/components/CreateFullPage/CreateFullPage.d.ts +5 -1
- package/lib/components/CreateFullPage/CreateFullPage.js +98 -150
- package/lib/components/CreateFullPage/CreateFullPageStep.js +64 -58
- package/lib/components/CreateInfluencer/CreateInfluencer.js +25 -29
- package/lib/components/CreateModal/CreateModal.js +39 -35
- package/lib/components/CreateSidePanel/CreateSidePanel.js +39 -38
- package/lib/components/CreateTearsheet/CreateTearsheet.d.ts +1 -1
- package/lib/components/CreateTearsheet/CreateTearsheet.js +112 -163
- package/lib/components/CreateTearsheet/CreateTearsheetDivider.js +8 -6
- package/lib/components/CreateTearsheet/CreateTearsheetStep.js +72 -68
- package/lib/components/CreateTearsheetNarrow/CreateTearsheetNarrow.js +29 -29
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +292 -335
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +213 -213
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +121 -120
- package/lib/components/DataSpreadsheet/hooks/useMoveActiveCell.js +15 -13
- package/lib/components/DataSpreadsheet/hooks/useMultipleKeyTracking.js +35 -53
- package/lib/components/DataSpreadsheet/hooks/useResetSpreadsheetFocus.js +10 -9
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetEdit.js +40 -46
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetMouseMove.js +29 -28
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetMouseUp.js +72 -87
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetOutsideClick.js +16 -15
- package/lib/components/DataSpreadsheet/utils/checkActiveHeaderCell.js +9 -11
- package/lib/components/DataSpreadsheet/utils/checkForHoldingKey.js +1 -1
- package/lib/components/DataSpreadsheet/utils/checkSelectedHeaderCell.js +10 -11
- package/lib/components/DataSpreadsheet/utils/commonEventHandlers.js +73 -122
- package/lib/components/DataSpreadsheet/utils/createActiveCellFn.js +25 -25
- package/lib/components/DataSpreadsheet/utils/createCellSelectionArea.js +31 -30
- package/lib/components/DataSpreadsheet/utils/getCellSize.js +2 -4
- package/lib/components/DataSpreadsheet/utils/getSelectionAreaPoints.js +9 -9
- package/lib/components/DataSpreadsheet/utils/getSpreadsheetWidth.js +12 -14
- package/lib/components/DataSpreadsheet/utils/handleActiveCellInSelectionEnter.js +40 -36
- package/lib/components/DataSpreadsheet/utils/handleActiveCellInSelectionTab.js +37 -34
- package/lib/components/DataSpreadsheet/utils/handleCellDeletion.js +21 -22
- package/lib/components/DataSpreadsheet/utils/handleEditSubmit.js +37 -34
- package/lib/components/DataSpreadsheet/utils/handleHeaderCellSelection.js +64 -75
- package/lib/components/DataSpreadsheet/utils/handleMultipleKeys.js +93 -87
- package/lib/components/DataSpreadsheet/utils/moveColumnIndicatorLine.js +29 -26
- package/lib/components/DataSpreadsheet/utils/removeCellSelections.js +9 -11
- package/lib/components/DataSpreadsheet/utils/selectAllCells.js +17 -14
- package/lib/components/Datagrid/Datagrid/Datagrid.js +26 -23
- package/lib/components/Datagrid/Datagrid/DatagridBody.js +7 -6
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +129 -111
- package/lib/components/Datagrid/Datagrid/DatagridEmptyBody.js +19 -18
- package/lib/components/Datagrid/Datagrid/DatagridExpandedRow.js +41 -42
- package/lib/components/Datagrid/Datagrid/DatagridHead.js +9 -10
- package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +170 -123
- package/lib/components/Datagrid/Datagrid/DatagridRefBody.js +17 -14
- package/lib/components/Datagrid/Datagrid/DatagridRow.js +99 -89
- package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +62 -60
- package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +47 -56
- package/lib/components/Datagrid/Datagrid/DatagridSimpleBody.js +17 -14
- package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +83 -96
- package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +73 -75
- package/lib/components/Datagrid/Datagrid/DraggableElement.js +37 -28
- package/lib/components/Datagrid/Datagrid/addons/AiLabel/DatagridAiLabel.js +6 -4
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +9 -7
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +17 -19
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +34 -36
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +56 -85
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +86 -104
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/TearsheetWrapper.js +26 -28
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/common.js +1 -3
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +96 -104
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +124 -135
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +90 -106
- package/lib/components/Datagrid/Datagrid/addons/Filtering/OverflowCheckboxes.js +40 -45
- package/lib/components/Datagrid/Datagrid/addons/Filtering/constants.js +13 -13
- package/lib/components/Datagrid/Datagrid/addons/Filtering/handleCheckboxChange.js +23 -30
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.js +2 -2
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +211 -218
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useShouldDisableButtons.js +11 -9
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useSubscribeToEventEmitter.js +4 -3
- package/lib/components/Datagrid/Datagrid/addons/Filtering/utils.js +44 -42
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +28 -17
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +195 -190
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +41 -39
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/getCellIdAsObject.js +7 -9
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/returnUpdatedActiveCell.js +18 -15
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridFocus.js +5 -3
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +84 -73
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleMultipleKeys.js +22 -26
- package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +23 -27
- package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +19 -18
- package/lib/components/Datagrid/Datagrid/addons/stateReducer.js +211 -173
- package/lib/components/Datagrid/common-column-ids.js +1 -1
- package/lib/components/Datagrid/useActionsColumn.js +80 -60
- package/lib/components/Datagrid/useColumnCenterAlign.js +17 -27
- package/lib/components/Datagrid/useColumnRightAlign.js +17 -28
- package/lib/components/Datagrid/useCustomizeColumns.js +17 -19
- package/lib/components/Datagrid/useDatagrid.js +12 -17
- package/lib/components/Datagrid/useDefaultStringRenderer.js +19 -20
- package/lib/components/Datagrid/useDisableSelectRows.js +49 -57
- package/lib/components/Datagrid/useEditableCell.js +1 -1
- package/lib/components/Datagrid/useExpandedRow.js +20 -25
- package/lib/components/Datagrid/useFiltering.js +51 -56
- package/lib/components/Datagrid/useFlexResize.js +31 -29
- package/lib/components/Datagrid/useFloatingScroll.js +40 -38
- package/lib/components/Datagrid/useFocusRowExpander.js +16 -15
- package/lib/components/Datagrid/useInfiniteScroll.js +22 -20
- package/lib/components/Datagrid/useInitialColumnSort.js +22 -21
- package/lib/components/Datagrid/useInlineEdit.js +24 -26
- package/lib/components/Datagrid/useNestedRowExpander.js +61 -78
- package/lib/components/Datagrid/useNestedRows.js +45 -45
- package/lib/components/Datagrid/useOnRowClick.js +32 -26
- package/lib/components/Datagrid/useParentDimensions.js +35 -37
- package/lib/components/Datagrid/useResizeTable.js +11 -9
- package/lib/components/Datagrid/useRowExpander.js +28 -25
- package/lib/components/Datagrid/useRowIsMouseOver.js +22 -28
- package/lib/components/Datagrid/useRowRenderer.js +25 -35
- package/lib/components/Datagrid/useRowSize.js +26 -23
- package/lib/components/Datagrid/useSelectAllToggle.js +47 -46
- package/lib/components/Datagrid/useSelectRows.js +89 -106
- package/lib/components/Datagrid/useSkeletonRows.js +14 -25
- package/lib/components/Datagrid/useSortableColumns.js +61 -87
- package/lib/components/Datagrid/useStickyColumn.js +84 -94
- package/lib/components/Datagrid/utils/getAutoSizedColumnWidth.js +5 -16
- package/lib/components/Decorator/Decorator.js +3 -3
- package/lib/components/DecoratorBase/DecoratorBase.js +93 -87
- package/lib/components/DecoratorBase/DecoratorIcon.js +14 -14
- package/lib/components/DecoratorBase/utils.js +8 -6
- package/lib/components/DecoratorDualButton/DecoratorDualButton.js +4 -4
- package/lib/components/DecoratorLink/DecoratorLink.js +4 -4
- package/lib/components/DecoratorSingleButton/DecoratorSingleButton.js +4 -4
- package/lib/components/DelimitedList/DelimitedList.js +15 -14
- package/lib/components/DescriptionList/DescriptionList.js +20 -16
- package/lib/components/DescriptionList/DescriptionListBody.js +8 -8
- package/lib/components/DescriptionList/DescriptionListCell.js +8 -8
- package/lib/components/DescriptionList/DescriptionListRow.js +8 -8
- package/lib/components/DescriptionList/constants.js +1 -1
- package/lib/components/EditFullPage/EditFullPage.js +15 -9
- package/lib/components/EditInPlace/EditInPlace.js +79 -77
- package/lib/components/EditSidePanel/EditSidePanel.js +49 -46
- package/lib/components/EditTearsheet/EditTearsheet.js +64 -98
- package/lib/components/EditTearsheet/EditTearsheetForm.js +35 -27
- package/lib/components/EditTearsheetNarrow/EditTearsheetNarrow.js +14 -9
- package/lib/components/EditUpdateCards/EditUpdateCards.d.ts +2 -9
- package/lib/components/EditUpdateCards/EditUpdateCards.js +41 -30
- package/lib/components/EmptyStates/EmptyState.js +37 -33
- package/lib/components/EmptyStates/EmptyStateContent.js +28 -20
- package/lib/components/EmptyStates/EmptyStateIllustration.js +14 -27
- package/lib/components/EmptyStates/EmptyStateV2.js +33 -28
- package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +27 -24
- package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +27 -24
- package/lib/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +27 -24
- package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +27 -24
- package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +27 -24
- package/lib/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +27 -24
- package/lib/components/EmptyStates/assets/ErrorIllustration.js +26 -25
- package/lib/components/EmptyStates/assets/NoDataIllustration.js +24 -23
- package/lib/components/EmptyStates/assets/NoTagsIllustration.js +53 -52
- package/lib/components/EmptyStates/assets/NotFoundIllustration.js +37 -36
- package/lib/components/EmptyStates/assets/NotificationsIllustration.js +42 -41
- package/lib/components/EmptyStates/assets/UnauthorizedIllustration.js +37 -36
- package/lib/components/ExportModal/ExportModal.js +81 -93
- package/lib/components/ExpressiveCard/ExpressiveCard.d.ts +2 -10
- package/lib/components/ExpressiveCard/ExpressiveCard.js +11 -5
- package/lib/components/FeatureFlags/index.js +33 -43
- package/lib/components/FilterPanel/FilterPanel.js +11 -11
- package/lib/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.js +19 -19
- package/lib/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.js +20 -24
- package/lib/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.js +12 -12
- package/lib/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.js +53 -59
- package/lib/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.js +14 -14
- package/lib/components/FilterPanel/FilterPanelLabel/FilterPanelLabel.js +12 -12
- package/lib/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.js +20 -24
- package/lib/components/FilterSummary/FilterSummary.js +59 -66
- package/lib/components/FullPageError/FullPageError.js +27 -25
- package/lib/components/FullPageError/assets/Error403SVG.js +4 -2
- package/lib/components/FullPageError/assets/Error404SVG.js +4 -2
- package/lib/components/FullPageError/assets/ErrorGenericSVG.js +4 -2
- package/lib/components/GetStartedCard/GetStartedCard.js +5 -5
- package/lib/components/Guidebanner/Guidebanner.js +45 -62
- package/lib/components/Guidebanner/GuidebannerElement.js +13 -13
- package/lib/components/Guidebanner/GuidebannerElementButton.js +14 -16
- package/lib/components/Guidebanner/GuidebannerElementLink.js +8 -8
- package/lib/components/HTTPErrors/HTTPError403/HTTPError403.js +17 -17
- package/lib/components/HTTPErrors/HTTPError404/HTTPError404.js +17 -17
- package/lib/components/HTTPErrors/HTTPErrorContent.js +22 -21
- package/lib/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +17 -17
- package/lib/components/HTTPErrors/assets/HTTPErrorSvg403.js +83 -81
- package/lib/components/HTTPErrors/assets/HTTPErrorSvg404.js +87 -85
- package/lib/components/HTTPErrors/assets/HTTPErrorSvgOther.js +83 -81
- package/lib/components/ImportModal/ImportModal.js +124 -161
- package/lib/components/InlineTip/InlineTip.js +44 -59
- package/lib/components/InlineTip/InlineTipButton.js +8 -8
- package/lib/components/InlineTip/InlineTipLink.js +11 -12
- package/lib/components/InlineTip/utils.js +9 -19
- package/lib/components/InterstitialScreen/InterstitialScreen.js +61 -82
- package/lib/components/InterstitialScreen/InterstitialScreenBody.js +55 -61
- package/lib/components/InterstitialScreen/InterstitialScreenFooter.js +86 -117
- package/lib/components/InterstitialScreen/InterstitialScreenHeader.js +29 -25
- package/lib/components/MultiAddSelect/MultiAddSelect.js +5 -7
- package/lib/components/Nav/Nav.js +38 -42
- package/lib/components/Nav/NavItem.js +43 -50
- package/lib/components/Nav/NavItemLink.js +9 -8
- package/lib/components/Nav/NavList.js +56 -65
- package/lib/components/NonLinearReading/NonLinearReading.js +17 -22
- package/lib/components/NotificationsPanel/NotificationsPanel.js +177 -257
- package/lib/components/NotificationsPanel/utils.js +26 -24
- package/lib/components/OptionsTile/OptionsTile.js +88 -80
- package/lib/components/PageHeader/PageHeader.js +292 -255
- package/lib/components/PageHeader/PageHeaderTitle.js +42 -35
- package/lib/components/PageHeader/PageHeaderUtils.js +31 -28
- package/lib/components/ProductiveCard/ProductiveCard.d.ts +2 -13
- package/lib/components/ProductiveCard/ProductiveCard.js +19 -13
- package/lib/components/RemoveModal/RemoveModal.js +45 -48
- package/lib/components/Saving/Saving.js +51 -56
- package/lib/components/ScrollGradient/ScrollGradient.js +62 -65
- package/lib/components/ScrollGradient/constants.js +13 -24
- package/lib/components/SearchBar/SearchBar.d.ts +5 -6
- package/lib/components/SearchBar/SearchBar.js +61 -67
- package/lib/components/SidePanel/SidePanel.d.ts +2 -5
- package/lib/components/SidePanel/SidePanel.js +243 -244
- package/lib/components/SidePanel/constants.js +1 -1
- package/lib/components/SimpleHeader/SimpleHeader.js +21 -24
- package/lib/components/SingleAddSelect/SingleAddSelect.js +3 -3
- package/lib/components/StatusIcon/StatusIcon.js +194 -280
- package/lib/components/StatusIndicator/StatusIndicator.js +20 -23
- package/lib/components/StatusIndicator/StatusIndicatorStep.js +17 -17
- package/lib/components/StringFormatter/StringFormatter.js +60 -36
- package/lib/components/StringFormatter/utils/enums.js +13 -13
- package/lib/components/TagOverflow/TagOverflow.js +69 -73
- package/lib/components/TagOverflow/TagOverflowModal.js +48 -51
- package/lib/components/TagOverflow/TagOverflowPopover.js +62 -60
- package/lib/components/TagOverflow/constants.js +1 -1
- package/lib/components/TagSet/TagSet.js +103 -129
- package/lib/components/TagSet/TagSetModal.js +47 -50
- package/lib/components/TagSet/TagSetOverflow.js +53 -49
- package/lib/components/Tearsheet/Tearsheet.js +21 -21
- package/lib/components/Tearsheet/TearsheetNarrow.js +19 -18
- package/lib/components/Tearsheet/TearsheetShell.js +156 -152
- package/lib/components/Toolbar/Toolbar.js +43 -46
- package/lib/components/Toolbar/ToolbarButton.js +24 -23
- package/lib/components/Toolbar/ToolbarGroup.js +8 -7
- package/lib/components/TooltipTrigger/TooltipTrigger.js +9 -8
- package/lib/components/TruncatedList/TruncatedList.js +43 -60
- package/lib/components/UserAvatar/UserAvatar.js +48 -47
- package/lib/components/UserProfileImage/UserProfileImage.js +58 -73
- package/lib/components/WebTerminal/WebTerminal.js +63 -66
- package/lib/components/WebTerminal/WebTerminalContentWrapper.js +15 -10
- package/lib/components/WebTerminal/hooks/index.js +21 -23
- package/lib/components/_Canary/Canary.js +12 -7
- package/lib/global/js/hooks/useActiveElement.js +5 -9
- package/lib/global/js/hooks/useClickOutside.js +4 -4
- package/lib/global/js/hooks/useControllableState.js +3 -7
- package/lib/global/js/hooks/useCreateComponentFocus.js +16 -30
- package/lib/global/js/hooks/useCreateComponentStepChange.js +99 -190
- package/lib/global/js/hooks/useFocus.js +64 -85
- package/lib/global/js/hooks/useIsomorphicEffect.js +1 -1
- package/lib/global/js/hooks/useOverflowItems/useOverflowItems.js +48 -58
- package/lib/global/js/hooks/useOverflowString.js +13 -24
- package/lib/global/js/hooks/usePortalTarget.js +5 -11
- package/lib/global/js/hooks/usePrefersReducedMotion.js +12 -12
- package/lib/global/js/hooks/usePrefix.js +1 -3
- package/lib/global/js/hooks/usePresence.js +8 -12
- package/lib/global/js/hooks/usePreviousValue.js +3 -3
- package/lib/global/js/hooks/useResetCreateComponent.js +15 -13
- package/lib/global/js/hooks/useResizeObserver.js +26 -34
- package/lib/global/js/hooks/useRetrieveFormTitles.js +10 -9
- package/lib/global/js/hooks/useRetrieveStepData.js +21 -20
- package/lib/global/js/hooks/useValidCreateStepCount.js +3 -3
- package/lib/global/js/hooks/useWindowResize.js +23 -23
- package/lib/global/js/hooks/useWindowScroll.js +15 -18
- package/lib/global/js/package-settings.js +43 -56
- package/lib/global/js/utils/Wrap.js +18 -17
- package/lib/global/js/utils/clamp.js +1 -1
- package/lib/global/js/utils/debounce.js +6 -6
- package/lib/global/js/utils/deepCloneObject.js +7 -16
- package/lib/global/js/utils/deepCompareObject.js +9 -18
- package/lib/global/js/utils/devtools.js +3 -2
- package/lib/global/js/utils/getFocusableElements.js +2 -13
- package/lib/global/js/utils/getNodeTextContent.js +6 -15
- package/lib/global/js/utils/getNumberOfHiddenSteps.js +3 -3
- package/lib/global/js/utils/getScrollbarWidth.js +3 -3
- package/lib/global/js/utils/getSupportedLocale.js +3 -3
- package/lib/global/js/utils/lastIndexInArray.js +3 -4
- package/lib/global/js/utils/pconsole.js +15 -22
- package/lib/global/js/utils/props-helper.js +34 -40
- package/lib/global/js/utils/rangeWithCallback.js +2 -2
- package/lib/global/js/utils/scrollableAncestor.js +8 -17
- package/lib/global/js/utils/throttle.js +4 -4
- package/lib/global/js/utils/useId.js +11 -3
- package/lib/global/js/utils/uuidv4.js +3 -7
- package/lib/global/js/utils/wait.js +1 -3
- package/lib/index.js +1 -4
- package/lib/node_modules/@carbon/icons-react/es/Icon.js +17 -19
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-10.js +1263 -1136
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-3.js +1330 -1186
- package/lib/node_modules/@carbon/icons-react/es/iconPropTypes-4cbeb95d.js +1 -1
- package/lib/node_modules/@carbon/icons-react/node_modules/@carbon/icon-helpers/es/index.js +3 -5
- package/lib/node_modules/prop-types/checkPropTypes.js +4 -5
- package/lib/node_modules/prop-types/factoryWithThrowingShims.js +1 -1
- package/lib/node_modules/prop-types/factoryWithTypeCheckers.js +6 -7
- package/lib/settings.js +15 -19
- package/package.json +13 -13
- package/scss/components/Datagrid/styles/_useSortableColumns.scss +3 -0
- package/scss/components/NotificationsPanel/_notifications-panel.scss +16 -4
- package/scss/components/StringFormatter/_string-formatter.scss +18 -2
- package/scss/components/Tearsheet/_tearsheet.scss +1 -22
- package/telemetry.yml +2 -3
- package/es/global/js/utils/checkForOverflow.js +0 -21
- package/lib/global/js/utils/checkForOverflow.js +0 -23
@@ -35,178 +35,124 @@ var useSpreadsheetOutsideClick = require('./hooks/useSpreadsheetOutsideClick.js'
|
|
35
35
|
var useMoveActiveCell = require('./hooks/useMoveActiveCell.js');
|
36
36
|
var useSpreadsheetEdit = require('./hooks/useSpreadsheetEdit.js');
|
37
37
|
|
38
|
-
var _excluded = ["cellSize", "className", "columns", "data", "defaultEmptyRowCount", "onDataUpdate", "onColDrag", "id", "onActiveCellChange", "onSelectionAreaChange", "renderRowHeader", "renderRowHeaderDirection", "disableColumnSwapping", "readOnlyTable", "selectAllAriaLabel", "spreadsheetAriaLabel", "theme", "totalVisibleColumns"];
|
39
|
-
|
40
38
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
41
|
-
|
42
|
-
|
39
|
+
const blockClass = `${settings.pkg.prefix}--data-spreadsheet`;
|
40
|
+
const componentName = 'DataSpreadsheet';
|
43
41
|
|
44
42
|
// Default values for props
|
45
|
-
|
43
|
+
const defaults = {
|
46
44
|
columns: Object.freeze([]),
|
47
45
|
data: Object.freeze([]),
|
48
46
|
defaultEmptyRowCount: 16,
|
49
|
-
onDataUpdate: Object.freeze(
|
50
|
-
onColDrag: Object.freeze(
|
51
|
-
onActiveCellChange: Object.freeze(
|
52
|
-
onSelectionAreaChange: Object.freeze(
|
47
|
+
onDataUpdate: Object.freeze(() => {}),
|
48
|
+
onColDrag: Object.freeze(() => {}),
|
49
|
+
onActiveCellChange: Object.freeze(() => {}),
|
50
|
+
onSelectionAreaChange: Object.freeze(() => {})};
|
53
51
|
/**
|
54
52
|
* DataSpreadsheet: used to organize and display large amounts of structured data, separated by columns and rows in a grid-like format.
|
55
53
|
*/
|
56
|
-
exports.DataSpreadsheet = /*#__PURE__*/React.forwardRef(
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
columns =
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
activeCellCoordinates = _useState8[0],
|
105
|
-
setActiveCellCoordinates = _useState8[1];
|
106
|
-
var _useState9 = React.useState([]),
|
107
|
-
_useState10 = _rollupPluginBabelHelpers.slicedToArray(_useState9, 2),
|
108
|
-
selectionAreas = _useState10[0],
|
109
|
-
setSelectionAreas = _useState10[1];
|
110
|
-
var _useState11 = React.useState([]),
|
111
|
-
_useState12 = _rollupPluginBabelHelpers.slicedToArray(_useState11, 2),
|
112
|
-
selectionAreaData = _useState12[0],
|
113
|
-
setSelectionAreaData = _useState12[1];
|
114
|
-
var _useState13 = React.useState(false),
|
115
|
-
_useState14 = _rollupPluginBabelHelpers.slicedToArray(_useState13, 2),
|
116
|
-
clickAndHoldActive = _useState14[0],
|
117
|
-
setClickAndHoldActive = _useState14[1];
|
118
|
-
var _useState15 = React.useState(''),
|
119
|
-
_useState16 = _rollupPluginBabelHelpers.slicedToArray(_useState15, 2),
|
120
|
-
currentMatcher = _useState16[0],
|
121
|
-
setCurrentMatcher = _useState16[1];
|
122
|
-
var _useState17 = React.useState(false),
|
123
|
-
_useState18 = _rollupPluginBabelHelpers.slicedToArray(_useState17, 2),
|
124
|
-
isEditing = _useState18[0],
|
125
|
-
setIsEditing = _useState18[1];
|
126
|
-
var _useState19 = React.useState(''),
|
127
|
-
_useState20 = _rollupPluginBabelHelpers.slicedToArray(_useState19, 2),
|
128
|
-
cellEditorValue = _useState20[0],
|
129
|
-
setCellEditorValue = _useState20[1];
|
130
|
-
var _useState21 = React.useState(false),
|
131
|
-
_useState22 = _rollupPluginBabelHelpers.slicedToArray(_useState21, 2),
|
132
|
-
headerCellHoldActive = _useState22[0],
|
133
|
-
setHeaderCellHoldActive = _useState22[1];
|
134
|
-
var _useState23 = React.useState(false),
|
135
|
-
_useState24 = _rollupPluginBabelHelpers.slicedToArray(_useState23, 2),
|
136
|
-
selectedHeaderReorderActive = _useState24[0],
|
137
|
-
setSelectedHeaderReorderActive = _useState24[1];
|
138
|
-
var isBlurSpreadsheet = React.useRef(false);
|
139
|
-
var _useState25 = React.useState(false),
|
140
|
-
_useState26 = _rollupPluginBabelHelpers.slicedToArray(_useState25, 2),
|
141
|
-
isActiveHeaderCellChanged = _useState26[0],
|
142
|
-
setIsActiveHeaderCellChanged = _useState26[1];
|
143
|
-
var _useState27 = React.useState(false),
|
144
|
-
_useState28 = _rollupPluginBabelHelpers.slicedToArray(_useState27, 2),
|
145
|
-
activeCellInsideSelectionArea = _useState28[0],
|
146
|
-
setActiveCellInsideSelectionArea = _useState28[1];
|
147
|
-
var previousState = usePreviousValue.usePreviousValue({
|
148
|
-
activeCellCoordinates: activeCellCoordinates,
|
149
|
-
isEditing: isEditing,
|
150
|
-
cellEditorValue: cellEditorValue,
|
151
|
-
selectedHeaderReorderActive: selectedHeaderReorderActive
|
54
|
+
exports.DataSpreadsheet = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
55
|
+
let {
|
56
|
+
// The component props, in alphabetical order (for consistency).
|
57
|
+
cellSize = 'sm',
|
58
|
+
className,
|
59
|
+
columns = defaults.columns,
|
60
|
+
data = defaults.data,
|
61
|
+
defaultEmptyRowCount = defaults.defaultEmptyRowCount,
|
62
|
+
onDataUpdate = defaults.onDataUpdate,
|
63
|
+
onColDrag = defaults.onColDrag,
|
64
|
+
id,
|
65
|
+
onActiveCellChange = defaults.onActiveCellChange,
|
66
|
+
onSelectionAreaChange = defaults.onSelectionAreaChange,
|
67
|
+
renderRowHeader,
|
68
|
+
renderRowHeaderDirection,
|
69
|
+
disableColumnSwapping = false,
|
70
|
+
readOnlyTable = false,
|
71
|
+
selectAllAriaLabel,
|
72
|
+
spreadsheetAriaLabel,
|
73
|
+
theme,
|
74
|
+
totalVisibleColumns,
|
75
|
+
// Collect any other property values passed in.
|
76
|
+
...rest
|
77
|
+
} = _ref;
|
78
|
+
const multiKeyTrackingRef = React.useRef(null);
|
79
|
+
const localRef = React.useRef(undefined);
|
80
|
+
const spreadsheetRef = ref || localRef;
|
81
|
+
const focusedElement = useActiveElement.useActiveElement();
|
82
|
+
const [currentColumns, setCurrentColumns] = React.useState(columns);
|
83
|
+
const [pastColumns, setPastColumns] = React.useState([]);
|
84
|
+
const [containerHasFocus, setContainerHasFocus] = React.useState(false);
|
85
|
+
const [activeCellCoordinates, setActiveCellCoordinates] = React.useState(null);
|
86
|
+
const [selectionAreas, setSelectionAreas] = React.useState([]);
|
87
|
+
const [selectionAreaData, setSelectionAreaData] = React.useState([]);
|
88
|
+
const [clickAndHoldActive, setClickAndHoldActive] = React.useState(false);
|
89
|
+
const [currentMatcher, setCurrentMatcher] = React.useState('');
|
90
|
+
const [isEditing, setIsEditing] = React.useState(false);
|
91
|
+
const [cellEditorValue, setCellEditorValue] = React.useState('');
|
92
|
+
const [headerCellHoldActive, setHeaderCellHoldActive] = React.useState(false);
|
93
|
+
const [selectedHeaderReorderActive, setSelectedHeaderReorderActive] = React.useState(false);
|
94
|
+
const isBlurSpreadsheet = React.useRef(false);
|
95
|
+
const [isActiveHeaderCellChanged, setIsActiveHeaderCellChanged] = React.useState(false);
|
96
|
+
const [activeCellInsideSelectionArea, setActiveCellInsideSelectionArea] = React.useState(false);
|
97
|
+
const previousState = usePreviousValue.usePreviousValue({
|
98
|
+
activeCellCoordinates,
|
99
|
+
isEditing,
|
100
|
+
cellEditorValue,
|
101
|
+
selectedHeaderReorderActive
|
152
102
|
}) || {};
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
rows = _ref2.rows,
|
189
|
-
totalColumnsWidth = _ref2.totalColumnsWidth,
|
190
|
-
prepareRow = _ref2.prepareRow,
|
191
|
-
setColumnOrder = _ref2.setColumnOrder,
|
192
|
-
visibleColumns = _ref2.visibleColumns;
|
103
|
+
const cellSizeValue = getCellSize.getCellSize(cellSize);
|
104
|
+
const cellEditorRef = React.useRef(undefined);
|
105
|
+
const [activeCellContent, setActiveCellContent] = React.useState();
|
106
|
+
const activeCellRef = React.useRef(undefined);
|
107
|
+
const cellEditorRulerRef = React.useRef(undefined);
|
108
|
+
const hasCustomRowHeader = typeof renderRowHeader === 'function';
|
109
|
+
const maxNumRowsCount = data.length.toString().length;
|
110
|
+
const defaultColumn = React.useMemo(() => ({
|
111
|
+
width: 150,
|
112
|
+
rowHeaderWidth: hasCustomRowHeader ? 40 + maxNumRowsCount * 8.56 : 64,
|
113
|
+
rowHeight: cellSizeValue
|
114
|
+
}), [cellSizeValue, hasCustomRowHeader, maxNumRowsCount]);
|
115
|
+
const {
|
116
|
+
keysPressedList,
|
117
|
+
usingMac
|
118
|
+
} = useMultipleKeyTracking.useMultipleKeyTracking({
|
119
|
+
ref: multiKeyTrackingRef,
|
120
|
+
containerHasFocus,
|
121
|
+
isEditing
|
122
|
+
});
|
123
|
+
const scrollBarSize = React.useMemo(() => getScrollbarWidth.getScrollbarWidth(), []);
|
124
|
+
const {
|
125
|
+
getTableProps,
|
126
|
+
getTableBodyProps,
|
127
|
+
headerGroups,
|
128
|
+
rows,
|
129
|
+
totalColumnsWidth,
|
130
|
+
prepareRow,
|
131
|
+
setColumnOrder,
|
132
|
+
visibleColumns
|
133
|
+
} = reactTable.useTable({
|
134
|
+
columns,
|
135
|
+
data,
|
136
|
+
defaultColumn
|
137
|
+
}, reactTable.useBlockLayout, reactTable.useColumnOrder);
|
193
138
|
|
194
139
|
// Update the spreadsheet data after editing a cell
|
195
|
-
|
196
|
-
onDataUpdate(
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
}
|
203
|
-
|
140
|
+
const updateData = React.useCallback((rowIndex, columnId, newValue) => {
|
141
|
+
onDataUpdate(prev => prev.map((row, index) => {
|
142
|
+
if (index === rowIndex) {
|
143
|
+
return {
|
144
|
+
...prev[rowIndex],
|
145
|
+
[columnId]: cellEditorValue || newValue
|
146
|
+
};
|
147
|
+
}
|
148
|
+
return row;
|
149
|
+
}));
|
204
150
|
}, [cellEditorValue, onDataUpdate]);
|
205
|
-
React.useEffect(
|
206
|
-
|
151
|
+
React.useEffect(() => {
|
152
|
+
const currentHeaders = [];
|
207
153
|
if (Object.keys(currentColumns).length > 0) {
|
208
|
-
Object.keys(currentColumns).forEach(
|
209
|
-
if (
|
154
|
+
Object.keys(currentColumns).forEach(itemIndex => {
|
155
|
+
if (typeof currentColumns[itemIndex].Header === 'object') {
|
210
156
|
if (currentColumns[itemIndex].column_name) {
|
211
157
|
currentHeaders.push(currentColumns[itemIndex].column_name);
|
212
158
|
} else {
|
@@ -229,50 +175,47 @@ exports.DataSpreadsheet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
229
175
|
setPastColumns([]);
|
230
176
|
}
|
231
177
|
}
|
232
|
-
}, [previousState
|
178
|
+
}, [previousState?.selectedHeaderReorderActive, currentColumns, headerCellHoldActive, columns, activeCellContent, onColDrag, pastColumns]);
|
233
179
|
|
234
180
|
// Removes the active cell element
|
235
|
-
|
236
|
-
|
237
|
-
var activeCellHighlight = spreadsheetRef === null || spreadsheetRef === void 0 || (_current = spreadsheetRef.current) === null || _current === void 0 ? void 0 : _current.querySelector(".".concat(blockClass, "__active-cell--highlight"));
|
181
|
+
const removeActiveCell = React.useCallback(() => {
|
182
|
+
const activeCellHighlight = spreadsheetRef?.current?.querySelector(`.${blockClass}__active-cell--highlight`);
|
238
183
|
if (activeCellHighlight) {
|
239
184
|
activeCellHighlight.style.display = 'none';
|
240
185
|
}
|
241
186
|
}, [spreadsheetRef]);
|
242
|
-
|
187
|
+
const removeCellEditor = React.useCallback(() => {
|
243
188
|
setCellEditorValue('');
|
244
189
|
setIsEditing(false);
|
245
|
-
if (cellEditorRef
|
190
|
+
if (cellEditorRef?.current) {
|
246
191
|
cellEditorRef.current.style.display = 'none';
|
247
192
|
}
|
248
193
|
}, []);
|
249
194
|
|
250
195
|
// Remove cell editor if the active cell coordinates change and save with new cell data, this will
|
251
196
|
// happen if you click on another cell while isEditing is true
|
252
|
-
React.useEffect(
|
253
|
-
|
254
|
-
if ((
|
255
|
-
|
197
|
+
React.useEffect(() => {
|
198
|
+
const prevCoords = previousState?.activeCellCoordinates;
|
199
|
+
if ((prevCoords?.row !== activeCellCoordinates?.row || prevCoords?.column !== activeCellCoordinates?.column) && isEditing) {
|
200
|
+
const cellProps = rows[Number(prevCoords?.row)].cells[Number(prevCoords?.column)];
|
256
201
|
removeCellEditor();
|
257
|
-
updateData(prevCoords
|
258
|
-
if (cellEditorRulerRef
|
202
|
+
updateData(prevCoords?.row, cellProps.column.id, undefined);
|
203
|
+
if (cellEditorRulerRef?.current) {
|
259
204
|
cellEditorRulerRef.current.textContent = '';
|
260
205
|
}
|
261
206
|
}
|
262
|
-
if (
|
263
|
-
if (activeCellCoordinates &&
|
264
|
-
|
207
|
+
if (prevCoords?.row !== activeCellCoordinates?.row || prevCoords?.column !== activeCellCoordinates?.column) {
|
208
|
+
if (activeCellCoordinates && activeCellCoordinates?.row !== 'header' && activeCellCoordinates?.column !== 'header') {
|
209
|
+
const activeCellFullData = typeof activeCellCoordinates?.column === 'number' && typeof activeCellCoordinates?.row === 'number' ? rows[activeCellCoordinates?.row].cells[activeCellCoordinates?.column] : null;
|
265
210
|
if (activeCellFullData) {
|
266
211
|
setActiveCellContent(activeCellFullData.render('Cell'));
|
267
212
|
} else {
|
268
213
|
setActiveCellContent(null);
|
269
214
|
}
|
270
215
|
}
|
271
|
-
if (activeCellCoordinates &&
|
216
|
+
if (activeCellCoordinates && activeCellCoordinates?.row === 'header' || activeCellCoordinates?.column === 'header') {
|
272
217
|
setActiveCellContent(null);
|
273
|
-
setIsActiveHeaderCellChanged(
|
274
|
-
return !prev;
|
275
|
-
});
|
218
|
+
setIsActiveHeaderCellChanged(prev => !prev);
|
276
219
|
}
|
277
220
|
}
|
278
221
|
// For when we edit and focus out of data spreadsheet
|
@@ -281,50 +224,51 @@ exports.DataSpreadsheet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
281
224
|
isBlurSpreadsheet.current = false;
|
282
225
|
removeCellEditor();
|
283
226
|
}
|
284
|
-
}, [isBlurSpreadsheet, activeCellCoordinates, previousState
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
addToHeader =
|
290
|
-
|
291
|
-
|
227
|
+
}, [isBlurSpreadsheet, activeCellCoordinates, previousState?.activeCellCoordinates, previousState?.cellEditorValue, updateData, rows, isEditing, removeCellEditor, activeCellContent]);
|
228
|
+
const createActiveCell = React.useCallback(_ref2 => {
|
229
|
+
let {
|
230
|
+
placementElement,
|
231
|
+
coords,
|
232
|
+
addToHeader = false
|
233
|
+
} = _ref2;
|
234
|
+
const activeCellFullData = typeof coords?.column === 'number' && typeof coords?.row === 'number' ? rows[coords?.row].cells[coords?.column] : null;
|
235
|
+
const activeCellValue = activeCellFullData ? Object.values(activeCellFullData.row.values)[coords?.column] : null;
|
292
236
|
createActiveCellFn.createActiveCellFn({
|
293
|
-
placementElement
|
294
|
-
coords
|
295
|
-
addToHeader
|
237
|
+
placementElement,
|
238
|
+
coords,
|
239
|
+
addToHeader,
|
296
240
|
contextRef: spreadsheetRef,
|
297
|
-
blockClass
|
298
|
-
onActiveCellChange
|
299
|
-
activeCellValue
|
300
|
-
activeCellRef
|
301
|
-
cellEditorRef
|
302
|
-
defaultColumn
|
241
|
+
blockClass,
|
242
|
+
onActiveCellChange,
|
243
|
+
activeCellValue,
|
244
|
+
activeCellRef,
|
245
|
+
cellEditorRef,
|
246
|
+
defaultColumn
|
303
247
|
});
|
304
248
|
}, [spreadsheetRef, rows, onActiveCellChange, defaultColumn]);
|
305
249
|
useResetSpreadsheetFocus.useResetSpreadsheetFocus({
|
306
|
-
focusedElement
|
307
|
-
removeActiveCell
|
308
|
-
setContainerHasFocus
|
250
|
+
focusedElement,
|
251
|
+
removeActiveCell,
|
252
|
+
setContainerHasFocus
|
309
253
|
});
|
310
254
|
useSpreadsheetOutsideClick.useSpreadsheetOutsideClick({
|
311
|
-
isBlurSpreadsheet
|
312
|
-
spreadsheetRef
|
313
|
-
setActiveCellCoordinates
|
314
|
-
setSelectionAreas
|
315
|
-
removeActiveCell
|
316
|
-
setContainerHasFocus
|
317
|
-
removeCellEditor
|
255
|
+
isBlurSpreadsheet,
|
256
|
+
spreadsheetRef,
|
257
|
+
setActiveCellCoordinates,
|
258
|
+
setSelectionAreas,
|
259
|
+
removeActiveCell,
|
260
|
+
setContainerHasFocus,
|
261
|
+
removeCellEditor
|
318
262
|
});
|
319
263
|
useMoveActiveCell.useMoveActiveCell({
|
320
|
-
spreadsheetRef
|
321
|
-
activeCellCoordinates
|
322
|
-
containerHasFocus
|
323
|
-
createActiveCell
|
324
|
-
activeCellContent
|
325
|
-
isActiveHeaderCellChanged
|
264
|
+
spreadsheetRef,
|
265
|
+
activeCellCoordinates,
|
266
|
+
containerHasFocus,
|
267
|
+
createActiveCell,
|
268
|
+
activeCellContent,
|
269
|
+
isActiveHeaderCellChanged
|
326
270
|
});
|
327
|
-
|
271
|
+
const handleInitialArrowPress = React.useCallback(() => {
|
328
272
|
// If activeCellCoordinates is null then we need to set an initial value
|
329
273
|
// which will place the activeCell on the select all cell/button
|
330
274
|
setActiveCellInsideSelectionArea(false);
|
@@ -336,20 +280,25 @@ exports.DataSpreadsheet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
336
280
|
}
|
337
281
|
return;
|
338
282
|
}, [activeCellCoordinates]);
|
339
|
-
|
340
|
-
|
341
|
-
coords =
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
283
|
+
const updateActiveCellCoordinates = React.useCallback(_ref3 => {
|
284
|
+
let {
|
285
|
+
coords = {
|
286
|
+
...activeCellCoordinates
|
287
|
+
},
|
288
|
+
updatedValue,
|
289
|
+
optOutOfSelectionAreaUpdate = false
|
290
|
+
} = _ref3;
|
291
|
+
const newActiveCell = {
|
292
|
+
...coords,
|
293
|
+
...updatedValue
|
294
|
+
};
|
346
295
|
setActiveCellCoordinates(newActiveCell);
|
347
296
|
// Only run if the active cell is _not_ a header cell. This will add a point1 object
|
348
297
|
// to selectionAreas every time the active cell changes, allowing us to create cell
|
349
298
|
// selections using keyboard. Opting out of the selection area updates here means
|
350
299
|
// that the active cell is being moved within a selection area
|
351
300
|
if (newActiveCell.row !== 'header' && newActiveCell.column !== 'header' && !optOutOfSelectionAreaUpdate) {
|
352
|
-
|
301
|
+
const tempMatcher = uuidv4.default();
|
353
302
|
setSelectionAreas([{
|
354
303
|
point1: newActiveCell,
|
355
304
|
matcher: tempMatcher
|
@@ -357,9 +306,13 @@ exports.DataSpreadsheet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
357
306
|
setCurrentMatcher(tempMatcher);
|
358
307
|
}
|
359
308
|
}, [activeCellCoordinates]);
|
360
|
-
|
361
|
-
|
362
|
-
|
309
|
+
const handleHomeEndKey = React.useCallback(_ref4 => {
|
310
|
+
let {
|
311
|
+
type
|
312
|
+
} = _ref4;
|
313
|
+
const coordinatesClone = {
|
314
|
+
...activeCellCoordinates
|
315
|
+
};
|
363
316
|
updateActiveCellCoordinates({
|
364
317
|
coords: coordinatesClone,
|
365
318
|
updatedValue: {
|
@@ -368,18 +321,19 @@ exports.DataSpreadsheet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
368
321
|
});
|
369
322
|
removeCellSelections.removeCellSelections({
|
370
323
|
matcher: undefined,
|
371
|
-
spreadsheetRef
|
324
|
+
spreadsheetRef
|
372
325
|
});
|
373
326
|
}, [activeCellCoordinates, updateActiveCellCoordinates, spreadsheetRef, columns.length]);
|
374
|
-
|
327
|
+
const checkForReturnCondition = React.useCallback(key => {
|
375
328
|
return isEditing || key === 'Meta' || key === 'Control';
|
376
329
|
}, [isEditing]);
|
377
|
-
|
378
|
-
|
379
|
-
(_event = event) === null || _event === void 0 || _event.preventDefault();
|
330
|
+
const handleArrowKeyPress = React.useCallback(arrowKey => {
|
331
|
+
event?.preventDefault();
|
380
332
|
handleInitialArrowPress();
|
381
|
-
|
382
|
-
|
333
|
+
const coordinatesClone = {
|
334
|
+
...activeCellCoordinates
|
335
|
+
};
|
336
|
+
let updatedValue;
|
383
337
|
switch (arrowKey) {
|
384
338
|
// Left
|
385
339
|
case 'ArrowLeft':
|
@@ -468,42 +422,39 @@ exports.DataSpreadsheet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
468
422
|
if (updatedValue) {
|
469
423
|
updateActiveCellCoordinates({
|
470
424
|
coords: coordinatesClone,
|
471
|
-
updatedValue
|
425
|
+
updatedValue
|
472
426
|
});
|
473
427
|
}
|
474
428
|
}, [handleInitialArrowPress, updateActiveCellCoordinates, activeCellCoordinates, columns, rows]);
|
475
|
-
|
429
|
+
const handleKeyPressEvent = React.useCallback(event => {
|
476
430
|
commonEventHandlers.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);
|
477
431
|
}, [activeCellInsideSelectionArea, updateActiveCellCoordinates, activeCellCoordinates, removeActiveCell, columns, rows, spreadsheetRef, currentMatcher, removeCellEditor, selectionAreas, handleHomeEndKey, keysPressedList, usingMac, updateData, checkForReturnCondition, handleArrowKeyPress, readOnlyTable]);
|
478
|
-
|
479
|
-
var _activeCellFullData$r;
|
432
|
+
const startEditMode = () => {
|
480
433
|
setIsEditing(true);
|
481
434
|
setClickAndHoldActive(false);
|
482
|
-
|
483
|
-
|
435
|
+
const activeCellFullData = typeof activeCellCoordinates?.column === 'number' && typeof activeCellCoordinates?.row === 'number' ? rows[activeCellCoordinates?.row].cells[activeCellCoordinates?.column] : null;
|
436
|
+
const activeCellValue = activeCellFullData?.row?.cells?.[Number(activeCellCoordinates?.column)]?.value;
|
484
437
|
setCellEditorValue(activeCellValue || '');
|
485
|
-
if (cellEditorRulerRef
|
438
|
+
if (cellEditorRulerRef?.current) {
|
486
439
|
cellEditorRulerRef.current.textContent = activeCellValue;
|
487
440
|
}
|
488
|
-
if (cellEditorRef
|
489
|
-
|
490
|
-
cellEditorRef.current.style.width = activeCellRef === null || activeCellRef === void 0 || (_activeCellRef$curren = activeCellRef.current) === null || _activeCellRef$curren === void 0 || (_activeCellRef$curren = _activeCellRef$curren.style) === null || _activeCellRef$curren === void 0 ? void 0 : _activeCellRef$curren.width;
|
441
|
+
if (cellEditorRef?.current && activeCellRef?.current) {
|
442
|
+
cellEditorRef.current.style.width = activeCellRef?.current?.style?.width;
|
491
443
|
}
|
492
444
|
};
|
493
445
|
|
494
446
|
// Sets the initial placement of the cell editor cursor at the end of the text area
|
495
447
|
// this is not done for us by default in Safari
|
496
|
-
React.useEffect(
|
497
|
-
if (isEditing && !
|
498
|
-
|
499
|
-
cellEditorRef
|
500
|
-
cellEditorRef === null || cellEditorRef === void 0 || (_cellEditorRef$curren2 = cellEditorRef.current) === null || _cellEditorRef$curren2 === void 0 || _cellEditorRef$curren2.focus();
|
448
|
+
React.useEffect(() => {
|
449
|
+
if (isEditing && !previousState?.isEditing) {
|
450
|
+
cellEditorRef?.current?.setSelectionRange(Number(cellEditorRulerRef?.current?.textContent?.length), Number(cellEditorRulerRef?.current?.textContent?.length));
|
451
|
+
cellEditorRef?.current?.focus();
|
501
452
|
}
|
502
|
-
}, [isEditing, previousState
|
503
|
-
|
504
|
-
if (
|
505
|
-
|
506
|
-
if (
|
453
|
+
}, [isEditing, previousState?.isEditing]);
|
454
|
+
const handleActiveCellClick = () => {
|
455
|
+
if (activeCellCoordinates?.row === 'header' || activeCellCoordinates?.column === 'header') {
|
456
|
+
const indexValue = activeCellCoordinates?.row === 'header' ? activeCellCoordinates?.column : activeCellCoordinates?.row;
|
457
|
+
if (activeCellCoordinates?.row === 'header' && activeCellCoordinates?.column === 'header') {
|
507
458
|
return;
|
508
459
|
}
|
509
460
|
handleRowColumnHeaderClick({
|
@@ -515,18 +466,18 @@ exports.DataSpreadsheet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
515
466
|
};
|
516
467
|
|
517
468
|
// Mouse up on active cell
|
518
|
-
|
469
|
+
const handleActiveCellMouseUp = () => {
|
519
470
|
setClickAndHoldActive(false);
|
520
471
|
};
|
521
472
|
|
522
473
|
// Mouse down on active cell
|
523
|
-
|
524
|
-
if (
|
525
|
-
|
474
|
+
const handleActiveCellMouseDown = () => {
|
475
|
+
if (activeCellCoordinates?.row !== 'header' || activeCellCoordinates?.column !== 'header') {
|
476
|
+
const tempMatcher = uuidv4.default();
|
526
477
|
setClickAndHoldActive(true);
|
527
478
|
removeCellSelections.removeCellSelections({
|
528
479
|
matcher: null,
|
529
|
-
spreadsheetRef
|
480
|
+
spreadsheetRef
|
530
481
|
});
|
531
482
|
setSelectionAreas([{
|
532
483
|
point1: activeCellCoordinates,
|
@@ -540,105 +491,108 @@ exports.DataSpreadsheet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
540
491
|
};
|
541
492
|
|
542
493
|
// Go into edit mode if 'Enter' key is pressed on activeCellRef
|
543
|
-
|
544
|
-
|
494
|
+
const handleActiveCellKeyDown = event => {
|
495
|
+
const {
|
496
|
+
key
|
497
|
+
} = event;
|
545
498
|
if (key === 'Enter' && !activeCellInsideSelectionArea && !readOnlyTable) {
|
546
|
-
if (
|
499
|
+
if (activeCellCoordinates?.column !== 'header' && activeCellCoordinates?.row !== 'header') {
|
547
500
|
startEditMode();
|
548
501
|
}
|
549
|
-
if (
|
502
|
+
if (activeCellCoordinates?.row === 'header' || activeCellCoordinates?.column === 'header') {
|
550
503
|
handleRowColumnHeaderClick({
|
551
504
|
isKeyboard: true
|
552
505
|
});
|
553
506
|
}
|
554
507
|
}
|
555
508
|
};
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
index =
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
509
|
+
const handleRowColumnHeaderClick = _ref5 => {
|
510
|
+
let {
|
511
|
+
isKeyboard,
|
512
|
+
index = -1
|
513
|
+
} = _ref5;
|
514
|
+
const handleHeaderCellProps = {
|
515
|
+
activeCellCoordinates,
|
516
|
+
rows,
|
517
|
+
columns,
|
518
|
+
currentMatcher,
|
519
|
+
setActiveCellCoordinates,
|
520
|
+
setCurrentMatcher,
|
521
|
+
setSelectionAreas,
|
522
|
+
spreadsheetRef,
|
523
|
+
index,
|
524
|
+
isKeyboard,
|
525
|
+
setSelectionAreaData,
|
572
526
|
isHoldingCommandKey: null,
|
573
527
|
isHoldingShiftKey: null
|
574
528
|
};
|
575
529
|
// Select an entire column
|
576
|
-
if (
|
577
|
-
handleHeaderCellSelection.handleHeaderCellSelection(
|
578
|
-
type: 'column'
|
579
|
-
|
530
|
+
if (activeCellCoordinates?.row === 'header' && activeCellCoordinates?.column !== 'header') {
|
531
|
+
handleHeaderCellSelection.handleHeaderCellSelection({
|
532
|
+
type: 'column',
|
533
|
+
...handleHeaderCellProps
|
534
|
+
});
|
580
535
|
}
|
581
536
|
// Select an entire row
|
582
|
-
if (
|
583
|
-
handleHeaderCellSelection.handleHeaderCellSelection(
|
584
|
-
type: 'row'
|
585
|
-
|
537
|
+
if (activeCellCoordinates?.column === 'header' && activeCellCoordinates?.row !== 'header') {
|
538
|
+
handleHeaderCellSelection.handleHeaderCellSelection({
|
539
|
+
type: 'row',
|
540
|
+
...handleHeaderCellProps
|
541
|
+
});
|
586
542
|
}
|
587
|
-
if (
|
543
|
+
if (activeCellCoordinates?.column === 'header' && activeCellCoordinates?.row === 'header') {
|
588
544
|
selectAllCells.selectAllCells({
|
589
545
|
ref: spreadsheetRef,
|
590
|
-
setCurrentMatcher
|
591
|
-
setSelectionAreas
|
592
|
-
rows
|
593
|
-
columns
|
594
|
-
activeCellCoordinates
|
595
|
-
updateActiveCellCoordinates
|
546
|
+
setCurrentMatcher,
|
547
|
+
setSelectionAreas,
|
548
|
+
rows,
|
549
|
+
columns,
|
550
|
+
activeCellCoordinates,
|
551
|
+
updateActiveCellCoordinates
|
596
552
|
});
|
597
553
|
}
|
598
554
|
};
|
599
555
|
|
600
556
|
// Go into edit mode if double click is detected on activeCellRef
|
601
|
-
|
557
|
+
const handleActiveCellDoubleClick = readOnlyTable => {
|
602
558
|
if (!readOnlyTable) {
|
603
559
|
startEditMode();
|
604
560
|
}
|
605
561
|
};
|
606
562
|
useSpreadsheetEdit.useSpreadsheetEdit({
|
607
|
-
isEditing
|
608
|
-
rows
|
609
|
-
activeCellCoordinates
|
610
|
-
activeCellRef
|
611
|
-
cellEditorRef
|
612
|
-
cellEditorRulerRef
|
613
|
-
visibleColumns
|
614
|
-
defaultColumn
|
615
|
-
cellEditorValue
|
563
|
+
isEditing,
|
564
|
+
rows,
|
565
|
+
activeCellCoordinates,
|
566
|
+
activeCellRef,
|
567
|
+
cellEditorRef,
|
568
|
+
cellEditorRulerRef,
|
569
|
+
visibleColumns,
|
570
|
+
defaultColumn,
|
571
|
+
cellEditorValue
|
616
572
|
});
|
617
573
|
|
618
574
|
// Only update if there are cell selection areas
|
619
575
|
// Find point object that matches currentMatcher and remove the second point
|
620
576
|
// because hovering over the active cell while clicking and holding should
|
621
577
|
// remove the previously existing selection area
|
622
|
-
|
578
|
+
const handleActiveCellMouseEnterCallback = React.useCallback((areas, clickHold) => {
|
623
579
|
if (!currentMatcher) {
|
624
580
|
return;
|
625
581
|
}
|
626
582
|
if (areas && areas.length && clickHold && currentMatcher) {
|
627
|
-
setSelectionAreas(
|
628
|
-
|
629
|
-
|
630
|
-
return item.matcher === currentMatcher;
|
631
|
-
});
|
583
|
+
setSelectionAreas(prev => {
|
584
|
+
const selectionAreaClone = deepCloneObject.deepCloneObject(prev);
|
585
|
+
const indexOfItemToUpdate = selectionAreaClone.findIndex(item => item.matcher === currentMatcher);
|
632
586
|
if (indexOfItemToUpdate === -1) {
|
633
587
|
return prev;
|
634
588
|
}
|
635
|
-
if (
|
589
|
+
if (typeof selectionAreaClone[indexOfItemToUpdate].point2 === 'object' && selectionAreaClone[indexOfItemToUpdate].areaCreated) {
|
636
590
|
selectionAreaClone[indexOfItemToUpdate].point2 = selectionAreaClone[indexOfItemToUpdate].point1;
|
637
591
|
selectionAreaClone[indexOfItemToUpdate].areaCreated = false;
|
638
592
|
setActiveCellInsideSelectionArea(false);
|
639
593
|
removeCellSelections.removeCellSelections({
|
640
594
|
matcher: currentMatcher,
|
641
|
-
spreadsheetRef
|
595
|
+
spreadsheetRef
|
642
596
|
});
|
643
597
|
return selectionAreaClone;
|
644
598
|
}
|
@@ -646,22 +600,23 @@ exports.DataSpreadsheet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
646
600
|
});
|
647
601
|
}
|
648
602
|
}, [spreadsheetRef, currentMatcher]);
|
649
|
-
|
603
|
+
const handleActiveCellMouseEnter = React.useCallback(() => {
|
650
604
|
handleActiveCellMouseEnterCallback(selectionAreas, clickAndHoldActive);
|
651
605
|
}, [clickAndHoldActive, selectionAreas, handleActiveCellMouseEnterCallback]);
|
652
606
|
// cspell:words rowcount colcount
|
653
607
|
return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({}, rest, getTableProps(), devtools.getDevtoolsProps(componentName), {
|
654
|
-
className: cx(blockClass, className,
|
608
|
+
className: cx(blockClass, className, `${blockClass}--interactive-cell-element`, {
|
609
|
+
[`${blockClass}__container-has-focus`]: containerHasFocus,
|
610
|
+
[`${blockClass}__${theme}`]: theme === 'dark'
|
611
|
+
}),
|
655
612
|
ref: spreadsheetRef,
|
656
613
|
role: "grid",
|
657
614
|
tabIndex: 0,
|
658
|
-
"aria-rowcount":
|
659
|
-
"aria-colcount":
|
615
|
+
"aria-rowcount": rows?.length || 0,
|
616
|
+
"aria-colcount": columns?.length || 0,
|
660
617
|
"aria-label": spreadsheetAriaLabel,
|
661
618
|
onKeyDown: handleKeyPressEvent,
|
662
|
-
onFocus:
|
663
|
-
return setContainerHasFocus(true);
|
664
|
-
}
|
619
|
+
onFocus: () => setContainerHasFocus(true)
|
665
620
|
}), /*#__PURE__*/React.createElement("div", {
|
666
621
|
ref: multiKeyTrackingRef
|
667
622
|
}, /*#__PURE__*/React.createElement(DataSpreadsheetHeader.DataSpreadsheetHeader, {
|
@@ -732,44 +687,46 @@ exports.DataSpreadsheet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
732
687
|
onMouseUp: handleActiveCellMouseUp,
|
733
688
|
onClick: handleActiveCellClick,
|
734
689
|
onKeyDown: handleActiveCellKeyDown,
|
735
|
-
onDoubleClick:
|
736
|
-
return handleActiveCellDoubleClick(readOnlyTable);
|
737
|
-
},
|
690
|
+
onDoubleClick: () => handleActiveCellDoubleClick(readOnlyTable),
|
738
691
|
onMouseEnter: handleActiveCellMouseEnter,
|
739
692
|
ref: activeCellRef,
|
740
|
-
className: cx(
|
693
|
+
className: cx(`${blockClass}--interactive-cell-element`, `${blockClass}__active-cell--highlight`, {
|
694
|
+
[`${blockClass}__active-cell--with-selection`]: activeCellInsideSelectionArea
|
695
|
+
}),
|
741
696
|
type: "button"
|
742
697
|
}, activeCellContent), /*#__PURE__*/React.createElement("textarea", {
|
743
|
-
id:
|
698
|
+
id: `${blockClass}__cell-editor-text-area`,
|
744
699
|
value: cellEditorValue,
|
745
700
|
onKeyDown: handleEditSubmit.handleEditSubmit({
|
746
|
-
activeCellCoordinates
|
747
|
-
cellEditorRulerRef
|
748
|
-
columns
|
749
|
-
previousState
|
750
|
-
removeCellEditor
|
751
|
-
rows
|
752
|
-
setActiveCellCoordinates
|
753
|
-
setCurrentMatcher
|
754
|
-
setSelectionAreas
|
755
|
-
spreadsheetRef
|
756
|
-
updateData
|
701
|
+
activeCellCoordinates,
|
702
|
+
cellEditorRulerRef,
|
703
|
+
columns,
|
704
|
+
previousState,
|
705
|
+
removeCellEditor,
|
706
|
+
rows,
|
707
|
+
setActiveCellCoordinates,
|
708
|
+
setCurrentMatcher,
|
709
|
+
setSelectionAreas,
|
710
|
+
spreadsheetRef,
|
711
|
+
updateData
|
757
712
|
}),
|
758
|
-
onChange:
|
713
|
+
onChange: event => {
|
759
714
|
if (previousState.isEditing) {
|
760
715
|
setCellEditorValue(event.target.value);
|
761
|
-
if (cellEditorRulerRef
|
716
|
+
if (cellEditorRulerRef?.current) {
|
762
717
|
cellEditorRulerRef.current.textContent = event.target.value;
|
763
718
|
}
|
764
719
|
}
|
765
720
|
},
|
766
721
|
ref: cellEditorRef,
|
767
|
-
"aria-labelledby": activeCellCoordinates ?
|
768
|
-
className: cx(
|
722
|
+
"aria-labelledby": activeCellCoordinates ? `${blockClass}__cell--${activeCellCoordinates?.row}--${activeCellCoordinates?.column}` : '',
|
723
|
+
className: cx(`${blockClass}__cell-editor`, `${blockClass}--interactive-cell-element`, `${blockClass}__cell-editor--${cellSize}`, {
|
724
|
+
[`${blockClass}__cell-editor--active`]: isEditing
|
725
|
+
})
|
769
726
|
}), /*#__PURE__*/React.createElement("pre", {
|
770
727
|
"aria-hidden": true,
|
771
728
|
ref: cellEditorRulerRef,
|
772
|
-
className:
|
729
|
+
className: `${blockClass}__cell-editor-ruler`
|
773
730
|
})));
|
774
731
|
});
|
775
732
|
|