@carbon/ibm-products 1.73.1 → 1.73.3
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 +33 -55
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +1 -14
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +24 -41
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +1 -12
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +26 -49
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +1 -14
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +30 -53
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -14
- package/css/index.min.css.map +1 -1
- package/es/components/APIKeyModal/APIKeyDownloader.js +1 -1
- package/es/components/APIKeyModal/APIKeyModal.js +3 -3
- package/es/components/AboutModal/AboutModal.js +2 -2
- package/es/components/ActionBar/ActionBar.js +4 -4
- package/es/components/ActionBar/ActionBarItem.js +2 -2
- package/es/components/ActionSet/ActionSet.js +5 -6
- package/es/components/AddSelect/AddSelectBody.js +4 -4
- package/es/components/AddSelect/AddSelectColumn.js +5 -4
- package/es/components/AddSelect/AddSelectFilter.js +2 -2
- package/es/components/AddSelect/AddSelectList.js +2 -3
- package/es/components/AddSelect/AddSelectSidebar.js +1 -1
- package/es/components/AddSelect/add-select-utils.js +7 -6
- package/es/components/AddSelect/hooks/usePath.js +2 -2
- package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +4 -5
- package/es/components/ButtonMenu/ButtonMenu.js +0 -1
- package/es/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +5 -5
- package/es/components/Card/Card.js +3 -4
- package/es/components/Card/CardHeader.js +1 -2
- package/es/components/Cascade/Cascade.js +2 -2
- package/es/components/Coachmark/Coachmark.js +1 -1
- package/es/components/CoachmarkBeacon/CoachmarkBeacon.js +2 -3
- package/es/components/CoachmarkFixed/CoachmarkFixed.js +1 -2
- package/es/components/CoachmarkStack/CoachmarkStackHome.js +1 -1
- package/es/components/ComboButton/ComboButton.js +2 -2
- package/es/components/CreateFullPage/CreateFullPageStep.js +3 -4
- package/es/components/CreateInfluencer/CreateInfluencer.js +0 -1
- package/es/components/CreateModal/CreateModal.js +1 -1
- package/es/components/CreateSidePanel/CreateSidePanel.js +2 -2
- package/es/components/CreateTearsheet/CreateTearsheetStep.js +3 -4
- package/es/components/CreateTearsheetNarrow/CreateTearsheetNarrow.js +1 -1
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +3 -5
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +7 -8
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +4 -5
- package/es/components/DataSpreadsheet/hooks/useSpreadsheetEdit.js +2 -3
- package/es/components/DataSpreadsheet/hooks/useSpreadsheetMouseMove.js +5 -5
- package/es/components/DataSpreadsheet/hooks/useSpreadsheetMouseUp.js +4 -4
- package/es/components/DataSpreadsheet/utils/checkSelectedHeaderCell.js +4 -4
- package/es/components/DataSpreadsheet/utils/createActiveCellFn.js +1 -2
- package/es/components/DataSpreadsheet/utils/createCellSelectionArea.js +0 -1
- package/es/components/DataSpreadsheet/utils/generateData.js +2 -2
- package/es/components/DataSpreadsheet/utils/handleActiveCellInSelectionEnter.js +2 -2
- package/es/components/DataSpreadsheet/utils/handleCellDeletion.js +4 -4
- package/es/components/DataSpreadsheet/utils/handleEditSubmit.js +2 -4
- package/es/components/DataSpreadsheet/utils/handleHeaderCellSelection.js +2 -2
- package/es/components/DataSpreadsheet/utils/handleMultipleKeys.js +2 -2
- package/es/components/DataSpreadsheet/utils/selectAllCells.js +2 -2
- package/es/components/Datagrid/Datagrid/DatagridContent.js +1 -2
- package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +4 -5
- package/es/components/Datagrid/Datagrid/DatagridRefBody.js +2 -2
- package/es/components/Datagrid/Datagrid/DatagridRow.js +15 -16
- package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +2 -2
- package/es/components/Datagrid/Datagrid/DatagridSimpleBody.js +2 -2
- package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +2 -3
- package/es/components/Datagrid/Datagrid/DraggableElement.js +1 -2
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +2 -2
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +2 -2
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +1 -2
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +3 -4
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +2 -2
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +11 -11
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +2 -3
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +11 -11
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +2 -2
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/returnUpdatedActiveCell.js +3 -3
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +5 -5
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleMultipleKeys.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +0 -2
- package/es/components/Datagrid/Datagrid/addons/stateReducer.js +5 -5
- package/es/components/Datagrid/Datagrid.stories/common.js +5 -5
- package/es/components/Datagrid/useActionsColumn.js +3 -5
- package/es/components/Datagrid/useColumnCenterAlign.js +2 -2
- package/es/components/Datagrid/useColumnRightAlign.js +2 -2
- package/es/components/Datagrid/useCustomizeColumns.js +2 -2
- package/es/components/Datagrid/useDatagrid.js +2 -2
- package/es/components/Datagrid/useDefaultStringRenderer.js +2 -2
- package/es/components/Datagrid/useDisableSelectRows.js +4 -4
- package/es/components/Datagrid/useExpandedRow.js +2 -2
- package/es/components/Datagrid/useFiltering.js +7 -8
- package/es/components/Datagrid/useFloatingScroll.js +1 -1
- package/es/components/Datagrid/useInitialColumnSort.js +1 -1
- package/es/components/Datagrid/useInlineEdit.js +2 -2
- package/es/components/Datagrid/useNestedRowExpander.js +3 -4
- package/es/components/Datagrid/useNestedRows.js +1 -2
- package/es/components/Datagrid/useRowExpander.js +2 -2
- package/es/components/Datagrid/useRowIsMouseOver.js +2 -2
- package/es/components/Datagrid/useRowRenderer.js +3 -3
- package/es/components/Datagrid/useRowSize.js +2 -2
- package/es/components/Datagrid/useSelectRows.js +4 -5
- package/es/components/Datagrid/useSortableColumns.js +3 -4
- package/es/components/Datagrid/useStickyColumn.js +5 -7
- package/es/components/Datagrid/utils/DatagridPagination.js +0 -1
- package/es/components/Datagrid/utils/filterPropsForTesting.js +2 -3
- package/es/components/Datagrid/utils/makeData.js +5 -5
- package/es/components/EditInPlace/EditInPlace.js +2 -2
- package/es/components/EditSidePanel/EditSidePanel.js +2 -2
- package/es/components/EditTearsheet/EditTearsheetForm.js +1 -2
- package/es/components/EmptyStates/EmptyState.js +2 -2
- package/es/components/EmptyStates/EmptyStateContent.js +2 -2
- package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +2 -2
- package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +2 -2
- package/es/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +2 -2
- package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +2 -2
- package/es/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +2 -2
- package/es/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +2 -2
- package/es/components/ExampleComponent/ExampleComponent.js +2 -2
- package/es/components/ExportModal/ExportModal.js +5 -5
- package/es/components/FilterSummary/FilterSummary.js +3 -3
- package/es/components/HTTPErrors/HTTPErrorContent.js +2 -2
- package/es/components/ImportModal/ImportModal.js +3 -3
- package/es/components/InlineEdit/InlineEdit.js +2 -2
- package/es/components/InlineEditV1/InlineEditV1.js +5 -4
- package/es/components/InlineEditV2/InlineEditV2.js +3 -4
- package/es/components/InlineTip/utils.js +6 -5
- package/es/components/InterstitialScreen/InterstitialScreen.js +4 -5
- package/es/components/InterstitialScreenViewModule/InterstitialScreenViewModule.js +0 -1
- package/es/components/NotificationsPanel/NotificationsPanel.js +2 -3
- package/es/components/PageHeader/PageHeader.js +11 -13
- package/es/components/PageHeader/PageHeaderUtils.js +2 -2
- package/es/components/ProductiveCard/ProductiveCard.js +2 -2
- package/es/components/RemoveModal/RemoveModal.js +2 -2
- package/es/components/Saving/Saving.js +6 -6
- package/es/components/SidePanel/SidePanel.js +17 -18
- package/es/components/SteppedAnimatedMedia/SteppedAnimatedMedia.js +2 -2
- package/es/components/TagSet/TagSet.js +4 -4
- package/es/components/TagSet/TagSetModal.js +5 -5
- package/es/components/TagSet/TagSetOverflow.js +1 -2
- package/es/components/Tearsheet/Tearsheet.js +2 -2
- package/es/components/Tearsheet/TearsheetNarrow.js +2 -2
- package/es/components/Tearsheet/TearsheetShell.js +10 -11
- package/es/components/WebTerminal/WebTerminal.js +3 -4
- package/es/global/js/hooks/useCreateComponentFocus.js +1 -1
- package/es/global/js/hooks/useCreateComponentStepChange.js +3 -3
- package/es/global/js/hooks/useFocus.js +4 -4
- package/es/global/js/hooks/useWindowResize.js +2 -2
- package/es/global/js/package-settings.js +2 -3
- package/es/global/js/utils/Wrap.js +3 -3
- package/es/global/js/utils/deepCloneObject.js +4 -3
- package/es/global/js/utils/getNodeTextContent.js +6 -5
- package/es/global/js/utils/motionConstants.js +0 -1
- package/es/global/js/utils/props-helper.js +3 -3
- package/es/global/js/utils/scrollableAncestor.js +3 -3
- package/es/global/js/utils/test-helper.js +1 -1
- package/es/global/js/utils/unwrap-if-fragment.js +6 -6
- package/lib/components/APIKeyModal/APIKeyDownloader.js +4 -5
- package/lib/components/APIKeyModal/APIKeyModal.js +12 -8
- package/lib/components/AboutModal/AboutModal.js +14 -6
- package/lib/components/ActionBar/ActionBar.js +16 -9
- package/lib/components/ActionBar/ActionBarItem.js +12 -5
- package/lib/components/ActionBar/ActionBarOverflowItems.js +3 -4
- package/lib/components/ActionSet/ActionSet.js +15 -8
- package/lib/components/ActionSet/actions.js +4 -7
- package/lib/components/AddSelect/AddSelect.js +9 -5
- package/lib/components/AddSelect/AddSelectBody.js +13 -9
- package/lib/components/AddSelect/AddSelectBreadcrumbs.js +1 -2
- package/lib/components/AddSelect/AddSelectColumn.js +12 -8
- package/lib/components/AddSelect/AddSelectFilter.js +10 -6
- package/lib/components/AddSelect/AddSelectList.js +3 -5
- package/lib/components/AddSelect/AddSelectMetaPanel.js +3 -4
- package/lib/components/AddSelect/AddSelectSidebar.js +8 -4
- package/lib/components/AddSelect/AddSelectSort.js +1 -2
- package/lib/components/AddSelect/add-select-utils.js +10 -14
- package/lib/components/AddSelect/hooks/useItemSort.js +2 -3
- package/lib/components/AddSelect/hooks/useParentSelect.js +1 -2
- package/lib/components/AddSelect/hooks/usePath.js +8 -4
- package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +16 -10
- package/lib/components/ButtonMenu/ButtonMenu.js +10 -3
- package/lib/components/ButtonMenu/ButtonMenuItem.js +1 -2
- package/lib/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +13 -9
- package/lib/components/Card/Card.js +12 -9
- package/lib/components/Card/CardFooter.js +1 -2
- package/lib/components/Card/CardHeader.js +2 -4
- package/lib/components/Carousel/Carousel.js +9 -4
- package/lib/components/Carousel/CarouselItem.js +8 -2
- package/lib/components/Cascade/Cascade.js +11 -7
- package/lib/components/Checklist/Checklist.js +19 -4
- package/lib/components/Checklist/ChecklistChart.js +15 -2
- package/lib/components/Checklist/ChecklistIcon.js +17 -2
- package/lib/components/Coachmark/Coachmark.js +10 -5
- package/lib/components/Coachmark/CoachmarkDragbar.js +11 -4
- package/lib/components/Coachmark/CoachmarkHeader.js +9 -2
- package/lib/components/Coachmark/CoachmarkOverlay.js +11 -4
- package/lib/components/Coachmark/CoachmarkTagline.js +9 -2
- package/lib/components/Coachmark/utils/constants.js +2 -3
- package/lib/components/Coachmark/utils/context.js +3 -5
- package/lib/components/Coachmark/utils/enums.js +4 -7
- package/lib/components/Coachmark/utils/hooks.js +2 -3
- package/lib/components/CoachmarkBeacon/CoachmarkBeacon.js +11 -5
- package/lib/components/CoachmarkButton/CoachmarkButton.js +9 -2
- package/lib/components/CoachmarkFixed/CoachmarkFixed.js +12 -6
- package/lib/components/CoachmarkOverlayElement/CoachmarkOverlayElement.js +9 -2
- package/lib/components/CoachmarkOverlayElements/CoachmarkOverlayElements.js +11 -4
- package/lib/components/CoachmarkStack/CoachmarkStack.js +9 -4
- package/lib/components/CoachmarkStack/CoachmarkStackHome.js +10 -5
- package/lib/components/ComboButton/ComboButton.js +11 -6
- package/lib/components/ComboButton/ComboButtonItem/index.js +1 -2
- package/lib/components/CreateFullPage/CreateFullPage.js +14 -8
- package/lib/components/CreateFullPage/CreateFullPageStep.js +12 -8
- package/lib/components/CreateInfluencer/CreateInfluencer.js +1 -3
- package/lib/components/CreateModal/CreateModal.js +10 -3
- package/lib/components/CreateSidePanel/CreateSidePanel.js +12 -4
- package/lib/components/CreateTearsheet/CreateTearsheet.js +11 -8
- package/lib/components/CreateTearsheet/CreateTearsheetDivider.js +9 -4
- package/lib/components/CreateTearsheet/CreateTearsheetStep.js +12 -8
- package/lib/components/CreateTearsheet/preview-components/MultiStepTearsheet.js +11 -5
- package/lib/components/CreateTearsheet/preview-components/MultiStepWithIntro.js +4 -5
- package/lib/components/CreateTearsheetNarrow/CreateTearsheetNarrow.js +10 -3
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +14 -9
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +15 -12
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +12 -9
- package/lib/components/DataSpreadsheet/hooks/useMoveActiveCell.js +2 -3
- package/lib/components/DataSpreadsheet/hooks/useMultipleKeyTracking.js +2 -3
- package/lib/components/DataSpreadsheet/hooks/useResetSpreadsheetFocus.js +2 -3
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetEdit.js +4 -6
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetMouseMove.js +7 -8
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetMouseUp.js +11 -7
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetOutsideClick.js +2 -3
- package/lib/components/DataSpreadsheet/utils/checkActiveHeaderCell.js +2 -3
- package/lib/components/DataSpreadsheet/utils/checkSelectedHeaderCell.js +6 -7
- package/lib/components/DataSpreadsheet/utils/createActiveCellFn.js +3 -5
- package/lib/components/DataSpreadsheet/utils/createCellSelectionArea.js +2 -4
- package/lib/components/DataSpreadsheet/utils/generateData.js +4 -5
- package/lib/components/DataSpreadsheet/utils/getCellSize.js +2 -3
- package/lib/components/DataSpreadsheet/utils/getSelectionAreaPoints.js +2 -3
- package/lib/components/DataSpreadsheet/utils/getSpreadsheetWidth.js +2 -3
- package/lib/components/DataSpreadsheet/utils/handleActiveCellInSelectionEnter.js +9 -5
- package/lib/components/DataSpreadsheet/utils/handleActiveCellInSelectionTab.js +2 -3
- package/lib/components/DataSpreadsheet/utils/handleCellDeletion.js +6 -7
- package/lib/components/DataSpreadsheet/utils/handleEditSubmit.js +9 -7
- package/lib/components/DataSpreadsheet/utils/handleHeaderCellSelection.js +4 -5
- package/lib/components/DataSpreadsheet/utils/handleMultipleKeys.js +11 -9
- package/lib/components/DataSpreadsheet/utils/moveColumnIndicatorLine.js +2 -3
- package/lib/components/DataSpreadsheet/utils/removeCellSelections.js +2 -3
- package/lib/components/DataSpreadsheet/utils/selectAllCells.js +9 -5
- package/lib/components/Datagrid/Datagrid/Datagrid.js +7 -2
- package/lib/components/Datagrid/Datagrid/DatagridBody.js +1 -2
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +4 -6
- package/lib/components/Datagrid/Datagrid/DatagridEmptyBody.js +1 -2
- package/lib/components/Datagrid/Datagrid/DatagridExpandedRow.js +1 -2
- package/lib/components/Datagrid/Datagrid/DatagridHead.js +1 -2
- package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +12 -9
- package/lib/components/Datagrid/Datagrid/DatagridRefBody.js +9 -4
- package/lib/components/Datagrid/Datagrid/DatagridRow.js +21 -18
- package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +11 -6
- package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +9 -4
- package/lib/components/Datagrid/Datagrid/DatagridSimpleBody.js +9 -4
- package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +9 -4
- package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +10 -7
- package/lib/components/Datagrid/Datagrid/DraggableElement.js +2 -4
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +3 -4
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +9 -4
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +3 -4
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +10 -6
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +8 -4
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/TearsheetWrapper.js +9 -4
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/common.js +2 -3
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +4 -6
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +6 -8
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +12 -10
- package/lib/components/Datagrid/Datagrid/addons/Filtering/constants.js +15 -30
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.js +1 -2
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +19 -15
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useShouldDisableButtons.js +1 -2
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useSubscribeToEventEmitter.js +1 -2
- package/lib/components/Datagrid/Datagrid/addons/Filtering/motion/variants.js +4 -7
- package/lib/components/Datagrid/Datagrid/addons/Filtering/utils.js +2 -3
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +3 -5
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +19 -15
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +11 -8
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/getCellIdAsObject.js +2 -3
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/returnUpdatedActiveCell.js +10 -6
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridFocus.js +2 -3
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +12 -8
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleMultipleKeys.js +3 -4
- package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +10 -5
- package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +3 -6
- package/lib/components/Datagrid/Datagrid/addons/stateReducer.js +16 -16
- package/lib/components/Datagrid/Datagrid.stories/CustomizeColumnStory.js +2 -3
- package/lib/components/Datagrid/Datagrid.stories/RowSizeDropdownStory.js +2 -3
- package/lib/components/Datagrid/Datagrid.stories/SelectAllWithToggleStory.js +2 -3
- package/lib/components/Datagrid/Datagrid.stories/common.js +9 -12
- package/lib/components/Datagrid/common-column-ids.js +1 -2
- package/lib/components/Datagrid/useActionsColumn.js +10 -7
- package/lib/components/Datagrid/useColumnCenterAlign.js +8 -4
- package/lib/components/Datagrid/useColumnOrder.js +1 -2
- package/lib/components/Datagrid/useColumnRightAlign.js +8 -4
- package/lib/components/Datagrid/useCustomizeColumns.js +10 -6
- package/lib/components/Datagrid/useDatagrid.js +9 -4
- package/lib/components/Datagrid/useDefaultStringRenderer.js +9 -4
- package/lib/components/Datagrid/useDisableSelectRows.js +5 -6
- package/lib/components/Datagrid/useEditableCell.js +1 -2
- package/lib/components/Datagrid/useExpandedRow.js +8 -4
- package/lib/components/Datagrid/useFiltering.js +13 -10
- package/lib/components/Datagrid/useFlexResize.js +1 -2
- package/lib/components/Datagrid/useFloatingScroll.js +2 -3
- package/lib/components/Datagrid/useFocusRowExpander.js +2 -3
- package/lib/components/Datagrid/useInfiniteScroll.js +1 -2
- package/lib/components/Datagrid/useInitialColumnSort.js +3 -4
- package/lib/components/Datagrid/useInlineEdit.js +5 -6
- package/lib/components/Datagrid/useNestedRowExpander.js +11 -8
- package/lib/components/Datagrid/useNestedRows.js +2 -4
- package/lib/components/Datagrid/useOnRowClick.js +1 -2
- package/lib/components/Datagrid/useParentDimensions.js +1 -2
- package/lib/components/Datagrid/useResizeTable.js +1 -2
- package/lib/components/Datagrid/useRowExpander.js +10 -6
- package/lib/components/Datagrid/useRowIsMouseOver.js +9 -4
- package/lib/components/Datagrid/useRowRenderer.js +4 -5
- package/lib/components/Datagrid/useRowSize.js +9 -4
- package/lib/components/Datagrid/useSelectAllToggle.js +3 -4
- package/lib/components/Datagrid/useSelectRows.js +12 -9
- package/lib/components/Datagrid/useSkeletonRows.js +1 -2
- package/lib/components/Datagrid/useSortableColumns.js +10 -8
- package/lib/components/Datagrid/useStickyColumn.js +11 -9
- package/lib/components/Datagrid/utils/DatagridActions.js +4 -5
- package/lib/components/Datagrid/utils/DatagridPagination.js +2 -4
- package/lib/components/Datagrid/utils/Wrapper.js +2 -3
- package/lib/components/Datagrid/utils/filterPropsForTesting.js +5 -8
- package/lib/components/Datagrid/utils/getArgTypes.js +2 -3
- package/lib/components/Datagrid/utils/getAutoSizedColumnWidth.js +2 -3
- package/lib/components/Datagrid/utils/getInlineEditColumns.js +3 -5
- package/lib/components/Datagrid/utils/handleFilterTagLabelText.js +2 -3
- package/lib/components/Datagrid/utils/makeData.js +13 -11
- package/lib/components/EditFullPage/EditFullPage.js +9 -2
- package/lib/components/EditInPlace/EditInPlace.js +11 -6
- package/lib/components/EditSidePanel/EditSidePanel.js +12 -4
- package/lib/components/EditTearsheet/EditTearsheet.js +11 -8
- package/lib/components/EditTearsheet/EditTearsheetForm.js +10 -6
- package/lib/components/EditTearsheet/preview-components/MultiFormEditTearsheet.js +4 -5
- package/lib/components/EditTearsheetNarrow/EditTearsheetNarrow.js +9 -2
- package/lib/components/EditUpdateCards/EditUpdateCards.js +9 -2
- package/lib/components/EmptyStates/EmptyState.js +12 -6
- package/lib/components/EmptyStates/EmptyStateContent.js +10 -4
- package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +11 -4
- package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +11 -4
- package/lib/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +11 -4
- package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +11 -4
- package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +11 -4
- package/lib/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +11 -4
- package/lib/components/EmptyStates/assets/ErrorIllustration.js +9 -2
- package/lib/components/EmptyStates/assets/NoDataIllustration.js +9 -2
- package/lib/components/EmptyStates/assets/NoTagsIllustration.js +9 -2
- package/lib/components/EmptyStates/assets/NotFoundIllustration.js +9 -2
- package/lib/components/EmptyStates/assets/NotificationsIllustration.js +9 -2
- package/lib/components/EmptyStates/assets/UnauthorizedIllustration.js +9 -2
- package/lib/components/ExampleComponent/ExampleComponent.js +14 -6
- package/lib/components/ExampleComponent/useExample.js +1 -2
- package/lib/components/ExportModal/ExportModal.js +14 -10
- package/lib/components/ExpressiveCard/ExpressiveCard.js +3 -4
- package/lib/components/FilterSummary/FilterSummary.js +12 -7
- package/lib/components/Guidebanner/Guidebanner.js +11 -4
- package/lib/components/Guidebanner/GuidebannerElement.js +9 -2
- package/lib/components/Guidebanner/GuidebannerElementButton.js +9 -2
- package/lib/components/Guidebanner/GuidebannerElementLink.js +9 -2
- package/lib/components/HTTPErrors/HTTPError403/HTTPError403.js +9 -2
- package/lib/components/HTTPErrors/HTTPError404/HTTPError404.js +9 -2
- package/lib/components/HTTPErrors/HTTPErrorContent.js +10 -4
- package/lib/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +9 -2
- package/lib/components/HTTPErrors/assets/HTTPErrorSvg403.js +1 -2
- package/lib/components/HTTPErrors/assets/HTTPErrorSvg404.js +1 -2
- package/lib/components/HTTPErrors/assets/HTTPErrorSvgOther.js +1 -2
- package/lib/components/ImportModal/ImportModal.js +12 -8
- package/lib/components/InlineEdit/InlineEdit.js +11 -6
- package/lib/components/InlineEditV1/InlineEditV1.js +18 -8
- package/lib/components/InlineEditV2/InlineEditV2.js +13 -10
- package/lib/components/InlineTip/InlineTip.js +11 -4
- package/lib/components/InlineTip/InlineTipButton.js +9 -2
- package/lib/components/InlineTip/InlineTipLink.js +9 -2
- package/lib/components/InlineTip/utils.js +5 -6
- package/lib/components/InterstitialScreen/InterstitialScreen.js +15 -9
- package/lib/components/InterstitialScreen/assets/index.js +4 -8
- package/lib/components/InterstitialScreenView/InterstitialScreenView.js +9 -2
- package/lib/components/InterstitialScreenViewModule/InterstitialScreenViewModule.js +9 -3
- package/lib/components/ModifiedTabs/ModifiedTabLabelNew.js +1 -2
- package/lib/components/ModifiedTabs/ModifiedTabLabelWithClose.js +1 -2
- package/lib/components/ModifiedTabs/ModifiedTabs.js +3 -4
- package/lib/components/MultiAddSelect/MultiAddSelect.js +3 -4
- package/lib/components/NonLinearReading/NonLinearReading.js +9 -4
- package/lib/components/NotificationsPanel/NotificationsPanel.js +14 -7
- package/lib/components/NotificationsPanel/NotificationsPanel_data.js +1 -2
- package/lib/components/NotificationsPanel/preview-components/UnreadNotificationBell.js +2 -3
- package/lib/components/NotificationsPanel/utils.js +1 -2
- package/lib/components/OptionsTile/OptionsTile.js +12 -4
- package/lib/components/PageHeader/PageHeader.js +21 -20
- package/lib/components/PageHeader/PageHeaderDemo.data.js +3 -4
- package/lib/components/PageHeader/PageHeaderTitle.js +2 -4
- package/lib/components/PageHeader/PageHeaderUtils.js +12 -11
- package/lib/components/ProductiveCard/ProductiveCard.js +11 -7
- package/lib/components/RemoveModal/RemoveModal.js +11 -7
- package/lib/components/Saving/Saving.js +15 -10
- package/lib/components/SidePanel/SidePanel.js +29 -22
- package/lib/components/SidePanel/constants.js +2 -3
- package/lib/components/SidePanel/motion/variants.js +3 -5
- package/lib/components/SingleAddSelect/SingleAddSelect.js +3 -4
- package/lib/components/StatusIcon/StatusIcon.js +7 -2
- package/lib/components/SteppedAnimatedMedia/SteppedAnimatedMedia.js +13 -6
- package/lib/components/SteppedAnimatedMedia/assets/index.js +3 -6
- package/lib/components/TagSet/TagSet.js +15 -13
- package/lib/components/TagSet/TagSetModal.js +14 -10
- package/lib/components/TagSet/TagSetOverflow.js +10 -7
- package/lib/components/Tearsheet/Tearsheet.js +13 -6
- package/lib/components/Tearsheet/TearsheetNarrow.js +13 -6
- package/lib/components/Tearsheet/TearsheetShell.js +26 -23
- package/lib/components/Toolbar/Toolbar.js +12 -10
- package/lib/components/Toolbar/ToolbarButton.js +10 -6
- package/lib/components/Toolbar/ToolbarGroup.js +9 -4
- package/lib/components/UserProfileImage/UserProfileImage.js +10 -2
- package/lib/components/WebTerminal/WebTerminal.js +15 -8
- package/lib/components/WebTerminal/WebTerminalContentWrapper.js +9 -2
- package/lib/components/WebTerminal/hooks/index.js +6 -9
- package/lib/components/WebTerminal/preview-components/Navigation.js +1 -2
- package/lib/components/WebTerminal/preview-components/documentationLinks.js +2 -3
- package/lib/components/_Canary/Canary.js +11 -2
- package/lib/global/js/hooks/useActiveElement.js +2 -3
- package/lib/global/js/hooks/useClickOutside.js +2 -3
- package/lib/global/js/hooks/useCreateComponentFocus.js +3 -4
- package/lib/global/js/hooks/useCreateComponentStepChange.js +5 -6
- package/lib/global/js/hooks/useFocus.js +6 -7
- package/lib/global/js/hooks/useIsomorphicEffect.js +1 -2
- package/lib/global/js/hooks/usePrefix.js +2 -3
- package/lib/global/js/hooks/usePreviousValue.js +2 -3
- package/lib/global/js/hooks/useResetCreateComponent.js +2 -3
- package/lib/global/js/hooks/useResizeObserver.js +2 -3
- package/lib/global/js/hooks/useRetrieveStepData.js +2 -3
- package/lib/global/js/hooks/useValidCreateStepCount.js +2 -3
- package/lib/global/js/hooks/useWindowResize.js +4 -5
- package/lib/global/js/package-settings.js +9 -6
- package/lib/global/js/utils/ClickListener.js +3 -4
- package/lib/global/js/utils/DisplayBox.js +1 -2
- package/lib/global/js/utils/Wrap.js +12 -5
- package/lib/global/js/utils/deepCloneObject.js +3 -4
- package/lib/global/js/utils/devtools.js +1 -2
- package/lib/global/js/utils/getBezierValues.js +2 -3
- package/lib/global/js/utils/getFocusableElements.js +2 -3
- package/lib/global/js/utils/getNodeTextContent.js +5 -6
- package/lib/global/js/utils/getNumberOfHiddenSteps.js +2 -3
- package/lib/global/js/utils/getScrollbarWidth.js +2 -3
- package/lib/global/js/utils/keyboardNavigation.js +4 -8
- package/lib/global/js/utils/lastIndexInArray.js +2 -3
- package/lib/global/js/utils/motionConstants.js +3 -5
- package/lib/global/js/utils/pconsole.js +8 -15
- package/lib/global/js/utils/props-helper.js +15 -17
- package/lib/global/js/utils/rangeWithCallback.js +2 -3
- package/lib/global/js/utils/scrollableAncestor.js +5 -6
- package/lib/global/js/utils/story-helper.js +6 -11
- package/lib/global/js/utils/test-helper.js +15 -28
- package/lib/global/js/utils/unwrap-if-fragment.js +7 -8
- package/lib/global/js/utils/uuidv4.js +1 -2
- package/lib/global/js/utils/wait.js +1 -2
- package/lib/global/js/utils/wrapFocus.js +1 -2
- package/lib/settings.js +2 -4
- package/package.json +13 -13
- package/scss/components/AboutModal/_about-modal.scss +1 -2
- package/scss/components/Checklist/_checklist.scss +0 -1
- package/scss/components/Coachmark/styles/_coachmark-tagline.scss +1 -4
- package/scss/components/Datagrid/_datagrid.scss +0 -1
- package/scss/components/Datagrid/styles/_datagrid.scss +1 -2
- package/scss/components/SidePanel/_side-panel.scss +1 -4
@@ -24,7 +24,7 @@ var applyInitialFilters = function applyInitialFilters(filterState, initialFilte
|
|
24
24
|
};
|
25
25
|
|
26
26
|
// This functions takes the filters passed in and makes an object to track it's state
|
27
|
-
var getInitialStateFromFilters = function getInitialStateFromFilters(filters, variation, initialFilters) {
|
27
|
+
var getInitialStateFromFilters = exports.getInitialStateFromFilters = function getInitialStateFromFilters(filters, variation, initialFilters) {
|
28
28
|
var initialFilterState = {};
|
29
29
|
var setInitialState = function setInitialState(_ref) {
|
30
30
|
var type = _ref.type,
|
@@ -94,5 +94,4 @@ var getInitialStateFromFilters = function getInitialStateFromFilters(filters, va
|
|
94
94
|
applyInitialFilters(initialFilterState, initialFilters);
|
95
95
|
}
|
96
96
|
return initialFilterState;
|
97
|
-
};
|
98
|
-
exports.getInitialStateFromFilters = getInitialStateFromFilters;
|
97
|
+
};
|
package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js
CHANGED
@@ -18,8 +18,7 @@ var _settings = require("../../../../../../settings");
|
|
18
18
|
*/
|
19
19
|
|
20
20
|
var blockClass = "".concat(_settings.pkg.prefix, "--datagrid");
|
21
|
-
var InlineEditButton = function InlineEditButton(_ref) {
|
22
|
-
var _cx, _cx2;
|
21
|
+
var InlineEditButton = exports.InlineEditButton = function InlineEditButton(_ref) {
|
23
22
|
var label = _ref.label,
|
24
23
|
Icon = _ref.renderIcon,
|
25
24
|
disabled = _ref.disabled,
|
@@ -30,7 +29,7 @@ var InlineEditButton = function InlineEditButton(_ref) {
|
|
30
29
|
columnConfig = _ref.columnConfig,
|
31
30
|
type = _ref.type;
|
32
31
|
return /*#__PURE__*/_react.default.createElement("div", {
|
33
|
-
className: (0, _classnames.default)("".concat(blockClass, "__inline-edit-button"), (
|
32
|
+
className: (0, _classnames.default)("".concat(blockClass, "__inline-edit-button"), (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(blockClass, "__inline-edit-button--disabled"), disabled || nonEditCell), "".concat(blockClass, "__inline-edit-button--with-label-icon"), LabelIcon), "".concat(blockClass, "__inline-edit-button--non-edit"), nonEditCell), "".concat(blockClass, "__inline-edit-button--active"), isActiveCell), "".concat(blockClass, "__inline-edit-button--").concat(type), type === 'date' || type === 'selection')),
|
34
33
|
tabIndex: isActiveCell ? 0 : -1,
|
35
34
|
"data-disabled": disabled || nonEditCell,
|
36
35
|
"aria-disabled": disabled || nonEditCell,
|
@@ -39,14 +38,13 @@ var InlineEditButton = function InlineEditButton(_ref) {
|
|
39
38
|
}, LabelIcon && /*#__PURE__*/_react.default.createElement("div", {
|
40
39
|
className: "".concat(blockClass, "__label-icon")
|
41
40
|
}, /*#__PURE__*/_react.default.createElement(LabelIcon, null)), label !== '' ? /*#__PURE__*/_react.default.createElement("span", {
|
42
|
-
className: (0, _classnames.default)("".concat(blockClass, "__inline-edit-button-label"), (
|
41
|
+
className: (0, _classnames.default)("".concat(blockClass, "__inline-edit-button-label"), (0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(blockClass, "__inline-edit-button-label-with-icon"), !nonEditCell), "".concat(blockClass, "__defaultStringRenderer--multiline"), columnConfig === null || columnConfig === void 0 ? void 0 : columnConfig.multiLineWrap))
|
43
42
|
}, label) : /*#__PURE__*/_react.default.createElement("span", {
|
44
43
|
className: "".concat(blockClass, "__placeholder")
|
45
44
|
}, placeholder), !nonEditCell && Icon && /*#__PURE__*/_react.default.createElement("div", {
|
46
45
|
className: "".concat(blockClass, "__inline-edit-button-icon")
|
47
46
|
}, /*#__PURE__*/_react.default.createElement(Icon, null)));
|
48
47
|
};
|
49
|
-
exports.InlineEditButton = InlineEditButton;
|
50
48
|
InlineEditButton.propTypes = {
|
51
49
|
columnConfig: _propTypes.default.object,
|
52
50
|
disabled: _propTypes.default.bool,
|
@@ -20,13 +20,18 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
20
20
|
var _InlineEditContext = require("../InlineEditContext");
|
21
21
|
var _hooks = require("../../../../../../global/js/hooks");
|
22
22
|
var _propsHelper = require("../../../../../../global/js/utils/props-helper");
|
23
|
-
function _getRequireWildcardCache(
|
24
|
-
function _interopRequireWildcard(
|
25
|
-
function ownKeys(
|
26
|
-
function _objectSpread(
|
23
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
24
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
25
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
26
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /**
|
27
|
+
* Copyright IBM Corp. 2022, 2022
|
28
|
+
*
|
29
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
30
|
+
* LICENSE file in the root directory of this source tree.
|
31
|
+
*/
|
27
32
|
var blockClass = "".concat(_settings.pkg.prefix, "--datagrid");
|
28
|
-
var InlineEditCell = function InlineEditCell(_ref) {
|
29
|
-
var _config$validator,
|
33
|
+
var InlineEditCell = exports.InlineEditCell = function InlineEditCell(_ref) {
|
34
|
+
var _config$validator, _value$text;
|
30
35
|
var cell = _ref.cell,
|
31
36
|
config = _ref.config,
|
32
37
|
instance = _ref.instance,
|
@@ -112,11 +117,11 @@ var InlineEditCell = function InlineEditCell(_ref) {
|
|
112
117
|
}, [activeCellId, cellId, nonEditCell, editId, cellValue, saveCellData]);
|
113
118
|
var openDropdown = function openDropdown(type) {
|
114
119
|
var _datePickerRef$curren;
|
115
|
-
var dropdownTrigger = type === 'selection' ? dropdownRef === null || dropdownRef === void 0 ? void 0 : dropdownRef.current : datePickerRef === null || datePickerRef === void 0
|
120
|
+
var dropdownTrigger = type === 'selection' ? dropdownRef === null || dropdownRef === void 0 ? void 0 : dropdownRef.current : datePickerRef === null || datePickerRef === void 0 || (_datePickerRef$curren = datePickerRef.current) === null || _datePickerRef$curren === void 0 ? void 0 : _datePickerRef$curren.inputField;
|
116
121
|
dropdownTrigger.click();
|
117
122
|
if (type === 'date') {
|
118
123
|
// datePickerRef.current.cal.calendarContainer.focus();
|
119
|
-
dropdownTrigger === null || dropdownTrigger === void 0
|
124
|
+
dropdownTrigger === null || dropdownTrigger === void 0 || dropdownTrigger.focus();
|
120
125
|
}
|
121
126
|
};
|
122
127
|
|
@@ -283,7 +288,7 @@ var InlineEditCell = function InlineEditCell(_ref) {
|
|
283
288
|
});
|
284
289
|
setInEditMode(false);
|
285
290
|
sendFocusBackToGrid();
|
286
|
-
inputProps === null || inputProps === void 0
|
291
|
+
inputProps === null || inputProps === void 0 || (_inputProps$onChange = inputProps.onChange) === null || _inputProps$onChange === void 0 || _inputProps$onChange.call(inputProps, item.selectedItem);
|
287
292
|
},
|
288
293
|
downshiftProps: {
|
289
294
|
onStateChange: function onStateChange(downshiftState) {
|
@@ -321,9 +326,9 @@ var InlineEditCell = function InlineEditCell(_ref) {
|
|
321
326
|
var renderDateCell = function renderDateCell() {
|
322
327
|
var _config$inputProps, _outerButtonElement$c;
|
323
328
|
var datePickerPreparedProps = (0, _propsHelper.prepareProps)(config.inputProps, ['datePickerInputProps']);
|
324
|
-
var datePickerInputProps = config === null || config === void 0
|
329
|
+
var datePickerInputProps = config === null || config === void 0 || (_config$inputProps = config.inputProps) === null || _config$inputProps === void 0 ? void 0 : _config$inputProps.datePickerInputProps;
|
325
330
|
return /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.DatePicker, (0, _extends2.default)({}, datePickerPreparedProps, {
|
326
|
-
appendTo: outerButtonElement === null || outerButtonElement === void 0
|
331
|
+
appendTo: outerButtonElement === null || outerButtonElement === void 0 || (_outerButtonElement$c = outerButtonElement.current) === null || _outerButtonElement$c === void 0 ? void 0 : _outerButtonElement$c.parentElement,
|
327
332
|
ref: datePickerRef,
|
328
333
|
style: {
|
329
334
|
width: cell.column.totalWidth
|
@@ -333,7 +338,7 @@ var InlineEditCell = function InlineEditCell(_ref) {
|
|
333
338
|
onChange: function onChange(newDate) {
|
334
339
|
var _datePickerPreparedPr;
|
335
340
|
var newDateObj = newDate[0];
|
336
|
-
datePickerPreparedProps === null || datePickerPreparedProps === void 0
|
341
|
+
datePickerPreparedProps === null || datePickerPreparedProps === void 0 || (_datePickerPreparedPr = datePickerPreparedProps.onChange) === null || _datePickerPreparedPr === void 0 || _datePickerPreparedPr.call(datePickerPreparedProps, newDateObj, cell);
|
337
342
|
var newCellId = getNewCellId('Enter');
|
338
343
|
saveCellData(newDateObj);
|
339
344
|
setCellValue(newDateObj);
|
@@ -362,7 +367,7 @@ var InlineEditCell = function InlineEditCell(_ref) {
|
|
362
367
|
};
|
363
368
|
var buildDate = function buildDate(value) {
|
364
369
|
var _config$inputProps2;
|
365
|
-
var dateFormat = config === null || config === void 0
|
370
|
+
var dateFormat = config === null || config === void 0 || (_config$inputProps2 = config.inputProps) === null || _config$inputProps2 === void 0 ? void 0 : _config$inputProps2.dateFormat;
|
366
371
|
if (value instanceof Date) {
|
367
372
|
var maskedFullYear = value.getFullYear();
|
368
373
|
var maskedMonth = padTo2Digits(value.getMonth() + 1);
|
@@ -433,7 +438,7 @@ var InlineEditCell = function InlineEditCell(_ref) {
|
|
433
438
|
"data-inline-type": type,
|
434
439
|
onClick: !nonEditCell ? handleInlineCellClick : addActiveState,
|
435
440
|
onKeyDown: !nonEditCell ? handleKeyDown : null,
|
436
|
-
className: (0, _classnames.default)("".concat(blockClass, "__inline-edit--outer-cell-button"), (
|
441
|
+
className: (0, _classnames.default)("".concat(blockClass, "__inline-edit--outer-cell-button"), (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(blockClass, "__inline-edit--outer-cell-button--").concat(rowSize), rowSize), "".concat(blockClass, "__inline-edit--outer-cell-button--lg"), !rowSize), "".concat(blockClass, "__inline-edit--outer-cell-button--invalid"), config === null || config === void 0 || (_config$validator = config.validator) === null || _config$validator === void 0 ? void 0 : _config$validator.call(config, cellValue)))
|
437
442
|
}, !inEditMode && /*#__PURE__*/_react.default.createElement(_InlineEditButton.InlineEditButton, {
|
438
443
|
isActiveCell: cellId === activeCellId,
|
439
444
|
renderIcon: setRenderIcon(),
|
@@ -447,7 +452,6 @@ var InlineEditCell = function InlineEditCell(_ref) {
|
|
447
452
|
}), !nonEditCell && inEditMode && cellId === activeCellId && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, type === 'text' && renderTextInput(), type === 'number' && renderNumberInput(), type === 'selection' && renderSelectCell(), type === 'date' && renderDateCell()))
|
448
453
|
);
|
449
454
|
};
|
450
|
-
exports.InlineEditCell = InlineEditCell;
|
451
455
|
InlineEditCell.propTypes = {
|
452
456
|
cell: _propTypes.default.object,
|
453
457
|
config: _propTypes.default.object,
|
package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js
CHANGED
@@ -12,12 +12,16 @@ var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
13
13
|
var _returnUpdatedActiveCell = require("./returnUpdatedActiveCell");
|
14
14
|
var _getCellIdAsObject = require("./getCellIdAsObject");
|
15
|
-
function _getRequireWildcardCache(
|
16
|
-
function _interopRequireWildcard(
|
17
|
-
function ownKeys(
|
18
|
-
function _objectSpread(
|
19
|
-
|
20
|
-
|
15
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
17
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
18
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /**
|
19
|
+
* Copyright IBM Corp. 2022, 2022
|
20
|
+
*
|
21
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
22
|
+
* LICENSE file in the root directory of this source tree.
|
23
|
+
*/
|
24
|
+
var InlineEditContext = exports.InlineEditContext = /*#__PURE__*/(0, _react.createContext)();
|
21
25
|
var inlineEditReducer = function inlineEditReducer(state, action) {
|
22
26
|
switch (action.type) {
|
23
27
|
case 'ADD_GRID_ACTIVE_FOCUS':
|
@@ -83,7 +87,7 @@ var inlineEditReducer = function inlineEditReducer(state, action) {
|
|
83
87
|
return state;
|
84
88
|
}
|
85
89
|
};
|
86
|
-
var InlineEditProvider = function InlineEditProvider(_ref) {
|
90
|
+
var InlineEditProvider = exports.InlineEditProvider = function InlineEditProvider(_ref) {
|
87
91
|
var children = _ref.children;
|
88
92
|
var initialState = {};
|
89
93
|
var _useReducer = (0, _react.useReducer)(inlineEditReducer, initialState),
|
@@ -97,7 +101,6 @@ var InlineEditProvider = function InlineEditProvider(_ref) {
|
|
97
101
|
}
|
98
102
|
}, children);
|
99
103
|
};
|
100
|
-
exports.InlineEditProvider = InlineEditProvider;
|
101
104
|
InlineEditProvider.propTypes = {
|
102
105
|
children: _propTypes.default.element
|
103
106
|
};
|
package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/getCellIdAsObject.js
CHANGED
@@ -13,7 +13,7 @@ exports.getCellIdAsObject = void 0;
|
|
13
13
|
|
14
14
|
// Turns activeCellId into an object to be able to
|
15
15
|
// update cell coordinates more easily
|
16
|
-
var getCellIdAsObject = function getCellIdAsObject(oldId) {
|
16
|
+
var getCellIdAsObject = exports.getCellIdAsObject = function getCellIdAsObject(oldId) {
|
17
17
|
var oldIdArr = oldId.split('-');
|
18
18
|
var updatedOldValuesArray = oldIdArr.map(function (item) {
|
19
19
|
if (isNaN(item)) {
|
@@ -30,5 +30,4 @@ var getCellIdAsObject = function getCellIdAsObject(oldId) {
|
|
30
30
|
activeCellCoords[element] = indexArray[index];
|
31
31
|
});
|
32
32
|
return activeCellCoords;
|
33
|
-
};
|
34
|
-
exports.getCellIdAsObject = getCellIdAsObject;
|
33
|
+
};
|
@@ -7,12 +7,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
exports.returnUpdatedActiveCell = void 0;
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
9
9
|
var _settings = require("../../../../../../settings");
|
10
|
-
function ownKeys(
|
11
|
-
function _objectSpread(
|
10
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
11
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /**
|
12
|
+
* Copyright IBM Corp. 2022, 2022
|
13
|
+
*
|
14
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
15
|
+
* LICENSE file in the root directory of this source tree.
|
16
|
+
*/
|
12
17
|
var blockClass = "".concat(_settings.pkg.prefix, "--datagrid");
|
13
18
|
// This function returns the state back to the reducer after
|
14
19
|
// determining the new active cell value
|
15
|
-
var returnUpdatedActiveCell = function returnUpdatedActiveCell(_ref) {
|
20
|
+
var returnUpdatedActiveCell = exports.returnUpdatedActiveCell = function returnUpdatedActiveCell(_ref) {
|
16
21
|
var activeCellCoords = _ref.activeCellCoords,
|
17
22
|
direction = _ref.direction,
|
18
23
|
totalVisibleColumns = _ref.totalVisibleColumns,
|
@@ -26,10 +31,9 @@ var returnUpdatedActiveCell = function returnUpdatedActiveCell(_ref) {
|
|
26
31
|
var newCellIdButton = document.querySelector("#".concat(instance.tableId, " .").concat(blockClass, "__table-with-inline-edit [data-cell-id=\"").concat(newActiveCellId, "\"] .").concat(blockClass, "__inline-edit-button"));
|
27
32
|
// Allows scrollable area to keep focused/active cell id visible
|
28
33
|
if (newCellIdButton) {
|
29
|
-
newCellIdButton === null || newCellIdButton === void 0
|
34
|
+
newCellIdButton === null || newCellIdButton === void 0 || newCellIdButton.focus();
|
30
35
|
}
|
31
36
|
return _objectSpread(_objectSpread({}, state), {}, {
|
32
37
|
activeCellId: newActiveCellId
|
33
38
|
});
|
34
|
-
};
|
35
|
-
exports.returnUpdatedActiveCell = returnUpdatedActiveCell;
|
39
|
+
};
|
@@ -11,7 +11,7 @@ exports.handleGridFocus = void 0;
|
|
11
11
|
* LICENSE file in the root directory of this source tree.
|
12
12
|
*/
|
13
13
|
|
14
|
-
var handleGridFocus = function handleGridFocus(state, dispatch) {
|
14
|
+
var handleGridFocus = exports.handleGridFocus = function handleGridFocus(state, dispatch) {
|
15
15
|
var gridActive = state.gridActive,
|
16
16
|
previousActiveCellId = state.previousActiveCellId;
|
17
17
|
if (!gridActive) {
|
@@ -21,5 +21,4 @@ var handleGridFocus = function handleGridFocus(state, dispatch) {
|
|
21
21
|
payload: previousActiveCellId || 'column-0-row-0' // If there is a previous active cell id that is found use that, otherwise use the first cell in the grid area
|
22
22
|
});
|
23
23
|
}
|
24
|
-
};
|
25
|
-
exports.handleGridFocus = handleGridFocus;
|
24
|
+
};
|
@@ -9,10 +9,15 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
9
9
|
var _settings = require("../../../../../settings");
|
10
10
|
var _handleMultipleKeys = require("./handleMultipleKeys");
|
11
11
|
var _getCellIdAsObject = require("./InlineEditContext/getCellIdAsObject");
|
12
|
-
function ownKeys(
|
13
|
-
function _objectSpread(
|
12
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
13
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /**
|
14
|
+
* Copyright IBM Corp. 2022, 2022
|
15
|
+
*
|
16
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
18
|
+
*/
|
14
19
|
var blockClass = "".concat(_settings.pkg.prefix, "--datagrid");
|
15
|
-
var handleGridKeyPress = function handleGridKeyPress(_ref) {
|
20
|
+
var handleGridKeyPress = exports.handleGridKeyPress = function handleGridKeyPress(_ref) {
|
16
21
|
var event = _ref.event,
|
17
22
|
dispatch = _ref.dispatch,
|
18
23
|
state = _ref.state,
|
@@ -204,14 +209,14 @@ var handleGridKeyPress = function handleGridKeyPress(_ref) {
|
|
204
209
|
if (focusedType === 'selection') {
|
205
210
|
setTimeout(function () {
|
206
211
|
var dropdownTrigger = focusedCell.querySelector('button');
|
207
|
-
dropdownTrigger === null || dropdownTrigger === void 0
|
212
|
+
dropdownTrigger === null || dropdownTrigger === void 0 || dropdownTrigger.click();
|
208
213
|
}, 1);
|
209
214
|
}
|
210
215
|
if (focusedType === 'date') {
|
211
216
|
setTimeout(function () {
|
212
217
|
var dateInputTrigger = focusedCell.querySelector('input');
|
213
|
-
dateInputTrigger === null || dateInputTrigger === void 0
|
214
|
-
dateInputTrigger === null || dateInputTrigger === void 0
|
218
|
+
dateInputTrigger === null || dateInputTrigger === void 0 || dateInputTrigger.click();
|
219
|
+
dateInputTrigger === null || dateInputTrigger === void 0 || dateInputTrigger.focus();
|
215
220
|
}, 1);
|
216
221
|
}
|
217
222
|
dispatch({
|
@@ -225,5 +230,4 @@ var handleGridKeyPress = function handleGridKeyPress(_ref) {
|
|
225
230
|
}
|
226
231
|
}
|
227
232
|
}
|
228
|
-
};
|
229
|
-
exports.handleGridKeyPress = handleGridKeyPress;
|
233
|
+
};
|
@@ -15,7 +15,7 @@ var _getFocusableElements = require("../../../../../global/js/utils/getFocusable
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
var blockClass = "".concat(_settings.pkg.prefix, "--datagrid");
|
18
|
-
var handleMultipleKeys = function handleMultipleKeys(_ref) {
|
18
|
+
var handleMultipleKeys = exports.handleMultipleKeys = function handleMultipleKeys(_ref) {
|
19
19
|
var usingMac = _ref.usingMac,
|
20
20
|
keysPressedList = _ref.keysPressedList,
|
21
21
|
dispatch = _ref.dispatch,
|
@@ -80,8 +80,7 @@ var handleMultipleKeys = function handleMultipleKeys(_ref) {
|
|
80
80
|
});
|
81
81
|
if (indexOfTable && Number.isFinite(indexOfTable)) {
|
82
82
|
var _datagridFocusableEle;
|
83
|
-
(_datagridFocusableEle = datagridFocusableElements[indexOfTable]) === null || _datagridFocusableEle === void 0
|
83
|
+
(_datagridFocusableEle = datagridFocusableElements[indexOfTable]) === null || _datagridFocusableEle === void 0 || _datagridFocusableEle.focus();
|
84
84
|
}
|
85
85
|
}
|
86
|
-
};
|
87
|
-
exports.handleMultipleKeys = handleMultipleKeys;
|
86
|
+
};
|
@@ -18,8 +18,14 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
18
18
|
var _RowSizeRadioGroup = _interopRequireDefault(require("./RowSizeRadioGroup"));
|
19
19
|
var _settings = require("../../../../../settings");
|
20
20
|
var _excluded = ["legendText"];
|
21
|
-
|
22
|
-
|
21
|
+
/**
|
22
|
+
* Copyright IBM Corp. 2021, 2023
|
23
|
+
*
|
24
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
25
|
+
* LICENSE file in the root directory of this source tree.
|
26
|
+
*/
|
27
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
28
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
23
29
|
var blockClass = "".concat(_settings.pkg.prefix, "--datagrid__row-size");
|
24
30
|
var RowSizeDropdown = function RowSizeDropdown(_ref) {
|
25
31
|
var _ref$legendText = _ref.legendText,
|
@@ -35,7 +41,7 @@ var RowSizeDropdown = function RowSizeDropdown(_ref) {
|
|
35
41
|
if (isOpen) {
|
36
42
|
var radioGroupParentElement = radioGroupRef === null || radioGroupRef === void 0 ? void 0 : radioGroupRef.current;
|
37
43
|
var checkedRadioChild = radioGroupParentElement === null || radioGroupParentElement === void 0 ? void 0 : radioGroupParentElement.querySelector(".".concat(_settings.carbon.prefix, "--radio-button:checked"));
|
38
|
-
checkedRadioChild === null || checkedRadioChild === void 0
|
44
|
+
checkedRadioChild === null || checkedRadioChild === void 0 || checkedRadioChild.focus();
|
39
45
|
}
|
40
46
|
}, [isOpen]);
|
41
47
|
var onCloseHandler = function onCloseHandler() {
|
@@ -86,5 +92,4 @@ RowSizeDropdown.propTypes = {
|
|
86
92
|
onChange: _propTypes.default.func.isRequired,
|
87
93
|
selectedOption: _propTypes.default.string
|
88
94
|
};
|
89
|
-
var _default = RowSizeDropdown;
|
90
|
-
exports.default = _default;
|
95
|
+
var _default = exports.default = RowSizeDropdown;
|
@@ -11,8 +11,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
var _carbonComponentsReact = require("carbon-components-react");
|
12
12
|
var _isArray = _interopRequireDefault(require("lodash/isArray"));
|
13
13
|
var _settings = require("../../../../../settings");
|
14
|
-
function _getRequireWildcardCache(
|
15
|
-
function _interopRequireWildcard(
|
14
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
15
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
16
16
|
/* eslint-disable react/default-props-match-prop-types */
|
17
17
|
// @flow
|
18
18
|
/*
|
@@ -72,7 +72,6 @@ var getBackwardCompatibleRowSize = function getBackwardCompatibleRowSize(rowSize
|
|
72
72
|
compact: 'xs'
|
73
73
|
// md is a new value
|
74
74
|
};
|
75
|
-
|
76
75
|
return rowSizeMap[rowSize] || rowSize;
|
77
76
|
};
|
78
77
|
RowSizeRadioGroup.defaultProps = {
|
@@ -87,7 +86,6 @@ RowSizeRadioGroup.defaultProps = {
|
|
87
86
|
}, {
|
88
87
|
value: 'xs' // 24
|
89
88
|
}],
|
90
|
-
|
91
89
|
selectedOption: 'lg'
|
92
90
|
};
|
93
91
|
RowSizeRadioGroup.propTypes = {
|
@@ -99,5 +97,4 @@ RowSizeRadioGroup.propTypes = {
|
|
99
97
|
rowSizes: _propTypes.default.array.isRequired,
|
100
98
|
selectedOption: _propTypes.default.string.isRequired
|
101
99
|
};
|
102
|
-
var _default = RowSizeRadioGroup;
|
103
|
-
exports.default = _default;
|
100
|
+
var _default = exports.default = RowSizeRadioGroup;
|
@@ -9,8 +9,13 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
11
11
|
var _settings = require("../../../../settings");
|
12
|
-
function ownKeys(
|
13
|
-
function _objectSpread(
|
12
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
13
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /**
|
14
|
+
* Copyright IBM Corp. 2023, 2023
|
15
|
+
*
|
16
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
18
|
+
*/
|
14
19
|
var COLUMN_RESIZE_START = 'columnStartResizing';
|
15
20
|
var COLUMN_RESIZING = 'columnResizing';
|
16
21
|
var COLUMN_RESIZE_END = 'columnDoneResizing';
|
@@ -18,7 +23,7 @@ var INIT = 'init';
|
|
18
23
|
var TOGGLE_ROW_SELECTED = 'toggleRowSelected';
|
19
24
|
var TOGGLE_ALL_ROWS_SELECTED = 'toggleAllRowsSelected';
|
20
25
|
var blockClass = "".concat(_settings.pkg.prefix, "--datagrid");
|
21
|
-
var handleColumnResizeEndEvent = function handleColumnResizeEndEvent(dispatch, onColResizeEnd, headerId, isKeyEvent) {
|
26
|
+
var handleColumnResizeEndEvent = exports.handleColumnResizeEndEvent = function handleColumnResizeEndEvent(dispatch, onColResizeEnd, headerId, isKeyEvent) {
|
22
27
|
dispatch({
|
23
28
|
type: COLUMN_RESIZE_END,
|
24
29
|
payload: {
|
@@ -28,8 +33,7 @@ var handleColumnResizeEndEvent = function handleColumnResizeEndEvent(dispatch, o
|
|
28
33
|
}
|
29
34
|
});
|
30
35
|
};
|
31
|
-
exports.
|
32
|
-
var handleColumnResizingEvent = function handleColumnResizingEvent(dispatch, header, newWidth, isKeyEvent) {
|
36
|
+
var handleColumnResizingEvent = exports.handleColumnResizingEvent = function handleColumnResizingEvent(dispatch, header, newWidth, isKeyEvent) {
|
33
37
|
if (isKeyEvent) {
|
34
38
|
dispatch({
|
35
39
|
type: COLUMN_RESIZE_START,
|
@@ -49,8 +53,7 @@ var handleColumnResizingEvent = function handleColumnResizingEvent(dispatch, hea
|
|
49
53
|
}
|
50
54
|
});
|
51
55
|
};
|
52
|
-
exports.
|
53
|
-
var handleToggleRowSelected = function handleToggleRowSelected(_ref) {
|
56
|
+
var handleToggleRowSelected = exports.handleToggleRowSelected = function handleToggleRowSelected(_ref) {
|
54
57
|
var dispatch = _ref.dispatch,
|
55
58
|
rowData = _ref.rowData,
|
56
59
|
isChecked = _ref.isChecked,
|
@@ -66,8 +69,7 @@ var handleToggleRowSelected = function handleToggleRowSelected(_ref) {
|
|
66
69
|
}
|
67
70
|
});
|
68
71
|
};
|
69
|
-
exports.
|
70
|
-
var handleSelectAllRowData = function handleSelectAllRowData(_ref2) {
|
72
|
+
var handleSelectAllRowData = exports.handleSelectAllRowData = function handleSelectAllRowData(_ref2) {
|
71
73
|
var dispatch = _ref2.dispatch,
|
72
74
|
rows = _ref2.rows,
|
73
75
|
getRowId = _ref2.getRowId,
|
@@ -83,8 +85,7 @@ var handleSelectAllRowData = function handleSelectAllRowData(_ref2) {
|
|
83
85
|
}
|
84
86
|
});
|
85
87
|
};
|
86
|
-
exports.
|
87
|
-
var stateReducer = function stateReducer(newState, action) {
|
88
|
+
var stateReducer = exports.stateReducer = function stateReducer(newState, action) {
|
88
89
|
switch (action.type) {
|
89
90
|
case TOGGLE_ALL_ROWS_SELECTED:
|
90
91
|
{
|
@@ -188,13 +189,13 @@ var stateReducer = function stateReducer(newState, action) {
|
|
188
189
|
var currentColumn = {};
|
189
190
|
currentColumn[_headerId2] = newState.columnResizing.columnWidths[_headerId2];
|
190
191
|
var allChangedColumns = newState.columnResizing.columnWidths;
|
191
|
-
onColResizeEnd === null || onColResizeEnd === void 0
|
192
|
+
onColResizeEnd === null || onColResizeEnd === void 0 || onColResizeEnd(currentColumn, allChangedColumns);
|
192
193
|
if (!isKeyEvent) {
|
193
194
|
if (typeof isKeyEvent === 'undefined') {
|
194
195
|
// Blur resizer input if it has focus and is not from a key event resize
|
195
196
|
if (document.activeElement.classList.contains("".concat(blockClass, "__col-resizer-range"))) {
|
196
|
-
var _document
|
197
|
-
(_document = document) === null || _document === void 0
|
197
|
+
var _document;
|
198
|
+
(_document = document) === null || _document === void 0 || (_document = _document.activeElement) === null || _document === void 0 || _document.blur();
|
198
199
|
}
|
199
200
|
return;
|
200
201
|
}
|
@@ -208,5 +209,4 @@ var stateReducer = function stateReducer(newState, action) {
|
|
208
209
|
});
|
209
210
|
}
|
210
211
|
}
|
211
|
-
};
|
212
|
-
exports.stateReducer = stateReducer;
|
212
|
+
};
|
@@ -5,9 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.story = void 0;
|
7
7
|
var notes = "\n # Customizing columns\n Customizing columns allows user to reorder and hide certain columns of the datagrid. Consuming component can use the provided callback to save/update according to their persistent strategy.\n\n ## Documentation:\n\n - (required) Add following plugins to `useDatagrid` hook\n - `useCustomizeColumns`\n - `useColumnOrder`\n - (required) Implement `options.DatagridActions` component\n - this component will have props: `datagridState`\n - render `datagridState.CustomizeColumnsButton` component wherever makes sense.\n - `CustomizeColumnsButton` props can be overridden. Available props: [carbon-components-react doc](https://react.carbondesignsystem.com/?path=/docs/components-button--default)\n - (optional) Preserve and apply the user preference\n - `options.initialState.hiddenColumns: Array<ColumnId: String>`\n - Array of column ids that will be hidden after initial render\n - [react-table doc](https://react-table.tanstack.com/docs/api/useTable#table-options)\n - `options.initialState.columnOrder: Array<ColumnId: String>`\n - Order of the columns. Any column ids not in this array will be ordered by their position in the `options.columns`\n - [react-table doc](https://react-table.tanstack.com/docs/api/useColumnOrder#table-options)\n - `options.customizeColumnsProps.onSaveColumnPrefs`\n - type: `Function(Columns: Array<{ColumnId: String, isVisible: Boolean}>) => void`\n - It's a callback function when 'Save' button clicked on the modal. It allows consumer to preserve the updated column preference. This output can also be used to compute the `hiddenColumns` and `columnOrder`\n - (optional) Reset to default\n - There is a reset to default button on the modal. It will use the `options.columns` as the default. If there are columns should be hidden by default, denote them with property: `isVisible: false` (undefined will be treated as `true`)\n\n code snippet:\n\n ```js\n const columns = React.useMemo(() => defaultHeader, []);\n const [data] = useState(makeData(10));\n const DatagridActions = (datagridState) => (\n <TableToolbarContent>\n <TableToolbarSearch ... />\n <Button ... />\n <datagridState.CustomizeColumnsButton />\n </TableToolbarContent>\n )\n const datagridState = useDatagrid(\n {\n columns,\n data,\n initialState: {\n hiddenColumns: ['age'],\n columnOrder: [],\n },\n customizeColumnsProps: {\n onSaveColumnPrefs: (newColDefs) => {\n console.log(newColDefs);\n },\n },\n DatagridActions,\n },\n useCustomizeColumns,\n useColumnOrder,\n );\n\n return (\n <Wrapper>\n <IntlProvider locale=\"en\">\n <Datagrid {...datagridState} />\n <div>\n Hidden column ids: \n <pre>{JSON.stringify(datagridState.state.hiddenColumns, null, 2)}</pre>\n </div>\n </IntlProvider>\n </Wrapper>\n );\n ```\n";
|
8
|
-
var story = {
|
8
|
+
var story = exports.story = {
|
9
9
|
parameters: {
|
10
10
|
notes: notes
|
11
11
|
}
|
12
|
-
};
|
13
|
-
exports.story = story;
|
12
|
+
};
|
@@ -5,9 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.story = void 0;
|
7
7
|
var notes = "\n# Changing row size (height/density)\nAllow users to adjust the data density on datagrid.\n\n## Documentation:\n\n- (optional) Define initial row size by `datagridOptions.rowSize`.\n - Default value is `md`.\n - Supported values are `xl`, `lg`, `md`, `sm`, `xs` same as size prop on carbon component react `DataTable`.\n- (optional) Provide list of allowed sizes use `datagridOptions.rowSizes`\n - Default list is\n ```\n [{ value: 'lg'}, { value: 'md'}, {value: 'sm'}, {value: 'xs'}]\n ```\n - Provide `labelText` in each option if not satisfied with the default labels.\n- (optional) Use `RowSizeDropdown` component to change row size:\n - (required) Implement `datagridOptions.DatagridActions` component\n - The component will have props: `datagridState`\n - Render `datagridState.RowSizeDropdown` component in `datagridOptions.DatagridActions`.\n - Pass `datagridState.rowSizeDropdownProps` as props\n - No extra logic is needed.\n - (optional) Preserve row size, use `datagridOptions.onRowSizeChange`\n - type: `Function(rowSize: String) => void`\n - It's a callback function when different row size option is selected on the dropdown.\n- (optional) Use other component to change row size:\n - Wire the variable controlled by the component with `datagridOptions.rowSize = variable`\n- (optional) Render different content in the cell on different `rowSize`\n - `Cell` renderer of each column will receive `datagridState` which will contain `rowSize`. Render different content based on this value.\n\ncode snippet:\n\n```js\nconst columns = React.useMemo(() => [ ...defaultHeader.slice(0, 3),\n {\n Header: 'Different cell content',\n id: 'rowSizeDemo-cell',\n disableSortBy: true,\n Cell: ({ rowSize }) => rowSize,\n }\n], []);\nconst [data] = useState(makeData(10));\nconst DatagridActions = (datagridState) => (\n <TableToolbarContent>\n <TableToolbarSearch ... />\n <Button ... />\n <datagridState.RowSizeDropdown {...datagridState.rowSizeDropdownProps} />\n </TableToolbarContent>\n)\nconst datagridState = useDatagrid(\n {\n columns,\n data,\n rowSize: 'xs',\n rowSizes: [\n {\n value: 'lg',\n labelText: 'Super tall row',\n },\n {\n value: 'md',\n },\n {\n value: 'xs',\n labelText: 'Teeny tiny row',\n },\n ],\n onRowSizeChange: (rowSize) => {\n console.log(rowSize);\n },\n DatagridActions,\n },\n);\n\nreturn (\n <Wrapper>\n <IntlProvider locale=\"en\">\n <Datagrid {...datagridState} />\n </IntlProvider>\n </Wrapper>\n);\n```\n";
|
8
|
-
var story = {
|
8
|
+
var story = exports.story = {
|
9
9
|
parameters: {
|
10
10
|
notes: notes
|
11
11
|
}
|
12
|
-
};
|
13
|
-
exports.story = story;
|
12
|
+
};
|
@@ -5,9 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.story = void 0;
|
7
7
|
var notes = "\n# Select all toggle\nUse this feature will allow user to toggle the select all checkbox behavior between selecting all rows **on current page** vs **across all pages**\n<br/>\nIt's using [react-table API](https://react-table.tanstack.com/docs/api/useRowSelect#instance-properties) to select all rows.\n\n## Terminology\n- Pagination\n - **UI side pagination**: all rows are loaded to browser, but only display subset of them.\n - **Server side pagination**: subset of rows are loaded to browser, going to another page requires another network call\n- Selection mode\n - **all rows**: selects all rows across pages.\n - **all page rows**: selects all rows on the current page.\n\n## Compatibility with other plugin hooks and options\n- It has to be used with `useSelectRows` hook.\n- Select all toggle will not be enabled if `options.DatagridPagination` is not defined (select all is the same without pagination)\n- Compatible with `options.DatagridBatchActions`\n- Obviously it will not work when select-all is hidden by `options.hideSelectAll`.\n- Not compatible with `useInfiniteScroll`. Pull request welcome!\n\n## Sample usage:\n- (required) `useSelectRows` - enable row selections with select all on header\n- (required) `useSelectAllToggle` - enable select all toggle.\n- (optional) config the label on toggle menu:\n - (optional) `options.selectAllToggle.labels.allRows` for label that selects all rows across all pages\n - (optional) `options.selectAllToggle.labels.allPageRows` for label that selects all rows on current page\n- (optional) `options.selectAllToggle.onSelectAllRows`\n - type: `Function(areAllRowsSelected: Boolean) => void`\n - callback when `instance.isAllRowsSelected` value changes. Check out doc: [instance property](https://react-table.tanstack.com/docs/api/useRowSelect#instance-properties)\n - `true`: when selection mode is **all rows** and user selects all via toggle dropdown 'Select all' or toggle 'on' on the select all checkbox.\n - useful when grid is server side paginated (only a subset of rows are loaded in UI)\n\n```js\nconst columns = React.useMemo(() => defaultHeader, []);\n const [data] = useState(makeData(100));\n const datagridState = useDatagrid(\n {\n columns,\n data,\n initialState: {\n pageSize: 10,\n pageSizes: [5,10,25,50]\n },\n selectAllToggle: {\n labels: {\n allRows: \"Select all randomly generated rows\",\n },\n onSelectAllRows: (areAllSelected) => console.log('are all selected: ', areAllSelected),\n },\n DatagridPagination,\n DatagridActions,\n DatagridBatchActions,\n },\n useSelectRows,\n useSelectAllToggle,\n );\n\n return (\n <Wrapper>\n <Datagrid {...datagridState} />\n </Wrapper>\n);\n```\n\n";
|
8
|
-
var story = {
|
8
|
+
var story = exports.story = {
|
9
9
|
parameters: {
|
10
10
|
notes: notes
|
11
11
|
}
|
12
|
-
};
|
13
|
-
exports.story = story;
|
12
|
+
};
|