@carbon/ibm-products 2.0.0-rc.1 → 2.0.0-rc.10
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +2 -2
- package/css/index-full-carbon.css +1187 -325
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +6 -8
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +789 -171
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +4 -8
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +1068 -414
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +6 -8
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +981 -267
- package/css/index.css.map +1 -1
- package/css/index.min.css +6 -8
- package/css/index.min.css.map +1 -1
- package/es/components/APIKeyModal/APIKeyModal.js +1 -1
- package/es/components/ActionBar/ActionBarOverflowItems.js +1 -0
- package/es/components/ActionSet/ActionSet.js +7 -3
- package/es/components/AddSelect/AddSelect.js +6 -6
- package/es/components/AddSelect/AddSelectBody.js +72 -31
- package/es/components/AddSelect/AddSelectBreadcrumbs.js +12 -4
- package/es/components/AddSelect/AddSelectColumn.js +8 -8
- package/es/components/AddSelect/AddSelectFilter.js +10 -7
- package/es/components/AddSelect/AddSelectList.js +64 -29
- package/es/components/AddSelect/AddSelectMetaPanel.js +7 -1
- package/es/components/AddSelect/AddSelectSidebar.js +5 -2
- package/es/components/AddSelect/AddSelectSort.js +2 -2
- package/es/components/AddSelect/add-select-utils.js +9 -2
- package/es/components/AddSelect/hooks/useItemSort.js +6 -0
- package/es/components/AddSelect/hooks/useParentSelect.js +6 -0
- package/es/components/AddSelect/hooks/usePath.js +15 -1
- package/es/components/AddSelect/index.js +1 -1
- package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +4 -6
- package/es/components/Card/Card.js +16 -6
- package/es/components/Card/CardFooter.js +3 -1
- package/es/components/Card/CardHeader.js +20 -1
- package/es/components/ComboButton/ComboButton.js +1 -1
- package/es/components/CreateFullPage/CreateFullPage.js +4 -1
- package/es/components/CreateTearsheet/CreateTearsheet.js +8 -1
- package/es/components/CreateTearsheetNarrow/CreateTearsheetNarrow.js +2 -2
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +64 -11
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +2 -1
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +7 -0
- package/es/components/DataSpreadsheet/hooks/useMultipleKeyTracking.js +6 -5
- package/es/components/DataSpreadsheet/utils/handleCellDeletion.js +40 -0
- package/es/components/DataSpreadsheet/utils/handleMultipleKeys.js +1 -1
- package/es/components/Datagrid/Datagrid/Datagrid.js +10 -38
- package/es/components/Datagrid/Datagrid/DatagridContent.js +154 -0
- package/es/components/Datagrid/Datagrid/DatagridExpandedRow.js +9 -1
- package/es/components/Datagrid/Datagrid/DatagridRow.js +53 -6
- package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +10 -3
- package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +13 -4
- package/es/components/Datagrid/Datagrid/DatagridToolbar.js +9 -6
- package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +2 -1
- package/es/components/Datagrid/Datagrid/DraggableElement.js +6 -2
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +5 -45
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +4 -1
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +36 -10
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsModal.js +62 -26
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/ModalWrapper.js +3 -2
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +60 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/index.js +1 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +537 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/index.js +1 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +112 -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 +39 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridFocus.js +19 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +263 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleMultipleKeys.js +87 -0
- package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +17 -14
- package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +13 -36
- package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/CustomizeColumnStory.js +0 -0
- package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/LeftPanelStory.js +0 -0
- package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/RowSizeDropdownStory.js +0 -0
- package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/SelectAllWithToggleStory.js +0 -0
- package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/StickyActionsColumnStory.js +0 -0
- package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/common.js +0 -0
- package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/index.js +0 -0
- package/es/components/Datagrid/index.js +3 -1
- package/es/components/Datagrid/useActionsColumn.js +28 -12
- package/es/components/Datagrid/useColumnOrder.js +8 -0
- package/es/components/Datagrid/useCustomizeColumns.js +5 -0
- package/es/components/Datagrid/useDefaultStringRenderer.js +4 -1
- package/es/components/Datagrid/useDisableSelectRows.js +6 -2
- package/es/components/Datagrid/useExpandedRow.js +0 -1
- package/es/components/Datagrid/useInfiniteScroll.js +5 -2
- package/es/components/Datagrid/useInlineEdit.js +71 -0
- package/es/components/Datagrid/useNestedRowExpander.js +47 -0
- package/es/components/Datagrid/useNestedRows.js +16 -4
- package/es/components/Datagrid/useRowExpander.js +12 -4
- package/es/components/Datagrid/useRowSize.js +17 -6
- package/es/components/Datagrid/useSelectAllToggle.js +17 -4
- package/es/components/Datagrid/useSelectRows.js +12 -2
- package/es/components/Datagrid/useSortableColumns.js +1 -1
- package/es/components/Datagrid/useStickyColumn.js +11 -0
- package/es/components/Datagrid/utils/DatagridActions.js +236 -0
- package/es/components/Datagrid/utils/DatagridPagination.js +33 -0
- package/es/components/Datagrid/utils/Wrapper.js +21 -0
- package/es/components/Datagrid/utils/getArgTypes.js +89 -0
- package/es/components/Datagrid/utils/getInlineEditColumns.js +153 -0
- package/es/components/Datagrid/utils/makeData.js +47 -2
- package/es/components/EditUpdateCards/EditUpdateCards.js +144 -0
- package/es/components/EditUpdateCards/index.js +7 -0
- package/es/components/ExportModal/ExportModal.js +1 -1
- package/es/components/ImportModal/ImportModal.js +3 -3
- package/es/components/InlineEdit/InlineEdit.js +28 -426
- package/es/components/InlineEditV1/InlineEditV1.js +447 -0
- package/es/components/InlineEditV1/index.js +7 -0
- package/es/components/InlineEditV2/InlineEditV2.js +289 -0
- package/es/components/InlineEditV2/index.js +7 -0
- package/es/components/ModifiedTabs/ModifiedTabLabelNew.js +1 -1
- package/es/components/ModifiedTabs/ModifiedTabLabelWithClose.js +1 -1
- package/es/components/MultiAddSelect/MultiAddSelect.js +14 -7
- package/es/components/MultiAddSelect/index.js +6 -0
- package/es/components/NotificationsPanel/NotificationsPanel.js +1 -1
- package/es/components/OptionsTile/OptionsTile.js +29 -13
- package/es/components/PageHeader/PageHeader.js +4 -4
- package/es/components/PageHeader/PageHeaderTitle.js +1 -1
- package/es/components/ProductiveCard/ProductiveCard.js +5 -0
- package/es/components/RemoveModal/RemoveModal.js +20 -3
- package/es/components/Saving/Saving.js +1 -1
- package/es/components/SidePanel/SidePanel.js +45 -52
- package/es/components/SidePanel/motion/variants.js +45 -0
- package/es/components/SingleAddSelect/SingleAddSelect.js +6 -0
- package/es/components/SingleAddSelect/index.js +6 -0
- package/es/components/StatusIcon/StatusIcon.js +1 -1
- package/es/components/UserProfileImage/UserProfileImage.js +1 -1
- package/es/components/WebTerminal/WebTerminal.js +2 -2
- package/es/components/WebTerminal/WebTerminalContentWrapper.js +1 -1
- package/es/components/WebTerminal/hooks/index.js +6 -0
- package/es/components/WebTerminal/index.js +6 -0
- package/es/components/WebTerminal/preview-components/Navigation.js +7 -1
- package/es/components/WebTerminal/preview-components/documentationLinks.js +6 -0
- package/es/components/WebTerminal/preview-components/index.js +7 -0
- package/es/components/index.js +3 -2
- package/es/global/js/hooks/index.js +2 -1
- package/es/global/js/hooks/useClickOutside.js +1 -1
- package/es/global/js/hooks/useControllableState.js +83 -0
- package/es/global/js/hooks/useResetCreateComponent.js +6 -2
- package/es/global/js/package-settings.js +7 -4
- package/es/global/js/utils/getBezierValues.js +20 -0
- package/es/global/js/utils/getNumberOfHiddenSteps.js +19 -0
- package/es/global/js/utils/motionConstants.js +45 -0
- package/es/global/js/utils/rangeWithCallback.js +13 -0
- package/es/global/js/utils/story-helper.js +5 -1
- package/es/global/js/utils/uuidv4.spec.js +4 -0
- package/lib/components/APIKeyModal/APIKeyModal.js +4 -4
- package/lib/components/ActionBar/ActionBarOverflowItems.js +1 -0
- package/lib/components/ActionSet/ActionSet.js +7 -3
- package/lib/components/AddSelect/AddSelect.js +5 -6
- package/lib/components/AddSelect/AddSelectBody.js +67 -30
- package/lib/components/AddSelect/AddSelectBreadcrumbs.js +15 -4
- package/lib/components/AddSelect/AddSelectColumn.js +7 -7
- package/lib/components/AddSelect/AddSelectFilter.js +9 -6
- package/lib/components/AddSelect/AddSelectList.js +65 -30
- package/lib/components/AddSelect/AddSelectMetaPanel.js +8 -2
- package/lib/components/AddSelect/AddSelectSidebar.js +4 -1
- package/lib/components/AddSelect/AddSelectSort.js +5 -5
- package/lib/components/AddSelect/add-select-utils.js +9 -2
- package/lib/components/AddSelect/hooks/useItemSort.js +6 -0
- package/lib/components/AddSelect/hooks/useParentSelect.js +6 -0
- package/lib/components/AddSelect/hooks/usePath.js +9 -1
- package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +6 -6
- package/lib/components/Card/Card.js +16 -6
- package/lib/components/Card/CardFooter.js +3 -1
- package/lib/components/Card/CardHeader.js +21 -1
- package/lib/components/ComboButton/ComboButton.js +3 -3
- package/lib/components/CreateFullPage/CreateFullPage.js +4 -1
- package/lib/components/CreateTearsheet/CreateTearsheet.js +9 -1
- package/lib/components/CreateTearsheetNarrow/CreateTearsheetNarrow.js +2 -2
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +64 -10
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +2 -1
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +7 -0
- package/lib/components/DataSpreadsheet/hooks/useMultipleKeyTracking.js +6 -5
- package/lib/components/DataSpreadsheet/utils/handleCellDeletion.js +51 -0
- package/lib/components/DataSpreadsheet/utils/handleMultipleKeys.js +1 -1
- package/lib/components/Datagrid/Datagrid/Datagrid.js +12 -45
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +188 -0
- package/lib/components/Datagrid/Datagrid/DatagridExpandedRow.js +9 -1
- package/lib/components/Datagrid/Datagrid/DatagridRow.js +63 -6
- package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +12 -3
- package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +16 -5
- package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +10 -7
- package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +2 -1
- package/lib/components/Datagrid/Datagrid/DraggableElement.js +7 -3
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +12 -47
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +5 -2
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +48 -25
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsModal.js +60 -25
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/ModalWrapper.js +3 -2
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +76 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/index.js +13 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +562 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/index.js +13 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +129 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/getCellIdAsObject.js +36 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/index.js +19 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/returnUpdatedActiveCell.js +45 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridFocus.js +28 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +272 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleMultipleKeys.js +100 -0
- package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +17 -13
- package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +13 -35
- package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/CustomizeColumnStory.js +0 -0
- package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/LeftPanelStory.js +0 -0
- package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/RowSizeDropdownStory.js +0 -0
- package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/SelectAllWithToggleStory.js +0 -0
- package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/StickyActionsColumnStory.js +0 -0
- package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/common.js +0 -0
- package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/index.js +0 -0
- package/lib/components/Datagrid/index.js +17 -1
- package/lib/components/Datagrid/useActionsColumn.js +28 -13
- package/lib/components/Datagrid/useColumnOrder.js +17 -0
- package/lib/components/Datagrid/useCustomizeColumns.js +5 -0
- package/lib/components/Datagrid/useDefaultStringRenderer.js +5 -1
- package/lib/components/Datagrid/useDisableSelectRows.js +6 -2
- package/lib/components/Datagrid/useExpandedRow.js +0 -1
- package/lib/components/Datagrid/useInfiniteScroll.js +5 -2
- package/lib/components/Datagrid/useInlineEdit.js +85 -0
- package/lib/components/Datagrid/useNestedRowExpander.js +63 -0
- package/lib/components/Datagrid/useNestedRows.js +17 -4
- package/lib/components/Datagrid/useRowExpander.js +17 -5
- package/lib/components/Datagrid/useRowSize.js +18 -13
- package/lib/components/Datagrid/useSelectAllToggle.js +18 -4
- package/lib/components/Datagrid/useSelectRows.js +12 -2
- package/lib/components/Datagrid/useSortableColumns.js +5 -5
- package/lib/components/Datagrid/useStickyColumn.js +11 -0
- package/lib/components/Datagrid/utils/DatagridActions.js +260 -0
- package/lib/components/Datagrid/utils/DatagridPagination.js +46 -0
- package/lib/components/Datagrid/utils/Wrapper.js +33 -0
- package/lib/components/Datagrid/utils/getArgTypes.js +97 -0
- package/lib/components/Datagrid/utils/getInlineEditColumns.js +168 -0
- package/lib/components/Datagrid/utils/makeData.js +48 -2
- package/lib/components/EditUpdateCards/EditUpdateCards.js +152 -0
- package/lib/components/EditUpdateCards/index.js +13 -0
- package/lib/components/ExportModal/ExportModal.js +3 -3
- package/lib/components/ImportModal/ImportModal.js +4 -4
- package/lib/components/InlineEdit/InlineEdit.js +27 -426
- package/lib/components/InlineEditV1/InlineEditV1.js +464 -0
- package/lib/components/InlineEditV1/index.js +13 -0
- package/lib/components/InlineEditV2/InlineEditV2.js +309 -0
- package/lib/components/InlineEditV2/index.js +13 -0
- package/lib/components/ModifiedTabs/ModifiedTabLabelNew.js +2 -2
- package/lib/components/ModifiedTabs/ModifiedTabLabelWithClose.js +3 -3
- package/lib/components/MultiAddSelect/MultiAddSelect.js +14 -7
- package/lib/components/NotificationsPanel/NotificationsPanel.js +8 -8
- package/lib/components/OptionsTile/OptionsTile.js +34 -17
- package/lib/components/PageHeader/PageHeader.js +5 -5
- package/lib/components/PageHeader/PageHeaderTitle.js +1 -1
- package/lib/components/ProductiveCard/ProductiveCard.js +5 -0
- package/lib/components/RemoveModal/RemoveModal.js +20 -3
- package/lib/components/Saving/Saving.js +5 -5
- package/lib/components/SidePanel/SidePanel.js +48 -53
- package/lib/components/SidePanel/motion/variants.js +55 -0
- package/lib/components/SingleAddSelect/SingleAddSelect.js +6 -0
- package/lib/components/StatusIcon/StatusIcon.js +45 -45
- package/lib/components/UserProfileImage/UserProfileImage.js +7 -7
- package/lib/components/WebTerminal/WebTerminal.js +3 -3
- package/lib/components/WebTerminal/hooks/index.js +6 -0
- package/lib/components/WebTerminal/preview-components/Navigation.js +10 -4
- package/lib/components/WebTerminal/preview-components/documentationLinks.js +6 -0
- package/lib/components/index.js +21 -1
- package/lib/global/js/hooks/index.js +9 -1
- package/lib/global/js/hooks/useClickOutside.js +1 -1
- package/lib/global/js/hooks/useControllableState.js +94 -0
- package/lib/global/js/hooks/useResetCreateComponent.js +7 -2
- package/lib/global/js/package-settings.js +7 -4
- package/lib/global/js/utils/getBezierValues.js +29 -0
- package/lib/global/js/utils/getNumberOfHiddenSteps.js +28 -0
- package/lib/global/js/utils/motionConstants.js +55 -0
- package/lib/global/js/utils/rangeWithCallback.js +22 -0
- package/lib/global/js/utils/story-helper.js +5 -1
- package/lib/global/js/utils/uuidv4.spec.js +4 -0
- package/package.json +18 -16
- package/scss/components/ActionSet/_action-set.scss +9 -4
- package/scss/components/AddSelect/_add-select.scss +132 -34
- package/scss/components/AddSelect/_index.scss +1 -1
- package/scss/components/AddSelect/_storybook-styles.scss +1 -1
- package/scss/components/Card/_card.scss +1 -0
- package/scss/components/Cascade/_cascade.scss +1 -1
- package/scss/components/CreateTearsheet/_create-tearsheet.scss +2 -0
- package/scss/components/Datagrid/_datagrid.scss +7 -0
- package/scss/components/Datagrid/_storybook-styles.scss +17 -5
- package/scss/components/Datagrid/styles/_datagrid.scss +87 -18
- package/scss/components/Datagrid/styles/_draggableElement.scss +26 -9
- package/scss/components/Datagrid/styles/_index.scss +1 -0
- package/scss/components/Datagrid/styles/_useActionsColumn.scss +14 -0
- package/scss/components/Datagrid/styles/_useExpandedRow.scss +57 -11
- package/scss/components/Datagrid/styles/_useInlineEdit.scss +419 -0
- package/scss/components/Datagrid/styles/_useNestedRows.scss +33 -1
- package/scss/components/Datagrid/styles/_useStickyColumn.scss +31 -2
- package/scss/components/Datagrid/styles/addons/_CustomizeColumnsModal.scss +47 -6
- package/scss/components/Datagrid/styles/addons/_RowSizeDropdown.scss +9 -1
- 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/{InlineEdit → InlineEditV1}/_carbon-imports.scss +0 -0
- package/scss/components/{InlineEdit → InlineEditV1}/_index-with-carbon.scss +1 -1
- package/scss/components/{InlineEdit → InlineEditV1}/_index.scss +1 -1
- package/scss/components/{InlineEdit/_inline-edit.scss → InlineEditV1/_inline-edit-v1.scss} +4 -2
- package/scss/components/{InlineEdit → InlineEditV1}/_storybook-styles.scss +0 -0
- package/scss/components/InlineEditV2/_carbon-imports.scss +9 -0
- package/scss/components/InlineEditV2/_index-with-carbon.scss +9 -0
- package/scss/components/InlineEditV2/_index.scss +10 -0
- package/scss/components/InlineEditV2/_inline-edit-v2.scss +83 -0
- package/scss/components/InlineEditV2/_storybook-styles.scss +9 -0
- package/scss/components/MultiAddSelect/_multi-add-select.scss +7 -0
- package/scss/components/MultiAddSelect/_storybook-styles.scss +1 -1
- package/scss/components/NotificationsPanel/_notifications-panel.scss +3 -6
- package/scss/components/RemoveModal/_remove-modal.scss +0 -4
- package/scss/components/SidePanel/_side-panel.scss +3 -82
- package/scss/components/SidePanel/_storybook-styles.scss +6 -1
- package/scss/components/SingleAddSelect/_carbon-imports.scss +1 -1
- package/scss/components/SingleAddSelect/_index-with-carbon.scss +1 -1
- package/scss/components/SingleAddSelect/_index.scss +7 -0
- package/scss/components/SingleAddSelect/_single-add-select.scss +7 -0
- package/scss/components/SingleAddSelect/_storybook-styles.scss +1 -1
- package/scss/components/Tearsheet/_tearsheet.scss +2 -2
- package/scss/components/WebTerminal/_carbon-imports.scss +6 -0
- package/scss/components/WebTerminal/_index.scss +7 -0
- package/scss/components/WebTerminal/_storybook-styles.scss +7 -0
- package/scss/components/_index-released-only-with-carbon.scss +1 -1
- package/scss/components/_index-released-only.scss +2 -1
- package/scss/components/_index-with-carbon.scss +3 -1
- package/scss/components/_index.scss +3 -1
@@ -1,7 +1,8 @@
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
2
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
4
|
-
var _excluded = ["id", "
|
4
|
+
var _excluded = ["id", "itemText", "onClick", "icon"],
|
5
|
+
_excluded2 = ["id", "onClick", "shouldHideMenuItem", "shouldDisableMenuItem", "disabled"];
|
5
6
|
|
6
7
|
/*
|
7
8
|
* Licensed Materials - Property of IBM
|
@@ -19,7 +20,8 @@ var blockClass = "".concat(pkg.prefix, "--datagrid");
|
|
19
20
|
var useActionsColumn = function useActionsColumn(hooks) {
|
20
21
|
var useAttachActionsOnInstance = function useAttachActionsOnInstance(instance) {
|
21
22
|
var rowActions = instance.rowActions,
|
22
|
-
isFetching = instance.isFetching
|
23
|
+
isFetching = instance.isFetching,
|
24
|
+
selectedFlatRows = instance.selectedFlatRows;
|
23
25
|
|
24
26
|
if (rowActions && Array.isArray(rowActions)) {
|
25
27
|
var addActionsMenu = function addActionsMenu(props, cellData) {
|
@@ -28,7 +30,7 @@ var useActionsColumn = function useActionsColumn(hooks) {
|
|
28
30
|
column = cell.column;
|
29
31
|
|
30
32
|
if (column.isAction) {
|
31
|
-
var
|
33
|
+
var _cx3;
|
32
34
|
|
33
35
|
return [props, {
|
34
36
|
children: /*#__PURE__*/React.createElement("div", {
|
@@ -40,26 +42,37 @@ var useActionsColumn = function useActionsColumn(hooks) {
|
|
40
42
|
style: {
|
41
43
|
display: 'flex'
|
42
44
|
}
|
43
|
-
}, rowActions.map(function (action) {
|
45
|
+
}, rowActions.map(function (action, index) {
|
44
46
|
var id = action.id,
|
45
47
|
itemText = action.itemText,
|
46
48
|
_onClick = action.onClick,
|
47
|
-
icon = action.icon
|
49
|
+
icon = action.icon,
|
50
|
+
rest = _objectWithoutProperties(action, _excluded);
|
51
|
+
|
52
|
+
var selectedRowId = selectedFlatRows === null || selectedFlatRows === void 0 ? void 0 : selectedFlatRows.filter(function (item) {
|
53
|
+
return item.id === row.id ? item.id : null;
|
54
|
+
});
|
48
55
|
return /*#__PURE__*/React.createElement("div", {
|
49
|
-
className: "".concat(blockClass, "__actions-column-button"),
|
50
|
-
key: ""
|
51
|
-
}, /*#__PURE__*/React.createElement(OverflowMenu, {
|
56
|
+
className: cx("".concat(blockClass, "__actions-column-button"), _defineProperty({}, "".concat(blockClass, "__disabled-row-action-button"), selectedFlatRows && selectedFlatRows.length && selectedRowId && selectedRowId.length)),
|
57
|
+
key: "".concat(itemText, "__").concat(index)
|
58
|
+
}, /*#__PURE__*/React.createElement(OverflowMenu, _extends({}, rest, {
|
52
59
|
renderIcon: icon,
|
53
60
|
hasIconOnly: true,
|
54
61
|
light: true,
|
55
62
|
iconDescription: itemText,
|
56
63
|
kind: "ghost",
|
64
|
+
className: cx(_defineProperty({}, "".concat(blockClass, "__disabled-row-action"), selectedFlatRows && selectedFlatRows.length && selectedRowId && selectedRowId.length)),
|
57
65
|
onClick: function onClick(e) {
|
66
|
+
if (selectedFlatRows && selectedFlatRows.length && selectedRowId && selectedRowId.length) {
|
67
|
+
// Row actions should be disabled if row is selected and batchActions toolbar is active
|
68
|
+
return;
|
69
|
+
}
|
70
|
+
|
58
71
|
e.stopPropagation();
|
59
72
|
|
60
73
|
_onClick(id, row, e);
|
61
74
|
}
|
62
|
-
}));
|
75
|
+
})));
|
63
76
|
})), !isFetching && rowActions.length > 2 && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(OverflowMenu, {
|
64
77
|
size: "sm",
|
65
78
|
light: true,
|
@@ -73,7 +86,7 @@ var useActionsColumn = function useActionsColumn(hooks) {
|
|
73
86
|
shouldHideMenuItem = action.shouldHideMenuItem,
|
74
87
|
shouldDisableMenuItem = action.shouldDisableMenuItem,
|
75
88
|
disabled = action.disabled,
|
76
|
-
rest = _objectWithoutProperties(action,
|
89
|
+
rest = _objectWithoutProperties(action, _excluded2);
|
77
90
|
|
78
91
|
var hidden = typeof shouldHideMenuItem === 'function' && shouldHideMenuItem(row); // shouldDisableMenuItem will override disabled because it's more specific
|
79
92
|
// if shouldDisableMenuItem doesn't exists, fall back to disabled
|
@@ -94,7 +107,10 @@ var useActionsColumn = function useActionsColumn(hooks) {
|
|
94
107
|
key: id
|
95
108
|
}));
|
96
109
|
})))),
|
97
|
-
className: cx((
|
110
|
+
className: cx((_cx3 = {}, _defineProperty(_cx3, "".concat(blockClass, "__actions-column-cell"), true), _defineProperty(_cx3, "".concat(blockClass, "__cell"), true), _cx3)),
|
111
|
+
style: {
|
112
|
+
width: 96
|
113
|
+
}
|
98
114
|
}];
|
99
115
|
}
|
100
116
|
|
@@ -26,6 +26,10 @@ var useCustomizeColumns = function useCustomizeColumns(hooks) {
|
|
26
26
|
|
27
27
|
hooks.useInstance.push(function (instance) {
|
28
28
|
var customizeColumnsProps = instance.customizeColumnsProps;
|
29
|
+
|
30
|
+
var _ref = customizeColumnsProps || {},
|
31
|
+
labels = _ref.labels;
|
32
|
+
|
29
33
|
Object.assign(instance, {
|
30
34
|
customizeColumnsProps: _objectSpread(_objectSpread({}, customizeColumnsProps), {}, {
|
31
35
|
isModalOpen: isModalOpen,
|
@@ -33,6 +37,7 @@ var useCustomizeColumns = function useCustomizeColumns(hooks) {
|
|
33
37
|
}),
|
34
38
|
CustomizeColumnsButton: function CustomizeColumnsButton(props) {
|
35
39
|
return /*#__PURE__*/React.createElement(ToggleButtonWrapper, _extends({
|
40
|
+
iconTooltipLabel: labels === null || labels === void 0 ? void 0 : labels.iconTooltipLabel,
|
36
41
|
isModalOpen: isModalOpen,
|
37
42
|
setIsModalOpen: setIsModalOpen
|
38
43
|
}, props));
|
@@ -13,13 +13,16 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
13
13
|
* restricted by GSA ADP Schedule Contract with IBM Corp.
|
14
14
|
*/
|
15
15
|
import React from 'react';
|
16
|
+
import cx from 'classnames';
|
16
17
|
import { pkg } from '../../settings';
|
17
18
|
var blockClass = "".concat(pkg.prefix, "--datagrid");
|
18
19
|
|
19
20
|
var useDefaultStringRenderer = function useDefaultStringRenderer(hooks) {
|
20
21
|
var StringRenderer = function StringRenderer(tableProps) {
|
22
|
+
var _tableProps$column;
|
23
|
+
|
21
24
|
return /*#__PURE__*/React.createElement("div", {
|
22
|
-
className: "".concat(blockClass, "__defaultStringRenderer"),
|
25
|
+
className: cx("".concat(blockClass, "__defaultStringRenderer"), _defineProperty({}, "".concat(blockClass, "__defaultStringRenderer--multiline"), (_tableProps$column = tableProps.column) === null || _tableProps$column === void 0 ? void 0 : _tableProps$column.multiLineWrap)),
|
23
26
|
title: tableProps.value
|
24
27
|
}, tableProps.value);
|
25
28
|
};
|
@@ -22,6 +22,8 @@ var useDisableSelectRows = function useDisableSelectRows(hooks) {
|
|
22
22
|
|
23
23
|
var updateSelectAll = function updateSelectAll(hooks) {
|
24
24
|
var getToggleAllRowsSelectedProps = function getToggleAllRowsSelectedProps(props, _ref2) {
|
25
|
+
var _instance$disableSele, _instance$disableSele2;
|
26
|
+
|
25
27
|
var instance = _ref2.instance;
|
26
28
|
var selectableRows = instance.rows.filter(function (row) {
|
27
29
|
return !(instance.shouldDisableSelectRow && instance.shouldDisableSelectRow(row));
|
@@ -41,7 +43,7 @@ var updateSelectAll = function updateSelectAll(hooks) {
|
|
41
43
|
},
|
42
44
|
checked: isAllRowsSelected,
|
43
45
|
disabled: instance.disableSelectAll,
|
44
|
-
title: 'Toggle All Rows Selected',
|
46
|
+
title: (instance === null || instance === void 0 ? void 0 : (_instance$disableSele = instance.disableSelectRowsProps) === null || _instance$disableSele === void 0 ? void 0 : (_instance$disableSele2 = _instance$disableSele.labels) === null || _instance$disableSele2 === void 0 ? void 0 : _instance$disableSele2.toggleAllRowsLabel) || 'Toggle All Rows Selected',
|
45
47
|
indeterminate: Boolean(!isAllRowsSelected && Object.keys(instance.state.selectedRowIds).length)
|
46
48
|
}];
|
47
49
|
};
|
@@ -51,6 +53,8 @@ var updateSelectAll = function updateSelectAll(hooks) {
|
|
51
53
|
|
52
54
|
var updatePageSelectAll = function updatePageSelectAll(hooks) {
|
53
55
|
var getToggleAllPageRowsSelectedProps = function getToggleAllPageRowsSelectedProps(props, _ref4) {
|
56
|
+
var _instance$disableSele3, _instance$disableSele4;
|
57
|
+
|
54
58
|
var instance = _ref4.instance;
|
55
59
|
var selectableRows = instance.page.filter(function (row) {
|
56
60
|
return !(instance.shouldDisableSelectRow && instance.shouldDisableSelectRow(row));
|
@@ -70,7 +74,7 @@ var updatePageSelectAll = function updatePageSelectAll(hooks) {
|
|
70
74
|
},
|
71
75
|
checked: isAllRowsSelected,
|
72
76
|
disabled: instance.disableSelectAll,
|
73
|
-
title: 'Toggle All Rows Selected',
|
77
|
+
title: (instance === null || instance === void 0 ? void 0 : (_instance$disableSele3 = instance.disableSelectRowsProps) === null || _instance$disableSele3 === void 0 ? void 0 : (_instance$disableSele4 = _instance$disableSele3.labels) === null || _instance$disableSele4 === void 0 ? void 0 : _instance$disableSele4.toggleAllRowsLabel) || 'Toggle All Rows Selected',
|
74
78
|
indeterminate: Boolean(!isAllRowsSelected && instance.page.some(function (_ref6) {
|
75
79
|
var id = _ref6.id;
|
76
80
|
return instance.state.selectedRowIds[id];
|
@@ -37,7 +37,6 @@ var useExpandedRow = function useExpandedRow(hooks) {
|
|
37
37
|
return _objectSpread(_objectSpread({}, row), {}, {
|
38
38
|
canExpand: row.original && !row.original.notExpandable,
|
39
39
|
expandedContentHeight: expandedRowsHeight[row.index] || expandedContentHeight,
|
40
|
-
// RowRenderer: DatagridExpandedRow(row.RowRenderer, expansionRenderer),
|
41
40
|
RowRenderer: DatagridExpandedRow(row.RowRenderer, ExpandedRowContentComponent)
|
42
41
|
});
|
43
42
|
});
|
@@ -18,7 +18,10 @@ var useInfiniteScroll = function useInfiniteScroll(hooks) {
|
|
18
18
|
var isFetching = instance.isFetching,
|
19
19
|
tableHeight = instance.tableHeight,
|
20
20
|
innerListRef = instance.innerListRef,
|
21
|
-
fetchMoreData = instance.fetchMoreData
|
21
|
+
fetchMoreData = instance.fetchMoreData,
|
22
|
+
tableId = instance.tableId;
|
23
|
+
var tableElement = document.querySelector("#".concat(tableId));
|
24
|
+
var totalTableHeight = tableHeight || (tableElement === null || tableElement === void 0 ? void 0 : tableElement.clientHeight);
|
22
25
|
var loadMoreThreshold = 200;
|
23
26
|
|
24
27
|
var emptyFetchData = function emptyFetchData() {}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
@@ -34,7 +37,7 @@ var useInfiniteScroll = function useInfiniteScroll(hooks) {
|
|
34
37
|
scrollOffset = _ref.scrollOffset;
|
35
38
|
|
36
39
|
if (innerListRef && innerListRef.current) {
|
37
|
-
if (!isFetching && scrollDirection === 'forward' && scrollOffset +
|
40
|
+
if (!isFetching && scrollDirection === 'forward' && scrollOffset + totalTableHeight >= innerListRef.current.clientHeight - loadMoreThreshold) {
|
38
41
|
if (fetchMoreData) {
|
39
42
|
fetchMore();
|
40
43
|
}
|
@@ -0,0 +1,71 @@
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
2
|
+
|
3
|
+
/*
|
4
|
+
* Licensed Materials - Property of IBM
|
5
|
+
* 5724-Q36
|
6
|
+
* (c) Copyright IBM Corp. 2022
|
7
|
+
* US Government Users Restricted Rights - Use, duplication or disclosure
|
8
|
+
* restricted by GSA ADP Schedule Contract with IBM Corp.
|
9
|
+
*/
|
10
|
+
import React from 'react';
|
11
|
+
import { pkg } from '../../settings';
|
12
|
+
import cx from 'classnames';
|
13
|
+
import { InlineEditCell } from './Datagrid/addons/InlineEdit/InlineEditCell';
|
14
|
+
var blockClass = "".concat(pkg.prefix, "--datagrid");
|
15
|
+
|
16
|
+
var useInlineEdit = function useInlineEdit(hooks) {
|
17
|
+
var addInlineEdit = function addInlineEdit(props, _ref) {
|
18
|
+
var _cell$column, _cell$column$inlineEd, _instance$columns$fil;
|
19
|
+
|
20
|
+
var cell = _ref.cell,
|
21
|
+
instance = _ref.instance;
|
22
|
+
var columnInlineEditConfig = cell.column.inlineEdit;
|
23
|
+
var inlineEditType = (_cell$column = cell.column) === null || _cell$column === void 0 ? void 0 : (_cell$column$inlineEd = _cell$column.inlineEdit) === null || _cell$column$inlineEd === void 0 ? void 0 : _cell$column$inlineEd.type;
|
24
|
+
var totalInlineEditColumns = (_instance$columns$fil = instance.columns.filter(function (item) {
|
25
|
+
return item.inlineEdit;
|
26
|
+
})) === null || _instance$columns$fil === void 0 ? void 0 : _instance$columns$fil.length;
|
27
|
+
|
28
|
+
var renderInlineEditComponent = function renderInlineEditComponent(type) {
|
29
|
+
return /*#__PURE__*/React.createElement(InlineEditCell, {
|
30
|
+
config: columnInlineEditConfig,
|
31
|
+
tabIndex: -1,
|
32
|
+
value: cell.value,
|
33
|
+
cell: cell,
|
34
|
+
instance: instance,
|
35
|
+
totalInlineEditColumns: totalInlineEditColumns,
|
36
|
+
type: type
|
37
|
+
});
|
38
|
+
};
|
39
|
+
|
40
|
+
if (cell.column.id === 'spacer') {
|
41
|
+
return [props, {
|
42
|
+
className: cx("".concat(blockClass, "__cell"), "".concat(blockClass, "__cell--spacer"))
|
43
|
+
}];
|
44
|
+
}
|
45
|
+
|
46
|
+
return [props, {
|
47
|
+
className: cx("".concat(blockClass, "__cell"), _defineProperty({}, "".concat(blockClass, "__cell-inline-edit"), true)),
|
48
|
+
role: 'gridcell',
|
49
|
+
children: /*#__PURE__*/React.createElement(React.Fragment, null, inlineEditType === 'text' && renderInlineEditComponent(inlineEditType), inlineEditType === 'number' && renderInlineEditComponent(inlineEditType), inlineEditType === 'selection' && renderInlineEditComponent(inlineEditType), inlineEditType === 'date' && renderInlineEditComponent(inlineEditType), !inlineEditType && /*#__PURE__*/React.createElement(InlineEditCell, {
|
50
|
+
config: columnInlineEditConfig,
|
51
|
+
tabIndex: -1,
|
52
|
+
value: cell.value,
|
53
|
+
cell: cell,
|
54
|
+
instance: instance,
|
55
|
+
disabled: true,
|
56
|
+
nonEditCell: true,
|
57
|
+
totalInlineEditColumns: totalInlineEditColumns,
|
58
|
+
type: "text"
|
59
|
+
}))
|
60
|
+
}];
|
61
|
+
};
|
62
|
+
|
63
|
+
hooks.getCellProps.push(addInlineEdit);
|
64
|
+
hooks.useInstance.push(function (instance) {
|
65
|
+
Object.assign(instance, {
|
66
|
+
withInlineEdit: true
|
67
|
+
});
|
68
|
+
});
|
69
|
+
};
|
70
|
+
|
71
|
+
export default useInlineEdit;
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
4
|
+
|
5
|
+
/* eslint-disable react/prop-types */
|
6
|
+
|
7
|
+
/*
|
8
|
+
* Licensed Materials - Property of IBM
|
9
|
+
* 5724-Q36
|
10
|
+
* (c) Copyright IBM Corp. 2020
|
11
|
+
* US Government Users Restricted Rights - Use, duplication or disclosure
|
12
|
+
* restricted by GSA ADP Schedule Contract with IBM Corp.
|
13
|
+
*/
|
14
|
+
import React from 'react';
|
15
|
+
import { ChevronRight } from '@carbon/react/icons';
|
16
|
+
import cx from 'classnames';
|
17
|
+
import { pkg, carbon } from '../../settings';
|
18
|
+
var blockClass = "".concat(pkg.prefix, "--datagrid");
|
19
|
+
|
20
|
+
var useNestedRowExpander = function useNestedRowExpander(hooks) {
|
21
|
+
var visibleColumns = function visibleColumns(columns) {
|
22
|
+
var expanderColumn = {
|
23
|
+
id: 'expander',
|
24
|
+
Cell: function Cell(_ref) {
|
25
|
+
var _cx;
|
26
|
+
|
27
|
+
var row = _ref.row;
|
28
|
+
return row.canExpand && /*#__PURE__*/React.createElement("button", _extends({
|
29
|
+
type: "button",
|
30
|
+
"aria-label": "Expand current row",
|
31
|
+
className: cx("".concat(blockClass, "__row-expander"), "".concat(carbon.prefix, "--btn"), "".concat(carbon.prefix, "--btn--ghost"))
|
32
|
+
}, row.getToggleRowExpandedProps()), /*#__PURE__*/React.createElement(ChevronRight, {
|
33
|
+
className: cx("".concat(blockClass, "__expander-icon"), (_cx = {}, _defineProperty(_cx, "".concat(blockClass, "__expander-icon--not-open"), !row.isExpanded), _defineProperty(_cx, "".concat(blockClass, "__expander-icon--open"), row.isExpanded), _cx))
|
34
|
+
}));
|
35
|
+
},
|
36
|
+
width: 48,
|
37
|
+
disableResizing: true,
|
38
|
+
disableSortBy: true,
|
39
|
+
Header: ''
|
40
|
+
};
|
41
|
+
return [expanderColumn].concat(_toConsumableArray(columns));
|
42
|
+
};
|
43
|
+
|
44
|
+
hooks.visibleColumns.push(visibleColumns);
|
45
|
+
};
|
46
|
+
|
47
|
+
export default useNestedRowExpander;
|
@@ -1,3 +1,5 @@
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
2
|
+
|
1
3
|
/*
|
2
4
|
* Licensed Materials - Property of IBM
|
3
5
|
* 5724-Q36
|
@@ -5,18 +7,21 @@
|
|
5
7
|
* US Government Users Restricted Rights - Use, duplication or disclosure
|
6
8
|
* restricted by GSA ADP Schedule Contract with IBM Corp.
|
7
9
|
*/
|
8
|
-
import useRowExpander from './useRowExpander';
|
9
10
|
import { pkg } from '../../settings';
|
11
|
+
import cx from 'classnames';
|
12
|
+
import useNestedRowExpander from './useNestedRowExpander';
|
10
13
|
var blockClass = "".concat(pkg.prefix, "--datagrid");
|
11
14
|
|
12
15
|
var useNestedRows = function useNestedRows(hooks) {
|
13
|
-
|
16
|
+
useNestedRowExpander(hooks);
|
14
17
|
var marginLeft = 24;
|
15
18
|
|
16
19
|
var getRowProps = function getRowProps(props, _ref) {
|
20
|
+
var _cx;
|
21
|
+
|
17
22
|
var row = _ref.row;
|
18
23
|
return [props, {
|
19
|
-
className: row.depth > 0
|
24
|
+
className: cx((_cx = {}, _defineProperty(_cx, "".concat(blockClass, "__carbon-nested-row"), row.depth > 0), _defineProperty(_cx, "".concat(blockClass, "__carbon-row-expanded"), row.isExpanded), _cx))
|
20
25
|
}];
|
21
26
|
};
|
22
27
|
|
@@ -25,7 +30,7 @@ var useNestedRows = function useNestedRows(hooks) {
|
|
25
30
|
return [props, {
|
26
31
|
style: {
|
27
32
|
marginLeft: "".concat(row.depth > 0 ? marginLeft : 0, "px"),
|
28
|
-
paddingLeft: "".concat(row.depth
|
33
|
+
paddingLeft: "".concat(row.depth === 2 ? marginLeft * (row.depth - 1) + marginLeft - 8 : row.depth > 2 ? marginLeft * (row.depth - 1) + marginLeft : row.depth === 1 ? marginLeft - 16 : 0, "px"),
|
29
34
|
maxWidth: "calc(100% - ".concat(marginLeft * row.depth, "px)")
|
30
35
|
}
|
31
36
|
}];
|
@@ -45,9 +50,16 @@ var useNestedRows = function useNestedRows(hooks) {
|
|
45
50
|
}];
|
46
51
|
};
|
47
52
|
|
53
|
+
var useInstance = function useInstance(instance) {
|
54
|
+
Object.assign(instance, {
|
55
|
+
withNestedRows: true
|
56
|
+
});
|
57
|
+
};
|
58
|
+
|
48
59
|
hooks.getRowProps.push(getRowProps);
|
49
60
|
hooks.getRowProps.push(getRowStyles);
|
50
61
|
hooks.getCellProps.push(getCellProps);
|
62
|
+
hooks.useInstance.push(useInstance);
|
51
63
|
};
|
52
64
|
|
53
65
|
export default useNestedRows;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
3
|
|
3
4
|
/* eslint-disable react/prop-types */
|
4
5
|
|
@@ -10,7 +11,10 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
10
11
|
* restricted by GSA ADP Schedule Contract with IBM Corp.
|
11
12
|
*/
|
12
13
|
import React from 'react';
|
13
|
-
import { ChevronDown, ChevronUp } from '@carbon/icons
|
14
|
+
import { ChevronDown, ChevronUp } from '@carbon/react/icons';
|
15
|
+
import { pkg, carbon } from '../../settings';
|
16
|
+
import cx from 'classnames';
|
17
|
+
var blockClass = "".concat(pkg.prefix, "--datagrid");
|
14
18
|
|
15
19
|
var useRowExpander = function useRowExpander(hooks) {
|
16
20
|
var visibleColumns = function visibleColumns(columns) {
|
@@ -18,10 +22,14 @@ var useRowExpander = function useRowExpander(hooks) {
|
|
18
22
|
id: 'expander',
|
19
23
|
Cell: function Cell(_ref) {
|
20
24
|
var row = _ref.row;
|
21
|
-
return row.canExpand && /*#__PURE__*/React.createElement("
|
22
|
-
|
25
|
+
return row.canExpand && /*#__PURE__*/React.createElement("button", _extends({
|
26
|
+
type: "button",
|
27
|
+
"aria-label": "Expand current row",
|
28
|
+
className: cx("".concat(blockClass, "__row-expander"), "".concat(carbon.prefix, "--btn"), "".concat(carbon.prefix, "--btn--ghost"))
|
29
|
+
}, row.getToggleRowExpandedProps()), row.isExpanded ? /*#__PURE__*/React.createElement(ChevronUp, {
|
30
|
+
className: "".concat(blockClass, "__row-expander--icon")
|
23
31
|
}) : /*#__PURE__*/React.createElement(ChevronDown, {
|
24
|
-
|
32
|
+
className: "".concat(blockClass, "__row-expander--icon")
|
25
33
|
}));
|
26
34
|
},
|
27
35
|
width: 48,
|
@@ -1,5 +1,10 @@
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
1
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
2
3
|
|
4
|
+
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; }
|
5
|
+
|
6
|
+
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; }
|
7
|
+
|
3
8
|
/*
|
4
9
|
* Licensed Materials - Property of IBM
|
5
10
|
* 5724-Q36
|
@@ -17,13 +22,19 @@ var useRowSize = function useRowSize(hooks) {
|
|
17
22
|
setRowSize = _useState2[1];
|
18
23
|
|
19
24
|
hooks.useInstance.push(function (instance) {
|
20
|
-
var
|
25
|
+
var rowSizeProps = instance.rowSizeProps,
|
26
|
+
rowSizes = instance.rowSizes,
|
21
27
|
rowSize = instance.rowSize,
|
22
28
|
onRowSizeChange = instance.onRowSizeChange;
|
29
|
+
|
30
|
+
var _ref = rowSizeProps || {},
|
31
|
+
labels = _ref.labels;
|
32
|
+
|
23
33
|
Object.assign(instance, {
|
24
34
|
rowSize: internalRowSize || rowSize,
|
25
|
-
rowSizeDropdownProps: {
|
26
|
-
rowSizes: rowSizes
|
35
|
+
rowSizeDropdownProps: _objectSpread(_objectSpread({
|
36
|
+
rowSizes: rowSizes
|
37
|
+
}, labels), {}, {
|
27
38
|
selectedOption: internalRowSize || rowSize,
|
28
39
|
onChange: function onChange(value) {
|
29
40
|
setRowSize(value);
|
@@ -32,13 +43,13 @@ var useRowSize = function useRowSize(hooks) {
|
|
32
43
|
onRowSizeChange(value);
|
33
44
|
}
|
34
45
|
}
|
35
|
-
},
|
46
|
+
}),
|
36
47
|
RowSizeDropdown: RowSizeDropdown
|
37
48
|
});
|
38
49
|
});
|
39
50
|
|
40
|
-
var getTableProps = function getTableProps(props,
|
41
|
-
var instance =
|
51
|
+
var getTableProps = function getTableProps(props, _ref2) {
|
52
|
+
var instance = _ref2.instance;
|
42
53
|
var rowSize = instance.rowSize;
|
43
54
|
|
44
55
|
if (!rowSize) {
|
@@ -1,3 +1,5 @@
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
2
|
+
|
1
3
|
/*
|
2
4
|
* Licensed Materials - Property of IBM
|
3
5
|
* 5724-Q36
|
@@ -7,6 +9,7 @@
|
|
7
9
|
*/
|
8
10
|
// @flow
|
9
11
|
import React from 'react';
|
12
|
+
import cx from 'classnames';
|
10
13
|
import { selectionColumnId } from './common-column-ids';
|
11
14
|
import SelectAllWithToggle from './Datagrid/DatagridSelectAllWithToggle';
|
12
15
|
import { pkg } from '../../settings';
|
@@ -40,12 +43,18 @@ var useSelectAllWithToggleComponent = function useSelectAllWithToggleComponent(h
|
|
40
43
|
|
41
44
|
var useAddClassNameToSelectRow = function useAddClassNameToSelectRow(hooks) {
|
42
45
|
hooks.getCellProps.push(function (props, data) {
|
46
|
+
var _columns$;
|
47
|
+
|
43
48
|
var column = data.cell.column;
|
44
|
-
var
|
49
|
+
var _data$instance = data.instance,
|
50
|
+
DatagridPagination = _data$instance.DatagridPagination,
|
51
|
+
columns = _data$instance.columns,
|
52
|
+
withStickyColumn = _data$instance.withStickyColumn;
|
53
|
+
var isFirstColumnStickyLeft = ((_columns$ = columns[0]) === null || _columns$ === void 0 ? void 0 : _columns$.sticky) === 'left' && withStickyColumn;
|
45
54
|
|
46
55
|
if (column.id === selectionColumnId && DatagridPagination) {
|
47
56
|
return [props, {
|
48
|
-
className: "".concat(blockClass, "__select-all-toggle-on")
|
57
|
+
className: cx("".concat(blockClass, "__select-all-toggle-on"), _defineProperty({}, "".concat(blockClass, "__select-all-sticky-left"), isFirstColumnStickyLeft))
|
49
58
|
}];
|
50
59
|
}
|
51
60
|
|
@@ -59,14 +68,18 @@ var Header = function Header(gridState) {
|
|
59
68
|
selectAllToggle = gridState.selectAllToggle,
|
60
69
|
getToggleAllPageRowsSelectedProps = gridState.getToggleAllPageRowsSelectedProps,
|
61
70
|
getToggleAllRowsSelectedProps = gridState.getToggleAllRowsSelectedProps,
|
62
|
-
isAllRowsSelected = gridState.isAllRowsSelected
|
71
|
+
isAllRowsSelected = gridState.isAllRowsSelected,
|
72
|
+
withStickyColumn = gridState.withStickyColumn,
|
73
|
+
columns = gridState.columns;
|
63
74
|
var props = {
|
64
75
|
tableId: tableId,
|
65
76
|
isFetching: isFetching,
|
66
77
|
selectAllToggle: selectAllToggle,
|
67
78
|
getToggleAllPageRowsSelectedProps: getToggleAllPageRowsSelectedProps,
|
68
79
|
getToggleAllRowsSelectedProps: getToggleAllRowsSelectedProps,
|
69
|
-
isAllRowsSelected: isAllRowsSelected
|
80
|
+
isAllRowsSelected: isAllRowsSelected,
|
81
|
+
withStickyColumn: withStickyColumn,
|
82
|
+
columns: columns
|
70
83
|
};
|
71
84
|
return /*#__PURE__*/React.createElement(SelectAllWithToggle, props);
|
72
85
|
};
|
@@ -41,6 +41,11 @@ var useSelectRows = function useSelectRows(hooks) {
|
|
41
41
|
};
|
42
42
|
|
43
43
|
hooks.useInstance.push(useInstance);
|
44
|
+
hooks.useInstance.push(function (instance) {
|
45
|
+
Object.assign(instance, {
|
46
|
+
withSelectRows: true
|
47
|
+
});
|
48
|
+
});
|
44
49
|
hooks.visibleColumns.push(function (columns) {
|
45
50
|
return [{
|
46
51
|
id: selectionColumnId,
|
@@ -66,6 +71,8 @@ var useHighlightSelection = function useHighlightSelection(hooks) {
|
|
66
71
|
};
|
67
72
|
|
68
73
|
var SelectRow = function SelectRow(datagridState) {
|
74
|
+
var _columns$;
|
75
|
+
|
69
76
|
var _datagridState$isFetc = datagridState.isFetching,
|
70
77
|
isFetching = _datagridState$isFetc === void 0 ? false : _datagridState$isFetc,
|
71
78
|
tableId = datagridState.tableId,
|
@@ -73,7 +80,9 @@ var SelectRow = function SelectRow(datagridState) {
|
|
73
80
|
cell = datagridState.cell,
|
74
81
|
radio = datagridState.radio,
|
75
82
|
toggleAllRowsSelected = datagridState.toggleAllRowsSelected,
|
76
|
-
onRadioSelect = datagridState.onRadioSelect
|
83
|
+
onRadioSelect = datagridState.onRadioSelect,
|
84
|
+
columns = datagridState.columns,
|
85
|
+
withStickyColumn = datagridState.withStickyColumn;
|
77
86
|
var selectDisabled = isFetching || row.getRowProps().selectDisabled;
|
78
87
|
|
79
88
|
var _row$getToggleRowSele = row.getToggleRowSelectedProps(),
|
@@ -81,6 +90,7 @@ var SelectRow = function SelectRow(datagridState) {
|
|
81
90
|
selectProps = _objectWithoutProperties(_row$getToggleRowSele, _excluded);
|
82
91
|
|
83
92
|
var cellProps = cell.getCellProps();
|
93
|
+
var isFirstColumnStickyLeft = ((_columns$ = columns[0]) === null || _columns$ === void 0 ? void 0 : _columns$.sticky) === 'left' && withStickyColumn;
|
84
94
|
return /*#__PURE__*/React.createElement(TableSelectRow, _extends({}, cellProps, selectProps, {
|
85
95
|
radio: radio,
|
86
96
|
onSelect: function onSelect(e) {
|
@@ -98,7 +108,7 @@ var SelectRow = function SelectRow(datagridState) {
|
|
98
108
|
},
|
99
109
|
id: "".concat(tableId, "-").concat(row.index),
|
100
110
|
name: "".concat(tableId, "-").concat(row.index, "-name"),
|
101
|
-
className: cx("".concat(blockClass, "__checkbox-cell"), cellProps.className),
|
111
|
+
className: cx("".concat(blockClass, "__checkbox-cell"), cellProps.className, _defineProperty({}, "".concat(blockClass, "__checkbox-cell-sticky-left"), isFirstColumnStickyLeft)),
|
102
112
|
ariaLabel: "".concat(tableId, "-row-").concat(row.index) // TODO: aria label should be i18n'ed
|
103
113
|
,
|
104
114
|
disabled: selectDisabled
|
@@ -15,7 +15,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
15
15
|
*/
|
16
16
|
import React from 'react';
|
17
17
|
import { Button } from '@carbon/react';
|
18
|
-
import { ArrowUp, ArrowDown, ArrowsVertical } from '@carbon/icons
|
18
|
+
import { ArrowUp, ArrowDown, ArrowsVertical } from '@carbon/react/icons';
|
19
19
|
var ordering = {
|
20
20
|
ASC: 'ASC',
|
21
21
|
DESC: 'DESC',
|
@@ -17,6 +17,7 @@ import cx from 'classnames';
|
|
17
17
|
import { pkg } from '../../settings';
|
18
18
|
var blockClass = "".concat(pkg.prefix, "--datagrid");
|
19
19
|
var styleClassPrefix = "".concat(blockClass, "__right-sticky-column");
|
20
|
+
var leftStickyStyleClassPrefix = "".concat(blockClass, "__left-sticky-column");
|
20
21
|
var OFFSET_SCROLL_CLASS = "".concat(styleClassPrefix, "-offset-scroll");
|
21
22
|
|
22
23
|
var useStickyColumn = function useStickyColumn(hooks) {
|
@@ -144,6 +145,16 @@ var changeProps = function changeProps(elementName, headerCellRef, props, data)
|
|
144
145
|
})];
|
145
146
|
}
|
146
147
|
|
148
|
+
if (column.sticky === 'left') {
|
149
|
+
var _data$instance, _cx2;
|
150
|
+
|
151
|
+
return [props, _objectSpread({
|
152
|
+
className: cx((_cx2 = {}, _defineProperty(_cx2, "".concat(leftStickyStyleClassPrefix, "-").concat(elementName), true), _defineProperty(_cx2, "".concat(leftStickyStyleClassPrefix, "-").concat(elementName, "--with-extra-select-column"), data === null || data === void 0 ? void 0 : (_data$instance = data.instance) === null || _data$instance === void 0 ? void 0 : _data$instance.withSelectRows), _cx2))
|
153
|
+
}, headerCellRef && {
|
154
|
+
ref: headerCellRef
|
155
|
+
})];
|
156
|
+
}
|
157
|
+
|
147
158
|
return [props];
|
148
159
|
};
|
149
160
|
|