@carbon/ibm-products 2.0.0-rc.1 → 2.0.0-rc.11
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 +1294 -331
- 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 +1171 -416
- 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 +1068 -262
- 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 +65 -15
- 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 +42 -0
- package/es/components/DataSpreadsheet/utils/handleMultipleKeys.js +1 -1
- package/es/components/Datagrid/Datagrid/Datagrid.js +13 -37
- package/es/components/Datagrid/Datagrid/DatagridContent.js +159 -0
- package/es/components/Datagrid/Datagrid/DatagridEmptyBody.js +17 -4
- package/es/components/Datagrid/Datagrid/DatagridExpandedRow.js +9 -1
- package/es/components/Datagrid/Datagrid/DatagridRow.js +44 -5
- 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 +29 -8
- package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +31 -9
- 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/Filtering/FilterFlyout.js +424 -0
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +83 -0
- package/es/components/Datagrid/Datagrid/addons/Filtering/constants.js +20 -0
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useInitialStateFromFilters.js +22 -0
- package/es/components/Datagrid/Datagrid/addons/Filtering/index.js +7 -0
- package/es/components/Datagrid/Datagrid/addons/Filtering/utils.js +38 -0
- 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 +4 -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/useFiltering.js +90 -0
- 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/useParentDimensions.js +3 -1
- 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 +223 -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 +94 -0
- package/es/components/Datagrid/utils/getInlineEditColumns.js +158 -0
- package/es/components/Datagrid/utils/makeData.js +55 -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/FilterSummary/FilterSummary.js +54 -0
- package/es/components/FilterSummary/index.js +7 -0
- 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 +65 -14
- 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 +53 -0
- package/lib/components/DataSpreadsheet/utils/handleMultipleKeys.js +1 -1
- package/lib/components/Datagrid/Datagrid/Datagrid.js +16 -44
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +193 -0
- package/lib/components/Datagrid/Datagrid/DatagridEmptyBody.js +17 -4
- package/lib/components/Datagrid/Datagrid/DatagridExpandedRow.js +9 -1
- package/lib/components/Datagrid/Datagrid/DatagridRow.js +45 -5
- 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 +32 -8
- package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +33 -9
- 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/Filtering/FilterFlyout.js +443 -0
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +104 -0
- package/lib/components/Datagrid/Datagrid/addons/Filtering/constants.js +35 -0
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useInitialStateFromFilters.js +33 -0
- package/lib/components/Datagrid/Datagrid/addons/Filtering/index.js +15 -0
- package/lib/components/Datagrid/Datagrid/addons/Filtering/utils.js +47 -0
- 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 +25 -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/useFiltering.js +94 -0
- 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/useParentDimensions.js +3 -1
- 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 +248 -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 +102 -0
- package/lib/components/Datagrid/utils/getInlineEditColumns.js +173 -0
- package/lib/components/Datagrid/utils/makeData.js +57 -3
- 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/FilterSummary/FilterSummary.js +72 -0
- package/lib/components/FilterSummary/index.js +15 -0
- 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 -1
- package/scss/components/Datagrid/_storybook-styles.scss +29 -5
- package/scss/components/Datagrid/styles/_datagrid.scss +105 -18
- package/scss/components/Datagrid/styles/_draggableElement.scss +26 -9
- package/scss/components/Datagrid/styles/_index.scss +2 -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/_FilterFlyout.scss +87 -0
- 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/FilterSummary/_filter-summary.scss +20 -0
- package/scss/components/FilterSummary/_index.scss +10 -0
- package/scss/components/FilterSummary/_storybook-styles.scss +14 -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 +4 -1
@@ -0,0 +1,46 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports.DatagridPagination = void 0;
|
9
|
+
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
11
|
+
|
12
|
+
var _react2 = require("@carbon/react");
|
13
|
+
|
14
|
+
/* eslint-disable react/prop-types */
|
15
|
+
|
16
|
+
/**
|
17
|
+
* Copyright IBM Corp. 2022, 2022
|
18
|
+
*
|
19
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
20
|
+
* LICENSE file in the root directory of this source tree.
|
21
|
+
*/
|
22
|
+
var DatagridPagination = function DatagridPagination(_ref) {
|
23
|
+
var state = _ref.state,
|
24
|
+
setPageSize = _ref.setPageSize,
|
25
|
+
gotoPage = _ref.gotoPage,
|
26
|
+
rows = _ref.rows;
|
27
|
+
|
28
|
+
var updatePagination = function updatePagination(_ref2) {
|
29
|
+
var page = _ref2.page,
|
30
|
+
pageSize = _ref2.pageSize;
|
31
|
+
console.log(state);
|
32
|
+
setPageSize(pageSize);
|
33
|
+
gotoPage(page - 1); // Carbon is non-zero-based
|
34
|
+
};
|
35
|
+
|
36
|
+
return /*#__PURE__*/_react.default.createElement(_react2.Pagination, {
|
37
|
+
page: state.pageIndex + 1 // react-table is zero-based
|
38
|
+
,
|
39
|
+
pageSize: state.pageSize,
|
40
|
+
pageSizes: state.pageSizes || [10, 20, 30, 40, 50],
|
41
|
+
totalItems: rows.length,
|
42
|
+
onChange: updatePagination
|
43
|
+
});
|
44
|
+
};
|
45
|
+
|
46
|
+
exports.DatagridPagination = DatagridPagination;
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports.Wrapper = void 0;
|
9
|
+
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
11
|
+
|
12
|
+
/* eslint-disable react/prop-types */
|
13
|
+
|
14
|
+
/**
|
15
|
+
* Copyright IBM Corp. 2020, 2022
|
16
|
+
*
|
17
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
18
|
+
* LICENSE file in the root directory of this source tree.
|
19
|
+
*/
|
20
|
+
var Wrapper = function Wrapper(_ref) {
|
21
|
+
var children = _ref.children;
|
22
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
23
|
+
style: {
|
24
|
+
height: '100vh',
|
25
|
+
width: '100%',
|
26
|
+
padding: '1rem',
|
27
|
+
margin: '0',
|
28
|
+
zIndex: '0'
|
29
|
+
}
|
30
|
+
}, children);
|
31
|
+
};
|
32
|
+
|
33
|
+
exports.Wrapper = Wrapper;
|
@@ -0,0 +1,102 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.ARG_TYPES = void 0;
|
7
|
+
|
8
|
+
/**
|
9
|
+
* Copyright IBM Corp. 2022, 2022
|
10
|
+
*
|
11
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
12
|
+
* LICENSE file in the root directory of this source tree.
|
13
|
+
*/
|
14
|
+
var ARG_TYPES = {
|
15
|
+
gridTitle: {
|
16
|
+
name: 'gridTitle',
|
17
|
+
control: 'text',
|
18
|
+
description: 'This sets the title text for the Datagrid component. _This value is set/passed inside of the `datagridState` object._',
|
19
|
+
type: {
|
20
|
+
name: 'string',
|
21
|
+
required: false
|
22
|
+
}
|
23
|
+
},
|
24
|
+
gridDescription: {
|
25
|
+
name: 'gridDescription',
|
26
|
+
control: 'text',
|
27
|
+
description: 'This sets the description text for the Datagrid component. _This value is set/passed inside of the `datagridState` object._',
|
28
|
+
type: {
|
29
|
+
name: 'string',
|
30
|
+
required: false
|
31
|
+
}
|
32
|
+
},
|
33
|
+
emptyStateTitle: {
|
34
|
+
name: 'emptyStateTitle',
|
35
|
+
control: 'text',
|
36
|
+
description: 'This sets the empty state title text for the Datagrid component. _This value is set/passed inside of the `datagridState` object._',
|
37
|
+
type: {
|
38
|
+
name: 'string',
|
39
|
+
required: false
|
40
|
+
}
|
41
|
+
},
|
42
|
+
emptyStateDescription: {
|
43
|
+
name: 'emptyStateDescription',
|
44
|
+
control: 'text',
|
45
|
+
description: 'This sets the empty state description text for the Datagrid component. _This value is set/passed inside of the `datagridState` object._',
|
46
|
+
type: {
|
47
|
+
name: 'string',
|
48
|
+
required: false
|
49
|
+
}
|
50
|
+
},
|
51
|
+
emptyStateSize: {
|
52
|
+
control: 'select',
|
53
|
+
options: ['sm', 'lg']
|
54
|
+
},
|
55
|
+
useDenseHeader: {
|
56
|
+
control: {
|
57
|
+
type: 'radio'
|
58
|
+
},
|
59
|
+
options: [true, false],
|
60
|
+
description: 'This sets the dense header option for the Datagrid component. _This value is set/passed inside of the `datagridState` object._'
|
61
|
+
},
|
62
|
+
rowSize: {
|
63
|
+
control: 'select',
|
64
|
+
options: ['xs', 'sm', 'md', 'lg', 'xl'],
|
65
|
+
description: 'This sets the height for each row of the Datagrid component. _This value is set/passed inside of the `datagridState` object._'
|
66
|
+
},
|
67
|
+
rowSizes: {
|
68
|
+
control: 'object',
|
69
|
+
description: 'This array of objects specifies the different row size options that will render from the settings icon in the table actions. _This value is set/passed inside of the `datagridState` object._'
|
70
|
+
},
|
71
|
+
onRowSizeChange: {
|
72
|
+
description: 'Callback function that is called on row size changes. _This value is set/passed inside of the `datagridState` object._'
|
73
|
+
},
|
74
|
+
rowActions: {
|
75
|
+
control: 'object',
|
76
|
+
description: 'This array of objects renders the action buttons for each row in the Datagrid. _This value is set/passed inside of the `datagridState` object._',
|
77
|
+
action: 'Row action onClick'
|
78
|
+
},
|
79
|
+
batchActions: {
|
80
|
+
control: {
|
81
|
+
type: 'radio'
|
82
|
+
},
|
83
|
+
options: [true, false],
|
84
|
+
description: 'This will allow the Datagrid component to use batch actions. _This value is set/passed inside of the `datagridState` object._'
|
85
|
+
},
|
86
|
+
expandedContentHeight: {
|
87
|
+
control: {
|
88
|
+
type: 'number'
|
89
|
+
},
|
90
|
+
description: 'This value controls the height of the expanded content area. _This value is set/passed inside of the `datagridState` object._'
|
91
|
+
},
|
92
|
+
customizeColumnsProps: {
|
93
|
+
control: 'object',
|
94
|
+
description: 'This is an object containing all of the props used with the column customization extension. _This value is set/passed inside of the `datagridState` object._'
|
95
|
+
},
|
96
|
+
filterProps: {
|
97
|
+
name: 'Filter props',
|
98
|
+
control: 'object',
|
99
|
+
description: 'This is an object for all the props passed into the filter flyout and filter panel'
|
100
|
+
}
|
101
|
+
};
|
102
|
+
exports.ARG_TYPES = ARG_TYPES;
|
@@ -0,0 +1,173 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports.inlineEditSelectItems = exports.getInlineEditColumns = void 0;
|
9
|
+
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
11
|
+
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
13
|
+
|
14
|
+
var _icons = require("@carbon/react/icons");
|
15
|
+
|
16
|
+
/**
|
17
|
+
* Copyright IBM Corp. 2022, 2022
|
18
|
+
*
|
19
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
20
|
+
* LICENSE file in the root directory of this source tree.
|
21
|
+
*/
|
22
|
+
var inlineEditSelectItems = [{
|
23
|
+
id: 'option-0',
|
24
|
+
icon: function icon(props) {
|
25
|
+
return /*#__PURE__*/_react.default.createElement(_icons.ChartColumnFloating, (0, _extends2.default)({
|
26
|
+
size: 16
|
27
|
+
}, props));
|
28
|
+
},
|
29
|
+
text: 'Column Chart'
|
30
|
+
}, {
|
31
|
+
id: 'option-1',
|
32
|
+
icon: function icon(props) {
|
33
|
+
return /*#__PURE__*/_react.default.createElement(_icons.ChartBubble, (0, _extends2.default)({
|
34
|
+
size: 16
|
35
|
+
}, props));
|
36
|
+
},
|
37
|
+
text: 'Bubble Chart'
|
38
|
+
}, {
|
39
|
+
id: 'option-2',
|
40
|
+
icon: function icon(props) {
|
41
|
+
return /*#__PURE__*/_react.default.createElement(_icons.ChartVennDiagram, (0, _extends2.default)({
|
42
|
+
size: 16
|
43
|
+
}, props));
|
44
|
+
},
|
45
|
+
text: 'Venn Diagram'
|
46
|
+
}];
|
47
|
+
exports.inlineEditSelectItems = inlineEditSelectItems;
|
48
|
+
|
49
|
+
var getInlineEditColumns = function getInlineEditColumns() {
|
50
|
+
return [{
|
51
|
+
Header: 'Row Index',
|
52
|
+
accessor: function accessor(row, i) {
|
53
|
+
return i;
|
54
|
+
},
|
55
|
+
id: 'rowIndex' // id is required when accessor is a function.
|
56
|
+
|
57
|
+
}, {
|
58
|
+
Header: 'First Name',
|
59
|
+
accessor: 'firstName',
|
60
|
+
inlineEdit: {
|
61
|
+
type: 'text',
|
62
|
+
// required for including validation, this is used to set the invalid prop internally
|
63
|
+
validator: function validator(n) {
|
64
|
+
return n.length > 40;
|
65
|
+
},
|
66
|
+
// These props are passed to the Carbon component used for inline editing
|
67
|
+
inputProps: {
|
68
|
+
invalidText: 'Invalid text, character count must be less than 40'
|
69
|
+
}
|
70
|
+
}
|
71
|
+
}, {
|
72
|
+
Header: 'Last Name',
|
73
|
+
accessor: 'lastName',
|
74
|
+
inlineEdit: {
|
75
|
+
type: 'text',
|
76
|
+
// required for including validation, this is used to set the invalid prop internally
|
77
|
+
validator: function validator(n) {
|
78
|
+
return n.length > 40;
|
79
|
+
},
|
80
|
+
// These props are passed to the Carbon component used for inline editing
|
81
|
+
inputProps: {
|
82
|
+
invalidText: 'Invalid text, character count must be less than 40'
|
83
|
+
}
|
84
|
+
}
|
85
|
+
}, {
|
86
|
+
Header: 'Age',
|
87
|
+
accessor: 'age',
|
88
|
+
width: 120,
|
89
|
+
inlineEdit: {
|
90
|
+
// required for including validation, this is used to set the invalid prop internally
|
91
|
+
validator: function validator(n) {
|
92
|
+
return n && n < 18;
|
93
|
+
},
|
94
|
+
type: 'number',
|
95
|
+
// These props are passed to the Carbon component used for inline editing
|
96
|
+
inputProps: {
|
97
|
+
invalidText: 'Invalid number, must be 18 or greater'
|
98
|
+
}
|
99
|
+
}
|
100
|
+
}, {
|
101
|
+
Header: 'Visits',
|
102
|
+
accessor: 'visits',
|
103
|
+
width: 120,
|
104
|
+
inlineEdit: {
|
105
|
+
validator: function validator(n) {
|
106
|
+
return n && n < 10;
|
107
|
+
},
|
108
|
+
type: 'number',
|
109
|
+
inputProps: {
|
110
|
+
invalidText: 'Invalid number, must be 10 or greater'
|
111
|
+
} // These props are passed to the Carbon component used for inline editing
|
112
|
+
|
113
|
+
}
|
114
|
+
}, {
|
115
|
+
Header: 'Active since',
|
116
|
+
accessor: 'activeSince',
|
117
|
+
inlineEdit: {
|
118
|
+
type: 'date',
|
119
|
+
inputProps: {
|
120
|
+
// optionally pass props here to be passed through to Carbon's DatePicker component
|
121
|
+
onChange: function onChange(newDateObj, cell) {
|
122
|
+
console.log(newDateObj, cell);
|
123
|
+
},
|
124
|
+
// optionally pass props here to be passed through to Carbon's DatePickerInput component
|
125
|
+
datePickerInputProps: {
|
126
|
+
labelText: 'Change active since date'
|
127
|
+
}
|
128
|
+
}
|
129
|
+
}
|
130
|
+
}, {
|
131
|
+
Header: 'Chart type',
|
132
|
+
accessor: 'chartType',
|
133
|
+
inlineEdit: {
|
134
|
+
type: 'selection',
|
135
|
+
inputProps: {
|
136
|
+
// These props are passed to the Carbon component used for inline editing
|
137
|
+
items: inlineEditSelectItems,
|
138
|
+
onChange: function onChange(item) {
|
139
|
+
return console.log(item);
|
140
|
+
}
|
141
|
+
}
|
142
|
+
}
|
143
|
+
}, {
|
144
|
+
Header: 'Someone 2',
|
145
|
+
accessor: 'someone2'
|
146
|
+
}, {
|
147
|
+
Header: 'Someone 3',
|
148
|
+
accessor: 'someone3'
|
149
|
+
}, {
|
150
|
+
Header: 'Someone 4',
|
151
|
+
accessor: 'someone4'
|
152
|
+
}, {
|
153
|
+
Header: 'Someone 5',
|
154
|
+
accessor: 'someone5'
|
155
|
+
}, {
|
156
|
+
Header: 'Someone 6',
|
157
|
+
accessor: 'someone6'
|
158
|
+
}, {
|
159
|
+
Header: 'Someone 7',
|
160
|
+
accessor: 'someone7'
|
161
|
+
}, {
|
162
|
+
Header: 'Someone 8',
|
163
|
+
accessor: 'someone8'
|
164
|
+
}, {
|
165
|
+
Header: 'Someone 9',
|
166
|
+
accessor: 'someone9'
|
167
|
+
}, {
|
168
|
+
Header: 'Someone 10',
|
169
|
+
accessor: 'someone10'
|
170
|
+
}];
|
171
|
+
};
|
172
|
+
|
173
|
+
exports.getInlineEditColumns = getInlineEditColumns;
|
@@ -13,10 +13,25 @@ var _react = _interopRequireDefault(require("react"));
|
|
13
13
|
|
14
14
|
var _namor = _interopRequireDefault(require("namor"));
|
15
15
|
|
16
|
+
var _getInlineEditColumns = require("./getInlineEditColumns");
|
17
|
+
|
16
18
|
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; }
|
17
19
|
|
18
20
|
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) { (0, _defineProperty2.default)(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; }
|
19
21
|
|
22
|
+
var getRandomInteger = function getRandomInteger(min, max, decimalPlaces) {
|
23
|
+
var roundedMin = Math.ceil(min);
|
24
|
+
var roundedMax = Math.floor(max);
|
25
|
+
var randomNumber = Math.random() * (max - min) + min;
|
26
|
+
|
27
|
+
if (!decimalPlaces) {
|
28
|
+
return Math.floor(Math.random() * (roundedMax - roundedMin + 1)) + roundedMin;
|
29
|
+
}
|
30
|
+
|
31
|
+
var power = Math.pow(10, decimalPlaces);
|
32
|
+
return Math.floor(randomNumber * power) / power;
|
33
|
+
};
|
34
|
+
|
20
35
|
var makeData = function makeData() {
|
21
36
|
for (var _len = arguments.length, lens = new Array(_len), _key = 0; _key < _len; _key++) {
|
22
37
|
lens[_key] = arguments[_key];
|
@@ -46,11 +61,39 @@ var range = function range(len) {
|
|
46
61
|
|
47
62
|
return arr;
|
48
63
|
};
|
64
|
+
/** This function is only to create a random data point when the person joined */
|
65
|
+
|
49
66
|
|
50
67
|
exports.range = range;
|
51
68
|
|
69
|
+
var getRandomDateJoined = function getRandomDateJoined() {
|
70
|
+
return randomDate(new Date(2022, 0, 1), new Date());
|
71
|
+
};
|
72
|
+
|
73
|
+
var getPasswordStrength = function getPasswordStrength() {
|
74
|
+
var chance = Math.random();
|
75
|
+
return chance > 0.66 ? 'critical' : chance > 0.33 ? 'minor-warning' : 'normal';
|
76
|
+
};
|
77
|
+
|
78
|
+
var renderDocLink = function renderDocLink() {
|
79
|
+
var chance = Math.random();
|
80
|
+
var docLinkObj = {
|
81
|
+
href: chance > 0.66 ? 'http://carbondesignsystem.com/' : chance > 0.33 ? 'https://pages.github.ibm.com/cdai-design/pal/' : 'http://carbon-for-ibm-products.netlify.app/',
|
82
|
+
text: chance > 0.66 ? 'Carbon Design System' : chance > 0.33 ? 'Carbon for IBM Products PAL' : 'Carbon for IBM Products storybook'
|
83
|
+
};
|
84
|
+
return docLinkObj;
|
85
|
+
};
|
86
|
+
|
52
87
|
var newPerson = function newPerson() {
|
53
88
|
var statusChance = Math.random();
|
89
|
+
var roleChance = Math.random();
|
90
|
+
var activeChance = Math.random();
|
91
|
+
var initialChartTypeIndex = getRandomInteger(0, 2);
|
92
|
+
var activeSinceDate = new Date();
|
93
|
+
var yesterdayDate = new Date();
|
94
|
+
yesterdayDate.setDate(yesterdayDate.getDate() - 1);
|
95
|
+
var twoDaysAgoDate = new Date();
|
96
|
+
twoDaysAgoDate.setDate(twoDaysAgoDate.getDate() - 2);
|
54
97
|
return {
|
55
98
|
firstName: _namor.default.generate({
|
56
99
|
words: 1,
|
@@ -63,6 +106,9 @@ var newPerson = function newPerson() {
|
|
63
106
|
age: Math.floor(Math.random() * 30),
|
64
107
|
visits: Math.floor(Math.random() * 100),
|
65
108
|
progress: Math.floor(Math.random() * 100),
|
109
|
+
status: statusChance > 0.66 ? 'relationship' : statusChance > 0.33 ? 'complicated' : 'single',
|
110
|
+
role: roleChance > 0.66 ? 'developer' : roleChance > 0.33 ? 'designer' : 'researcher',
|
111
|
+
joined: getRandomDateJoined(),
|
66
112
|
someone1: _namor.default.generate({
|
67
113
|
words: 1,
|
68
114
|
numbers: 0
|
@@ -104,7 +150,7 @@ var newPerson = function newPerson() {
|
|
104
150
|
numbers: 0
|
105
151
|
}),
|
106
152
|
someone11: _namor.default.generate({
|
107
|
-
words:
|
153
|
+
words: 4,
|
108
154
|
numbers: 0
|
109
155
|
}),
|
110
156
|
someone12: _namor.default.generate({
|
@@ -143,7 +189,11 @@ var newPerson = function newPerson() {
|
|
143
189
|
words: 1,
|
144
190
|
numbers: 0
|
145
191
|
}),
|
146
|
-
|
192
|
+
chartType: initialChartTypeIndex === 0 ? _getInlineEditColumns.inlineEditSelectItems[0] : initialChartTypeIndex === 1 ? _getInlineEditColumns.inlineEditSelectItems[1] : _getInlineEditColumns.inlineEditSelectItems[2],
|
193
|
+
activeSince: activeChance > 0.66 ? activeSinceDate : activeChance > 0.33 ? yesterdayDate : twoDaysAgoDate,
|
194
|
+
bonus: "$\r".concat(getRandomInteger(100, 500, 2)),
|
195
|
+
passwordStrength: getPasswordStrength(),
|
196
|
+
doc_link: renderDocLink()
|
147
197
|
};
|
148
198
|
};
|
149
199
|
|
@@ -164,4 +214,8 @@ var newPersonWithTwoLines = function newPersonWithTwoLines() {
|
|
164
214
|
};
|
165
215
|
};
|
166
216
|
|
167
|
-
exports.newPersonWithTwoLines = newPersonWithTwoLines;
|
217
|
+
exports.newPersonWithTwoLines = newPersonWithTwoLines;
|
218
|
+
|
219
|
+
var randomDate = function randomDate(start, end) {
|
220
|
+
return new Date(start.getTime() + Math.random() * (end.getTime() - start.getTime()));
|
221
|
+
};
|
@@ -0,0 +1,152 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports.EditUpdateCards = void 0;
|
9
|
+
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
11
|
+
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
13
|
+
|
14
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
15
|
+
|
16
|
+
var _react = _interopRequireDefault(require("react"));
|
17
|
+
|
18
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
19
|
+
|
20
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
21
|
+
|
22
|
+
var _devtools = require("../../global/js/utils/devtools");
|
23
|
+
|
24
|
+
var _settings = require("../../settings");
|
25
|
+
|
26
|
+
var _ProductiveCard = require("../ProductiveCard");
|
27
|
+
|
28
|
+
var _excluded = ["actionIcons", "actionsPlacement", "className", "description", "editChildren", "editMode", "label", "previewChildren", "title", "titleSize"];
|
29
|
+
// import { children } from 'cheerio/lib/api/traversing';
|
30
|
+
// Carbon and package components we use.
|
31
|
+
|
32
|
+
/* TODO: @import(s) of carbon components and other package components. */
|
33
|
+
// The block part of our conventional BEM class names (blockClass__E--M).
|
34
|
+
var blockClass = "".concat(_settings.pkg.prefix, "--edit-update-cards");
|
35
|
+
var componentName = 'EditUpdateCards'; // NOTE: the component SCSS is not imported here: it is rolled up separately.
|
36
|
+
// Default values can be included here and then assigned to the prop params,
|
37
|
+
// e.g. prop = defaults.prop,
|
38
|
+
// This gathers default values together neatly and ensures non-primitive
|
39
|
+
// values are initialized early to avoid react making unnecessary re-renders.
|
40
|
+
// Note that default values are not required for props that are 'required',
|
41
|
+
// nor for props where the component can apply undefined values reasonably.
|
42
|
+
// Default values should be provided when the component needs to make a choice
|
43
|
+
// or assumption when a prop is not supplied.
|
44
|
+
// Default values for props
|
45
|
+
// const defaults = {
|
46
|
+
// /* TODO: add defaults for relevant props if needed */
|
47
|
+
// };
|
48
|
+
|
49
|
+
/**
|
50
|
+
* TODO: A description of the component.
|
51
|
+
*/
|
52
|
+
|
53
|
+
var EditUpdateCards = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
54
|
+
var actionIcons = _ref.actionIcons,
|
55
|
+
actionsPlacement = _ref.actionsPlacement,
|
56
|
+
className = _ref.className,
|
57
|
+
description = _ref.description,
|
58
|
+
editChildren = _ref.editChildren,
|
59
|
+
editMode = _ref.editMode,
|
60
|
+
label = _ref.label,
|
61
|
+
previewChildren = _ref.previewChildren,
|
62
|
+
title = _ref.title,
|
63
|
+
titleSize = _ref.titleSize,
|
64
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
65
|
+
// const [editMode, setEditMode] = useState(false);
|
66
|
+
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, rest, {
|
67
|
+
className: (0, _classnames.default)(blockClass, // Apply the block class to the main HTML element
|
68
|
+
className, // Apply any supplied class names to the main HTML element.
|
69
|
+
// example: `${blockClass}__template-string-class-${kind}-n-${size}`,
|
70
|
+
(0, _defineProperty2.default)({}, "".concat(blockClass, "__actions-bottom"), actionsPlacement === 'bottom')),
|
71
|
+
ref: ref,
|
72
|
+
role: "main"
|
73
|
+
}, (0, _devtools.getDevtoolsProps)(componentName)), /*#__PURE__*/_react.default.createElement(_ProductiveCard.ProductiveCard, {
|
74
|
+
actionIcons: actionIcons,
|
75
|
+
actionsPlacement: actionsPlacement,
|
76
|
+
className: className,
|
77
|
+
description: description,
|
78
|
+
label: label,
|
79
|
+
title: title,
|
80
|
+
titleSize: titleSize
|
81
|
+
}, editMode === false && /*#__PURE__*/_react.default.createElement("div", null, previewChildren), editMode && /*#__PURE__*/_react.default.createElement("div", null, editChildren)));
|
82
|
+
}); // Return a placeholder if not released and not enabled by feature flag
|
83
|
+
|
84
|
+
|
85
|
+
exports.EditUpdateCards = EditUpdateCards;
|
86
|
+
exports.EditUpdateCards = EditUpdateCards = _settings.pkg.checkComponentEnabled(EditUpdateCards, componentName); // The display name of the component, used by React. Note that displayName
|
87
|
+
// is used in preference to relying on function.name.
|
88
|
+
|
89
|
+
EditUpdateCards.displayName = componentName; // The types and DocGen commentary for the component props,
|
90
|
+
// in alphabetical order (for consistency).
|
91
|
+
// See https://www.npmjs.com/package/prop-types#usage.
|
92
|
+
|
93
|
+
EditUpdateCards.propTypes = {
|
94
|
+
/**
|
95
|
+
* Icons that are displayed on card. Refer to design documentation for implementation guidelines
|
96
|
+
*/
|
97
|
+
actionIcons: _propTypes.default.arrayOf(_propTypes.default.shape({
|
98
|
+
id: _propTypes.default.string,
|
99
|
+
icon: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
100
|
+
onKeyDown: _propTypes.default.func,
|
101
|
+
onClick: _propTypes.default.func,
|
102
|
+
iconDescription: _propTypes.default.string,
|
103
|
+
href: _propTypes.default.string
|
104
|
+
})),
|
105
|
+
|
106
|
+
/**
|
107
|
+
* Determines if the action icons are on the top or bottom of the card
|
108
|
+
*/
|
109
|
+
actionsPlacement: _propTypes.default.oneOf(['top', 'bottom']),
|
110
|
+
|
111
|
+
/**
|
112
|
+
* Optional label for the top of the card.
|
113
|
+
*/
|
114
|
+
className: _propTypes.default.string,
|
115
|
+
|
116
|
+
/**
|
117
|
+
* Optional header description
|
118
|
+
*/
|
119
|
+
description: _propTypes.default.string,
|
120
|
+
|
121
|
+
/**
|
122
|
+
* Edit mode children
|
123
|
+
*/
|
124
|
+
editChildren: _propTypes.default.node,
|
125
|
+
|
126
|
+
/**
|
127
|
+
* Edit mode
|
128
|
+
*/
|
129
|
+
editMode: _propTypes.default.bool,
|
130
|
+
|
131
|
+
/**
|
132
|
+
* Optional label for the top of the card
|
133
|
+
*/
|
134
|
+
label: _propTypes.default.string,
|
135
|
+
|
136
|
+
/**
|
137
|
+
* Preview mode children
|
138
|
+
*/
|
139
|
+
previewChildren: _propTypes.default.node,
|
140
|
+
|
141
|
+
/**
|
142
|
+
* Title that's displayed at the top of the card
|
143
|
+
*/
|
144
|
+
title: _propTypes.default.string,
|
145
|
+
|
146
|
+
/**
|
147
|
+
* Determines title size
|
148
|
+
*/
|
149
|
+
titleSize: _propTypes.default.oneOf(['default', 'large'])
|
150
|
+
/* TODO: add types and DocGen for all props. */
|
151
|
+
|
152
|
+
};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
Object.defineProperty(exports, "EditUpdateCards", {
|
7
|
+
enumerable: true,
|
8
|
+
get: function get() {
|
9
|
+
return _EditUpdateCards.EditUpdateCards;
|
10
|
+
}
|
11
|
+
});
|
12
|
+
|
13
|
+
var _EditUpdateCards = require("./EditUpdateCards");
|
@@ -23,7 +23,7 @@ var _react2 = require("@carbon/react");
|
|
23
23
|
|
24
24
|
var _classnames = _interopRequireDefault(require("classnames"));
|
25
25
|
|
26
|
-
var
|
26
|
+
var _icons = require("@carbon/react/icons");
|
27
27
|
|
28
28
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
29
29
|
|
@@ -193,10 +193,10 @@ var ExportModal = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
193
193
|
}, loading && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_react2.Loading, {
|
194
194
|
small: true,
|
195
195
|
withOverlay: false
|
196
|
-
}), /*#__PURE__*/_react.default.createElement("p", null, loadingMessage)), successful && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(
|
196
|
+
}), /*#__PURE__*/_react.default.createElement("p", null, loadingMessage)), successful && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_icons.CheckmarkFilled, {
|
197
197
|
size: 16,
|
198
198
|
className: "".concat(blockClass, "__checkmark-icon")
|
199
|
-
}), /*#__PURE__*/_react.default.createElement("p", null, successMessage)), error && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(
|
199
|
+
}), /*#__PURE__*/_react.default.createElement("p", null, successMessage)), error && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_icons.ErrorFilled, {
|
200
200
|
size: 16,
|
201
201
|
className: "".concat(blockClass, "__error-icon")
|
202
202
|
}), /*#__PURE__*/_react.default.createElement("p", null, errorMessage)))), !submitted && /*#__PURE__*/_react.default.createElement(_react2.ModalFooter, {
|