@carbon/ibm-products 2.61.0 → 2.62.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/index-full-carbon.css +170 -22
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +1 -1
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +170 -22
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +1 -1
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +170 -22
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +1 -1
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +170 -22
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/css/index.min.css.map +1 -1
- package/es/_virtual/_rollupPluginBabelHelpers.js +4 -4
- package/es/components/APIKeyModal/APIKeyDownloader.js +2 -2
- package/es/components/APIKeyModal/APIKeyModal.js +16 -16
- package/es/components/AboutModal/AboutModal.js +1 -1
- package/es/components/ActionBar/ActionBar.js +5 -5
- package/es/components/ActionBar/ActionBarOverflowItems.js +3 -3
- package/es/components/ActionSet/ActionSet.js +5 -5
- package/es/components/AddSelect/AddSelect.js +5 -4
- package/es/components/AddSelect/AddSelectBody.js +12 -11
- package/es/components/AddSelect/AddSelectColumn.js +1 -1
- package/es/components/AddSelect/AddSelectFilter.js +1 -1
- package/es/components/AddSelect/AddSelectMetaPanel.js +3 -3
- package/es/components/AddSelect/AddSelectRow.js +21 -13
- package/es/components/AddSelect/AddSelectSidebar.js +14 -4
- package/es/components/AddSelect/AddSelectSort.js +5 -5
- package/es/components/AddSelect/add-select-utils.js +3 -3
- package/es/components/AddSelect/types/index.d.ts +1 -0
- package/es/components/BigNumbers/BigNumbers.js +11 -11
- package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +4 -4
- package/es/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +4 -4
- package/es/components/Card/Card.js +14 -14
- package/es/components/Card/CardFooter.js +4 -4
- package/es/components/Card/CardHeader.js +2 -2
- package/es/components/Carousel/Carousel.js +16 -16
- package/es/components/Cascade/Cascade.js +2 -2
- package/es/components/Checklist/Checklist.js +11 -11
- package/es/components/Checklist/ChecklistChart.js +1 -1
- package/es/components/Checklist/ChecklistIcon.js +1 -1
- package/es/components/Coachmark/Coachmark.js +10 -10
- package/es/components/Coachmark/CoachmarkDragbar.js +5 -5
- package/es/components/Coachmark/CoachmarkHeader.js +4 -4
- package/es/components/Coachmark/CoachmarkOverlay.js +4 -4
- package/es/components/Coachmark/CoachmarkTagline.js +3 -3
- package/es/components/CoachmarkBeacon/CoachmarkBeacon.js +1 -1
- package/es/components/CoachmarkFixed/CoachmarkFixed.js +6 -6
- package/es/components/CoachmarkOverlayElements/CoachmarkOverlayElements.d.ts +0 -10
- package/es/components/CoachmarkOverlayElements/CoachmarkOverlayElements.js +16 -35
- package/es/components/CoachmarkStack/CoachmarkStack.d.ts +2 -13
- package/es/components/CoachmarkStack/CoachmarkStack.js +12 -22
- package/es/components/CoachmarkStack/CoachmarkStackHome.d.ts +0 -17
- package/es/components/CoachmarkStack/CoachmarkStackHome.js +6 -29
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +12 -12
- package/es/components/ConditionBuilder/ConditionBuilder.js +2 -2
- package/es/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +5 -5
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +2 -2
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +1 -1
- package/es/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +3 -3
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +19 -19
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +7 -7
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +2 -2
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +3 -3
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +6 -6
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +6 -6
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +1 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +3 -3
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +31 -31
- package/es/components/ConditionBuilder/utils/handleKeyboardEvents.js +15 -15
- package/es/components/ConditionBuilder/utils/useDataConfigs.js +1 -1
- package/es/components/ConditionBuilder/utils/useTranslations.js +2 -2
- package/es/components/ConditionBuilder/utils/util.js +13 -13
- package/es/components/CreateFullPage/CreateFullPage.js +3 -3
- package/es/components/CreateFullPage/CreateFullPageStep.js +9 -9
- package/es/components/CreateInfluencer/CreateInfluencer.js +8 -8
- package/es/components/CreateModal/CreateModal.js +1 -1
- package/es/components/CreateSidePanel/CreateSidePanel.js +1 -1
- package/es/components/CreateTearsheet/CreateTearsheet.js +4 -4
- package/es/components/CreateTearsheet/CreateTearsheetStep.js +16 -16
- package/es/components/CreateTearsheetNarrow/CreateTearsheetNarrow.js +1 -1
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +52 -52
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +36 -36
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +26 -26
- package/es/components/DataSpreadsheet/hooks/useMoveActiveCell.js +3 -3
- package/es/components/DataSpreadsheet/hooks/useMultipleKeyTracking.js +3 -3
- package/es/components/DataSpreadsheet/hooks/useResetSpreadsheetFocus.js +1 -1
- package/es/components/DataSpreadsheet/hooks/useSpreadsheetEdit.js +16 -16
- package/es/components/DataSpreadsheet/hooks/useSpreadsheetMouseMove.js +5 -5
- package/es/components/DataSpreadsheet/hooks/useSpreadsheetMouseUp.js +8 -8
- package/es/components/DataSpreadsheet/hooks/useSpreadsheetOutsideClick.js +1 -1
- package/es/components/DataSpreadsheet/utils/checkActiveHeaderCell.js +3 -3
- package/es/components/DataSpreadsheet/utils/checkSelectedHeaderCell.js +5 -5
- package/es/components/DataSpreadsheet/utils/commonEventHandlers.js +3 -3
- package/es/components/DataSpreadsheet/utils/createActiveCellFn.js +10 -10
- package/es/components/DataSpreadsheet/utils/createCellSelectionArea.js +1 -1
- package/es/components/DataSpreadsheet/utils/getSpreadsheetWidth.js +1 -1
- package/es/components/DataSpreadsheet/utils/handleActiveCellInSelectionEnter.js +6 -6
- package/es/components/DataSpreadsheet/utils/handleActiveCellInSelectionTab.js +6 -6
- package/es/components/DataSpreadsheet/utils/handleCellDeletion.js +6 -6
- package/es/components/DataSpreadsheet/utils/handleEditSubmit.js +3 -3
- package/es/components/DataSpreadsheet/utils/handleHeaderCellSelection.js +10 -10
- package/es/components/DataSpreadsheet/utils/handleMultipleKeys.js +14 -14
- package/es/components/DataSpreadsheet/utils/moveColumnIndicatorLine.js +4 -4
- package/es/components/DataSpreadsheet/utils/removeCellSelections.js +1 -1
- package/es/components/Datagrid/Datagrid/Datagrid.js +2 -2
- package/es/components/Datagrid/Datagrid/DatagridBody.js +1 -1
- package/es/components/Datagrid/Datagrid/DatagridContent.js +14 -14
- package/es/components/Datagrid/Datagrid/DatagridEmptyBody.js +2 -2
- package/es/components/Datagrid/Datagrid/DatagridExpandedRow.js +3 -3
- package/es/components/Datagrid/Datagrid/DatagridHead.js +2 -2
- package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +23 -23
- package/es/components/Datagrid/Datagrid/DatagridRefBody.js +2 -2
- package/es/components/Datagrid/Datagrid/DatagridRow.js +19 -19
- package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +9 -9
- package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +7 -7
- package/es/components/Datagrid/Datagrid/DatagridSimpleBody.js +1 -1
- package/es/components/Datagrid/Datagrid/DatagridToolbar.js +11 -11
- package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +18 -18
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +9 -9
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/TearsheetWrapper.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +15 -15
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.d.ts +1 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +59 -44
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/OverflowCheckboxes.js +2 -2
- package/es/components/Datagrid/Datagrid/addons/Filtering/constants.js +1 -5
- package/es/components/Datagrid/Datagrid/addons/Filtering/handleCheckboxChange.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +20 -20
- package/es/components/Datagrid/Datagrid/addons/Filtering/utils.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +35 -35
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/returnUpdatedActiveCell.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +6 -6
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleMultipleKeys.js +2 -2
- package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +5 -5
- package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/stateReducer.js +4 -4
- package/es/components/Datagrid/useActionsColumn.js +2 -2
- package/es/components/Datagrid/useColumnRightAlign.js +3 -3
- package/es/components/Datagrid/useCustomizeColumns.js +1 -1
- package/es/components/Datagrid/useDatagrid.js +2 -2
- package/es/components/Datagrid/useDefaultStringRenderer.js +1 -1
- package/es/components/Datagrid/useDisableSelectRows.js +16 -16
- package/es/components/Datagrid/useExpandedRow.js +1 -1
- package/es/components/Datagrid/useFiltering.js +1 -1
- package/es/components/Datagrid/useFloatingScroll.js +2 -2
- package/es/components/Datagrid/useFocusRowExpander.js +4 -4
- package/es/components/Datagrid/useInfiniteScroll.js +1 -1
- package/es/components/Datagrid/useInitialColumnSort.js +1 -1
- package/es/components/Datagrid/useInlineEdit.js +4 -4
- package/es/components/Datagrid/useNestedRowExpander.js +6 -6
- package/es/components/Datagrid/useNestedRows.js +6 -6
- package/es/components/Datagrid/useOnRowClick.js +1 -1
- package/es/components/Datagrid/useRowExpander.js +4 -4
- package/es/components/Datagrid/useRowIsMouseOver.js +1 -1
- package/es/components/Datagrid/useRowRenderer.js +6 -6
- package/es/components/Datagrid/useSelectAllToggle.js +2 -2
- package/es/components/Datagrid/useSelectRows.js +5 -5
- package/es/components/Datagrid/useSortableColumns.js +11 -11
- package/es/components/Datagrid/useStickyColumn.js +8 -8
- package/es/components/DecoratorBase/DecoratorBase.js +8 -8
- package/es/components/DecoratorBase/DecoratorIcon.js +2 -2
- package/es/components/DelimitedList/DelimitedList.js +3 -3
- package/es/components/DescriptionList/DescriptionList.js +2 -2
- package/es/components/EditInPlace/EditInPlace.js +6 -6
- package/es/components/EditSidePanel/EditSidePanel.js +3 -3
- package/es/components/EditTearsheet/EditTearsheet.js +3 -3
- package/es/components/EditTearsheet/EditTearsheetForm.js +2 -2
- package/es/components/EmptyStates/EmptyState.js +5 -5
- package/es/components/EmptyStates/EmptyStateContent.js +2 -2
- package/es/components/EmptyStates/EmptyStateV2.js +2 -2
- package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +3 -3
- package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +3 -3
- package/es/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +3 -3
- package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +3 -3
- package/es/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +3 -3
- package/es/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +3 -3
- package/es/components/ExportModal/ExportModal.js +7 -7
- package/es/components/FeatureFlags/index.js +1 -1
- package/es/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.js +1 -1
- package/es/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.js +2 -2
- package/es/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.js +8 -8
- package/es/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.js +1 -1
- package/es/components/FilterSummary/FilterSummary.js +18 -34
- package/es/components/FullPageError/FullPageError.js +1 -1
- package/es/components/Guidebanner/Guidebanner.js +8 -8
- package/es/components/Guidebanner/GuidebannerElementButton.js +1 -1
- package/es/components/ImportModal/ImportModal.js +2 -2
- package/es/components/InlineTip/InlineTip.d.ts +0 -14
- package/es/components/InlineTip/InlineTip.js +13 -35
- package/es/components/InlineTip/utils.js +1 -1
- package/es/components/InterstitialScreen/InterstitialScreen.d.ts +0 -26
- package/es/components/InterstitialScreen/InterstitialScreen.js +22 -56
- package/es/components/MultiAddSelect/MultiAddSelect.d.ts +4 -0
- package/es/components/MultiAddSelect/MultiAddSelect.js +2 -1
- package/es/components/Nav/Nav.js +3 -3
- package/es/components/Nav/NavItem.js +8 -9
- package/es/components/Nav/NavList.js +14 -15
- package/es/components/NonLinearReading/NonLinearReading.js +1 -1
- package/es/components/NotificationsPanel/NotificationsPanel.d.ts +53 -1
- package/es/components/NotificationsPanel/NotificationsPanel.js +89 -71
- package/es/components/OptionsTile/OptionsTile.js +4 -3
- package/es/components/PageHeader/PageHeader.js +19 -19
- package/es/components/PageHeader/PageHeaderTitle.js +1 -1
- package/es/components/PageHeader/PageHeaderUtils.js +1 -1
- package/es/components/ProductiveCard/ProductiveCard.js +1 -1
- package/es/components/RemoveModal/RemoveModal.js +2 -2
- package/es/components/Saving/Saving.js +4 -4
- package/es/components/ScrollGradient/ScrollGradient.js +6 -6
- package/es/components/SearchBar/SearchBar.js +6 -6
- package/es/components/SidePanel/SidePanel.js +45 -45
- package/es/components/SimpleHeader/SimpleHeader.js +4 -4
- package/es/components/StatusIcon/StatusIcon.js +1 -1
- package/es/components/StatusIndicator/StatusIndicator.js +2 -2
- package/es/components/StatusIndicator/StatusIndicatorStep.js +1 -1
- package/es/components/StringFormatter/StringFormatter.js +4 -4
- package/es/components/TagOverflow/TagOverflow.js +7 -7
- package/es/components/TagOverflow/TagOverflowModal.js +4 -4
- package/es/components/TagOverflow/TagOverflowPopover.js +13 -13
- package/es/components/TagSet/TagSet.js +15 -15
- package/es/components/TagSet/TagSetModal.js +6 -6
- package/es/components/TagSet/TagSetOverflow.js +3 -3
- package/es/components/Tearsheet/Tearsheet.js +2 -2
- package/es/components/Tearsheet/TearsheetNarrow.js +1 -1
- package/es/components/Tearsheet/TearsheetShell.js +6 -6
- package/es/components/Toolbar/Toolbar.js +6 -6
- package/es/components/Toolbar/ToolbarButton.js +4 -4
- package/es/components/TruncatedList/TruncatedList.js +8 -8
- package/es/components/UserAvatar/UserAvatar.js +4 -4
- package/es/components/UserProfileImage/UserProfileImage.js +2 -2
- package/es/components/WebTerminal/WebTerminal.js +8 -8
- package/es/global/js/hooks/useControllableState.js +1 -1
- package/es/global/js/hooks/useCreateComponentFocus.js +1 -1
- package/es/global/js/hooks/useCreateComponentStepChange.js +10 -10
- package/es/global/js/hooks/useFocus.js +19 -19
- package/es/global/js/hooks/useOverflowItems/index.d.ts +7 -0
- package/es/global/js/hooks/{useOverflowItems.js → useOverflowItems/useOverflowItems.js} +16 -16
- package/es/global/js/hooks/useOverflowString.js +6 -6
- package/es/global/js/hooks/usePresence.d.ts +23 -0
- package/es/global/js/hooks/usePresence.js +26 -6
- package/es/global/js/hooks/useResetCreateComponent.js +1 -1
- package/es/global/js/hooks/useResizeObserver.js +5 -5
- package/es/global/js/hooks/useRetrieveStepData.js +1 -1
- package/es/global/js/package-settings.js +4 -4
- package/es/global/js/utils/Wrap.js +2 -2
- package/es/global/js/utils/checkForOverflow.js +1 -1
- package/es/global/js/utils/debounce.d.ts +1 -1
- package/es/global/js/utils/debounce.js +2 -2
- package/es/global/js/utils/getSupportedLocale.d.ts +2 -0
- package/es/global/js/utils/getSupportedLocale.js +2 -0
- package/es/global/js/utils/lastIndexInArray.js +1 -1
- package/es/global/js/utils/props-helper.js +1 -1
- package/es/node_modules/@carbon/icon-helpers/es/index.js +2 -2
- package/es/node_modules/@carbon/icons-react/es/Icon.js +2 -2
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-10.js +894 -863
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-3.js +824 -823
- package/es/node_modules/prop-types/factoryWithTypeCheckers.js +1 -1
- package/es/settings.js +2 -2
- package/lib/_virtual/_rollupPluginBabelHelpers.js +4 -4
- package/lib/components/APIKeyModal/APIKeyDownloader.js +2 -2
- package/lib/components/APIKeyModal/APIKeyModal.js +16 -16
- package/lib/components/AboutModal/AboutModal.js +1 -1
- package/lib/components/ActionBar/ActionBar.js +5 -5
- package/lib/components/ActionBar/ActionBarOverflowItems.js +3 -3
- package/lib/components/ActionSet/ActionSet.js +5 -5
- package/lib/components/AddSelect/AddSelect.js +5 -4
- package/lib/components/AddSelect/AddSelectBody.js +12 -11
- package/lib/components/AddSelect/AddSelectColumn.js +1 -1
- package/lib/components/AddSelect/AddSelectFilter.js +1 -1
- package/lib/components/AddSelect/AddSelectMetaPanel.js +3 -3
- package/lib/components/AddSelect/AddSelectRow.js +20 -12
- package/lib/components/AddSelect/AddSelectSidebar.js +14 -4
- package/lib/components/AddSelect/AddSelectSort.js +5 -5
- package/lib/components/AddSelect/add-select-utils.js +3 -3
- package/lib/components/AddSelect/types/index.d.ts +1 -0
- package/lib/components/BigNumbers/BigNumbers.js +10 -10
- package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +4 -4
- package/lib/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +4 -4
- package/lib/components/Card/Card.js +14 -14
- package/lib/components/Card/CardFooter.js +4 -4
- package/lib/components/Card/CardHeader.js +2 -2
- package/lib/components/Carousel/Carousel.js +16 -16
- package/lib/components/Cascade/Cascade.js +2 -2
- package/lib/components/Checklist/Checklist.js +11 -11
- package/lib/components/Checklist/ChecklistChart.js +1 -1
- package/lib/components/Checklist/ChecklistIcon.js +1 -1
- package/lib/components/Coachmark/Coachmark.js +10 -10
- package/lib/components/Coachmark/CoachmarkDragbar.js +5 -5
- package/lib/components/Coachmark/CoachmarkHeader.js +4 -4
- package/lib/components/Coachmark/CoachmarkOverlay.js +4 -4
- package/lib/components/Coachmark/CoachmarkTagline.js +3 -3
- package/lib/components/CoachmarkBeacon/CoachmarkBeacon.js +1 -1
- package/lib/components/CoachmarkFixed/CoachmarkFixed.js +6 -6
- package/lib/components/CoachmarkOverlayElements/CoachmarkOverlayElements.d.ts +0 -10
- package/lib/components/CoachmarkOverlayElements/CoachmarkOverlayElements.js +16 -35
- package/lib/components/CoachmarkStack/CoachmarkStack.d.ts +2 -13
- package/lib/components/CoachmarkStack/CoachmarkStack.js +12 -22
- package/lib/components/CoachmarkStack/CoachmarkStackHome.d.ts +0 -17
- package/lib/components/CoachmarkStack/CoachmarkStackHome.js +6 -29
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +12 -12
- package/lib/components/ConditionBuilder/ConditionBuilder.js +2 -2
- package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +5 -5
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +2 -2
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +3 -3
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +19 -19
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +7 -7
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +2 -2
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +3 -3
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +6 -6
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +6 -6
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +3 -3
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +31 -31
- package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.js +15 -15
- package/lib/components/ConditionBuilder/utils/useDataConfigs.js +1 -1
- package/lib/components/ConditionBuilder/utils/useTranslations.js +2 -2
- package/lib/components/ConditionBuilder/utils/util.js +13 -13
- package/lib/components/CreateFullPage/CreateFullPage.js +3 -3
- package/lib/components/CreateFullPage/CreateFullPageStep.js +9 -9
- package/lib/components/CreateInfluencer/CreateInfluencer.js +8 -8
- package/lib/components/CreateModal/CreateModal.js +1 -1
- package/lib/components/CreateSidePanel/CreateSidePanel.js +1 -1
- package/lib/components/CreateTearsheet/CreateTearsheet.js +4 -4
- package/lib/components/CreateTearsheet/CreateTearsheetStep.js +16 -16
- package/lib/components/CreateTearsheetNarrow/CreateTearsheetNarrow.js +1 -1
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +52 -52
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +36 -36
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +26 -26
- package/lib/components/DataSpreadsheet/hooks/useMoveActiveCell.js +3 -3
- package/lib/components/DataSpreadsheet/hooks/useMultipleKeyTracking.js +3 -3
- package/lib/components/DataSpreadsheet/hooks/useResetSpreadsheetFocus.js +1 -1
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetEdit.js +16 -16
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetMouseMove.js +5 -5
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetMouseUp.js +8 -8
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetOutsideClick.js +1 -1
- package/lib/components/DataSpreadsheet/utils/checkActiveHeaderCell.js +3 -3
- package/lib/components/DataSpreadsheet/utils/checkSelectedHeaderCell.js +5 -5
- package/lib/components/DataSpreadsheet/utils/commonEventHandlers.js +3 -3
- package/lib/components/DataSpreadsheet/utils/createActiveCellFn.js +10 -10
- package/lib/components/DataSpreadsheet/utils/createCellSelectionArea.js +1 -1
- package/lib/components/DataSpreadsheet/utils/getSpreadsheetWidth.js +1 -1
- package/lib/components/DataSpreadsheet/utils/handleActiveCellInSelectionEnter.js +6 -6
- package/lib/components/DataSpreadsheet/utils/handleActiveCellInSelectionTab.js +6 -6
- package/lib/components/DataSpreadsheet/utils/handleCellDeletion.js +6 -6
- package/lib/components/DataSpreadsheet/utils/handleEditSubmit.js +3 -3
- package/lib/components/DataSpreadsheet/utils/handleHeaderCellSelection.js +10 -10
- package/lib/components/DataSpreadsheet/utils/handleMultipleKeys.js +14 -14
- package/lib/components/DataSpreadsheet/utils/moveColumnIndicatorLine.js +4 -4
- package/lib/components/DataSpreadsheet/utils/removeCellSelections.js +1 -1
- package/lib/components/Datagrid/Datagrid/Datagrid.js +2 -2
- package/lib/components/Datagrid/Datagrid/DatagridBody.js +1 -1
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +14 -14
- package/lib/components/Datagrid/Datagrid/DatagridEmptyBody.js +2 -2
- package/lib/components/Datagrid/Datagrid/DatagridExpandedRow.js +3 -3
- package/lib/components/Datagrid/Datagrid/DatagridHead.js +2 -2
- package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +23 -23
- package/lib/components/Datagrid/Datagrid/DatagridRefBody.js +2 -2
- package/lib/components/Datagrid/Datagrid/DatagridRow.js +19 -19
- package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +9 -9
- package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +7 -7
- package/lib/components/Datagrid/Datagrid/DatagridSimpleBody.js +1 -1
- package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +11 -11
- package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +18 -18
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +9 -9
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/TearsheetWrapper.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +15 -15
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.d.ts +1 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +59 -44
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/OverflowCheckboxes.js +2 -2
- package/lib/components/Datagrid/Datagrid/addons/Filtering/constants.js +0 -6
- package/lib/components/Datagrid/Datagrid/addons/Filtering/handleCheckboxChange.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +20 -20
- package/lib/components/Datagrid/Datagrid/addons/Filtering/utils.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +35 -35
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/returnUpdatedActiveCell.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +6 -6
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleMultipleKeys.js +2 -2
- package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +5 -5
- package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/stateReducer.js +4 -4
- package/lib/components/Datagrid/useActionsColumn.js +2 -2
- package/lib/components/Datagrid/useColumnRightAlign.js +3 -3
- package/lib/components/Datagrid/useCustomizeColumns.js +1 -1
- package/lib/components/Datagrid/useDatagrid.js +2 -2
- package/lib/components/Datagrid/useDefaultStringRenderer.js +1 -1
- package/lib/components/Datagrid/useDisableSelectRows.js +16 -16
- package/lib/components/Datagrid/useExpandedRow.js +1 -1
- package/lib/components/Datagrid/useFiltering.js +1 -1
- package/lib/components/Datagrid/useFloatingScroll.js +2 -2
- package/lib/components/Datagrid/useFocusRowExpander.js +4 -4
- package/lib/components/Datagrid/useInfiniteScroll.js +1 -1
- package/lib/components/Datagrid/useInitialColumnSort.js +1 -1
- package/lib/components/Datagrid/useInlineEdit.js +4 -4
- package/lib/components/Datagrid/useNestedRowExpander.js +6 -6
- package/lib/components/Datagrid/useNestedRows.js +6 -6
- package/lib/components/Datagrid/useOnRowClick.js +1 -1
- package/lib/components/Datagrid/useRowExpander.js +4 -4
- package/lib/components/Datagrid/useRowIsMouseOver.js +1 -1
- package/lib/components/Datagrid/useRowRenderer.js +6 -6
- package/lib/components/Datagrid/useSelectAllToggle.js +2 -2
- package/lib/components/Datagrid/useSelectRows.js +5 -5
- package/lib/components/Datagrid/useSortableColumns.js +11 -11
- package/lib/components/Datagrid/useStickyColumn.js +8 -8
- package/lib/components/DecoratorBase/DecoratorBase.js +8 -8
- package/lib/components/DecoratorBase/DecoratorIcon.js +2 -2
- package/lib/components/DelimitedList/DelimitedList.js +3 -3
- package/lib/components/DescriptionList/DescriptionList.js +2 -2
- package/lib/components/EditInPlace/EditInPlace.js +6 -6
- package/lib/components/EditSidePanel/EditSidePanel.js +3 -3
- package/lib/components/EditTearsheet/EditTearsheet.js +3 -3
- package/lib/components/EditTearsheet/EditTearsheetForm.js +2 -2
- package/lib/components/EmptyStates/EmptyState.js +5 -5
- package/lib/components/EmptyStates/EmptyStateContent.js +2 -2
- package/lib/components/EmptyStates/EmptyStateV2.js +2 -2
- package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +3 -3
- package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +3 -3
- package/lib/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +3 -3
- package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +3 -3
- package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +3 -3
- package/lib/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +3 -3
- package/lib/components/ExportModal/ExportModal.js +7 -7
- package/lib/components/FeatureFlags/index.js +1 -1
- package/lib/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.js +1 -1
- package/lib/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.js +2 -2
- package/lib/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.js +8 -8
- package/lib/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.js +1 -1
- package/lib/components/FilterSummary/FilterSummary.js +18 -34
- package/lib/components/FullPageError/FullPageError.js +1 -1
- package/lib/components/Guidebanner/Guidebanner.js +8 -8
- package/lib/components/Guidebanner/GuidebannerElementButton.js +1 -1
- package/lib/components/ImportModal/ImportModal.js +2 -2
- package/lib/components/InlineTip/InlineTip.d.ts +0 -14
- package/lib/components/InlineTip/InlineTip.js +13 -35
- package/lib/components/InlineTip/utils.js +1 -1
- package/lib/components/InterstitialScreen/InterstitialScreen.d.ts +0 -26
- package/lib/components/InterstitialScreen/InterstitialScreen.js +22 -56
- package/lib/components/MultiAddSelect/MultiAddSelect.d.ts +4 -0
- package/lib/components/MultiAddSelect/MultiAddSelect.js +2 -1
- package/lib/components/Nav/Nav.js +3 -3
- package/lib/components/Nav/NavItem.js +12 -13
- package/lib/components/Nav/NavList.js +18 -19
- package/lib/components/NonLinearReading/NonLinearReading.js +1 -1
- package/lib/components/NotificationsPanel/NotificationsPanel.d.ts +53 -1
- package/lib/components/NotificationsPanel/NotificationsPanel.js +89 -71
- package/lib/components/OptionsTile/OptionsTile.js +4 -3
- package/lib/components/PageHeader/PageHeader.js +19 -19
- package/lib/components/PageHeader/PageHeaderTitle.js +1 -1
- package/lib/components/PageHeader/PageHeaderUtils.js +1 -1
- package/lib/components/ProductiveCard/ProductiveCard.js +1 -1
- package/lib/components/RemoveModal/RemoveModal.js +2 -2
- package/lib/components/Saving/Saving.js +4 -4
- package/lib/components/ScrollGradient/ScrollGradient.js +6 -6
- package/lib/components/SearchBar/SearchBar.js +6 -6
- package/lib/components/SidePanel/SidePanel.js +45 -45
- package/lib/components/SimpleHeader/SimpleHeader.js +4 -4
- package/lib/components/StatusIcon/StatusIcon.js +1 -1
- package/lib/components/StatusIndicator/StatusIndicator.js +2 -2
- package/lib/components/StatusIndicator/StatusIndicatorStep.js +1 -1
- package/lib/components/StringFormatter/StringFormatter.js +4 -4
- package/lib/components/TagOverflow/TagOverflow.js +7 -7
- package/lib/components/TagOverflow/TagOverflowModal.js +4 -4
- package/lib/components/TagOverflow/TagOverflowPopover.js +13 -13
- package/lib/components/TagSet/TagSet.js +15 -15
- package/lib/components/TagSet/TagSetModal.js +6 -6
- package/lib/components/TagSet/TagSetOverflow.js +3 -3
- package/lib/components/Tearsheet/Tearsheet.js +2 -2
- package/lib/components/Tearsheet/TearsheetNarrow.js +1 -1
- package/lib/components/Tearsheet/TearsheetShell.js +6 -6
- package/lib/components/Toolbar/Toolbar.js +6 -6
- package/lib/components/Toolbar/ToolbarButton.js +4 -4
- package/lib/components/TruncatedList/TruncatedList.js +8 -8
- package/lib/components/UserAvatar/UserAvatar.js +4 -4
- package/lib/components/UserProfileImage/UserProfileImage.js +2 -2
- package/lib/components/WebTerminal/WebTerminal.js +8 -8
- package/lib/global/js/hooks/useControllableState.js +1 -1
- package/lib/global/js/hooks/useCreateComponentFocus.js +1 -1
- package/lib/global/js/hooks/useCreateComponentStepChange.js +10 -10
- package/lib/global/js/hooks/useFocus.js +19 -19
- package/lib/global/js/hooks/useOverflowItems/index.d.ts +7 -0
- package/lib/global/js/hooks/{useOverflowItems.js → useOverflowItems/useOverflowItems.js} +16 -16
- package/lib/global/js/hooks/useOverflowString.js +6 -6
- package/lib/global/js/hooks/usePresence.d.ts +23 -0
- package/lib/global/js/hooks/usePresence.js +26 -6
- package/lib/global/js/hooks/useResetCreateComponent.js +1 -1
- package/lib/global/js/hooks/useResizeObserver.js +5 -5
- package/lib/global/js/hooks/useRetrieveStepData.js +1 -1
- package/lib/global/js/package-settings.js +4 -4
- package/lib/global/js/utils/Wrap.js +2 -2
- package/lib/global/js/utils/checkForOverflow.js +1 -1
- package/lib/global/js/utils/debounce.d.ts +1 -1
- package/lib/global/js/utils/debounce.js +2 -2
- package/lib/global/js/utils/getSupportedLocale.d.ts +2 -0
- package/lib/global/js/utils/getSupportedLocale.js +2 -0
- package/lib/global/js/utils/lastIndexInArray.js +1 -1
- package/lib/global/js/utils/props-helper.js +1 -1
- package/lib/node_modules/@carbon/icon-helpers/es/index.js +2 -2
- package/lib/node_modules/@carbon/icons-react/es/Icon.js +2 -2
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-10.js +902 -871
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-3.js +824 -823
- package/lib/node_modules/prop-types/factoryWithTypeCheckers.js +1 -1
- package/lib/settings.js +2 -2
- package/package.json +19 -19
- package/scss/components/Datagrid/styles/addons/_FilterPanel.scss +100 -22
- package/scss/components/Datagrid/styles/addons/_animations.scss +56 -0
- package/scss/components/FilterSummary/_animations.scss +20 -0
- package/scss/components/FilterSummary/_filter-summary.scss +11 -0
- package/scss/components/FullPageError/_full-page-error.scss +4 -0
- package/scss/components/GetStartedCard/_get-started-card.scss +2 -2
- package/scss/components/NotificationsPanel/_notifications-panel.scss +35 -7
- package/scss/components/SidePanel/_side-panel.scss +4 -2
- package/scss/components/Tearsheet/_tearsheet.scss +6 -12
- package/telemetry.yml +9 -17
- package/es/components/Datagrid/Datagrid/addons/Filtering/motion/variants.d.ts +0 -60
- package/es/components/Datagrid/Datagrid/addons/Filtering/motion/variants.js +0 -80
- package/es/components/SteppedAnimatedMedia/SteppedAnimatedMedia.d.ts +0 -25
- package/es/components/SteppedAnimatedMedia/SteppedAnimatedMedia.js +0 -146
- package/es/components/SteppedAnimatedMedia/index.d.ts +0 -8
- package/es/global/js/utils/getBezierValues.d.ts +0 -1
- package/es/global/js/utils/getBezierValues.js +0 -28
- package/es/global/js/utils/motionConstants.d.ts +0 -23
- package/es/global/js/utils/motionConstants.js +0 -39
- package/lib/components/Datagrid/Datagrid/addons/Filtering/motion/variants.d.ts +0 -60
- package/lib/components/Datagrid/Datagrid/addons/Filtering/motion/variants.js +0 -84
- package/lib/components/SteppedAnimatedMedia/SteppedAnimatedMedia.d.ts +0 -25
- package/lib/components/SteppedAnimatedMedia/SteppedAnimatedMedia.js +0 -148
- package/lib/components/SteppedAnimatedMedia/index.d.ts +0 -8
- package/lib/global/js/utils/getBezierValues.d.ts +0 -1
- package/lib/global/js/utils/getBezierValues.js +0 -30
- package/lib/global/js/utils/motionConstants.d.ts +0 -23
- package/lib/global/js/utils/motionConstants.js +0 -42
- /package/es/global/js/hooks/{useOverflowItems.d.ts → useOverflowItems/useOverflowItems.d.ts} +0 -0
- /package/lib/global/js/hooks/{useOverflowItems.d.ts → useOverflowItems/useOverflowItems.d.ts} +0 -0
@@ -33,7 +33,7 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
|
|
33
33
|
setRootState = _useContext.setRootState,
|
34
34
|
variant = _useContext.variant,
|
35
35
|
actionState = _useContext.actionState;
|
36
|
-
var initialConditionState = useRef(initialState !== null && initialState !==
|
36
|
+
var initialConditionState = useRef(initialState !== null && initialState !== void 0 && initialState.state ? JSON.parse(JSON.stringify(initialState === null || initialState === void 0 ? void 0 : initialState.state)) : null);
|
37
37
|
var _useState = useState(false),
|
38
38
|
_useState2 = _slicedToArray(_useState, 2),
|
39
39
|
isConditionBuilderActive = _useState2[0],
|
@@ -55,24 +55,24 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
|
|
55
55
|
};
|
56
56
|
useEffect(function () {
|
57
57
|
var _rootState$groups;
|
58
|
-
if (rootState !== null && rootState !==
|
58
|
+
if (rootState !== null && rootState !== void 0 && (_rootState$groups = rootState.groups) !== null && _rootState$groups !== void 0 && _rootState$groups.length) {
|
59
59
|
setIsConditionBuilderActive(true);
|
60
60
|
} else {
|
61
61
|
setIsConditionBuilderActive(false);
|
62
62
|
}
|
63
63
|
if (getConditionState) {
|
64
|
-
getConditionState(rootState !== null && rootState !==
|
64
|
+
getConditionState(rootState !== null && rootState !== void 0 ? rootState : {});
|
65
65
|
}
|
66
66
|
|
67
67
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
68
68
|
}, [rootState]);
|
69
69
|
useEffect(function () {
|
70
|
-
getActionsState === null || getActionsState ===
|
70
|
+
getActionsState === null || getActionsState === void 0 || getActionsState(actionState !== null && actionState !== void 0 ? actionState : []);
|
71
71
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
72
72
|
}, [actionState]);
|
73
73
|
useEffect(function () {
|
74
|
-
if (initialState !== null && initialState !==
|
75
|
-
setRootState === null || setRootState ===
|
74
|
+
if (initialState !== null && initialState !== void 0 && initialState.enabledDefault) {
|
75
|
+
setRootState === null || setRootState === void 0 || setRootState(initialState.state);
|
76
76
|
}
|
77
77
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
78
78
|
}, [initialState]);
|
@@ -80,25 +80,25 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
|
|
80
80
|
var _initialConditionStat;
|
81
81
|
//when add condition button is clicked.
|
82
82
|
setIsConditionBuilderActive(true);
|
83
|
-
if (initialConditionState !== null && initialConditionState !==
|
84
|
-
setRootState === null || setRootState ===
|
83
|
+
if (initialConditionState !== null && initialConditionState !== void 0 && (_initialConditionStat = initialConditionState.current) !== null && _initialConditionStat !== void 0 && (_initialConditionStat = _initialConditionStat.groups) !== null && _initialConditionStat !== void 0 && _initialConditionStat.length) {
|
84
|
+
setRootState === null || setRootState === void 0 || setRootState(initialConditionState.current);
|
85
85
|
initialConditionState.current = null;
|
86
86
|
} else {
|
87
|
-
setRootState === null || setRootState ===
|
87
|
+
setRootState === null || setRootState === void 0 || setRootState(emptyState); //here we can set an empty skeleton object for an empty condition builder,
|
88
88
|
}
|
89
89
|
|
90
90
|
//or we can even pre-populate some existing builder and continue editing
|
91
91
|
};
|
92
92
|
var _onRemove = useCallback(function (groupId) {
|
93
93
|
var _rootState$groups2;
|
94
|
-
var groups = rootState === null || rootState ===
|
95
|
-
return groupId !== (group === null || group ===
|
94
|
+
var groups = rootState === null || rootState === void 0 || (_rootState$groups2 = rootState.groups) === null || _rootState$groups2 === void 0 ? void 0 : _rootState$groups2.filter(function (group) {
|
95
|
+
return groupId !== (group === null || group === void 0 ? void 0 : group.id);
|
96
96
|
});
|
97
|
-
setRootState === null || setRootState ===
|
97
|
+
setRootState === null || setRootState === void 0 || setRootState(_objectSpread2(_objectSpread2({}, rootState), {}, {
|
98
98
|
groups: rootState ? groups : []
|
99
99
|
}));
|
100
100
|
//set the initial state to empty.
|
101
|
-
if ((groups === null || groups ===
|
101
|
+
if ((groups === null || groups === void 0 ? void 0 : groups.length) === 0) {
|
102
102
|
initialConditionState.current = null;
|
103
103
|
}
|
104
104
|
}, [setRootState, rootState]);
|
@@ -109,7 +109,7 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
|
|
109
109
|
*/
|
110
110
|
if (rootState && rootState.groups) {
|
111
111
|
var groups = [].concat(_toConsumableArray(rootState.groups ? rootState.groups.slice(0, groupIndex) : []), [updatedGroup], _toConsumableArray(rootState.groups ? rootState.groups.slice(groupIndex + 1) : []));
|
112
|
-
setRootState === null || setRootState ===
|
112
|
+
setRootState === null || setRootState === void 0 || setRootState(_objectSpread2(_objectSpread2({}, rootState), {}, {
|
113
113
|
groups: groups
|
114
114
|
}));
|
115
115
|
}
|
@@ -127,13 +127,13 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
|
|
127
127
|
id: uuidv4()
|
128
128
|
}]
|
129
129
|
};
|
130
|
-
setRootState === null || setRootState ===
|
130
|
+
setRootState === null || setRootState === void 0 || setRootState(_objectSpread2(_objectSpread2({}, rootState), {}, {
|
131
131
|
groups: rootState && rootState.groups ? [].concat(_toConsumableArray(rootState.groups), [newGroup]) : [newGroup]
|
132
132
|
}));
|
133
133
|
};
|
134
134
|
var getColorIndex = function getColorIndex() {
|
135
135
|
var _rootState$groups$len, _rootState$groups3;
|
136
|
-
var groupLength = (_rootState$groups$len = rootState === null || rootState ===
|
136
|
+
var groupLength = (_rootState$groups$len = rootState === null || rootState === void 0 || (_rootState$groups3 = rootState.groups) === null || _rootState$groups3 === void 0 ? void 0 : _rootState$groups3.length) !== null && _rootState$groups$len !== void 0 ? _rootState$groups$len : 0;
|
137
137
|
return groupLength % 5;
|
138
138
|
};
|
139
139
|
if (!isConditionBuilderActive) {
|
@@ -157,7 +157,7 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
|
|
157
157
|
level: 4
|
158
158
|
}, /*#__PURE__*/React__default.createElement(Heading, null, conditionHeadingText)), /*#__PURE__*/React__default.createElement("div", _extends({
|
159
159
|
className: "".concat(blockClass, "__content-container")
|
160
|
-
}, wrapperRole), rootState && (rootState === null || rootState ===
|
160
|
+
}, wrapperRole), rootState && (rootState === null || rootState === void 0 || (_rootState$groups4 = rootState.groups) === null || _rootState$groups4 === void 0 ? void 0 : _rootState$groups4.map(function (eachGroup, groupIndex) {
|
161
161
|
var _ref2;
|
162
162
|
return /*#__PURE__*/React__default.createElement("div", {
|
163
163
|
key: eachGroup.id,
|
@@ -167,7 +167,7 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
|
|
167
167
|
aria: {
|
168
168
|
level: 1,
|
169
169
|
posinset: groupIndex * 2 + 1,
|
170
|
-
setsize: (_ref2 = rootState.groups && rootState.groups.length * 2) !== null && _ref2 !==
|
170
|
+
setsize: (_ref2 = rootState.groups && rootState.groups.length * 2) !== null && _ref2 !== void 0 ? _ref2 : 0
|
171
171
|
},
|
172
172
|
group: eachGroup,
|
173
173
|
onRemove: function onRemove() {
|
@@ -200,7 +200,7 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
|
|
200
200
|
previewType: "newGroup",
|
201
201
|
colorIndex: getColorIndex(),
|
202
202
|
group: {
|
203
|
-
groupOperator: rootState === null || rootState ===
|
203
|
+
groupOperator: rootState === null || rootState === void 0 ? void 0 : rootState.operator,
|
204
204
|
id: uuidv4()
|
205
205
|
}
|
206
206
|
})), actions && /*#__PURE__*/React__default.createElement(ConditionBuilderActions, {
|
@@ -48,7 +48,7 @@ var ConditionBuilderItem = function ConditionBuilderItem(_ref) {
|
|
48
48
|
unlessAny: translationsObject.unlessText
|
49
49
|
};
|
50
50
|
//Appending statements from custom statement configuration if present
|
51
|
-
statementConfigCustom === null || statementConfigCustom ===
|
51
|
+
statementConfigCustom === null || statementConfigCustom === void 0 || statementConfigCustom.forEach(function (statement) {
|
52
52
|
statementIdMap[statement.id] = statement.label;
|
53
53
|
});
|
54
54
|
var _useTranslations = useTranslations(['invalidText', 'addConditionText', 'addPropertyText', 'addOperatorText', 'addValueText', label], statementIdMap),
|
@@ -108,7 +108,7 @@ var ConditionBuilderItem = function ConditionBuilderItem(_ref) {
|
|
108
108
|
//this will focus the first input field in the popover
|
109
109
|
if (open && popoverRef.current) {
|
110
110
|
var _popoverRef$current;
|
111
|
-
var firstFocusableElement = popoverRef === null || popoverRef ===
|
111
|
+
var firstFocusableElement = popoverRef === null || popoverRef === void 0 || (_popoverRef$current = popoverRef.current) === null || _popoverRef$current === void 0 ? void 0 : _popoverRef$current.querySelector('input,textarea');
|
112
112
|
if (firstFocusableElement) {
|
113
113
|
setTimeout(function () {
|
114
114
|
return firstFocusableElement.focus();
|
@@ -118,8 +118,8 @@ var ConditionBuilderItem = function ConditionBuilderItem(_ref) {
|
|
118
118
|
}, [popoverRef, open]);
|
119
119
|
var manageInvalidSelection = function manageInvalidSelection() {
|
120
120
|
//when the user didn't select any value , we need to show as incomplete
|
121
|
-
if (rest['data-name'] === 'propertyField' && !(condition !== null && condition !==
|
122
|
-
onChange === null || onChange ===
|
121
|
+
if (rest['data-name'] === 'propertyField' && !(condition !== null && condition !== void 0 && condition.property) || rest['data-name'] === 'operatorField' && !(condition !== null && condition !== void 0 && condition.operator) || rest['data-name'] === 'valueField' && !(condition !== null && condition !== void 0 && condition.value)) {
|
122
|
+
onChange === null || onChange === void 0 || onChange('INVALID');
|
123
123
|
}
|
124
124
|
};
|
125
125
|
var closePopover = function closePopover() {
|
@@ -145,15 +145,15 @@ var ConditionBuilderItem = function ConditionBuilderItem(_ref) {
|
|
145
145
|
var getCustomOperatorLabel = function getCustomOperatorLabel(propertyLabel) {
|
146
146
|
var _config$operators;
|
147
147
|
return propertyLabel && (// @ts-ignore
|
148
|
-
config === null || config ===
|
148
|
+
config === null || config === void 0 || (_config$operators = config.operators) === null || _config$operators === void 0 ? void 0 : _config$operators.find(function (operator) {
|
149
149
|
return operator.id === propertyLabel;
|
150
150
|
}));
|
151
151
|
};
|
152
152
|
var getLabel = function getLabel() {
|
153
153
|
// @ts-ignore
|
154
|
-
if (config !== null && config !==
|
154
|
+
if (config !== null && config !== void 0 && config.operators && rest['data-name'] === 'operatorField') {
|
155
155
|
var _getCustomOperatorLab, _getCustomOperatorLab2;
|
156
|
-
return (_getCustomOperatorLab = (_getCustomOperatorLab2 = getCustomOperatorLabel(propertyLabel)) === null || _getCustomOperatorLab2 ===
|
156
|
+
return (_getCustomOperatorLab = (_getCustomOperatorLab2 = getCustomOperatorLabel(propertyLabel)) === null || _getCustomOperatorLab2 === void 0 ? void 0 : _getCustomOperatorLab2.label) !== null && _getCustomOperatorLab !== void 0 ? _getCustomOperatorLab : propertyLabel;
|
157
157
|
} else if (propertyLabel) {
|
158
158
|
return propertyLabel;
|
159
159
|
} else if (rest['data-name'] === 'propertyField') {
|
@@ -36,7 +36,7 @@ var ConditionBuilderItemDate = function ConditionBuilderItemDate(_ref) {
|
|
36
36
|
datePickerType: "single",
|
37
37
|
value: conditionState.value,
|
38
38
|
onClose: onCloseHandler,
|
39
|
-
appendTo: parentRef === null || parentRef ===
|
39
|
+
appendTo: parentRef === null || parentRef === void 0 ? void 0 : parentRef.current
|
40
40
|
}, /*#__PURE__*/React__default.createElement(DatePickerInput, {
|
41
41
|
id: "datePicker",
|
42
42
|
placeholder: "dd/mm/yyyy",
|
@@ -47,7 +47,7 @@ var ConditionBuilderItemDate = function ConditionBuilderItemDate(_ref) {
|
|
47
47
|
datePickerType: datePickerType,
|
48
48
|
onClose: onCloseHandler,
|
49
49
|
value: conditionState.value,
|
50
|
-
appendTo: parentRef === null || parentRef ===
|
50
|
+
appendTo: parentRef === null || parentRef === void 0 ? void 0 : parentRef.current
|
51
51
|
}, /*#__PURE__*/React__default.createElement(DatePickerInput, {
|
52
52
|
id: "datePickerStart",
|
53
53
|
placeholder: "dd/mm/yyyy",
|
@@ -24,7 +24,7 @@ var ConditionBuilderItemNumber = function ConditionBuilderItemNumber(_ref) {
|
|
24
24
|
var value = _ref2.value;
|
25
25
|
if (value !== '' && !isNaN(value) && checkIfValid(value)) {
|
26
26
|
var _config$unit;
|
27
|
-
onChange("".concat(value, " ").concat((_config$unit = config.unit) !== null && _config$unit !==
|
27
|
+
onChange("".concat(value, " ").concat((_config$unit = config.unit) !== null && _config$unit !== void 0 ? _config$unit : ''));
|
28
28
|
} else {
|
29
29
|
onChange('INVALID');
|
30
30
|
}
|
@@ -43,14 +43,14 @@ var ConditionBuilderItemNumber = function ConditionBuilderItemNumber(_ref) {
|
|
43
43
|
};
|
44
44
|
var getDefaultValue = function getDefaultValue() {
|
45
45
|
var _split$, _conditionState$value;
|
46
|
-
return (_split$ = (_conditionState$value = conditionState.value) === null || _conditionState$value ===
|
46
|
+
return (_split$ = (_conditionState$value = conditionState.value) === null || _conditionState$value === void 0 || (_conditionState$value = _conditionState$value.split(' ')) === null || _conditionState$value === void 0 ? void 0 : _conditionState$value[0]) !== null && _split$ !== void 0 ? _split$ : '';
|
47
47
|
};
|
48
48
|
return /*#__PURE__*/React__default.createElement("div", {
|
49
49
|
className: "".concat(blockClass, "__item-number")
|
50
50
|
}, /*#__PURE__*/React__default.createElement(NumberInput, _extends({}, config, {
|
51
51
|
label: conditionState.property,
|
52
52
|
hideLabel: true,
|
53
|
-
id: (_conditionState$prope = conditionState.property) === null || _conditionState$prope ===
|
53
|
+
id: (_conditionState$prope = conditionState.property) === null || _conditionState$prope === void 0 ? void 0 : _conditionState$prope.replace(/\s/g, ''),
|
54
54
|
invalidText: invalidNumberWarnText,
|
55
55
|
allowEmpty: true,
|
56
56
|
onChange: onChangeHandler,
|
package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js
CHANGED
@@ -16,9 +16,9 @@ import { blockClass, onKeyDownHandlerForSearch } from '../../utils/util.js';
|
|
16
16
|
|
17
17
|
var ItemOption = function ItemOption(_ref) {
|
18
18
|
var _ref$conditionState = _ref.conditionState,
|
19
|
-
conditionState = _ref$conditionState ===
|
19
|
+
conditionState = _ref$conditionState === void 0 ? {} : _ref$conditionState,
|
20
20
|
_ref$config = _ref.config,
|
21
|
-
config = _ref$config ===
|
21
|
+
config = _ref$config === void 0 ? {} : _ref$config,
|
22
22
|
onChange = _ref.onChange;
|
23
23
|
var _useContext = useContext(ConditionBuilderContext),
|
24
24
|
popOverSearchThreshold = _useContext.popOverSearchThreshold;
|
@@ -35,16 +35,16 @@ var ItemOption = function ItemOption(_ref) {
|
|
35
35
|
searchValue = _useState2[0],
|
36
36
|
setSearchValue = _useState2[1];
|
37
37
|
var selection = conditionState.value;
|
38
|
-
var filteredItems = searchValue ? allOptions === null || allOptions ===
|
38
|
+
var filteredItems = searchValue ? allOptions === null || allOptions === void 0 ? void 0 : allOptions.filter(function (opt) {
|
39
39
|
var _opt$label;
|
40
|
-
return (_opt$label = opt.label) === null || _opt$label ===
|
40
|
+
return (_opt$label = opt.label) === null || _opt$label === void 0 ? void 0 : _opt$label.toLowerCase().includes(searchValue.toLowerCase());
|
41
41
|
}) : allOptions;
|
42
42
|
useEffect(function () {
|
43
43
|
//this will focus the first input field in the popover
|
44
44
|
|
45
45
|
if (contentRef.current) {
|
46
46
|
var _contentRef$current;
|
47
|
-
var firstFocusableElement = (_contentRef$current = contentRef.current) === null || _contentRef$current ===
|
47
|
+
var firstFocusableElement = (_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current.querySelector('input, button,li');
|
48
48
|
if (firstFocusableElement) {
|
49
49
|
firstFocusableElement.focus();
|
50
50
|
}
|
@@ -84,7 +84,7 @@ var ItemOption = function ItemOption(_ref) {
|
|
84
84
|
})), /*#__PURE__*/React__default.createElement("ul", {
|
85
85
|
"aria-label": getAriaLabel(),
|
86
86
|
role: "listbox"
|
87
|
-
}, filteredItems === null || filteredItems ===
|
87
|
+
}, filteredItems === null || filteredItems === void 0 ? void 0 : filteredItems.map(function (option) {
|
88
88
|
var isSelected = selection === option.id;
|
89
89
|
var Icon = option.icon;
|
90
90
|
return /*#__PURE__*/React__default.createElement("li", {
|
@@ -17,9 +17,9 @@ import { checkForMultiSelectOperator, blockClass, onKeyDownHandlerForSearch } fr
|
|
17
17
|
var _SelectSkeleton, _CheckboxCheckedFille, _Checkbox;
|
18
18
|
var ItemOptionForValueField = function ItemOptionForValueField(_ref) {
|
19
19
|
var _ref$conditionState = _ref.conditionState,
|
20
|
-
conditionState = _ref$conditionState ===
|
20
|
+
conditionState = _ref$conditionState === void 0 ? {} : _ref$conditionState,
|
21
21
|
_ref$config = _ref.config,
|
22
|
-
config = _ref$config ===
|
22
|
+
config = _ref$config === void 0 ? {} : _ref$config,
|
23
23
|
onChange = _ref.onChange;
|
24
24
|
var multiSelectable = checkForMultiSelectOperator(conditionState, config);
|
25
25
|
var _useContext = useContext(ConditionBuilderContext),
|
@@ -41,7 +41,7 @@ var ItemOptionForValueField = function ItemOptionForValueField(_ref) {
|
|
41
41
|
_useState4 = _slicedToArray(_useState3, 2),
|
42
42
|
searchValue = _useState4[0],
|
43
43
|
setSearchValue = _useState4[1];
|
44
|
-
var filteredItems = allOptions === null || allOptions ===
|
44
|
+
var filteredItems = allOptions === null || allOptions === void 0 ? void 0 : allOptions.filter(function (opt) {
|
45
45
|
return opt.label.toLowerCase().includes(searchValue.toLowerCase());
|
46
46
|
});
|
47
47
|
var selection = Array.isArray(conditionState.value) ? conditionState.value : conditionState.value !== undefined ? [conditionState.value] : [];
|
@@ -77,7 +77,7 @@ var ItemOptionForValueField = function ItemOptionForValueField(_ref) {
|
|
77
77
|
return getOptions(rootState, conditionState);
|
78
78
|
case 2:
|
79
79
|
response = _context.sent;
|
80
|
-
if ((response === null || response ===
|
80
|
+
if ((response === null || response === void 0 ? void 0 : response.length) > 0 && Object.keys(response[0]).includes('label') && Object.keys(response[0]).includes('id')) {
|
81
81
|
setAllOptions(response);
|
82
82
|
}
|
83
83
|
case 4:
|
@@ -100,7 +100,7 @@ var ItemOptionForValueField = function ItemOptionForValueField(_ref) {
|
|
100
100
|
if (contentRef.current) {
|
101
101
|
var firstFocusableElement = contentRef.current.querySelector('input, button,li');
|
102
102
|
if (firstFocusableElement) {
|
103
|
-
firstFocusableElement === null || firstFocusableElement ===
|
103
|
+
firstFocusableElement === null || firstFocusableElement === void 0 || firstFocusableElement.focus();
|
104
104
|
}
|
105
105
|
}
|
106
106
|
}, [allOptions]);
|
@@ -167,7 +167,7 @@ var ItemOptionForValueField = function ItemOptionForValueField(_ref) {
|
|
167
167
|
"aria-label": getAriaLabel(),
|
168
168
|
role: "listbox",
|
169
169
|
"data-multi-select": multiSelectable
|
170
|
-
}, filteredItems === null || filteredItems ===
|
170
|
+
}, filteredItems === null || filteredItems === void 0 ? void 0 : filteredItems.map(function (option) {
|
171
171
|
var isSelected = selection.map(function (option) {
|
172
172
|
return option.id;
|
173
173
|
}).includes(option.id);
|
@@ -20,7 +20,7 @@ var ConditionBuilderItemText = function ConditionBuilderItemText(_ref) {
|
|
20
20
|
var inputProps = _objectSpread2(_objectSpread2({}, config), {}, {
|
21
21
|
hideLabel: true,
|
22
22
|
value: checkIsValid(conditionState.value) ? conditionState.value : '',
|
23
|
-
id: (_conditionState$prope = conditionState.property) === null || _conditionState$prope ===
|
23
|
+
id: (_conditionState$prope = conditionState.property) === null || _conditionState$prope === void 0 ? void 0 : _conditionState$prope.replace(/\s/g, ''),
|
24
24
|
onChange: function onChange(evt) {
|
25
25
|
_onChange(evt.target.value);
|
26
26
|
},
|
@@ -24,12 +24,12 @@ var ConditionBuilderItemTime = function ConditionBuilderItemTime(_ref) {
|
|
24
24
|
_useState4 = _slicedToArray(_useState3, 2),
|
25
25
|
dayZoneValue = _useState4[0],
|
26
26
|
setDayZoneValue = _useState4[1];
|
27
|
-
var _useState5 = useState(config === null || config ===
|
27
|
+
var _useState5 = useState(config === null || config === void 0 || (_config$timeZones = config.timeZones) === null || _config$timeZones === void 0 ? void 0 : _config$timeZones[0]),
|
28
28
|
_useState6 = _slicedToArray(_useState5, 2),
|
29
29
|
timeZoneValue = _useState6[0],
|
30
30
|
setTimeZoneValue = _useState6[1];
|
31
31
|
useEffect(function () {
|
32
|
-
var timeToUpdate = "".concat(timeValue !== null && timeValue !==
|
32
|
+
var timeToUpdate = "".concat(timeValue !== null && timeValue !== void 0 ? timeValue : '', " ").concat(dayZoneValue !== null && dayZoneValue !== void 0 ? dayZoneValue : '', " ").concat(timeZoneValue !== null && timeZoneValue !== void 0 ? timeZoneValue : '');
|
33
33
|
onChange(timeValue ? timeToUpdate : undefined);
|
34
34
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
35
35
|
}, [timeValue, dayZoneValue, timeZoneValue]);
|
@@ -60,7 +60,7 @@ var ConditionBuilderItemTime = function ConditionBuilderItemTime(_ref) {
|
|
60
60
|
}))), /*#__PURE__*/React__default.createElement(TimePickerSelect, {
|
61
61
|
id: "time-picker-time-zone",
|
62
62
|
onChange: setTimeZone
|
63
|
-
}, config === null || config ===
|
63
|
+
}, config === null || config === void 0 || (_config$timeZones2 = config.timeZones) === null || _config$timeZones2 === void 0 ? void 0 : _config$timeZones2.map(function (timeZone, index) {
|
64
64
|
return /*#__PURE__*/React__default.createElement(SelectItem, {
|
65
65
|
key: index,
|
66
66
|
value: timeZone,
|
@@ -67,7 +67,7 @@ var _ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
67
67
|
//we will shift the group one level up. The subgroups will open up as conditions.
|
68
68
|
|
69
69
|
//spreading out the condition inside the subgroup
|
70
|
-
var allConditions = group === null || group ===
|
70
|
+
var allConditions = group === null || group === void 0 || (_group$conditions = group.conditions) === null || _group$conditions === void 0 ? void 0 : _group$conditions.reduce(function (acc, condition) {
|
71
71
|
var _condition = condition;
|
72
72
|
if (_condition.conditions) {
|
73
73
|
//this is a subgroup
|
@@ -75,7 +75,7 @@ var _ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
75
75
|
}
|
76
76
|
return acc;
|
77
77
|
}, []);
|
78
|
-
onChange === null || onChange ===
|
78
|
+
onChange === null || onChange === void 0 || onChange(_objectSpread2(_objectSpread2({}, group), {}, {
|
79
79
|
conditions: allConditions
|
80
80
|
}));
|
81
81
|
} else {
|
@@ -85,16 +85,16 @@ var _ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
85
85
|
//This is to handle a edge case.
|
86
86
|
//When a group has structure as 1 condition,1 subgroup, 1 condition and if we delete first condition,
|
87
87
|
//the group will start with a subgroup. To avoid this,opening up that subgroup.
|
88
|
-
if ((filteredConditions === null || filteredConditions ===
|
88
|
+
if ((filteredConditions === null || filteredConditions === void 0 ? void 0 : filteredConditions[0]).conditions) {
|
89
89
|
var firstFilteredConditions = filteredConditions[0];
|
90
|
-
filteredConditions.splice.apply(filteredConditions, [0, 1].concat(_toConsumableArray(firstFilteredConditions === null || firstFilteredConditions ===
|
90
|
+
filteredConditions.splice.apply(filteredConditions, [0, 1].concat(_toConsumableArray(firstFilteredConditions === null || firstFilteredConditions === void 0 ? void 0 : firstFilteredConditions.conditions)));
|
91
91
|
}
|
92
|
-
onChange === null || onChange ===
|
92
|
+
onChange === null || onChange === void 0 || onChange(_objectSpread2(_objectSpread2({}, group), {}, {
|
93
93
|
conditions: filteredConditions
|
94
94
|
}));
|
95
95
|
}
|
96
96
|
} else {
|
97
|
-
onRemove === null || onRemove ===
|
97
|
+
onRemove === null || onRemove === void 0 || onRemove(evt);
|
98
98
|
}
|
99
99
|
};
|
100
100
|
//check to identify a group without a plain condition
|
@@ -105,10 +105,10 @@ var _ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
105
105
|
};
|
106
106
|
var onChangeHandler = function onChangeHandler(updatedCondition, conditionIndex) {
|
107
107
|
var _group$id;
|
108
|
-
var updatedConditions = [].concat(_toConsumableArray(group !== null && group !==
|
109
|
-
onChange === null || onChange ===
|
108
|
+
var updatedConditions = [].concat(_toConsumableArray(group !== null && group !== void 0 && group.conditions ? group.conditions.slice(0, conditionIndex) : []), [updatedCondition], _toConsumableArray(group !== null && group !== void 0 && group.conditions ? group.conditions.slice(conditionIndex + 1) : []));
|
109
|
+
onChange === null || onChange === void 0 || onChange(_objectSpread2(_objectSpread2({}, group), {}, {
|
110
110
|
conditions: updatedConditions,
|
111
|
-
id: (_group$id = group === null || group ===
|
111
|
+
id: (_group$id = group === null || group === void 0 ? void 0 : group.id) !== null && _group$id !== void 0 ? _group$id : uuidv4()
|
112
112
|
}));
|
113
113
|
};
|
114
114
|
var addConditionHandler = function addConditionHandler(conditionIndex) {
|
@@ -119,7 +119,7 @@ var _ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
119
119
|
popoverToOpen: 'propertyField',
|
120
120
|
id: uuidv4()
|
121
121
|
};
|
122
|
-
onChange === null || onChange ===
|
122
|
+
onChange === null || onChange === void 0 || onChange(_objectSpread2(_objectSpread2({}, group), {}, {
|
123
123
|
conditions: [].concat(_toConsumableArray(group.conditions ? group.conditions.slice(0, conditionIndex + 1) : []), [newCondition], _toConsumableArray(group.conditions ? group.conditions.slice(conditionIndex + 1) : []))
|
124
124
|
}));
|
125
125
|
};
|
@@ -128,7 +128,7 @@ var _ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
128
128
|
//get all close buttons.
|
129
129
|
//if the last condition is closing, focus the second last one.
|
130
130
|
//or focus the next one.
|
131
|
-
var currentGroupCloseButtons = (_e$currentTarget$clos = e.currentTarget.closest(".".concat(blockClass, "__group"))) === null || _e$currentTarget$clos ===
|
131
|
+
var currentGroupCloseButtons = (_e$currentTarget$clos = e.currentTarget.closest(".".concat(blockClass, "__group"))) === null || _e$currentTarget$clos === void 0 ? void 0 : _e$currentTarget$clos.querySelectorAll('[data-name="closeCondition"]');
|
132
132
|
if (conditionIndex == currentGroupCloseButtons.length - 1) {
|
133
133
|
manageTabIndexAndFocus(currentGroupCloseButtons[conditionIndex - 1], conditionBuilderRef);
|
134
134
|
} else {
|
@@ -138,25 +138,25 @@ var _ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
138
138
|
var handleFocusOnCloseHierarchical = function handleFocusOnCloseHierarchical(evt) {
|
139
139
|
var _evt$currentTarget, _evt$currentTarget2, _conditionBuilderCont, _conditionBuilderCont2;
|
140
140
|
//getting the current aria-level and aria-posinset.
|
141
|
-
var currentLevel = (_evt$currentTarget = evt.currentTarget) === null || _evt$currentTarget ===
|
142
|
-
var currentPos = (_evt$currentTarget2 = evt.currentTarget) === null || _evt$currentTarget2 ===
|
141
|
+
var currentLevel = (_evt$currentTarget = evt.currentTarget) === null || _evt$currentTarget === void 0 || (_evt$currentTarget = _evt$currentTarget.closest('[role="row"]')) === null || _evt$currentTarget === void 0 ? void 0 : _evt$currentTarget.getAttribute('aria-level');
|
142
|
+
var currentPos = (_evt$currentTarget2 = evt.currentTarget) === null || _evt$currentTarget2 === void 0 || (_evt$currentTarget2 = _evt$currentTarget2.closest('[role="row"]')) === null || _evt$currentTarget2 === void 0 ? void 0 : _evt$currentTarget2.getAttribute('aria-posinset');
|
143
143
|
|
144
144
|
//finding the next and previous items in same level
|
145
|
-
var nextElement = (_conditionBuilderCont = conditionBuilderContentRef.current) === null || _conditionBuilderCont ===
|
146
|
-
var prevElement = (_conditionBuilderCont2 = conditionBuilderContentRef.current) === null || _conditionBuilderCont2 ===
|
145
|
+
var nextElement = (_conditionBuilderCont = conditionBuilderContentRef.current) === null || _conditionBuilderCont === void 0 ? void 0 : _conditionBuilderCont.querySelector("[aria-level=\"".concat(currentLevel, "\"][aria-posinset=\"").concat(Number(currentPos) + 1, "\"]"));
|
146
|
+
var prevElement = (_conditionBuilderCont2 = conditionBuilderContentRef.current) === null || _conditionBuilderCont2 === void 0 ? void 0 : _conditionBuilderCont2.querySelector("[aria-level=\"".concat(currentLevel, "\"][aria-posinset=\"").concat(Number(currentPos) - 1, "\"]"));
|
147
147
|
//checking if next level is a valid condition. If then, focus the close button inside that condition
|
148
148
|
//Otherwise , check the previous item is a valid condition
|
149
149
|
|
150
|
-
if (nextElement !== null && nextElement !==
|
151
|
-
manageTabIndexAndFocus(nextElement === null || nextElement ===
|
152
|
-
} else if (prevElement !== null && prevElement !==
|
153
|
-
manageTabIndexAndFocus(prevElement === null || prevElement ===
|
150
|
+
if (nextElement !== null && nextElement !== void 0 && nextElement.classList.contains("".concat(blockClass, "__condition-block"))) {
|
151
|
+
manageTabIndexAndFocus(nextElement === null || nextElement === void 0 ? void 0 : nextElement.querySelector('[data-name="closeCondition"]'), conditionBuilderRef);
|
152
|
+
} else if (prevElement !== null && prevElement !== void 0 && prevElement.classList.contains("".concat(blockClass, "__condition-block"))) {
|
153
|
+
manageTabIndexAndFocus(prevElement === null || prevElement === void 0 ? void 0 : prevElement.querySelector('[data-name="closeCondition"]'), conditionBuilderRef);
|
154
154
|
}
|
155
155
|
//If there are no valid condition in this group, focus next or previous row
|
156
156
|
else {
|
157
157
|
var _conditionBuilderCont3, _conditionBuilderCont4;
|
158
|
-
var prevRows = (_conditionBuilderCont3 = conditionBuilderContentRef.current) === null || _conditionBuilderCont3 ===
|
159
|
-
var nextRow = (_conditionBuilderCont4 = conditionBuilderContentRef.current) === null || _conditionBuilderCont4 ===
|
158
|
+
var prevRows = (_conditionBuilderCont3 = conditionBuilderContentRef.current) === null || _conditionBuilderCont3 === void 0 ? void 0 : _conditionBuilderCont3.querySelectorAll("[aria-level=\"".concat(Number(currentLevel) - 1, "\"][role=\"row\"]"));
|
159
|
+
var nextRow = (_conditionBuilderCont4 = conditionBuilderContentRef.current) === null || _conditionBuilderCont4 === void 0 ? void 0 : _conditionBuilderCont4.querySelector("[aria-level=\"".concat(Number(currentLevel) + 1, "\"][role=\"row\"]"));
|
160
160
|
if (nextRow) {
|
161
161
|
//since there are no condition in current group, this group will move one level up
|
162
162
|
|
@@ -166,12 +166,12 @@ var _ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
166
166
|
};
|
167
167
|
setTimeout(function () {
|
168
168
|
var _conditionBuilderCont5;
|
169
|
-
var currentRowToFocus = (_conditionBuilderCont5 = conditionBuilderContentRef.current) === null || _conditionBuilderCont5 ===
|
170
|
-
manageTabIndexAndFocus(currentRowToFocus === null || currentRowToFocus ===
|
169
|
+
var currentRowToFocus = (_conditionBuilderCont5 = conditionBuilderContentRef.current) === null || _conditionBuilderCont5 === void 0 ? void 0 : _conditionBuilderCont5.querySelector("[role=\"row\"][aria-level=\"".concat(rowIdentity.ariaLevel, "\"][aria-posinset=\"").concat(rowIdentity.ariaPosInSet, "\"]"));
|
170
|
+
manageTabIndexAndFocus(currentRowToFocus === null || currentRowToFocus === void 0 ? void 0 : currentRowToFocus.querySelector('[data-name="closeCondition"]'), conditionBuilderRef);
|
171
171
|
}, 0);
|
172
|
-
} else if (prevRows !== null && prevRows !==
|
172
|
+
} else if (prevRows !== null && prevRows !== void 0 && prevRows.length && prevRows.length > 1) {
|
173
173
|
var _prevRows;
|
174
|
-
manageTabIndexAndFocus((_prevRows = prevRows[prevRows.length - 2]) === null || _prevRows ===
|
174
|
+
manageTabIndexAndFocus((_prevRows = prevRows[prevRows.length - 2]) === null || _prevRows === void 0 ? void 0 : _prevRows.querySelector('[data-name="closeCondition"]'), conditionBuilderRef);
|
175
175
|
}
|
176
176
|
}
|
177
177
|
};
|
@@ -210,7 +210,7 @@ var _ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
210
210
|
var _statementConfig$find;
|
211
211
|
var groupOperator = (_statementConfig$find = statementConfig.find(function (statement) {
|
212
212
|
return statement.id == updatedStatement;
|
213
|
-
})) === null || _statementConfig$find ===
|
213
|
+
})) === null || _statementConfig$find === void 0 ? void 0 : _statementConfig$find.connector;
|
214
214
|
onChange(_objectSpread2(_objectSpread2({}, group), {}, {
|
215
215
|
groupOperator: groupOperator,
|
216
216
|
statement: updatedStatement
|
@@ -229,7 +229,7 @@ var _ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
229
229
|
className: "".concat(blockClass, "__condition-wrapper"),
|
230
230
|
role: "grid",
|
231
231
|
"aria-label": conditionBuilderText
|
232
|
-
}, group === null || group ===
|
232
|
+
}, group === null || group === void 0 || (_group$conditions2 = group.conditions) === null || _group$conditions2 === void 0 ? void 0 : _group$conditions2.map(function (eachCondition, conditionIndex) {
|
233
233
|
var _group$conditions3;
|
234
234
|
return /*#__PURE__*/React__default.createElement("div", {
|
235
235
|
key: eachCondition.id,
|
@@ -239,7 +239,7 @@ var _ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
239
239
|
aria: {
|
240
240
|
level: aria.level + 1,
|
241
241
|
posinset: conditionIndex + 1,
|
242
|
-
setsize: group === null || group ===
|
242
|
+
setsize: group === null || group === void 0 || (_group$conditions3 = group.conditions) === null || _group$conditions3 === void 0 ? void 0 : _group$conditions3.length
|
243
243
|
},
|
244
244
|
isStatement: conditionIndex == 0,
|
245
245
|
condition: eachCondition,
|
@@ -290,7 +290,7 @@ var _ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
290
290
|
options: statementConfig,
|
291
291
|
isStatement: true
|
292
292
|
}
|
293
|
-
}))), group === null || group ===
|
293
|
+
}))), group === null || group === void 0 || (_group$conditions4 = group.conditions) === null || _group$conditions4 === void 0 ? void 0 : _group$conditions4.map(function (eachCondition, conditionIndex) {
|
294
294
|
var _group$conditions$len, _group$conditions5, _group$conditions$len2, _group$conditions6;
|
295
295
|
return /*#__PURE__*/React__default.createElement(Fragment, {
|
296
296
|
key: eachCondition.id
|
@@ -304,7 +304,7 @@ var _ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
304
304
|
aria: {
|
305
305
|
level: aria.level + 1,
|
306
306
|
posinset: conditionIndex + 1,
|
307
|
-
setsize: (_group$conditions$len = (_group$conditions5 = group.conditions) === null || _group$conditions5 ===
|
307
|
+
setsize: (_group$conditions$len = (_group$conditions5 = group.conditions) === null || _group$conditions5 === void 0 ? void 0 : _group$conditions5.length) !== null && _group$conditions$len !== void 0 ? _group$conditions$len : 0
|
308
308
|
},
|
309
309
|
className: "".concat(blockClass, "__group"),
|
310
310
|
group: eachCondition,
|
@@ -319,7 +319,7 @@ var _ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
319
319
|
aria: {
|
320
320
|
level: aria.level + 1,
|
321
321
|
posinset: conditionIndex + 1,
|
322
|
-
setsize: (_group$conditions$len2 = (_group$conditions6 = group.conditions) === null || _group$conditions6 ===
|
322
|
+
setsize: (_group$conditions$len2 = (_group$conditions6 = group.conditions) === null || _group$conditions6 === void 0 ? void 0 : _group$conditions6.length) !== null && _group$conditions$len2 !== void 0 ? _group$conditions$len2 : 0
|
323
323
|
},
|
324
324
|
isStatement: false,
|
325
325
|
condition: eachCondition,
|