@carbon/ibm-products 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +201 -0
- package/README.md +1 -1
- package/css/config.css +3 -0
- package/css/config.css.map +1 -0
- package/css/index-full-carbon.css +34268 -0
- package/css/index-full-carbon.css.map +1 -0
- package/css/index-full-carbon.min.css +8 -0
- package/css/index-full-carbon.min.css.map +1 -0
- package/css/index-without-carbon-released-only.css +8698 -0
- package/css/index-without-carbon-released-only.css.map +1 -0
- package/css/index-without-carbon-released-only.min.css +4 -0
- package/css/index-without-carbon-released-only.min.css.map +1 -0
- package/css/index-without-carbon.css +14253 -0
- package/css/index-without-carbon.css.map +1 -0
- package/css/index-without-carbon.min.css +8 -0
- package/css/index-without-carbon.min.css.map +1 -0
- package/css/index.css +17293 -0
- package/css/index.css.map +1 -0
- package/css/index.min.css +8 -0
- package/css/index.min.css.map +1 -0
- package/es/components/APIKeyModal/APIKeyDownloader.js +91 -0
- package/es/components/APIKeyModal/APIKeyModal.js +510 -0
- package/es/components/APIKeyModal/index.js +8 -0
- package/es/components/AboutModal/AboutModal.js +194 -0
- package/es/components/AboutModal/index.js +8 -0
- package/es/components/ActionBar/ActionBar.js +258 -0
- package/es/components/ActionBar/ActionBarItem.js +96 -0
- package/es/components/ActionBar/ActionBarOverflowItems.js +74 -0
- package/es/components/ActionBar/index.js +9 -0
- package/es/components/ActionSet/ActionSet.js +200 -0
- package/es/components/ActionSet/actions.js +55 -0
- package/es/components/ActionSet/index.js +8 -0
- package/es/components/AddSelect/AddSelect.js +129 -0
- package/es/components/AddSelect/AddSelectBody.js +368 -0
- package/es/components/AddSelect/AddSelectBreadcrumbs.js +45 -0
- package/es/components/AddSelect/AddSelectColumn.js +241 -0
- package/es/components/AddSelect/AddSelectFilter.js +172 -0
- package/es/components/AddSelect/AddSelectFormControl.js +82 -0
- package/es/components/AddSelect/AddSelectList.js +55 -0
- package/es/components/AddSelect/AddSelectMetaPanel.js +65 -0
- package/es/components/AddSelect/AddSelectRow.js +206 -0
- package/es/components/AddSelect/AddSelectSidebar.js +121 -0
- package/es/components/AddSelect/AddSelectSort.js +77 -0
- package/es/components/AddSelect/add-select-utils.js +127 -0
- package/es/components/AddSelect/hooks/useFocus.js +31 -0
- package/es/components/AddSelect/hooks/useItemSort.js +25 -0
- package/es/components/AddSelect/hooks/useParentSelect.js +20 -0
- package/es/components/AddSelect/hooks/usePath.js +72 -0
- package/es/components/AddSelect/index.js +8 -0
- package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +336 -0
- package/es/components/BreadcrumbWithOverflow/index.js +10 -0
- package/es/components/ButtonMenu/ButtonMenu.js +129 -0
- package/es/components/ButtonMenu/ButtonMenuItem.js +33 -0
- package/es/components/ButtonMenu/index.js +9 -0
- package/es/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +211 -0
- package/es/components/ButtonSetWithOverflow/index.js +8 -0
- package/es/components/Card/Card.js +264 -0
- package/es/components/Card/CardFooter.js +79 -0
- package/es/components/Card/CardHeader.js +74 -0
- package/es/components/Card/index.js +10 -0
- package/es/components/Cascade/Cascade.js +80 -0
- package/es/components/Cascade/index.js +1 -0
- package/es/components/ComboButton/ComboButton.js +101 -0
- package/es/components/ComboButton/ComboButtonItem/index.js +30 -0
- package/es/components/ComboButton/index.js +9 -0
- package/es/components/CreateFullPage/CreateFullPage.js +288 -0
- package/es/components/CreateFullPage/CreateFullPageStep.js +166 -0
- package/es/components/CreateFullPage/index.js +9 -0
- package/es/components/CreateInfluencer/CreateInfluencer.js +92 -0
- package/es/components/CreateInfluencer/index.js +8 -0
- package/es/components/CreateModal/CreateModal.js +137 -0
- package/es/components/CreateModal/index.js +10 -0
- package/es/components/CreateSidePanel/CreateSidePanel.js +156 -0
- package/es/components/CreateSidePanel/index.js +8 -0
- package/es/components/CreateTearsheet/CreateTearsheet.js +308 -0
- package/es/components/CreateTearsheet/CreateTearsheetDivider.js +33 -0
- package/es/components/CreateTearsheet/CreateTearsheetStep.js +174 -0
- package/es/components/CreateTearsheet/index.js +10 -0
- package/es/components/CreateTearsheet/preview-components/MultiStepTearsheet.js +284 -0
- package/es/components/CreateTearsheet/preview-components/MultiStepWithIntro.js +280 -0
- package/es/components/CreateTearsheetNarrow/CreateTearsheetNarrow.js +165 -0
- package/es/components/CreateTearsheetNarrow/index.js +8 -0
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +883 -0
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +551 -0
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +282 -0
- package/es/components/DataSpreadsheet/hooks/index.js +14 -0
- package/es/components/DataSpreadsheet/hooks/useMoveActiveCell.js +28 -0
- package/es/components/DataSpreadsheet/hooks/useMultipleKeyTracking.js +119 -0
- package/es/components/DataSpreadsheet/hooks/useResetSpreadsheetFocus.js +26 -0
- package/es/components/DataSpreadsheet/hooks/useSpreadsheetEdit.js +102 -0
- package/es/components/DataSpreadsheet/hooks/useSpreadsheetMouseMove.js +58 -0
- package/es/components/DataSpreadsheet/hooks/useSpreadsheetMouseUp.js +164 -0
- package/es/components/DataSpreadsheet/hooks/useSpreadsheetOutsideClick.js +41 -0
- package/es/components/DataSpreadsheet/index.js +8 -0
- package/es/components/DataSpreadsheet/utils/checkActiveHeaderCell.js +30 -0
- package/es/components/DataSpreadsheet/utils/checkSelectedHeaderCell.js +29 -0
- package/es/components/DataSpreadsheet/utils/createActiveCellFn.js +54 -0
- package/es/components/DataSpreadsheet/utils/createCellSelectionArea.js +64 -0
- package/es/components/DataSpreadsheet/utils/generateData.js +52 -0
- package/es/components/DataSpreadsheet/utils/getCellSize.js +25 -0
- package/es/components/DataSpreadsheet/utils/getSelectionAreaPoints.js +19 -0
- package/es/components/DataSpreadsheet/utils/getSpreadsheetWidth.js +34 -0
- package/es/components/DataSpreadsheet/utils/handleActiveCellInSelectionEnter.js +107 -0
- package/es/components/DataSpreadsheet/utils/handleActiveCellInSelectionTab.js +98 -0
- package/es/components/DataSpreadsheet/utils/handleCellDeletion.js +40 -0
- package/es/components/DataSpreadsheet/utils/handleEditSubmit.js +80 -0
- package/es/components/DataSpreadsheet/utils/handleHeaderCellSelection.js +158 -0
- package/es/components/DataSpreadsheet/utils/handleMultipleKeys.js +259 -0
- package/es/components/DataSpreadsheet/utils/moveColumnIndicatorLine.js +33 -0
- package/es/components/DataSpreadsheet/utils/removeCellSelections.js +28 -0
- package/es/components/DataSpreadsheet/utils/selectAllCells.js +49 -0
- package/es/components/Datagrid/Datagrid/Datagrid.js +63 -0
- package/es/components/Datagrid/Datagrid/DatagridBody.js +30 -0
- package/es/components/Datagrid/Datagrid/DatagridContent.js +181 -0
- package/es/components/Datagrid/Datagrid/DatagridEmptyBody.js +41 -0
- package/es/components/Datagrid/Datagrid/DatagridExpandedRow.js +32 -0
- package/es/components/Datagrid/Datagrid/DatagridHead.js +22 -0
- package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +52 -0
- package/es/components/Datagrid/Datagrid/DatagridRefBody.js +36 -0
- package/es/components/Datagrid/Datagrid/DatagridRow.js +118 -0
- package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +62 -0
- package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +140 -0
- package/es/components/Datagrid/Datagrid/DatagridSimpleBody.js +32 -0
- package/es/components/Datagrid/Datagrid/DatagridToolbar.js +142 -0
- package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +109 -0
- package/es/components/Datagrid/Datagrid/DraggableElement.js +177 -0
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +39 -0
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +52 -0
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +117 -0
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +176 -0
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +109 -0
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/TearsheetWrapper.js +51 -0
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/common.js +13 -0
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/index.js +10 -0
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +244 -0
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +269 -0
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +83 -0
- package/es/components/Datagrid/Datagrid/addons/Filtering/constants.js +27 -0
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/index.js +11 -0
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +299 -0
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useInitialStateFromFilters.js +21 -0
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useShouldDisableButtons.js +34 -0
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useSubscribeToEventEmitter.js +23 -0
- package/es/components/Datagrid/Datagrid/addons/Filtering/index.js +9 -0
- package/es/components/Datagrid/Datagrid/addons/Filtering/motion/variants.js +55 -0
- package/es/components/Datagrid/Datagrid/addons/Filtering/utils.js +84 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +59 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/index.js +1 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +489 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/index.js +1 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +98 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/getCellIdAsObject.js +27 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/index.js +1 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/returnUpdatedActiveCell.js +34 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridFocus.js +18 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +228 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleMultipleKeys.js +80 -0
- package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +67 -0
- package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +105 -0
- package/es/components/Datagrid/Datagrid/addons/RowSize/index.js +9 -0
- package/es/components/Datagrid/Datagrid/index.js +8 -0
- package/es/components/Datagrid/Datagrid.stories/CustomizeColumnStory.js +6 -0
- package/es/components/Datagrid/Datagrid.stories/RowSizeDropdownStory.js +6 -0
- package/es/components/Datagrid/Datagrid.stories/SelectAllWithToggleStory.js +6 -0
- package/es/components/Datagrid/Datagrid.stories/StickyActionsColumnStory.js +102 -0
- package/es/components/Datagrid/Datagrid.stories/common.js +190 -0
- package/es/components/Datagrid/Datagrid.stories/index.js +4 -0
- package/es/components/Datagrid/common-column-ids.js +9 -0
- package/es/components/Datagrid/index.js +28 -0
- package/es/components/Datagrid/useActionsColumn.js +140 -0
- package/es/components/Datagrid/useColumnCenterAlign.js +44 -0
- package/es/components/Datagrid/useColumnOrder.js +9 -0
- package/es/components/Datagrid/useColumnRightAlign.js +44 -0
- package/es/components/Datagrid/useCustomizeColumns.js +44 -0
- package/es/components/Datagrid/useDatagrid.js +37 -0
- package/es/components/Datagrid/useDefaultStringRenderer.js +42 -0
- package/es/components/Datagrid/useDisableSelectRows.js +80 -0
- package/es/components/Datagrid/useEditableCell.js +12 -0
- package/es/components/Datagrid/useExpandedRow.js +46 -0
- package/es/components/Datagrid/useFiltering.js +95 -0
- package/es/components/Datagrid/useFlexResize.js +44 -0
- package/es/components/Datagrid/useFloatingScroll.js +75 -0
- package/es/components/Datagrid/useInfiniteScroll.js +52 -0
- package/es/components/Datagrid/useInlineEdit.js +71 -0
- package/es/components/Datagrid/useNestedRowExpander.js +41 -0
- package/es/components/Datagrid/useNestedRows.js +58 -0
- package/es/components/Datagrid/useOnRowClick.js +47 -0
- package/es/components/Datagrid/useParentDimensions.js +57 -0
- package/es/components/Datagrid/useResizeTable.js +34 -0
- package/es/components/Datagrid/useRowExpander.js +41 -0
- package/es/components/Datagrid/useRowIsMouseOver.js +52 -0
- package/es/components/Datagrid/useRowRenderer.js +25 -0
- package/es/components/Datagrid/useRowSize.js +55 -0
- package/es/components/Datagrid/useSelectAllToggle.js +90 -0
- package/es/components/Datagrid/useSelectRows.js +117 -0
- package/es/components/Datagrid/useSkeletonRows.js +27 -0
- package/es/components/Datagrid/useSortableColumns.js +115 -0
- package/es/components/Datagrid/useStickyColumn.js +182 -0
- package/es/components/Datagrid/utils/DatagridActions.js +239 -0
- package/es/components/Datagrid/utils/DatagridPagination.js +32 -0
- package/es/components/Datagrid/utils/Wrapper.js +21 -0
- package/es/components/Datagrid/utils/getArgTypes.js +95 -0
- package/es/components/Datagrid/utils/getAutoSizedColumnWidth.js +27 -0
- package/es/components/Datagrid/utils/getInlineEditColumns.js +157 -0
- package/es/components/Datagrid/utils/makeData.js +193 -0
- package/es/components/EditFullPage/EditFullPage.js +86 -0
- package/es/components/EditFullPage/index.js +8 -0
- package/es/components/EditInPlace/EditInPlace.js +303 -0
- package/es/components/EditInPlace/index.js +8 -0
- package/es/components/EditSidePanel/EditSidePanel.js +189 -0
- package/es/components/EditSidePanel/index.js +8 -0
- package/es/components/EditTearsheet/EditTearsheet.js +195 -0
- package/es/components/EditTearsheet/EditTearsheetForm.js +99 -0
- package/es/components/EditTearsheet/index.js +9 -0
- package/es/components/EditTearsheet/preview-components/MultiFormEditTearsheet.js +218 -0
- package/es/components/EditTearsheetNarrow/EditTearsheetNarrow.js +86 -0
- package/es/components/EditTearsheetNarrow/index.js +8 -0
- package/es/components/EditUpdateCards/EditUpdateCards.js +142 -0
- package/es/components/EditUpdateCards/index.js +8 -0
- package/es/components/EmptyStates/EmptyState.js +116 -0
- package/es/components/EmptyStates/EmptyStateContent.js +87 -0
- package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +111 -0
- package/es/components/EmptyStates/ErrorEmptyState/index.js +8 -0
- package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +111 -0
- package/es/components/EmptyStates/NoDataEmptyState/index.js +8 -0
- package/es/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +111 -0
- package/es/components/EmptyStates/NoTagsEmptyState/index.js +8 -0
- package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +111 -0
- package/es/components/EmptyStates/NotFoundEmptyState/index.js +8 -0
- package/es/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +111 -0
- package/es/components/EmptyStates/NotificationsEmptyState/index.js +8 -0
- package/es/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +111 -0
- package/es/components/EmptyStates/UnauthorizedEmptyState/index.js +8 -0
- package/es/components/EmptyStates/assets/ErrorIllustration.js +218 -0
- package/es/components/EmptyStates/assets/NoDataIllustration.js +181 -0
- package/es/components/EmptyStates/assets/NoTagsIllustration.js +489 -0
- package/es/components/EmptyStates/assets/NotFoundIllustration.js +366 -0
- package/es/components/EmptyStates/assets/NotificationsIllustration.js +337 -0
- package/es/components/EmptyStates/assets/UnauthorizedIllustration.js +310 -0
- package/es/components/EmptyStates/index.js +14 -0
- package/es/components/ExampleComponent/ExampleComponent.js +180 -0
- package/es/components/ExampleComponent/ExampleDeprecatedComponent.js +28 -0
- package/es/components/ExampleComponent/index.js +8 -0
- package/es/components/ExampleComponent/useExample.js +49 -0
- package/es/components/ExportModal/ExportModal.js +278 -0
- package/es/components/ExportModal/index.js +8 -0
- package/es/components/ExpressiveCard/ExpressiveCard.js +114 -0
- package/es/components/ExpressiveCard/index.js +8 -0
- package/es/components/FilterSummary/FilterSummary.js +54 -0
- package/es/components/FilterSummary/index.js +7 -0
- package/es/components/HTTPErrors/HTTPError403/HTTPError403.js +85 -0
- package/es/components/HTTPErrors/HTTPError403/index.js +8 -0
- package/es/components/HTTPErrors/HTTPError404/HTTPError404.js +85 -0
- package/es/components/HTTPErrors/HTTPError404/index.js +8 -0
- package/es/components/HTTPErrors/HTTPErrorContent.js +81 -0
- package/es/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +85 -0
- package/es/components/HTTPErrors/HTTPErrorOther/index.js +8 -0
- package/es/components/HTTPErrors/assets/HTTPErrorSvg403.js +1240 -0
- package/es/components/HTTPErrors/assets/HTTPErrorSvg404.js +1039 -0
- package/es/components/HTTPErrors/assets/HTTPErrorSvgOther.js +1090 -0
- package/es/components/HTTPErrors/index.js +10 -0
- package/es/components/ImportModal/ImportModal.js +383 -0
- package/es/components/ImportModal/index.js +8 -0
- package/es/components/MultiAddSelect/MultiAddSelect.js +148 -0
- package/es/components/MultiAddSelect/index.js +8 -0
- package/es/components/NotificationsPanel/NotificationsPanel.js +556 -0
- package/es/components/NotificationsPanel/NotificationsPanel_data.js +135 -0
- package/es/components/NotificationsPanel/index.js +8 -0
- package/es/components/NotificationsPanel/preview-components/UnreadNotificationBell.js +48 -0
- package/es/components/NotificationsPanel/utils.js +50 -0
- package/es/components/OptionsTile/OptionsTile.js +327 -0
- package/es/components/OptionsTile/index.js +8 -0
- package/es/components/PageHeader/PageHeader.js +767 -0
- package/es/components/PageHeader/PageHeaderDemo.data.js +613 -0
- package/es/components/PageHeader/PageHeaderTitle.js +121 -0
- package/es/components/PageHeader/PageHeaderUtils.js +179 -0
- package/es/components/PageHeader/index.js +8 -0
- package/es/components/ProductiveCard/ProductiveCard.js +123 -0
- package/es/components/ProductiveCard/index.js +8 -0
- package/es/components/RemoveModal/RemoveModal.js +183 -0
- package/es/components/RemoveModal/index.js +8 -0
- package/es/components/Saving/Saving.js +159 -0
- package/es/components/Saving/index.js +8 -0
- package/es/components/SidePanel/SidePanel.js +630 -0
- package/es/components/SidePanel/constants.js +14 -0
- package/es/components/SidePanel/index.js +8 -0
- package/es/components/SidePanel/motion/variants.js +46 -0
- package/es/components/SingleAddSelect/SingleAddSelect.js +94 -0
- package/es/components/SingleAddSelect/index.js +8 -0
- package/es/components/StatusIcon/StatusIcon.js +345 -0
- package/es/components/StatusIcon/index.js +8 -0
- package/es/components/TagSet/TagSet.js +324 -0
- package/es/components/TagSet/TagSetModal.js +112 -0
- package/es/components/TagSet/TagSetOverflow.js +123 -0
- package/es/components/TagSet/constants.js +21 -0
- package/es/components/TagSet/index.js +8 -0
- package/es/components/Tearsheet/Tearsheet.js +190 -0
- package/es/components/Tearsheet/TearsheetNarrow.js +152 -0
- package/es/components/Tearsheet/TearsheetShell.js +405 -0
- package/es/components/Tearsheet/index.js +9 -0
- package/es/components/Toolbar/Toolbar.js +102 -0
- package/es/components/Toolbar/ToolbarButton.js +57 -0
- package/es/components/Toolbar/ToolbarGroup.js +35 -0
- package/es/components/Toolbar/index.js +10 -0
- package/es/components/UserProfileImage/UserProfileImage.js +176 -0
- package/es/components/UserProfileImage/index.js +10 -0
- package/es/components/WebTerminal/WebTerminal.js +205 -0
- package/es/components/WebTerminal/WebTerminalContentWrapper.js +50 -0
- package/es/components/WebTerminal/hooks/index.js +52 -0
- package/es/components/WebTerminal/index.js +10 -0
- package/es/components/WebTerminal/preview-components/Navigation.js +37 -0
- package/es/components/WebTerminal/preview-components/documentationLinks.js +32 -0
- package/es/components/WebTerminal/preview-components/index.js +12 -0
- package/es/components/_Canary/Canary.js +48 -0
- package/es/components/_Canary/index.js +8 -0
- package/es/components/index.js +44 -0
- package/es/global/js/hooks/index.js +18 -0
- package/es/global/js/hooks/useActiveElement.js +25 -0
- package/es/global/js/hooks/useClickOutside.js +21 -0
- package/es/global/js/hooks/useControllableState.js +74 -0
- package/es/global/js/hooks/useCreateComponentFocus.js +55 -0
- package/es/global/js/hooks/useCreateComponentStepChange.js +203 -0
- package/es/global/js/hooks/usePreviousValue.js +20 -0
- package/es/global/js/hooks/useResetCreateComponent.js +48 -0
- package/es/global/js/hooks/useResizeObserver.js +74 -0
- package/es/global/js/hooks/useRetrieveStepData.js +48 -0
- package/es/global/js/hooks/useValidCreateStepCount.js +21 -0
- package/es/global/js/hooks/useWindowResize.js +66 -0
- package/es/global/js/hooks/useWindowScroll.js +77 -0
- package/es/global/js/package-settings.js +197 -0
- package/es/global/js/utils/ClickListener.js +65 -0
- package/es/global/js/utils/DisplayBox.js +32 -0
- package/es/global/js/utils/Wrap.js +84 -0
- package/es/global/js/utils/deepCloneObject.js +23 -0
- package/es/global/js/utils/devtools.js +17 -0
- package/es/global/js/utils/getBezierValues.js +19 -0
- package/es/global/js/utils/getFocusableElements.js +14 -0
- package/es/global/js/utils/getNumberOfHiddenSteps.js +19 -0
- package/es/global/js/utils/getScrollbarWidth.js +15 -0
- package/es/global/js/utils/keyboardNavigation.js +36 -0
- package/es/global/js/utils/lastIndexInArray.js +24 -0
- package/es/global/js/utils/motionConstants.js +44 -0
- package/es/global/js/utils/pconsole.js +34 -0
- package/es/global/js/utils/props-helper.js +256 -0
- package/es/global/js/utils/rangeWithCallback.js +14 -0
- package/es/global/js/utils/scrollableAncestor.js +38 -0
- package/es/global/js/utils/story-helper.js +108 -0
- package/es/global/js/utils/test-helper.js +309 -0
- package/es/global/js/utils/unwrap-if-fragment.js +63 -0
- package/es/global/js/utils/uuidv4.js +11 -0
- package/es/global/js/utils/uuidv4.spec.js +27 -0
- package/es/global/js/utils/wait.js +8 -0
- package/es/global/js/utils/wrapFocus.js +68 -0
- package/es/index.js +9 -0
- package/es/settings.js +79 -0
- package/lib/components/APIKeyModal/APIKeyDownloader.js +102 -0
- package/lib/components/APIKeyModal/APIKeyModal.js +519 -0
- package/lib/components/APIKeyModal/index.js +12 -0
- package/lib/components/AboutModal/AboutModal.js +201 -0
- package/lib/components/AboutModal/index.js +12 -0
- package/lib/components/ActionBar/ActionBar.js +264 -0
- package/lib/components/ActionBar/ActionBarItem.js +99 -0
- package/lib/components/ActionBar/ActionBarOverflowItems.js +86 -0
- package/lib/components/ActionBar/index.js +19 -0
- package/lib/components/ActionSet/ActionSet.js +205 -0
- package/lib/components/ActionSet/actions.js +64 -0
- package/lib/components/ActionSet/index.js +12 -0
- package/lib/components/AddSelect/AddSelect.js +138 -0
- package/lib/components/AddSelect/AddSelectBody.js +377 -0
- package/lib/components/AddSelect/AddSelectBreadcrumbs.js +53 -0
- package/lib/components/AddSelect/AddSelectColumn.js +250 -0
- package/lib/components/AddSelect/AddSelectFilter.js +181 -0
- package/lib/components/AddSelect/AddSelectFormControl.js +90 -0
- package/lib/components/AddSelect/AddSelectList.js +61 -0
- package/lib/components/AddSelect/AddSelectMetaPanel.js +76 -0
- package/lib/components/AddSelect/AddSelectRow.js +217 -0
- package/lib/components/AddSelect/AddSelectSidebar.js +127 -0
- package/lib/components/AddSelect/AddSelectSort.js +85 -0
- package/lib/components/AddSelect/add-select-utils.js +138 -0
- package/lib/components/AddSelect/hooks/useFocus.js +39 -0
- package/lib/components/AddSelect/hooks/useItemSort.js +33 -0
- package/lib/components/AddSelect/hooks/useParentSelect.js +28 -0
- package/lib/components/AddSelect/hooks/usePath.js +78 -0
- package/lib/components/AddSelect/index.js +12 -0
- package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +342 -0
- package/lib/components/BreadcrumbWithOverflow/index.js +12 -0
- package/lib/components/ButtonMenu/ButtonMenu.js +133 -0
- package/lib/components/ButtonMenu/ButtonMenuItem.js +42 -0
- package/lib/components/ButtonMenu/index.js +19 -0
- package/lib/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +220 -0
- package/lib/components/ButtonSetWithOverflow/index.js +12 -0
- package/lib/components/Card/Card.js +273 -0
- package/lib/components/Card/CardFooter.js +87 -0
- package/lib/components/Card/CardHeader.js +82 -0
- package/lib/components/Card/index.js +26 -0
- package/lib/components/Cascade/Cascade.js +89 -0
- package/lib/components/Cascade/index.js +12 -0
- package/lib/components/ComboButton/ComboButton.js +110 -0
- package/lib/components/ComboButton/ComboButtonItem/index.js +36 -0
- package/lib/components/ComboButton/index.js +19 -0
- package/lib/components/CreateFullPage/CreateFullPage.js +298 -0
- package/lib/components/CreateFullPage/CreateFullPageStep.js +176 -0
- package/lib/components/CreateFullPage/index.js +19 -0
- package/lib/components/CreateInfluencer/CreateInfluencer.js +100 -0
- package/lib/components/CreateInfluencer/index.js +12 -0
- package/lib/components/CreateModal/CreateModal.js +143 -0
- package/lib/components/CreateModal/index.js +12 -0
- package/lib/components/CreateSidePanel/CreateSidePanel.js +160 -0
- package/lib/components/CreateSidePanel/index.js +12 -0
- package/lib/components/CreateTearsheet/CreateTearsheet.js +320 -0
- package/lib/components/CreateTearsheet/CreateTearsheetDivider.js +43 -0
- package/lib/components/CreateTearsheet/CreateTearsheetStep.js +184 -0
- package/lib/components/CreateTearsheet/index.js +26 -0
- package/lib/components/CreateTearsheet/preview-components/MultiStepTearsheet.js +294 -0
- package/lib/components/CreateTearsheet/preview-components/MultiStepWithIntro.js +291 -0
- package/lib/components/CreateTearsheetNarrow/CreateTearsheetNarrow.js +170 -0
- package/lib/components/CreateTearsheetNarrow/index.js +12 -0
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +891 -0
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +560 -0
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +291 -0
- package/lib/components/DataSpreadsheet/hooks/index.js +54 -0
- package/lib/components/DataSpreadsheet/hooks/useMoveActiveCell.js +34 -0
- package/lib/components/DataSpreadsheet/hooks/useMultipleKeyTracking.js +127 -0
- package/lib/components/DataSpreadsheet/hooks/useResetSpreadsheetFocus.js +33 -0
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetEdit.js +110 -0
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetMouseMove.js +64 -0
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetMouseUp.js +170 -0
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetOutsideClick.js +47 -0
- package/lib/components/DataSpreadsheet/index.js +12 -0
- package/lib/components/DataSpreadsheet/utils/checkActiveHeaderCell.js +37 -0
- package/lib/components/DataSpreadsheet/utils/checkSelectedHeaderCell.js +36 -0
- package/lib/components/DataSpreadsheet/utils/createActiveCellFn.js +61 -0
- package/lib/components/DataSpreadsheet/utils/createCellSelectionArea.js +71 -0
- package/lib/components/DataSpreadsheet/utils/generateData.js +60 -0
- package/lib/components/DataSpreadsheet/utils/getCellSize.js +32 -0
- package/lib/components/DataSpreadsheet/utils/getSelectionAreaPoints.js +26 -0
- package/lib/components/DataSpreadsheet/utils/getSpreadsheetWidth.js +41 -0
- package/lib/components/DataSpreadsheet/utils/handleActiveCellInSelectionEnter.js +113 -0
- package/lib/components/DataSpreadsheet/utils/handleActiveCellInSelectionTab.js +105 -0
- package/lib/components/DataSpreadsheet/utils/handleCellDeletion.js +47 -0
- package/lib/components/DataSpreadsheet/utils/handleEditSubmit.js +85 -0
- package/lib/components/DataSpreadsheet/utils/handleHeaderCellSelection.js +166 -0
- package/lib/components/DataSpreadsheet/utils/handleMultipleKeys.js +267 -0
- package/lib/components/DataSpreadsheet/utils/moveColumnIndicatorLine.js +40 -0
- package/lib/components/DataSpreadsheet/utils/removeCellSelections.js +35 -0
- package/lib/components/DataSpreadsheet/utils/selectAllCells.js +55 -0
- package/lib/components/Datagrid/Datagrid/Datagrid.js +70 -0
- package/lib/components/Datagrid/Datagrid/DatagridBody.js +39 -0
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +192 -0
- package/lib/components/Datagrid/Datagrid/DatagridEmptyBody.js +49 -0
- package/lib/components/Datagrid/Datagrid/DatagridExpandedRow.js +40 -0
- package/lib/components/Datagrid/Datagrid/DatagridHead.js +30 -0
- package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +61 -0
- package/lib/components/Datagrid/Datagrid/DatagridRefBody.js +43 -0
- package/lib/components/Datagrid/Datagrid/DatagridRow.js +126 -0
- package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +72 -0
- package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +150 -0
- package/lib/components/Datagrid/Datagrid/DatagridSimpleBody.js +39 -0
- package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +153 -0
- package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +119 -0
- package/lib/components/Datagrid/Datagrid/DraggableElement.js +189 -0
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +50 -0
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +62 -0
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +125 -0
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +184 -0
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +117 -0
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/TearsheetWrapper.js +61 -0
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/common.js +21 -0
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/index.js +20 -0
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +255 -0
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +280 -0
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +96 -0
- package/lib/components/Datagrid/Datagrid/addons/Filtering/constants.js +45 -0
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/index.js +34 -0
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +309 -0
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useInitialStateFromFilters.js +30 -0
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useShouldDisableButtons.js +41 -0
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useSubscribeToEventEmitter.js +30 -0
- package/lib/components/Datagrid/Datagrid/addons/Filtering/index.js +33 -0
- package/lib/components/Datagrid/Datagrid/addons/Filtering/motion/variants.js +64 -0
- package/lib/components/Datagrid/Datagrid/addons/Filtering/utils.js +91 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +67 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/index.js +12 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +498 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/index.js +12 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +108 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/getCellIdAsObject.js +34 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/index.js +18 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/returnUpdatedActiveCell.js +40 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridFocus.js +25 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +234 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleMultipleKeys.js +87 -0
- package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +77 -0
- package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +116 -0
- package/lib/components/Datagrid/Datagrid/addons/RowSize/index.js +13 -0
- package/lib/components/Datagrid/Datagrid/index.js +12 -0
- package/lib/components/Datagrid/Datagrid.stories/CustomizeColumnStory.js +13 -0
- package/lib/components/Datagrid/Datagrid.stories/RowSizeDropdownStory.js +13 -0
- package/lib/components/Datagrid/Datagrid.stories/SelectAllWithToggleStory.js +13 -0
- package/lib/components/Datagrid/Datagrid.stories/StickyActionsColumnStory.js +103 -0
- package/lib/components/Datagrid/Datagrid.stories/common.js +200 -0
- package/lib/components/Datagrid/Datagrid.stories/index.js +34 -0
- package/lib/components/Datagrid/common-column-ids.js +16 -0
- package/lib/components/Datagrid/index.js +153 -0
- package/lib/components/Datagrid/useActionsColumn.js +150 -0
- package/lib/components/Datagrid/useColumnCenterAlign.js +51 -0
- package/lib/components/Datagrid/useColumnOrder.js +15 -0
- package/lib/components/Datagrid/useColumnRightAlign.js +51 -0
- package/lib/components/Datagrid/useCustomizeColumns.js +53 -0
- package/lib/components/Datagrid/useDatagrid.js +44 -0
- package/lib/components/Datagrid/useDefaultStringRenderer.js +49 -0
- package/lib/components/Datagrid/useDisableSelectRows.js +87 -0
- package/lib/components/Datagrid/useEditableCell.js +20 -0
- package/lib/components/Datagrid/useExpandedRow.js +52 -0
- package/lib/components/Datagrid/useFiltering.js +101 -0
- package/lib/components/Datagrid/useFlexResize.js +52 -0
- package/lib/components/Datagrid/useFloatingScroll.js +84 -0
- package/lib/components/Datagrid/useInfiniteScroll.js +61 -0
- package/lib/components/Datagrid/useInlineEdit.js +82 -0
- package/lib/components/Datagrid/useNestedRowExpander.js +50 -0
- package/lib/components/Datagrid/useNestedRows.js +66 -0
- package/lib/components/Datagrid/useOnRowClick.js +54 -0
- package/lib/components/Datagrid/useParentDimensions.js +66 -0
- package/lib/components/Datagrid/useResizeTable.js +42 -0
- package/lib/components/Datagrid/useRowExpander.js +50 -0
- package/lib/components/Datagrid/useRowIsMouseOver.js +58 -0
- package/lib/components/Datagrid/useRowRenderer.js +34 -0
- package/lib/components/Datagrid/useRowSize.js +61 -0
- package/lib/components/Datagrid/useSelectAllToggle.js +102 -0
- package/lib/components/Datagrid/useSelectRows.js +126 -0
- package/lib/components/Datagrid/useSkeletonRows.js +35 -0
- package/lib/components/Datagrid/useSortableColumns.js +121 -0
- package/lib/components/Datagrid/useStickyColumn.js +188 -0
- package/lib/components/Datagrid/utils/DatagridActions.js +250 -0
- package/lib/components/Datagrid/utils/DatagridPagination.js +40 -0
- package/lib/components/Datagrid/utils/Wrapper.js +29 -0
- package/lib/components/Datagrid/utils/getArgTypes.js +102 -0
- package/lib/components/Datagrid/utils/getAutoSizedColumnWidth.js +35 -0
- package/lib/components/Datagrid/utils/getInlineEditColumns.js +166 -0
- package/lib/components/Datagrid/utils/makeData.js +201 -0
- package/lib/components/EditFullPage/EditFullPage.js +89 -0
- package/lib/components/EditFullPage/index.js +12 -0
- package/lib/components/EditInPlace/EditInPlace.js +312 -0
- package/lib/components/EditInPlace/index.js +12 -0
- package/lib/components/EditSidePanel/EditSidePanel.js +193 -0
- package/lib/components/EditSidePanel/index.js +12 -0
- package/lib/components/EditTearsheet/EditTearsheet.js +207 -0
- package/lib/components/EditTearsheet/EditTearsheetForm.js +109 -0
- package/lib/components/EditTearsheet/index.js +19 -0
- package/lib/components/EditTearsheet/preview-components/MultiFormEditTearsheet.js +229 -0
- package/lib/components/EditTearsheetNarrow/EditTearsheetNarrow.js +89 -0
- package/lib/components/EditTearsheetNarrow/index.js +12 -0
- package/lib/components/EditUpdateCards/EditUpdateCards.js +146 -0
- package/lib/components/EditUpdateCards/index.js +12 -0
- package/lib/components/EmptyStates/EmptyState.js +122 -0
- package/lib/components/EmptyStates/EmptyStateContent.js +89 -0
- package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +116 -0
- package/lib/components/EmptyStates/ErrorEmptyState/index.js +12 -0
- package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +116 -0
- package/lib/components/EmptyStates/NoDataEmptyState/index.js +12 -0
- package/lib/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +116 -0
- package/lib/components/EmptyStates/NoTagsEmptyState/index.js +12 -0
- package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +116 -0
- package/lib/components/EmptyStates/NotFoundEmptyState/index.js +12 -0
- package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +116 -0
- package/lib/components/EmptyStates/NotificationsEmptyState/index.js +12 -0
- package/lib/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +116 -0
- package/lib/components/EmptyStates/UnauthorizedEmptyState/index.js +12 -0
- package/lib/components/EmptyStates/assets/ErrorIllustration.js +223 -0
- package/lib/components/EmptyStates/assets/NoDataIllustration.js +186 -0
- package/lib/components/EmptyStates/assets/NoTagsIllustration.js +494 -0
- package/lib/components/EmptyStates/assets/NotFoundIllustration.js +371 -0
- package/lib/components/EmptyStates/assets/NotificationsIllustration.js +342 -0
- package/lib/components/EmptyStates/assets/UnauthorizedIllustration.js +315 -0
- package/lib/components/EmptyStates/index.js +54 -0
- package/lib/components/ExampleComponent/ExampleComponent.js +188 -0
- package/lib/components/ExampleComponent/ExampleDeprecatedComponent.js +36 -0
- package/lib/components/ExampleComponent/index.js +12 -0
- package/lib/components/ExampleComponent/useExample.js +58 -0
- package/lib/components/ExportModal/ExportModal.js +287 -0
- package/lib/components/ExportModal/index.js +12 -0
- package/lib/components/ExpressiveCard/ExpressiveCard.js +125 -0
- package/lib/components/ExpressiveCard/index.js +12 -0
- package/lib/components/FilterSummary/FilterSummary.js +63 -0
- package/lib/components/FilterSummary/index.js +13 -0
- package/lib/components/HTTPErrors/HTTPError403/HTTPError403.js +90 -0
- package/lib/components/HTTPErrors/HTTPError403/index.js +12 -0
- package/lib/components/HTTPErrors/HTTPError404/HTTPError404.js +90 -0
- package/lib/components/HTTPErrors/HTTPError404/index.js +12 -0
- package/lib/components/HTTPErrors/HTTPErrorContent.js +83 -0
- package/lib/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +90 -0
- package/lib/components/HTTPErrors/HTTPErrorOther/index.js +12 -0
- package/lib/components/HTTPErrors/assets/HTTPErrorSvg403.js +1249 -0
- package/lib/components/HTTPErrors/assets/HTTPErrorSvg404.js +1048 -0
- package/lib/components/HTTPErrors/assets/HTTPErrorSvgOther.js +1099 -0
- package/lib/components/HTTPErrors/index.js +26 -0
- package/lib/components/ImportModal/ImportModal.js +392 -0
- package/lib/components/ImportModal/index.js +12 -0
- package/lib/components/MultiAddSelect/MultiAddSelect.js +159 -0
- package/lib/components/MultiAddSelect/index.js +12 -0
- package/lib/components/NotificationsPanel/NotificationsPanel.js +562 -0
- package/lib/components/NotificationsPanel/NotificationsPanel_data.js +143 -0
- package/lib/components/NotificationsPanel/index.js +12 -0
- package/lib/components/NotificationsPanel/preview-components/UnreadNotificationBell.js +55 -0
- package/lib/components/NotificationsPanel/utils.js +57 -0
- package/lib/components/OptionsTile/OptionsTile.js +334 -0
- package/lib/components/OptionsTile/index.js +12 -0
- package/lib/components/PageHeader/PageHeader.js +775 -0
- package/lib/components/PageHeader/PageHeaderDemo.data.js +620 -0
- package/lib/components/PageHeader/PageHeaderTitle.js +129 -0
- package/lib/components/PageHeader/PageHeaderUtils.js +188 -0
- package/lib/components/PageHeader/index.js +12 -0
- package/lib/components/ProductiveCard/ProductiveCard.js +132 -0
- package/lib/components/ProductiveCard/index.js +12 -0
- package/lib/components/RemoveModal/RemoveModal.js +192 -0
- package/lib/components/RemoveModal/index.js +12 -0
- package/lib/components/Saving/Saving.js +169 -0
- package/lib/components/Saving/index.js +12 -0
- package/lib/components/SidePanel/SidePanel.js +638 -0
- package/lib/components/SidePanel/constants.js +21 -0
- package/lib/components/SidePanel/index.js +12 -0
- package/lib/components/SidePanel/motion/variants.js +54 -0
- package/lib/components/SingleAddSelect/SingleAddSelect.js +105 -0
- package/lib/components/SingleAddSelect/index.js +12 -0
- package/lib/components/StatusIcon/StatusIcon.js +356 -0
- package/lib/components/StatusIcon/index.js +12 -0
- package/lib/components/TagSet/TagSet.js +335 -0
- package/lib/components/TagSet/TagSetModal.js +121 -0
- package/lib/components/TagSet/TagSetOverflow.js +132 -0
- package/lib/components/TagSet/constants.js +28 -0
- package/lib/components/TagSet/index.js +12 -0
- package/lib/components/Tearsheet/Tearsheet.js +196 -0
- package/lib/components/Tearsheet/TearsheetNarrow.js +158 -0
- package/lib/components/Tearsheet/TearsheetShell.js +416 -0
- package/lib/components/Tearsheet/index.js +19 -0
- package/lib/components/Toolbar/Toolbar.js +114 -0
- package/lib/components/Toolbar/ToolbarButton.js +68 -0
- package/lib/components/Toolbar/ToolbarGroup.js +44 -0
- package/lib/components/Toolbar/index.js +26 -0
- package/lib/components/UserProfileImage/UserProfileImage.js +180 -0
- package/lib/components/UserProfileImage/index.js +12 -0
- package/lib/components/WebTerminal/WebTerminal.js +212 -0
- package/lib/components/WebTerminal/WebTerminalContentWrapper.js +55 -0
- package/lib/components/WebTerminal/hooks/index.js +64 -0
- package/lib/components/WebTerminal/index.js +32 -0
- package/lib/components/WebTerminal/preview-components/Navigation.js +45 -0
- package/lib/components/WebTerminal/preview-components/documentationLinks.js +39 -0
- package/lib/components/WebTerminal/preview-components/index.js +13 -0
- package/lib/components/_Canary/Canary.js +51 -0
- package/lib/components/_Canary/index.js +12 -0
- package/lib/components/index.js +486 -0
- package/lib/global/js/hooks/index.js +88 -0
- package/lib/global/js/hooks/useActiveElement.js +33 -0
- package/lib/global/js/hooks/useClickOutside.js +28 -0
- package/lib/global/js/hooks/useControllableState.js +80 -0
- package/lib/global/js/hooks/useCreateComponentFocus.js +62 -0
- package/lib/global/js/hooks/useCreateComponentStepChange.js +211 -0
- package/lib/global/js/hooks/usePreviousValue.js +26 -0
- package/lib/global/js/hooks/useResetCreateComponent.js +54 -0
- package/lib/global/js/hooks/useResizeObserver.js +83 -0
- package/lib/global/js/hooks/useRetrieveStepData.js +55 -0
- package/lib/global/js/hooks/useValidCreateStepCount.js +27 -0
- package/lib/global/js/hooks/useWindowResize.js +73 -0
- package/lib/global/js/hooks/useWindowScroll.js +86 -0
- package/lib/global/js/package-settings.js +203 -0
- package/lib/global/js/utils/ClickListener.js +76 -0
- package/lib/global/js/utils/DisplayBox.js +40 -0
- package/lib/global/js/utils/Wrap.js +89 -0
- package/lib/global/js/utils/deepCloneObject.js +31 -0
- package/lib/global/js/utils/devtools.js +26 -0
- package/lib/global/js/utils/getBezierValues.js +25 -0
- package/lib/global/js/utils/getFocusableElements.js +22 -0
- package/lib/global/js/utils/getNumberOfHiddenSteps.js +26 -0
- package/lib/global/js/utils/getScrollbarWidth.js +22 -0
- package/lib/global/js/utils/keyboardNavigation.js +46 -0
- package/lib/global/js/utils/lastIndexInArray.js +31 -0
- package/lib/global/js/utils/motionConstants.js +51 -0
- package/lib/global/js/utils/pconsole.js +47 -0
- package/lib/global/js/utils/props-helper.js +267 -0
- package/lib/global/js/utils/rangeWithCallback.js +21 -0
- package/lib/global/js/utils/scrollableAncestor.js +46 -0
- package/lib/global/js/utils/story-helper.js +120 -0
- package/lib/global/js/utils/test-helper.js +329 -0
- package/lib/global/js/utils/unwrap-if-fragment.js +70 -0
- package/lib/global/js/utils/uuidv4.js +18 -0
- package/lib/global/js/utils/uuidv4.spec.js +30 -0
- package/lib/global/js/utils/wait.js +15 -0
- package/lib/global/js/utils/wrapFocus.js +74 -0
- package/lib/index.js +27 -0
- package/lib/settings.js +88 -0
- package/package.json +3 -2
- package/scss/components/APIKeyModal/_api-key-modal.scss +52 -0
- package/scss/components/APIKeyModal/_carbon-imports.scss +15 -0
- package/scss/components/APIKeyModal/_index-with-carbon.scss +9 -0
- package/scss/components/APIKeyModal/_index.scss +10 -0
- package/scss/components/APIKeyModal/_storybook-styles.scss +35 -0
- package/scss/components/AboutModal/_about-modal.scss +95 -0
- package/scss/components/AboutModal/_carbon-imports.scss +11 -0
- package/scss/components/AboutModal/_index-with-carbon.scss +9 -0
- package/scss/components/AboutModal/_index.scss +8 -0
- package/scss/components/AboutModal/_storybook-styles.scss +29 -0
- package/scss/components/ActionBar/_action-bar.scss +51 -0
- package/scss/components/ActionBar/_carbon-imports.scss +11 -0
- package/scss/components/ActionBar/_index-with-carbon.scss +9 -0
- package/scss/components/ActionBar/_index.scss +8 -0
- package/scss/components/ActionBar/_storybook-styles.scss +8 -0
- package/scss/components/ActionSet/_action-set.scss +126 -0
- package/scss/components/ActionSet/_carbon-imports.scss +11 -0
- package/scss/components/ActionSet/_index-with-carbon.scss +9 -0
- package/scss/components/ActionSet/_index.scss +8 -0
- package/scss/components/ActionSet/_storybook-styles.scss +36 -0
- package/scss/components/AddSelect/_add-select.scss +462 -0
- package/scss/components/AddSelect/_carbon-imports.scss +19 -0
- package/scss/components/AddSelect/_index-with-carbon.scss +9 -0
- package/scss/components/AddSelect/_index.scss +10 -0
- package/scss/components/AddSelect/_storybook-styles.scss +6 -0
- package/scss/components/BreadcrumbWithOverflow/_breadcrumb-with-overflow.scss +97 -0
- package/scss/components/BreadcrumbWithOverflow/_carbon-imports.scss +12 -0
- package/scss/components/BreadcrumbWithOverflow/_index-with-carbon.scss +9 -0
- package/scss/components/BreadcrumbWithOverflow/_index.scss +8 -0
- package/scss/components/BreadcrumbWithOverflow/_storybook-styles.scss +8 -0
- package/scss/components/ButtonMenu/_button-menu.scss +29 -0
- package/scss/components/ButtonMenu/_carbon-imports.scss +9 -0
- package/scss/components/ButtonMenu/_index-with-carbon.scss +9 -0
- package/scss/components/ButtonMenu/_index.scss +8 -0
- package/scss/components/ButtonMenu/_storybook-styles.scss +6 -0
- package/scss/components/ButtonSetWithOverflow/_button-set-with-overflow.scss +42 -0
- package/scss/components/ButtonSetWithOverflow/_carbon-imports.scss +10 -0
- package/scss/components/ButtonSetWithOverflow/_index-with-carbon.scss +9 -0
- package/scss/components/ButtonSetWithOverflow/_index.scss +8 -0
- package/scss/components/ButtonSetWithOverflow/_storybook-styles.scss +8 -0
- package/scss/components/Card/_carbon-imports.scss +11 -0
- package/scss/components/Card/_card.scss +123 -0
- package/scss/components/Card/_index-with-carbon.scss +9 -0
- package/scss/components/Card/_index.scss +8 -0
- package/scss/components/Card/_storybook-styles.scss +12 -0
- package/scss/components/Cascade/_carbon-imports.scss +6 -0
- package/scss/components/Cascade/_cascade.scss +47 -0
- package/scss/components/Cascade/_index-with-carbon.scss +9 -0
- package/scss/components/Cascade/_index.scss +10 -0
- package/scss/components/Cascade/_storybook-styles.scss +33 -0
- package/scss/components/ComboButton/_carbon-imports.scss +11 -0
- package/scss/components/ComboButton/_combo-button.scss +76 -0
- package/scss/components/ComboButton/_index-with-carbon.scss +9 -0
- package/scss/components/ComboButton/_index.scss +10 -0
- package/scss/components/CreateFullPage/_carbon-imports.scss +17 -0
- package/scss/components/CreateFullPage/_create-full-page.scss +169 -0
- package/scss/components/CreateFullPage/_index-with-carbon.scss +9 -0
- package/scss/components/CreateFullPage/_index.scss +8 -0
- package/scss/components/CreateFullPage/_storybook-styles.scss +67 -0
- package/scss/components/CreateInfluencer/_carbon-imports.scss +10 -0
- package/scss/components/CreateInfluencer/_create-influencer.scss +86 -0
- package/scss/components/CreateInfluencer/_index-with-carbon.scss +9 -0
- package/scss/components/CreateInfluencer/_index.scss +8 -0
- package/scss/components/CreateModal/_carbon-imports.scss +12 -0
- package/scss/components/CreateModal/_create-modal.scss +81 -0
- package/scss/components/CreateModal/_index-with-carbon.scss +9 -0
- package/scss/components/CreateModal/_index.scss +8 -0
- package/scss/components/CreateModal/_storybook-styles.scss +54 -0
- package/scss/components/CreateSidePanel/_carbon-imports.scss +10 -0
- package/scss/components/CreateSidePanel/_create-side-panel.scss +93 -0
- package/scss/components/CreateSidePanel/_index-with-carbon.scss +9 -0
- package/scss/components/CreateSidePanel/_index.scss +8 -0
- package/scss/components/CreateSidePanel/_storybook-styles.scss +29 -0
- package/scss/components/CreateTearsheet/_carbon-imports.scss +10 -0
- package/scss/components/CreateTearsheet/_create-tearsheet.scss +158 -0
- package/scss/components/CreateTearsheet/_index-with-carbon.scss +9 -0
- package/scss/components/CreateTearsheet/_index.scss +8 -0
- package/scss/components/CreateTearsheet/_storybook-styles.scss +56 -0
- package/scss/components/CreateTearsheetNarrow/_carbon-imports.scss +10 -0
- package/scss/components/CreateTearsheetNarrow/_create-tearsheet-narrow.scss +61 -0
- package/scss/components/CreateTearsheetNarrow/_index-with-carbon.scss +9 -0
- package/scss/components/CreateTearsheetNarrow/_index.scss +8 -0
- package/scss/components/CreateTearsheetNarrow/_storybook-styles.scss +27 -0
- package/scss/components/DataSpreadsheet/_carbon-imports.scss +6 -0
- package/scss/components/DataSpreadsheet/_data-spreadsheet.scss +294 -0
- package/scss/components/DataSpreadsheet/_index-with-carbon.scss +9 -0
- package/scss/components/DataSpreadsheet/_index.scss +8 -0
- package/scss/components/DataSpreadsheet/_storybook-styles.scss +6 -0
- package/scss/components/Datagrid/_carbon-imports.scss +6 -0
- package/scss/components/Datagrid/_datagrid.scss +63 -0
- package/scss/components/Datagrid/_index-with-carbon.scss +9 -0
- package/scss/components/Datagrid/_index.scss +8 -0
- package/scss/components/Datagrid/_storybook-styles.scss +116 -0
- package/scss/components/Datagrid/styles/_datagrid.scss +634 -0
- package/scss/components/Datagrid/styles/_draggableElement.scss +92 -0
- package/scss/components/Datagrid/styles/_index.scss +22 -0
- package/scss/components/Datagrid/styles/_useActionsColumn.scss +39 -0
- package/scss/components/Datagrid/styles/_useColumnCenterAlign.scss +20 -0
- package/scss/components/Datagrid/styles/_useColumnRightAlign.scss +29 -0
- package/scss/components/Datagrid/styles/_useExpandedRow.scss +60 -0
- package/scss/components/Datagrid/styles/_useInlineEdit.scss +431 -0
- package/scss/components/Datagrid/styles/_useNestedRows.scss +71 -0
- package/scss/components/Datagrid/styles/_useNestedTable.scss +34 -0
- package/scss/components/Datagrid/styles/_useSelectAllToggle.scss +37 -0
- package/scss/components/Datagrid/styles/_useSortableColumns.scss +79 -0
- package/scss/components/Datagrid/styles/_useStickyColumn.scss +68 -0
- package/scss/components/Datagrid/styles/_variables.scss +10 -0
- package/scss/components/Datagrid/styles/addons/_CustomizeColumnsTearsheet.scss +82 -0
- package/scss/components/Datagrid/styles/addons/_FilterFlyout.scss +87 -0
- package/scss/components/Datagrid/styles/addons/_FilterPanel.scss +129 -0
- package/scss/components/Datagrid/styles/addons/_RowSizeDropdown.scss +45 -0
- package/scss/components/EditFullPage/_edit-full-page.scss +26 -0
- package/scss/components/EditFullPage/_index.scss +8 -0
- package/scss/components/EditFullPage/_storybook-styles.scss +10 -0
- package/scss/components/EditInPlace/_carbon-imports.scss +9 -0
- package/scss/components/EditInPlace/_edit-in-place.scss +164 -0
- package/scss/components/EditInPlace/_index-with-carbon.scss +9 -0
- package/scss/components/EditInPlace/_index.scss +10 -0
- package/scss/components/EditInPlace/_storybook-styles.scss +15 -0
- package/scss/components/EditSidePanel/_carbon-imports.scss +9 -0
- package/scss/components/EditSidePanel/_edit-side-panel.scss +66 -0
- package/scss/components/EditSidePanel/_index-with-carbon.scss +9 -0
- package/scss/components/EditSidePanel/_index.scss +8 -0
- package/scss/components/EditSidePanel/_storybook-styles.scss +29 -0
- package/scss/components/EditTearsheet/_edit-tearsheet.scss +136 -0
- package/scss/components/EditTearsheet/_index.scss +8 -0
- package/scss/components/EditTearsheet/_storybook-styles.scss +59 -0
- package/scss/components/EditTearsheetNarrow/_edit-tearsheet-narrow.scss +26 -0
- package/scss/components/EditTearsheetNarrow/_index.scss +8 -0
- package/scss/components/EditTearsheetNarrow/_storybook-styles.scss +10 -0
- package/scss/components/EditUpdateCards/_carbon-imports.scss +9 -0
- package/scss/components/EditUpdateCards/_edit-update-cards.scss +85 -0
- package/scss/components/EditUpdateCards/_index-with-carbon.scss +9 -0
- package/scss/components/EditUpdateCards/_index.scss +8 -0
- package/scss/components/EditUpdateCards/_storybook-styles.scss +55 -0
- package/scss/components/EmptyStates/_carbon-imports.scss +11 -0
- package/scss/components/EmptyStates/_empty-state.scss +82 -0
- package/scss/components/EmptyStates/_index-with-carbon.scss +9 -0
- package/scss/components/EmptyStates/_index.scss +8 -0
- package/scss/components/EmptyStates/_storybook-styles.scss +6 -0
- package/scss/components/ExampleComponent/_carbon-imports.scss +10 -0
- package/scss/components/ExampleComponent/_example-component.scss +28 -0
- package/scss/components/ExampleComponent/_index-with-carbon.scss +9 -0
- package/scss/components/ExampleComponent/_index.scss +8 -0
- package/scss/components/ExampleComponent/_storybook-styles.scss +6 -0
- package/scss/components/ExportModal/_carbon-imports.scss +16 -0
- package/scss/components/ExportModal/_export-modal.scss +46 -0
- package/scss/components/ExportModal/_index-with-carbon.scss +9 -0
- package/scss/components/ExportModal/_index.scss +10 -0
- package/scss/components/ExportModal/_storybook-styles.scss +6 -0
- package/scss/components/ExpressiveCard/_carbon-imports.scss +6 -0
- package/scss/components/ExpressiveCard/_expressive-card.scss +18 -0
- package/scss/components/ExpressiveCard/_index-with-carbon.scss +9 -0
- package/scss/components/ExpressiveCard/_index.scss +10 -0
- package/scss/components/ExpressiveCard/_storybook-styles.scss +26 -0
- package/scss/components/FilterSummary/_filter-summary.scss +21 -0
- package/scss/components/FilterSummary/_index.scss +10 -0
- package/scss/components/FilterSummary/_storybook-styles.scss +14 -0
- package/scss/components/HTTPErrors/_carbon-imports.scss +10 -0
- package/scss/components/HTTPErrors/_http-errors.scss +68 -0
- package/scss/components/HTTPErrors/_index-with-carbon.scss +9 -0
- package/scss/components/HTTPErrors/_index.scss +8 -0
- package/scss/components/HTTPErrors/_storybook-styles.scss +6 -0
- package/scss/components/ImportModal/_carbon-imports.scss +14 -0
- package/scss/components/ImportModal/_import-modal.scss +83 -0
- package/scss/components/ImportModal/_index-with-carbon.scss +9 -0
- package/scss/components/ImportModal/_index.scss +8 -0
- package/scss/components/ImportModal/_storybook-styles.scss +6 -0
- package/scss/components/MultiAddSelect/_carbon-imports.scss +6 -0
- package/scss/components/MultiAddSelect/_index-with-carbon.scss +9 -0
- package/scss/components/MultiAddSelect/_index.scss +8 -0
- package/scss/components/MultiAddSelect/_multi-add-select.scss +8 -0
- package/scss/components/MultiAddSelect/_storybook-styles.scss +6 -0
- package/scss/components/NotificationsPanel/_carbon-imports.scss +12 -0
- package/scss/components/NotificationsPanel/_index-with-carbon.scss +9 -0
- package/scss/components/NotificationsPanel/_index.scss +8 -0
- package/scss/components/NotificationsPanel/_notifications-panel.scss +294 -0
- package/scss/components/NotificationsPanel/_storybook-styles.scss +15 -0
- package/scss/components/OptionsTile/_carbon-imports.scss +10 -0
- package/scss/components/OptionsTile/_index-with-carbon.scss +9 -0
- package/scss/components/OptionsTile/_index.scss +8 -0
- package/scss/components/OptionsTile/_options-tile.scss +230 -0
- package/scss/components/OptionsTile/_storybook-styles.scss +29 -0
- package/scss/components/PageHeader/_carbon-imports.scss +13 -0
- package/scss/components/PageHeader/_index-with-carbon.scss +9 -0
- package/scss/components/PageHeader/_index.scss +10 -0
- package/scss/components/PageHeader/_page-header.scss +654 -0
- package/scss/components/PageHeader/_storybook-styles.scss +80 -0
- package/scss/components/ProductiveCard/_carbon-imports.scss +6 -0
- package/scss/components/ProductiveCard/_index-with-carbon.scss +9 -0
- package/scss/components/ProductiveCard/_index.scss +10 -0
- package/scss/components/ProductiveCard/_productive-card.scss +95 -0
- package/scss/components/ProductiveCard/_storybook-styles.scss +23 -0
- package/scss/components/RemoveModal/_carbon-imports.scss +12 -0
- package/scss/components/RemoveModal/_index-with-carbon.scss +9 -0
- package/scss/components/RemoveModal/_index.scss +10 -0
- package/scss/components/RemoveModal/_remove-modal.scss +27 -0
- package/scss/components/RemoveModal/_storybook-styles.scss +6 -0
- package/scss/components/Saving/_carbon-imports.scss +11 -0
- package/scss/components/Saving/_index-with-carbon.scss +9 -0
- package/scss/components/Saving/_index.scss +10 -0
- package/scss/components/Saving/_saving.scss +34 -0
- package/scss/components/Saving/_storybook-styles.scss +12 -0
- package/scss/components/SidePanel/_carbon-imports.scss +10 -0
- package/scss/components/SidePanel/_index-with-carbon.scss +9 -0
- package/scss/components/SidePanel/_index.scss +8 -0
- package/scss/components/SidePanel/_side-panel-variables.scss +14 -0
- package/scss/components/SidePanel/_side-panel.scss +450 -0
- package/scss/components/SidePanel/_storybook-styles.scss +45 -0
- package/scss/components/SingleAddSelect/_carbon-imports.scss +6 -0
- package/scss/components/SingleAddSelect/_index-with-carbon.scss +9 -0
- package/scss/components/SingleAddSelect/_index.scss +8 -0
- package/scss/components/SingleAddSelect/_single-add-select.scss +8 -0
- package/scss/components/SingleAddSelect/_storybook-styles.scss +6 -0
- package/scss/components/StatusIcon/_carbon-imports.scss +6 -0
- package/scss/components/StatusIcon/_index-with-carbon.scss +9 -0
- package/scss/components/StatusIcon/_index.scss +8 -0
- package/scss/components/StatusIcon/_status-icon.scss +145 -0
- package/scss/components/StatusIcon/_storybook-styles.scss +6 -0
- package/scss/components/TagSet/_carbon-imports.scss +14 -0
- package/scss/components/TagSet/_index-with-carbon.scss +9 -0
- package/scss/components/TagSet/_index.scss +8 -0
- package/scss/components/TagSet/_storybook-styles.scss +8 -0
- package/scss/components/TagSet/_tag-set.scss +180 -0
- package/scss/components/Tearsheet/_carbon-imports.scss +11 -0
- package/scss/components/Tearsheet/_index-with-carbon.scss +9 -0
- package/scss/components/Tearsheet/_index.scss +8 -0
- package/scss/components/Tearsheet/_storybook-styles.scss +25 -0
- package/scss/components/Tearsheet/_tearsheet.scss +336 -0
- package/scss/components/Toolbar/_carbon-imports.scss +8 -0
- package/scss/components/Toolbar/_index-with-carbon.scss +9 -0
- package/scss/components/Toolbar/_index.scss +8 -0
- package/scss/components/Toolbar/_toolbar.scss +75 -0
- package/scss/components/UserProfileImage/_carbon-imports.scss +10 -0
- package/scss/components/UserProfileImage/_color-map.scss +39 -0
- package/scss/components/UserProfileImage/_index-with-carbon.scss +9 -0
- package/scss/components/UserProfileImage/_index.scss +8 -0
- package/scss/components/UserProfileImage/_storybook.scss +6 -0
- package/scss/components/UserProfileImage/_user-profile-image.scss +155 -0
- package/scss/components/WebTerminal/_carbon-imports.scss +12 -0
- package/scss/components/WebTerminal/_index-with-carbon.scss +9 -0
- package/scss/components/WebTerminal/_index.scss +8 -0
- package/scss/components/WebTerminal/_storybook-styles.scss +36 -0
- package/scss/components/WebTerminal/_web-terminal.scss +94 -0
- package/scss/components/_Canary/_canary.scss +7 -0
- package/scss/components/_index-released-only-with-carbon.scss +37 -0
- package/scss/components/_index-released-only.scss +38 -0
- package/scss/components/_index-with-carbon.scss +47 -0
- package/scss/components/_index.scss +51 -0
- package/scss/config.scss +1 -0
- package/scss/global/styles/_display-box.scss +66 -0
- package/scss/global/styles/_imported-carbon-modules.scss +25 -0
- package/scss/global/styles/_mixins.scss +22 -0
- package/scss/global/styles/_project-settings.scss +10 -0
- package/scss/index-full-carbon.scss +10 -0
- package/scss/index-without-carbon-released-only.scss +12 -0
- package/scss/index-without-carbon.scss +12 -0
- package/scss/index.scss +10 -0
@@ -0,0 +1,883 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import _typeof from "@babel/runtime/helpers/typeof";
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
4
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
5
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
6
|
+
var _excluded = ["cellSize", "className", "columns", "data", "defaultEmptyRowCount", "onDataUpdate", "id", "onActiveCellChange", "onSelectionAreaChange", "selectAllAriaLabel", "spreadsheetAriaLabel", "theme", "totalVisibleColumns"];
|
7
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
8
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
9
|
+
/**
|
10
|
+
* Copyright IBM Corp. 2022, 2022
|
11
|
+
*
|
12
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
13
|
+
* LICENSE file in the root directory of this source tree.
|
14
|
+
*/
|
15
|
+
|
16
|
+
// Import portions of React that are needed.
|
17
|
+
import React, { useMemo, useRef, useState, useCallback, useEffect } from 'react';
|
18
|
+
import { useBlockLayout, useTable, useColumnOrder } from 'react-table';
|
19
|
+
|
20
|
+
// Other standard imports.
|
21
|
+
import PropTypes from 'prop-types';
|
22
|
+
import cx from 'classnames';
|
23
|
+
import { pkg } from '../../settings';
|
24
|
+
import { DataSpreadsheetBody } from './DataSpreadsheetBody';
|
25
|
+
import { DataSpreadsheetHeader } from './DataSpreadsheetHeader';
|
26
|
+
import { getDevtoolsProps } from '../../global/js/utils/devtools';
|
27
|
+
import { getScrollbarWidth } from '../../global/js/utils/getScrollbarWidth';
|
28
|
+
import { useActiveElement, usePreviousValue } from '../../global/js/hooks';
|
29
|
+
import uuidv4 from '../../global/js/utils/uuidv4';
|
30
|
+
import { deepCloneObject } from '../../global/js/utils/deepCloneObject';
|
31
|
+
import { useResetSpreadsheetFocus, useSpreadsheetOutsideClick, useMoveActiveCell, useMultipleKeyTracking, useSpreadsheetEdit } from './hooks';
|
32
|
+
import { createActiveCellFn } from './utils/createActiveCellFn';
|
33
|
+
import { getCellSize } from './utils/getCellSize';
|
34
|
+
import { handleMultipleKeys, includesResourceKey, includesShift } from './utils/handleMultipleKeys';
|
35
|
+
import { handleHeaderCellSelection } from './utils/handleHeaderCellSelection';
|
36
|
+
import { removeCellSelections } from './utils/removeCellSelections';
|
37
|
+
import { selectAllCells } from './utils/selectAllCells';
|
38
|
+
import { handleEditSubmit } from './utils/handleEditSubmit';
|
39
|
+
import { handleActiveCellInSelectionEnter } from './utils/handleActiveCellInSelectionEnter';
|
40
|
+
import { handleActiveCellInSelectionTab } from './utils/handleActiveCellInSelectionTab';
|
41
|
+
import { handleCellDeletion } from './utils/handleCellDeletion';
|
42
|
+
// cspell:words rowcount colcount
|
43
|
+
|
44
|
+
// The block part of our conventional BEM class names (blockClass__E--M).
|
45
|
+
var blockClass = "".concat(pkg.prefix, "--data-spreadsheet");
|
46
|
+
var componentName = 'DataSpreadsheet';
|
47
|
+
|
48
|
+
// Default values for props
|
49
|
+
var defaults = {
|
50
|
+
cellSize: 'sm',
|
51
|
+
columns: Object.freeze([]),
|
52
|
+
data: Object.freeze([]),
|
53
|
+
defaultEmptyRowCount: 16,
|
54
|
+
onDataUpdate: Object.freeze(function () {}),
|
55
|
+
onActiveCellChange: Object.freeze(function () {}),
|
56
|
+
onSelectionAreaChange: Object.freeze(function () {}),
|
57
|
+
theme: 'light'
|
58
|
+
};
|
59
|
+
|
60
|
+
/**
|
61
|
+
* DataSpreadsheet: used to organize and display large amounts of structured data, separated by columns and rows in a grid-like format.
|
62
|
+
*/
|
63
|
+
export var DataSpreadsheet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
64
|
+
var _cx;
|
65
|
+
var _ref$cellSize = _ref.cellSize,
|
66
|
+
cellSize = _ref$cellSize === void 0 ? defaults.cellSize : _ref$cellSize,
|
67
|
+
className = _ref.className,
|
68
|
+
_ref$columns = _ref.columns,
|
69
|
+
columns = _ref$columns === void 0 ? defaults.columns : _ref$columns,
|
70
|
+
_ref$data = _ref.data,
|
71
|
+
data = _ref$data === void 0 ? defaults.data : _ref$data,
|
72
|
+
_ref$defaultEmptyRowC = _ref.defaultEmptyRowCount,
|
73
|
+
defaultEmptyRowCount = _ref$defaultEmptyRowC === void 0 ? defaults.defaultEmptyRowCount : _ref$defaultEmptyRowC,
|
74
|
+
_ref$onDataUpdate = _ref.onDataUpdate,
|
75
|
+
onDataUpdate = _ref$onDataUpdate === void 0 ? defaults.onDataUpdate : _ref$onDataUpdate,
|
76
|
+
id = _ref.id,
|
77
|
+
_ref$onActiveCellChan = _ref.onActiveCellChange,
|
78
|
+
onActiveCellChange = _ref$onActiveCellChan === void 0 ? defaults.onActiveCellChange : _ref$onActiveCellChan,
|
79
|
+
_ref$onSelectionAreaC = _ref.onSelectionAreaChange,
|
80
|
+
onSelectionAreaChange = _ref$onSelectionAreaC === void 0 ? defaults.onSelectionAreaChange : _ref$onSelectionAreaC,
|
81
|
+
selectAllAriaLabel = _ref.selectAllAriaLabel,
|
82
|
+
spreadsheetAriaLabel = _ref.spreadsheetAriaLabel,
|
83
|
+
theme = _ref.theme,
|
84
|
+
totalVisibleColumns = _ref.totalVisibleColumns,
|
85
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
86
|
+
var multiKeyTrackingRef = useRef();
|
87
|
+
var localRef = useRef();
|
88
|
+
var spreadsheetRef = ref || localRef;
|
89
|
+
var focusedElement = useActiveElement();
|
90
|
+
var _useState = useState(false),
|
91
|
+
_useState2 = _slicedToArray(_useState, 2),
|
92
|
+
containerHasFocus = _useState2[0],
|
93
|
+
setContainerHasFocus = _useState2[1];
|
94
|
+
var _useState3 = useState(null),
|
95
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
96
|
+
activeCellCoordinates = _useState4[0],
|
97
|
+
setActiveCellCoordinates = _useState4[1];
|
98
|
+
var _useState5 = useState([]),
|
99
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
100
|
+
selectionAreas = _useState6[0],
|
101
|
+
setSelectionAreas = _useState6[1];
|
102
|
+
var _useState7 = useState([]),
|
103
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
104
|
+
selectionAreaData = _useState8[0],
|
105
|
+
setSelectionAreaData = _useState8[1];
|
106
|
+
var _useState9 = useState(false),
|
107
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
108
|
+
clickAndHoldActive = _useState10[0],
|
109
|
+
setClickAndHoldActive = _useState10[1];
|
110
|
+
var _useState11 = useState(''),
|
111
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
112
|
+
currentMatcher = _useState12[0],
|
113
|
+
setCurrentMatcher = _useState12[1];
|
114
|
+
var _useState13 = useState(false),
|
115
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
116
|
+
isEditing = _useState14[0],
|
117
|
+
setIsEditing = _useState14[1];
|
118
|
+
var _useState15 = useState(''),
|
119
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
120
|
+
cellEditorValue = _useState16[0],
|
121
|
+
setCellEditorValue = _useState16[1];
|
122
|
+
var _useState17 = useState(false),
|
123
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
124
|
+
headerCellHoldActive = _useState18[0],
|
125
|
+
setHeaderCellHoldActive = _useState18[1];
|
126
|
+
var _useState19 = useState(false),
|
127
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
128
|
+
activeCellInsideSelectionArea = _useState20[0],
|
129
|
+
setActiveCellInsideSelectionArea = _useState20[1];
|
130
|
+
var previousState = usePreviousValue({
|
131
|
+
activeCellCoordinates: activeCellCoordinates,
|
132
|
+
isEditing: isEditing
|
133
|
+
});
|
134
|
+
var cellSizeValue = getCellSize(cellSize);
|
135
|
+
var cellEditorRef = useRef();
|
136
|
+
var _useState21 = useState(),
|
137
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
138
|
+
activeCellContent = _useState22[0],
|
139
|
+
setActiveCellContent = _useState22[1];
|
140
|
+
var activeCellRef = useRef();
|
141
|
+
var cellEditorRulerRef = useRef();
|
142
|
+
var defaultColumn = useMemo(function () {
|
143
|
+
return {
|
144
|
+
width: 150,
|
145
|
+
rowHeaderWidth: 64,
|
146
|
+
rowHeight: cellSizeValue
|
147
|
+
};
|
148
|
+
}, [cellSizeValue]);
|
149
|
+
var _useMultipleKeyTracki = useMultipleKeyTracking({
|
150
|
+
ref: multiKeyTrackingRef,
|
151
|
+
containerHasFocus: containerHasFocus,
|
152
|
+
isEditing: isEditing
|
153
|
+
}),
|
154
|
+
keysPressedList = _useMultipleKeyTracki.keysPressedList,
|
155
|
+
usingMac = _useMultipleKeyTracki.usingMac;
|
156
|
+
var scrollBarSize = useMemo(function () {
|
157
|
+
return getScrollbarWidth();
|
158
|
+
}, []);
|
159
|
+
var _useTable = useTable({
|
160
|
+
columns: columns,
|
161
|
+
data: data,
|
162
|
+
defaultColumn: defaultColumn
|
163
|
+
}, useBlockLayout, useColumnOrder),
|
164
|
+
getTableProps = _useTable.getTableProps,
|
165
|
+
getTableBodyProps = _useTable.getTableBodyProps,
|
166
|
+
headerGroups = _useTable.headerGroups,
|
167
|
+
rows = _useTable.rows,
|
168
|
+
totalColumnsWidth = _useTable.totalColumnsWidth,
|
169
|
+
prepareRow = _useTable.prepareRow,
|
170
|
+
setColumnOrder = _useTable.setColumnOrder,
|
171
|
+
visibleColumns = _useTable.visibleColumns;
|
172
|
+
|
173
|
+
// Update the spreadsheet data after editing a cell
|
174
|
+
var updateData = useCallback(function (rowIndex, columnId, newValue) {
|
175
|
+
onDataUpdate(function (prev) {
|
176
|
+
return prev.map(function (row, index) {
|
177
|
+
if (index === rowIndex) {
|
178
|
+
return _objectSpread(_objectSpread({}, prev[rowIndex]), {}, _defineProperty({}, columnId, cellEditorValue || newValue));
|
179
|
+
}
|
180
|
+
return row;
|
181
|
+
});
|
182
|
+
});
|
183
|
+
}, [cellEditorValue, onDataUpdate]);
|
184
|
+
|
185
|
+
// Removes the active cell element
|
186
|
+
var removeActiveCell = useCallback(function () {
|
187
|
+
var activeCellHighlight = spreadsheetRef.current.querySelector(".".concat(blockClass, "__active-cell--highlight"));
|
188
|
+
activeCellHighlight.style.display = 'none';
|
189
|
+
}, [spreadsheetRef]);
|
190
|
+
var removeCellEditor = useCallback(function () {
|
191
|
+
setCellEditorValue('');
|
192
|
+
setIsEditing(false);
|
193
|
+
cellEditorRef.current.style.display = 'none';
|
194
|
+
}, []);
|
195
|
+
|
196
|
+
// Remove cell editor if the active cell coordinates change and save with new cell data, this will
|
197
|
+
// happen if you click on another cell while isEditing is true
|
198
|
+
useEffect(function () {
|
199
|
+
var prevCoords = previousState === null || previousState === void 0 ? void 0 : previousState.activeCellCoordinates;
|
200
|
+
if (((prevCoords === null || prevCoords === void 0 ? void 0 : prevCoords.row) !== (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) || (prevCoords === null || prevCoords === void 0 ? void 0 : prevCoords.column) !== (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column)) && isEditing) {
|
201
|
+
var cellProps = rows[prevCoords === null || prevCoords === void 0 ? void 0 : prevCoords.row].cells[prevCoords === null || prevCoords === void 0 ? void 0 : prevCoords.column];
|
202
|
+
removeCellEditor();
|
203
|
+
updateData(prevCoords === null || prevCoords === void 0 ? void 0 : prevCoords.row, cellProps.column.id);
|
204
|
+
cellEditorRulerRef.current.textContent = '';
|
205
|
+
}
|
206
|
+
if ((prevCoords === null || prevCoords === void 0 ? void 0 : prevCoords.row) !== (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) || (prevCoords === null || prevCoords === void 0 ? void 0 : prevCoords.column) !== (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column)) {
|
207
|
+
if (activeCellCoordinates && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) !== 'header' && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) !== 'header') {
|
208
|
+
var activeCellFullData = typeof (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'number' && typeof (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'number' ? rows[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row].cells[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column] : null;
|
209
|
+
setActiveCellContent(activeCellFullData.render('Cell'));
|
210
|
+
}
|
211
|
+
if (activeCellCoordinates && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'header' || (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'header') {
|
212
|
+
setActiveCellContent(null);
|
213
|
+
}
|
214
|
+
}
|
215
|
+
}, [activeCellCoordinates, previousState === null || previousState === void 0 ? void 0 : previousState.activeCellCoordinates, updateData, rows, isEditing, removeCellEditor, activeCellContent]);
|
216
|
+
var createActiveCell = useCallback(function (_ref2) {
|
217
|
+
var placementElement = _ref2.placementElement,
|
218
|
+
coords = _ref2.coords,
|
219
|
+
_ref2$addToHeader = _ref2.addToHeader,
|
220
|
+
addToHeader = _ref2$addToHeader === void 0 ? false : _ref2$addToHeader;
|
221
|
+
var activeCellFullData = typeof (coords === null || coords === void 0 ? void 0 : coords.column) === 'number' && typeof (coords === null || coords === void 0 ? void 0 : coords.row) === 'number' ? rows[coords === null || coords === void 0 ? void 0 : coords.row].cells[coords === null || coords === void 0 ? void 0 : coords.column] : null;
|
222
|
+
var activeCellValue = activeCellFullData ? Object.values(activeCellFullData.row.values)[coords === null || coords === void 0 ? void 0 : coords.column] : null;
|
223
|
+
var prevCoords = previousState === null || previousState === void 0 ? void 0 : previousState.activeCellCoordinates;
|
224
|
+
// Only create an active cell if the activeCellCoordinates have changed
|
225
|
+
if ((prevCoords === null || prevCoords === void 0 ? void 0 : prevCoords.row) !== (coords === null || coords === void 0 ? void 0 : coords.row) || (prevCoords === null || prevCoords === void 0 ? void 0 : prevCoords.column) !== (coords === null || coords === void 0 ? void 0 : coords.column)) {
|
226
|
+
createActiveCellFn({
|
227
|
+
placementElement: placementElement,
|
228
|
+
coords: coords,
|
229
|
+
addToHeader: addToHeader,
|
230
|
+
contextRef: spreadsheetRef,
|
231
|
+
blockClass: blockClass,
|
232
|
+
onActiveCellChange: onActiveCellChange,
|
233
|
+
activeCellValue: activeCellValue,
|
234
|
+
activeCellRef: activeCellRef,
|
235
|
+
cellEditorRef: cellEditorRef,
|
236
|
+
defaultColumn: defaultColumn
|
237
|
+
});
|
238
|
+
}
|
239
|
+
}, [spreadsheetRef, rows, onActiveCellChange, previousState === null || previousState === void 0 ? void 0 : previousState.activeCellCoordinates, defaultColumn]);
|
240
|
+
useResetSpreadsheetFocus({
|
241
|
+
focusedElement: focusedElement,
|
242
|
+
removeActiveCell: removeActiveCell,
|
243
|
+
setContainerHasFocus: setContainerHasFocus
|
244
|
+
});
|
245
|
+
useSpreadsheetOutsideClick({
|
246
|
+
spreadsheetRef: spreadsheetRef,
|
247
|
+
setActiveCellCoordinates: setActiveCellCoordinates,
|
248
|
+
setSelectionAreas: setSelectionAreas,
|
249
|
+
removeActiveCell: removeActiveCell,
|
250
|
+
removeCellSelections: removeCellSelections,
|
251
|
+
setContainerHasFocus: setContainerHasFocus,
|
252
|
+
removeCellEditor: removeCellEditor
|
253
|
+
});
|
254
|
+
useMoveActiveCell({
|
255
|
+
spreadsheetRef: spreadsheetRef,
|
256
|
+
activeCellCoordinates: activeCellCoordinates,
|
257
|
+
containerHasFocus: containerHasFocus,
|
258
|
+
createActiveCell: createActiveCell
|
259
|
+
});
|
260
|
+
var handleInitialArrowPress = useCallback(function () {
|
261
|
+
// If activeCellCoordinates is null then we need to set an initial value
|
262
|
+
// which will place the activeCell on the select all cell/button
|
263
|
+
setActiveCellInsideSelectionArea(false);
|
264
|
+
if (!activeCellCoordinates) {
|
265
|
+
setActiveCellCoordinates({
|
266
|
+
column: 'header',
|
267
|
+
row: 'header'
|
268
|
+
});
|
269
|
+
}
|
270
|
+
return;
|
271
|
+
}, [activeCellCoordinates]);
|
272
|
+
var updateActiveCellCoordinates = useCallback(function (_ref3) {
|
273
|
+
var _ref3$coords = _ref3.coords,
|
274
|
+
coords = _ref3$coords === void 0 ? _objectSpread({}, activeCellCoordinates) : _ref3$coords,
|
275
|
+
updatedValue = _ref3.updatedValue,
|
276
|
+
_ref3$optOutOfSelecti = _ref3.optOutOfSelectionAreaUpdate,
|
277
|
+
optOutOfSelectionAreaUpdate = _ref3$optOutOfSelecti === void 0 ? false : _ref3$optOutOfSelecti;
|
278
|
+
var newActiveCell = _objectSpread(_objectSpread({}, coords), updatedValue);
|
279
|
+
setActiveCellCoordinates(newActiveCell);
|
280
|
+
// Only run if the active cell is _not_ a header cell. This will add a point1 object
|
281
|
+
// to selectionAreas every time the active cell changes, allowing us to create cell
|
282
|
+
// selections using keyboard. Opting out of the selection area updates here means
|
283
|
+
// that the active cell is being moved within a selection area
|
284
|
+
if (newActiveCell.row !== 'header' && newActiveCell.column !== 'header' && !optOutOfSelectionAreaUpdate) {
|
285
|
+
var tempMatcher = uuidv4();
|
286
|
+
setSelectionAreas([{
|
287
|
+
point1: newActiveCell,
|
288
|
+
matcher: tempMatcher
|
289
|
+
}]);
|
290
|
+
setCurrentMatcher(tempMatcher);
|
291
|
+
}
|
292
|
+
}, [activeCellCoordinates]);
|
293
|
+
var handleHomeEndKey = useCallback(function (_ref4) {
|
294
|
+
var type = _ref4.type;
|
295
|
+
var coordinatesClone = _objectSpread({}, activeCellCoordinates);
|
296
|
+
updateActiveCellCoordinates({
|
297
|
+
coords: coordinatesClone,
|
298
|
+
updatedValue: {
|
299
|
+
column: type === 'home' ? 0 : columns.length - 1
|
300
|
+
}
|
301
|
+
});
|
302
|
+
removeCellSelections({
|
303
|
+
spreadsheetRef: spreadsheetRef
|
304
|
+
});
|
305
|
+
}, [activeCellCoordinates, updateActiveCellCoordinates, spreadsheetRef, columns.length]);
|
306
|
+
var handleKeyPress = useCallback(function (event) {
|
307
|
+
var key = event.key;
|
308
|
+
if (isEditing) {
|
309
|
+
return;
|
310
|
+
}
|
311
|
+
// Command keys need to be returned as there is default browser behavior with these keys
|
312
|
+
if (key === 'Meta' || key === 'Control') {
|
313
|
+
return;
|
314
|
+
}
|
315
|
+
// Prevent arrow keys, home key, and end key from scrolling the page when the data spreadsheet container has focus
|
316
|
+
if (['End', 'Home', 'ArrowLeft', 'ArrowUp', 'ArrowRight', 'ArrowDown'].indexOf(key) > -1 && !isEditing) {
|
317
|
+
event.preventDefault();
|
318
|
+
}
|
319
|
+
if (['Tab'].indexOf(key) > -1 && isEditing) {
|
320
|
+
return;
|
321
|
+
}
|
322
|
+
// Clear out all cell selection areas if user uses any arrow key, except if the shift key is being held
|
323
|
+
if (['ArrowLeft', 'ArrowUp', 'ArrowRight', 'ArrowDown'].indexOf(key) > -1) {
|
324
|
+
if (selectionAreas !== null && selectionAreas !== void 0 && selectionAreas.length && keysPressedList.length < 2 && !includesShift(keysPressedList)) {
|
325
|
+
setSelectionAreas([]);
|
326
|
+
setSelectionAreaData([]);
|
327
|
+
removeCellSelections({
|
328
|
+
spreadsheetRef: spreadsheetRef
|
329
|
+
});
|
330
|
+
}
|
331
|
+
}
|
332
|
+
if (!isEditing && (keysPressedList === null || keysPressedList === void 0 ? void 0 : keysPressedList.length) > 1) {
|
333
|
+
handleMultipleKeys({
|
334
|
+
activeCellCoordinates: activeCellCoordinates,
|
335
|
+
event: event,
|
336
|
+
keysPressedList: keysPressedList,
|
337
|
+
selectionAreas: selectionAreas,
|
338
|
+
currentMatcher: currentMatcher,
|
339
|
+
rows: rows,
|
340
|
+
setSelectionAreas: setSelectionAreas,
|
341
|
+
columns: columns,
|
342
|
+
updateActiveCellCoordinates: updateActiveCellCoordinates,
|
343
|
+
spreadsheetRef: spreadsheetRef,
|
344
|
+
removeCellSelections: removeCellSelections,
|
345
|
+
blockClass: blockClass,
|
346
|
+
setCurrentMatcher: setCurrentMatcher,
|
347
|
+
usingMac: usingMac
|
348
|
+
});
|
349
|
+
}
|
350
|
+
var deleteParams = {
|
351
|
+
selectionAreas: selectionAreas,
|
352
|
+
currentMatcher: currentMatcher,
|
353
|
+
rows: rows,
|
354
|
+
setActiveCellContent: setActiveCellContent,
|
355
|
+
updateData: updateData,
|
356
|
+
activeCellCoordinates: activeCellCoordinates
|
357
|
+
};
|
358
|
+
// Allow arrow key navigation if there are less than two activeKeys OR
|
359
|
+
// if one of the activeCellCoordinates is in a header position
|
360
|
+
if (keysPressedList.length < 2 && !includesShift(keysPressedList) || activeCellCoordinates.row === 'header' || activeCellCoordinates.column === 'header') {
|
361
|
+
switch (key) {
|
362
|
+
// Backspace
|
363
|
+
case 'Backspace':
|
364
|
+
{
|
365
|
+
handleCellDeletion(deleteParams);
|
366
|
+
break;
|
367
|
+
}
|
368
|
+
// Delete
|
369
|
+
case 'Delete':
|
370
|
+
{
|
371
|
+
handleCellDeletion(deleteParams);
|
372
|
+
break;
|
373
|
+
}
|
374
|
+
// Enter
|
375
|
+
case 'Enter':
|
376
|
+
{
|
377
|
+
handleActiveCellInSelectionEnter({
|
378
|
+
activeCellInsideSelectionArea: activeCellInsideSelectionArea,
|
379
|
+
activeCellCoordinates: activeCellCoordinates,
|
380
|
+
activeCellRef: activeCellRef,
|
381
|
+
selectionAreas: selectionAreas,
|
382
|
+
updateActiveCellCoordinates: updateActiveCellCoordinates
|
383
|
+
});
|
384
|
+
break;
|
385
|
+
}
|
386
|
+
// HOME
|
387
|
+
case 'Home':
|
388
|
+
{
|
389
|
+
if (includesResourceKey(keysPressedList, usingMac)) {
|
390
|
+
return;
|
391
|
+
}
|
392
|
+
handleHomeEndKey({
|
393
|
+
type: 'home'
|
394
|
+
});
|
395
|
+
break;
|
396
|
+
}
|
397
|
+
case 'End':
|
398
|
+
{
|
399
|
+
if (includesResourceKey(keysPressedList, usingMac)) {
|
400
|
+
return;
|
401
|
+
}
|
402
|
+
handleHomeEndKey({
|
403
|
+
type: 'end'
|
404
|
+
});
|
405
|
+
break;
|
406
|
+
}
|
407
|
+
// Tab
|
408
|
+
case 'Tab':
|
409
|
+
{
|
410
|
+
if (activeCellInsideSelectionArea) {
|
411
|
+
event.preventDefault();
|
412
|
+
return handleActiveCellInSelectionTab({
|
413
|
+
activeCellInsideSelectionArea: activeCellInsideSelectionArea,
|
414
|
+
activeCellCoordinates: activeCellCoordinates,
|
415
|
+
activeCellRef: activeCellRef,
|
416
|
+
selectionAreas: selectionAreas,
|
417
|
+
updateActiveCellCoordinates: updateActiveCellCoordinates
|
418
|
+
});
|
419
|
+
}
|
420
|
+
setSelectionAreas([]);
|
421
|
+
removeActiveCell();
|
422
|
+
removeCellEditor();
|
423
|
+
setContainerHasFocus(false);
|
424
|
+
setActiveCellCoordinates(null);
|
425
|
+
break;
|
426
|
+
}
|
427
|
+
// Left
|
428
|
+
case 'ArrowLeft':
|
429
|
+
{
|
430
|
+
handleInitialArrowPress();
|
431
|
+
var coordinatesClone = _objectSpread({}, activeCellCoordinates);
|
432
|
+
if (coordinatesClone.column === 'header') {
|
433
|
+
return;
|
434
|
+
}
|
435
|
+
if (typeof coordinatesClone.column === 'number') {
|
436
|
+
if (coordinatesClone.column === 0) {
|
437
|
+
updateActiveCellCoordinates({
|
438
|
+
coords: coordinatesClone,
|
439
|
+
updatedValue: {
|
440
|
+
column: 'header'
|
441
|
+
}
|
442
|
+
});
|
443
|
+
return;
|
444
|
+
}
|
445
|
+
updateActiveCellCoordinates({
|
446
|
+
coords: coordinatesClone,
|
447
|
+
updatedValue: {
|
448
|
+
column: coordinatesClone.column - 1
|
449
|
+
}
|
450
|
+
});
|
451
|
+
}
|
452
|
+
break;
|
453
|
+
}
|
454
|
+
// Up
|
455
|
+
case 'ArrowUp':
|
456
|
+
{
|
457
|
+
handleInitialArrowPress();
|
458
|
+
var _coordinatesClone = _objectSpread({}, activeCellCoordinates);
|
459
|
+
if (_coordinatesClone.row === 'header') {
|
460
|
+
return;
|
461
|
+
}
|
462
|
+
if (typeof _coordinatesClone.row === 'number') {
|
463
|
+
// set row back to header if we are at index 0
|
464
|
+
if (_coordinatesClone.row === 0) {
|
465
|
+
updateActiveCellCoordinates({
|
466
|
+
coords: _coordinatesClone,
|
467
|
+
updatedValue: {
|
468
|
+
row: 'header'
|
469
|
+
}
|
470
|
+
});
|
471
|
+
return;
|
472
|
+
}
|
473
|
+
// if we are at any other index than 0, subtract 1 from current row index
|
474
|
+
updateActiveCellCoordinates({
|
475
|
+
coords: _coordinatesClone,
|
476
|
+
updatedValue: {
|
477
|
+
row: _coordinatesClone.row - 1
|
478
|
+
}
|
479
|
+
});
|
480
|
+
}
|
481
|
+
break;
|
482
|
+
}
|
483
|
+
// Right
|
484
|
+
case 'ArrowRight':
|
485
|
+
{
|
486
|
+
handleInitialArrowPress();
|
487
|
+
var _coordinatesClone2 = _objectSpread({}, activeCellCoordinates);
|
488
|
+
if (_coordinatesClone2.column === 'header') {
|
489
|
+
updateActiveCellCoordinates({
|
490
|
+
coords: _coordinatesClone2,
|
491
|
+
updatedValue: {
|
492
|
+
column: 0
|
493
|
+
}
|
494
|
+
});
|
495
|
+
}
|
496
|
+
if (typeof _coordinatesClone2.column === 'number') {
|
497
|
+
// Prevent active cell coordinates from updating if the active
|
498
|
+
// cell is in the last column, ie we can't go any further to the right
|
499
|
+
if (columns.length - 1 === _coordinatesClone2.column) {
|
500
|
+
return;
|
501
|
+
}
|
502
|
+
updateActiveCellCoordinates({
|
503
|
+
coords: _coordinatesClone2,
|
504
|
+
updatedValue: {
|
505
|
+
column: _coordinatesClone2.column + 1
|
506
|
+
}
|
507
|
+
});
|
508
|
+
}
|
509
|
+
break;
|
510
|
+
}
|
511
|
+
// Down
|
512
|
+
case 'ArrowDown':
|
513
|
+
{
|
514
|
+
handleInitialArrowPress();
|
515
|
+
var _coordinatesClone3 = _objectSpread({}, activeCellCoordinates);
|
516
|
+
if (_coordinatesClone3.row === 'header') {
|
517
|
+
updateActiveCellCoordinates({
|
518
|
+
coords: _coordinatesClone3,
|
519
|
+
updatedValue: {
|
520
|
+
row: 0
|
521
|
+
}
|
522
|
+
});
|
523
|
+
}
|
524
|
+
if (typeof _coordinatesClone3.row === 'number') {
|
525
|
+
// Prevent active cell coordinates from updating if the active
|
526
|
+
// cell is in the last row, ie we can't go any further down since
|
527
|
+
// we are in the last row
|
528
|
+
if (rows.length - 1 === _coordinatesClone3.row) {
|
529
|
+
return;
|
530
|
+
}
|
531
|
+
updateActiveCellCoordinates({
|
532
|
+
coords: _coordinatesClone3,
|
533
|
+
updatedValue: {
|
534
|
+
row: _coordinatesClone3.row + 1
|
535
|
+
}
|
536
|
+
});
|
537
|
+
}
|
538
|
+
break;
|
539
|
+
}
|
540
|
+
}
|
541
|
+
}
|
542
|
+
}, [activeCellInsideSelectionArea, updateActiveCellCoordinates, handleInitialArrowPress, activeCellCoordinates, removeActiveCell, columns, rows, spreadsheetRef, currentMatcher, isEditing, removeCellEditor, selectionAreas, handleHomeEndKey, keysPressedList, usingMac, updateData]);
|
543
|
+
var startEditMode = function startEditMode() {
|
544
|
+
setIsEditing(true);
|
545
|
+
setClickAndHoldActive(false);
|
546
|
+
var activeCellFullData = typeof (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'number' && typeof (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'number' ? rows[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row].cells[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column] : null;
|
547
|
+
var activeCellValue = activeCellFullData ? activeCellFullData.row.cells[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column].value : null;
|
548
|
+
setCellEditorValue(activeCellValue);
|
549
|
+
cellEditorRulerRef.current.textContent = activeCellValue;
|
550
|
+
cellEditorRef.current.style.width = activeCellRef === null || activeCellRef === void 0 ? void 0 : activeCellRef.current.style.width;
|
551
|
+
};
|
552
|
+
|
553
|
+
// Sets the initial placement of the cell editor cursor at the end of the text area
|
554
|
+
// this is not done for us by default in Safari
|
555
|
+
useEffect(function () {
|
556
|
+
if (isEditing && !(previousState !== null && previousState !== void 0 && previousState.isEditing)) {
|
557
|
+
cellEditorRef.current.setSelectionRange(cellEditorRulerRef.current.textContent.length, cellEditorRulerRef.current.textContent.length);
|
558
|
+
cellEditorRef.current.focus();
|
559
|
+
}
|
560
|
+
}, [isEditing, previousState === null || previousState === void 0 ? void 0 : previousState.isEditing]);
|
561
|
+
var handleActiveCellClick = function handleActiveCellClick() {
|
562
|
+
if ((activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'header' || (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'header') {
|
563
|
+
var indexValue = (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'header' ? activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column : activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row;
|
564
|
+
if ((activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'header' && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'header') {
|
565
|
+
return;
|
566
|
+
}
|
567
|
+
handleRowColumnHeaderClick({
|
568
|
+
isKeyboard: false,
|
569
|
+
index: indexValue
|
570
|
+
});
|
571
|
+
}
|
572
|
+
return;
|
573
|
+
};
|
574
|
+
|
575
|
+
// Mouse up on active cell
|
576
|
+
var handleActiveCellMouseUp = function handleActiveCellMouseUp() {
|
577
|
+
setClickAndHoldActive(false);
|
578
|
+
};
|
579
|
+
|
580
|
+
// Mouse down on active cell
|
581
|
+
var handleActiveCellMouseDown = function handleActiveCellMouseDown() {
|
582
|
+
if ((activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) !== 'header' || (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) !== 'header') {
|
583
|
+
var tempMatcher = uuidv4();
|
584
|
+
setClickAndHoldActive(true);
|
585
|
+
removeCellSelections({
|
586
|
+
spreadsheetRef: spreadsheetRef
|
587
|
+
});
|
588
|
+
setSelectionAreas([{
|
589
|
+
point1: activeCellCoordinates,
|
590
|
+
matcher: tempMatcher
|
591
|
+
}]);
|
592
|
+
setCurrentMatcher(tempMatcher);
|
593
|
+
setSelectionAreaData([]);
|
594
|
+
setActiveCellInsideSelectionArea(false);
|
595
|
+
}
|
596
|
+
return;
|
597
|
+
};
|
598
|
+
|
599
|
+
// Go into edit mode if 'Enter' key is pressed on activeCellRef
|
600
|
+
var handleActiveCellKeyDown = function handleActiveCellKeyDown(event) {
|
601
|
+
var key = event.key;
|
602
|
+
if (key === 'Enter' && !activeCellInsideSelectionArea) {
|
603
|
+
if ((activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) !== 'header' && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) !== 'header') {
|
604
|
+
startEditMode();
|
605
|
+
}
|
606
|
+
if ((activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'header' || (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'header') {
|
607
|
+
handleRowColumnHeaderClick({
|
608
|
+
isKeyboard: true
|
609
|
+
});
|
610
|
+
}
|
611
|
+
}
|
612
|
+
};
|
613
|
+
var handleRowColumnHeaderClick = function handleRowColumnHeaderClick(_ref5) {
|
614
|
+
var isKeyboard = _ref5.isKeyboard,
|
615
|
+
_ref5$index = _ref5.index,
|
616
|
+
index = _ref5$index === void 0 ? null : _ref5$index;
|
617
|
+
var handleHeaderCellProps = {
|
618
|
+
activeCellCoordinates: activeCellCoordinates,
|
619
|
+
rows: rows,
|
620
|
+
columns: columns,
|
621
|
+
setActiveCellCoordinates: setActiveCellCoordinates,
|
622
|
+
setCurrentMatcher: setCurrentMatcher,
|
623
|
+
setSelectionAreas: setSelectionAreas,
|
624
|
+
spreadsheetRef: spreadsheetRef,
|
625
|
+
isKeyboard: isKeyboard,
|
626
|
+
setSelectionAreaData: setSelectionAreaData,
|
627
|
+
index: index,
|
628
|
+
currentMatcher: currentMatcher
|
629
|
+
};
|
630
|
+
// Select an entire column
|
631
|
+
if ((activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'header' && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) !== 'header') {
|
632
|
+
handleHeaderCellSelection(_objectSpread({
|
633
|
+
type: 'column'
|
634
|
+
}, handleHeaderCellProps));
|
635
|
+
}
|
636
|
+
// Select an entire row
|
637
|
+
if ((activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'header' && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) !== 'header') {
|
638
|
+
handleHeaderCellSelection(_objectSpread({
|
639
|
+
type: 'row'
|
640
|
+
}, handleHeaderCellProps));
|
641
|
+
}
|
642
|
+
if ((activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'header' && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'header') {
|
643
|
+
selectAllCells({
|
644
|
+
ref: spreadsheetRef,
|
645
|
+
setCurrentMatcher: setCurrentMatcher,
|
646
|
+
setSelectionAreas: setSelectionAreas,
|
647
|
+
rows: rows,
|
648
|
+
columns: columns,
|
649
|
+
activeCellCoordinates: activeCellCoordinates,
|
650
|
+
updateActiveCellCoordinates: updateActiveCellCoordinates
|
651
|
+
});
|
652
|
+
}
|
653
|
+
};
|
654
|
+
|
655
|
+
// Go into edit mode if double click is detected on activeCellRef
|
656
|
+
var handleActiveCellDoubleClick = function handleActiveCellDoubleClick() {
|
657
|
+
startEditMode();
|
658
|
+
};
|
659
|
+
useSpreadsheetEdit({
|
660
|
+
isEditing: isEditing,
|
661
|
+
rows: rows,
|
662
|
+
activeCellCoordinates: activeCellCoordinates,
|
663
|
+
activeCellRef: activeCellRef,
|
664
|
+
cellEditorRef: cellEditorRef,
|
665
|
+
cellEditorRulerRef: cellEditorRulerRef,
|
666
|
+
visibleColumns: visibleColumns,
|
667
|
+
defaultColumn: defaultColumn,
|
668
|
+
cellEditorValue: cellEditorValue
|
669
|
+
});
|
670
|
+
var handleActiveCellMouseEnter = useCallback(function () {
|
671
|
+
handleActiveCellMouseEnterCallback(selectionAreas, clickAndHoldActive);
|
672
|
+
}, [clickAndHoldActive, selectionAreas, handleActiveCellMouseEnterCallback]);
|
673
|
+
|
674
|
+
// Only update if there are cell selection areas
|
675
|
+
// Find point object that matches currentMatcher and remove the second point
|
676
|
+
// because hovering over the active cell while clicking and holding should
|
677
|
+
// remove the previously existing selection area
|
678
|
+
var handleActiveCellMouseEnterCallback = useCallback(function (areas, clickHold) {
|
679
|
+
if (!currentMatcher) {
|
680
|
+
return;
|
681
|
+
}
|
682
|
+
if (areas && areas.length && clickHold && currentMatcher) {
|
683
|
+
setSelectionAreas(function (prev) {
|
684
|
+
var selectionAreaClone = deepCloneObject(prev);
|
685
|
+
var indexOfItemToUpdate = selectionAreaClone.findIndex(function (item) {
|
686
|
+
return item.matcher === currentMatcher;
|
687
|
+
});
|
688
|
+
if (indexOfItemToUpdate === -1) {
|
689
|
+
return prev;
|
690
|
+
}
|
691
|
+
if (_typeof(selectionAreaClone[indexOfItemToUpdate].point2) === 'object' && selectionAreaClone[indexOfItemToUpdate].areaCreated) {
|
692
|
+
selectionAreaClone[indexOfItemToUpdate].point2 = selectionAreaClone[indexOfItemToUpdate].point1;
|
693
|
+
selectionAreaClone[indexOfItemToUpdate].areaCreated = false;
|
694
|
+
setActiveCellInsideSelectionArea(false);
|
695
|
+
removeCellSelections({
|
696
|
+
matcher: currentMatcher,
|
697
|
+
spreadsheetRef: spreadsheetRef
|
698
|
+
});
|
699
|
+
return selectionAreaClone;
|
700
|
+
}
|
701
|
+
return prev;
|
702
|
+
});
|
703
|
+
}
|
704
|
+
}, [spreadsheetRef, currentMatcher]);
|
705
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, rest, getTableProps(), getDevtoolsProps(componentName), {
|
706
|
+
className: cx(blockClass, className, "".concat(blockClass, "--interactive-cell-element"), (_cx = {}, _defineProperty(_cx, "".concat(blockClass, "__container-has-focus"), containerHasFocus), _defineProperty(_cx, "".concat(blockClass, "__").concat(theme), theme === 'dark'), _cx)),
|
707
|
+
ref: spreadsheetRef,
|
708
|
+
role: "grid",
|
709
|
+
tabIndex: 0,
|
710
|
+
"aria-rowcount": (rows === null || rows === void 0 ? void 0 : rows.length) || 0,
|
711
|
+
"aria-colcount": (columns === null || columns === void 0 ? void 0 : columns.length) || 0,
|
712
|
+
"aria-label": spreadsheetAriaLabel,
|
713
|
+
onKeyDown: handleKeyPress,
|
714
|
+
onFocus: function onFocus() {
|
715
|
+
return setContainerHasFocus(true);
|
716
|
+
}
|
717
|
+
}), /*#__PURE__*/React.createElement("div", {
|
718
|
+
ref: multiKeyTrackingRef
|
719
|
+
}, /*#__PURE__*/React.createElement(DataSpreadsheetHeader, {
|
720
|
+
ref: spreadsheetRef,
|
721
|
+
activeCellCoordinates: activeCellCoordinates,
|
722
|
+
cellSize: cellSize,
|
723
|
+
columns: columns,
|
724
|
+
currentMatcher: currentMatcher,
|
725
|
+
defaultColumn: defaultColumn,
|
726
|
+
headerGroups: headerGroups,
|
727
|
+
rows: rows,
|
728
|
+
scrollBarSize: scrollBarSize,
|
729
|
+
selectionAreas: selectionAreas,
|
730
|
+
setActiveCellCoordinates: setActiveCellCoordinates,
|
731
|
+
setSelectionAreas: setSelectionAreas,
|
732
|
+
setCurrentMatcher: setCurrentMatcher,
|
733
|
+
setSelectionAreaData: setSelectionAreaData,
|
734
|
+
totalVisibleColumns: totalVisibleColumns,
|
735
|
+
updateActiveCellCoordinates: updateActiveCellCoordinates,
|
736
|
+
setHeaderCellHoldActive: setHeaderCellHoldActive,
|
737
|
+
headerCellHoldActive: headerCellHoldActive,
|
738
|
+
visibleColumns: visibleColumns,
|
739
|
+
selectAllAriaLabel: selectAllAriaLabel
|
740
|
+
}), /*#__PURE__*/React.createElement(DataSpreadsheetBody, {
|
741
|
+
activeCellCoordinates: activeCellCoordinates,
|
742
|
+
ref: spreadsheetRef,
|
743
|
+
clickAndHoldActive: clickAndHoldActive,
|
744
|
+
setClickAndHoldActive: setClickAndHoldActive,
|
745
|
+
currentMatcher: currentMatcher,
|
746
|
+
setCurrentMatcher: setCurrentMatcher,
|
747
|
+
setContainerHasFocus: setContainerHasFocus,
|
748
|
+
selectionAreas: selectionAreas,
|
749
|
+
setSelectionAreas: setSelectionAreas,
|
750
|
+
cellSize: cellSize,
|
751
|
+
headerGroups: headerGroups,
|
752
|
+
defaultColumn: defaultColumn,
|
753
|
+
getTableBodyProps: getTableBodyProps,
|
754
|
+
onDataUpdate: onDataUpdate,
|
755
|
+
onActiveCellChange: onActiveCellChange,
|
756
|
+
onSelectionAreaChange: onSelectionAreaChange,
|
757
|
+
prepareRow: prepareRow,
|
758
|
+
rows: rows,
|
759
|
+
selectionAreaData: selectionAreaData,
|
760
|
+
setSelectionAreaData: setSelectionAreaData,
|
761
|
+
setActiveCellCoordinates: setActiveCellCoordinates,
|
762
|
+
scrollBarSize: scrollBarSize,
|
763
|
+
totalColumnsWidth: totalColumnsWidth,
|
764
|
+
id: id,
|
765
|
+
columns: columns,
|
766
|
+
defaultEmptyRowCount: defaultEmptyRowCount,
|
767
|
+
setActiveCellInsideSelectionArea: setActiveCellInsideSelectionArea,
|
768
|
+
totalVisibleColumns: totalVisibleColumns,
|
769
|
+
setHeaderCellHoldActive: setHeaderCellHoldActive,
|
770
|
+
setColumnOrder: setColumnOrder,
|
771
|
+
visibleColumns: visibleColumns
|
772
|
+
}), /*#__PURE__*/React.createElement("button", {
|
773
|
+
onMouseDown: handleActiveCellMouseDown,
|
774
|
+
onMouseUp: handleActiveCellMouseUp,
|
775
|
+
onClick: handleActiveCellClick,
|
776
|
+
onKeyDown: handleActiveCellKeyDown,
|
777
|
+
onDoubleClick: handleActiveCellDoubleClick,
|
778
|
+
onMouseEnter: handleActiveCellMouseEnter,
|
779
|
+
ref: activeCellRef,
|
780
|
+
className: cx("".concat(blockClass, "--interactive-cell-element"), "".concat(blockClass, "__active-cell--highlight"), _defineProperty({}, "".concat(blockClass, "__active-cell--with-selection"), activeCellInsideSelectionArea)),
|
781
|
+
type: "button"
|
782
|
+
}, activeCellContent), /*#__PURE__*/React.createElement("textarea", {
|
783
|
+
id: "".concat(blockClass, "__cell-editor-text-area"),
|
784
|
+
value: cellEditorValue,
|
785
|
+
onKeyDown: handleEditSubmit({
|
786
|
+
activeCellCoordinates: activeCellCoordinates,
|
787
|
+
cellEditorRulerRef: cellEditorRulerRef,
|
788
|
+
columns: columns,
|
789
|
+
previousState: previousState,
|
790
|
+
removeCellEditor: removeCellEditor,
|
791
|
+
rows: rows,
|
792
|
+
setActiveCellCoordinates: setActiveCellCoordinates,
|
793
|
+
setCurrentMatcher: setCurrentMatcher,
|
794
|
+
setSelectionAreas: setSelectionAreas,
|
795
|
+
spreadsheetRef: spreadsheetRef,
|
796
|
+
updateData: updateData
|
797
|
+
}),
|
798
|
+
onChange: function onChange(event) {
|
799
|
+
setCellEditorValue(event.target.value);
|
800
|
+
cellEditorRulerRef.current.textContent = event.target.value;
|
801
|
+
},
|
802
|
+
ref: cellEditorRef,
|
803
|
+
"aria-labelledby": activeCellCoordinates ? "".concat(blockClass, "__cell--").concat(activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row, "--").concat(activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) : null,
|
804
|
+
className: cx("".concat(blockClass, "__cell-editor"), "".concat(blockClass, "--interactive-cell-element"), "".concat(blockClass, "__cell-editor--").concat(cellSize), _defineProperty({}, "".concat(blockClass, "__cell-editor--active"), isEditing))
|
805
|
+
}), /*#__PURE__*/React.createElement("pre", {
|
806
|
+
"aria-hidden": true,
|
807
|
+
ref: cellEditorRulerRef,
|
808
|
+
className: "".concat(blockClass, "__cell-editor-ruler")
|
809
|
+
})));
|
810
|
+
});
|
811
|
+
|
812
|
+
// Return a placeholder if not released and not enabled by feature flag
|
813
|
+
DataSpreadsheet = pkg.checkComponentEnabled(DataSpreadsheet, componentName);
|
814
|
+
|
815
|
+
// The display name of the component, used by React. Note that displayName
|
816
|
+
// is used in preference to relying on function.name.
|
817
|
+
DataSpreadsheet.displayName = componentName;
|
818
|
+
|
819
|
+
// The types and DocGen commentary for the component props,
|
820
|
+
// in alphabetical order (for consistency).
|
821
|
+
// See https://www.npmjs.com/package/prop-types#usage.
|
822
|
+
DataSpreadsheet.propTypes = {
|
823
|
+
/**
|
824
|
+
* Specifies the cell height
|
825
|
+
*/
|
826
|
+
cellSize: PropTypes.oneOf(['xs', 'sm', 'md', 'lg']),
|
827
|
+
/**
|
828
|
+
* Provide an optional class to be applied to the containing node.
|
829
|
+
*/
|
830
|
+
className: PropTypes.string,
|
831
|
+
/**
|
832
|
+
* The data that will build the column headers
|
833
|
+
*/
|
834
|
+
columns: PropTypes.arrayOf(PropTypes.shape({
|
835
|
+
Header: PropTypes.string,
|
836
|
+
accessor: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
|
837
|
+
Cell: PropTypes.func // optional cell formatter
|
838
|
+
})),
|
839
|
+
|
840
|
+
/**
|
841
|
+
* The spreadsheet data that will be rendered in the body of the spreadsheet component
|
842
|
+
*/
|
843
|
+
data: PropTypes.arrayOf(PropTypes.shape),
|
844
|
+
/**
|
845
|
+
* Sets the number of empty rows to be created when there is no data provided
|
846
|
+
*/
|
847
|
+
defaultEmptyRowCount: PropTypes.number,
|
848
|
+
/**
|
849
|
+
* The spreadsheet id
|
850
|
+
*/
|
851
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
852
|
+
/**
|
853
|
+
* The event handler that is called when the active cell changes
|
854
|
+
*/
|
855
|
+
onActiveCellChange: PropTypes.func,
|
856
|
+
/**
|
857
|
+
* The setter fn for the data prop
|
858
|
+
*/
|
859
|
+
onDataUpdate: PropTypes.func,
|
860
|
+
/**
|
861
|
+
* The event handler that is called when the selection area values change
|
862
|
+
*/
|
863
|
+
onSelectionAreaChange: PropTypes.func,
|
864
|
+
/**
|
865
|
+
* The aria label applied to the Select all button
|
866
|
+
*/
|
867
|
+
selectAllAriaLabel: PropTypes.string.isRequired,
|
868
|
+
/**
|
869
|
+
* The aria label applied to the Data spreadsheet component
|
870
|
+
*/
|
871
|
+
spreadsheetAriaLabel: PropTypes.string.isRequired,
|
872
|
+
/**
|
873
|
+
* The theme the DataSpreadsheet should use (only used to render active cell/selection area colors on dark theme)
|
874
|
+
*/
|
875
|
+
theme: PropTypes.oneOf(['light', 'dark']),
|
876
|
+
/**
|
877
|
+
* The total number of columns to be initially visible, additional columns will be rendered and
|
878
|
+
* visible via horizontal scrollbar
|
879
|
+
*/
|
880
|
+
totalVisibleColumns: PropTypes.number
|
881
|
+
|
882
|
+
/* TODO: add types and DocGen for all props. */
|
883
|
+
};
|