@carbon/ibm-products 2.43.2-canary.7 → 2.43.2-canary.72
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 +167 -15
- 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 +215 -5
- 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 +167 -15
- 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 +167 -15
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/css/index.min.css.map +1 -1
- package/es/components/Coachmark/Coachmark.js +12 -7
- package/es/components/CoachmarkFixed/CoachmarkFixed.js +13 -11
- package/es/components/CoachmarkStack/CoachmarkStack.js +7 -3
- package/es/components/CoachmarkStack/CoachmarkStackHome.js +8 -4
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +57 -42
- package/es/components/ConditionBuilder/ConditionBuilder.js +81 -24
- package/es/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.d.ts +15 -0
- package/es/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +151 -0
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +3 -1
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +27 -13
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +8 -1
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +29 -7
- package/es/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +10 -6
- package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +19 -11
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +9 -11
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +58 -41
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +12 -7
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +26 -8
- package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +8 -2
- package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +35 -24
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +37 -36
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +37 -36
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +4 -2
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +67 -33
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.d.ts +3 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +24 -9
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +27 -9
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +13 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +114 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.d.ts → ItemOptionForValueField.d.ts} +2 -2
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.js → ItemOptionForValueField.js} +66 -36
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.d.ts +5 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +19 -7
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +1 -1
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +74 -23
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +45 -19
- package/es/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +1 -1
- package/es/components/ConditionBuilder/utils/handleKeyboardEvents.js +120 -29
- package/es/components/ConditionBuilder/utils/useTranslations.d.ts +1 -0
- package/es/components/ConditionBuilder/utils/useTranslations.js +26 -0
- package/es/components/ConditionBuilder/utils/util.d.ts +1 -0
- package/es/components/ConditionBuilder/utils/util.js +8 -1
- package/es/components/CreateFullPage/CreateFullPage.js +2 -2
- package/es/components/DataSpreadsheet/DataSpreadsheet.d.ts +20 -0
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +58 -19
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +12 -0
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +22 -6
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +8 -0
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +16 -3
- package/es/components/DataSpreadsheet/hooks/useSpreadsheetMouseMove.js +4 -1
- package/es/components/DataSpreadsheet/utils/moveColumnIndicatorLine.js +34 -2
- package/es/components/Datagrid/Datagrid/Datagrid.d.ts +0 -4
- package/es/components/Datagrid/Datagrid/Datagrid.js +4 -9
- package/es/components/Datagrid/Datagrid/DatagridContent.js +1 -1
- package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +23 -8
- package/es/components/Datagrid/Datagrid/DatagridRow.js +21 -8
- package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +2 -1
- package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +3 -2
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +6 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +6 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +3 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +7 -4
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.d.ts +1 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +21 -16
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +2 -3
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +74 -11
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +10 -2
- package/es/components/Datagrid/types/index.d.ts +44 -8
- package/es/components/Datagrid/useActionsColumn.d.ts +8 -1
- package/es/components/Datagrid/useActionsColumn.js +7 -6
- package/es/components/Datagrid/useColumnRightAlign.d.ts +8 -1
- package/es/components/Datagrid/useColumnRightAlign.js +4 -3
- package/es/components/Datagrid/useCustomizeColumns.d.ts +8 -1
- package/es/components/Datagrid/useCustomizeColumns.js +4 -3
- package/es/components/Datagrid/useDefaultStringRenderer.js +0 -1
- package/es/components/Datagrid/useInlineEdit.js +12 -2
- package/es/components/Datagrid/useNestedRowExpander.js +1 -3
- package/es/components/Datagrid/useNestedRows.js +32 -13
- package/es/components/Datagrid/useRowExpander.js +1 -3
- package/es/components/Datagrid/useSelectRows.js +2 -1
- package/es/components/Datagrid/useStickyColumn.d.ts +8 -1
- package/es/components/Datagrid/useStickyColumn.js +12 -9
- package/es/components/Decorator/Decorator.js +2 -1
- package/es/components/DecoratorBase/DecoratorBase.js +3 -5
- package/es/components/DecoratorDualButton/DecoratorDualButton.js +2 -1
- package/es/components/DecoratorLink/DecoratorLink.js +2 -1
- package/es/components/DecoratorSingleButton/DecoratorSingleButton.js +2 -1
- package/es/components/EditInPlace/EditInPlace.d.ts +4 -0
- package/es/components/EditInPlace/EditInPlace.js +21 -10
- package/es/components/EditTearsheet/EditTearsheet.d.ts +7 -2
- package/es/components/EditTearsheet/EditTearsheet.js +44 -10
- package/es/components/EditTearsheet/EditTearsheetForm.d.ts +45 -2
- package/es/components/EditTearsheet/EditTearsheetForm.js +3 -0
- package/es/components/HTTPErrors/HTTPError403/HTTPError403.js +6 -0
- package/es/components/HTTPErrors/HTTPError404/HTTPError404.js +6 -0
- package/es/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +6 -0
- package/es/components/HTTPErrors/assets/HTTPErrorSvg403.js +204 -200
- package/es/components/HTTPErrors/assets/HTTPErrorSvg404.js +116 -112
- package/es/components/HTTPErrors/assets/HTTPErrorSvgOther.js +110 -106
- package/es/components/Nav/NavItem.js +12 -3
- package/es/components/OptionsTile/OptionsTile.js +11 -6
- package/es/components/PageHeader/PageHeader.js +1 -0
- package/es/components/RemoveModal/RemoveModal.d.ts +4 -0
- package/es/components/RemoveModal/RemoveModal.js +7 -1
- package/es/components/SearchBar/SearchBar.d.ts +1 -1
- package/es/components/SearchBar/SearchBar.js +2 -2
- package/es/components/SidePanel/SidePanel.js +17 -21
- package/es/components/SidePanel/motion/variants.d.ts +4 -6
- package/es/components/SidePanel/motion/variants.js +10 -11
- package/es/components/StatusIndicator/StatusIndicatorStep.js +87 -0
- package/es/components/Tearsheet/Tearsheet.d.ts +8 -1
- package/es/components/Tearsheet/Tearsheet.js +9 -1
- package/es/components/Tearsheet/TearsheetNarrow.d.ts +11 -0
- package/es/components/Tearsheet/TearsheetNarrow.js +12 -0
- package/es/components/Tearsheet/TearsheetShell.d.ts +11 -1
- package/es/components/Tearsheet/TearsheetShell.js +24 -6
- package/es/components/Toolbar/ToolbarButton.js +1 -1
- package/es/components/WebTerminal/WebTerminal.js +10 -12
- package/es/components/index.d.ts +1 -1
- package/es/global/js/hooks/useFocus.d.ts +1 -0
- package/es/global/js/hooks/useFocus.js +5 -2
- package/es/global/js/hooks/usePrefersReducedMotion.js +14 -8
- package/es/global/js/package-settings.d.ts +1 -1
- package/es/global/js/package-settings.js +1 -1
- package/es/index.js +1 -0
- package/es/settings.d.ts +1 -1
- package/lib/components/Coachmark/Coachmark.js +12 -7
- package/lib/components/CoachmarkFixed/CoachmarkFixed.js +13 -11
- package/lib/components/CoachmarkStack/CoachmarkStack.js +7 -3
- package/lib/components/CoachmarkStack/CoachmarkStackHome.js +8 -4
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +56 -41
- package/lib/components/ConditionBuilder/ConditionBuilder.js +81 -24
- package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.d.ts +15 -0
- package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +160 -0
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +3 -1
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +26 -11
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +8 -1
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +28 -6
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +8 -4
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +18 -10
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +9 -11
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +57 -40
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +12 -7
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +26 -8
- package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +8 -2
- package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +34 -24
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +37 -36
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +37 -36
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +4 -2
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +66 -32
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.d.ts +3 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +24 -9
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +28 -10
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +13 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +122 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.d.ts → ItemOptionForValueField.d.ts} +2 -2
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.js → ItemOptionForValueField.js} +63 -33
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.d.ts +5 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +18 -6
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +1 -1
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +72 -21
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +44 -17
- package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +1 -1
- package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.js +120 -29
- package/lib/components/ConditionBuilder/utils/useTranslations.d.ts +1 -0
- package/lib/components/ConditionBuilder/utils/useTranslations.js +30 -0
- package/lib/components/ConditionBuilder/utils/util.d.ts +1 -0
- package/lib/components/ConditionBuilder/utils/util.js +8 -0
- package/lib/components/CreateFullPage/CreateFullPage.js +2 -2
- package/lib/components/DataSpreadsheet/DataSpreadsheet.d.ts +20 -0
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +58 -19
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +12 -0
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +22 -6
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +8 -0
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +16 -3
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetMouseMove.js +4 -1
- package/lib/components/DataSpreadsheet/utils/moveColumnIndicatorLine.js +34 -2
- package/lib/components/Datagrid/Datagrid/Datagrid.d.ts +0 -4
- package/lib/components/Datagrid/Datagrid/Datagrid.js +4 -9
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +1 -1
- package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +23 -8
- package/lib/components/Datagrid/Datagrid/DatagridRow.js +21 -8
- package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +2 -1
- package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +3 -2
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +6 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +6 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +3 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +7 -4
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.d.ts +1 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +21 -16
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +2 -3
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +73 -10
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +10 -2
- package/lib/components/Datagrid/types/index.d.ts +44 -8
- package/lib/components/Datagrid/useActionsColumn.d.ts +8 -1
- package/lib/components/Datagrid/useActionsColumn.js +7 -6
- package/lib/components/Datagrid/useColumnRightAlign.d.ts +8 -1
- package/lib/components/Datagrid/useColumnRightAlign.js +4 -3
- package/lib/components/Datagrid/useCustomizeColumns.d.ts +8 -1
- package/lib/components/Datagrid/useCustomizeColumns.js +4 -3
- package/lib/components/Datagrid/useDefaultStringRenderer.js +0 -1
- package/lib/components/Datagrid/useInlineEdit.js +12 -2
- package/lib/components/Datagrid/useNestedRowExpander.js +1 -3
- package/lib/components/Datagrid/useNestedRows.js +32 -13
- package/lib/components/Datagrid/useRowExpander.js +1 -3
- package/lib/components/Datagrid/useSelectRows.js +2 -1
- package/lib/components/Datagrid/useStickyColumn.d.ts +8 -1
- package/lib/components/Datagrid/useStickyColumn.js +12 -9
- package/lib/components/Decorator/Decorator.js +2 -1
- package/lib/components/DecoratorBase/DecoratorBase.js +3 -5
- package/lib/components/DecoratorDualButton/DecoratorDualButton.js +2 -1
- package/lib/components/DecoratorLink/DecoratorLink.js +2 -1
- package/lib/components/DecoratorSingleButton/DecoratorSingleButton.js +2 -1
- package/lib/components/EditInPlace/EditInPlace.d.ts +4 -0
- package/lib/components/EditInPlace/EditInPlace.js +21 -10
- package/lib/components/EditTearsheet/EditTearsheet.d.ts +7 -2
- package/lib/components/EditTearsheet/EditTearsheet.js +43 -9
- package/lib/components/EditTearsheet/EditTearsheetForm.d.ts +45 -2
- package/lib/components/EditTearsheet/EditTearsheetForm.js +3 -0
- package/lib/components/HTTPErrors/HTTPError403/HTTPError403.js +6 -0
- package/lib/components/HTTPErrors/HTTPError404/HTTPError404.js +6 -0
- package/lib/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +6 -0
- package/lib/components/HTTPErrors/assets/HTTPErrorSvg403.js +204 -200
- package/lib/components/HTTPErrors/assets/HTTPErrorSvg404.js +116 -112
- package/lib/components/HTTPErrors/assets/HTTPErrorSvgOther.js +110 -106
- package/lib/components/Nav/NavItem.js +10 -1
- package/lib/components/OptionsTile/OptionsTile.js +11 -6
- package/lib/components/PageHeader/PageHeader.js +1 -0
- package/lib/components/RemoveModal/RemoveModal.d.ts +4 -0
- package/lib/components/RemoveModal/RemoveModal.js +7 -1
- package/lib/components/SearchBar/SearchBar.d.ts +1 -1
- package/lib/components/SearchBar/SearchBar.js +2 -2
- package/lib/components/SidePanel/SidePanel.js +16 -20
- package/lib/components/SidePanel/motion/variants.d.ts +4 -6
- package/lib/components/SidePanel/motion/variants.js +10 -11
- package/lib/components/StatusIndicator/StatusIndicatorStep.js +94 -0
- package/lib/components/Tearsheet/Tearsheet.d.ts +8 -1
- package/lib/components/Tearsheet/Tearsheet.js +9 -1
- package/lib/components/Tearsheet/TearsheetNarrow.d.ts +11 -0
- package/lib/components/Tearsheet/TearsheetNarrow.js +12 -0
- package/lib/components/Tearsheet/TearsheetShell.d.ts +11 -1
- package/lib/components/Tearsheet/TearsheetShell.js +22 -4
- package/lib/components/Toolbar/ToolbarButton.js +1 -1
- package/lib/components/WebTerminal/WebTerminal.js +10 -12
- package/lib/components/index.d.ts +1 -1
- package/lib/global/js/hooks/useFocus.d.ts +1 -0
- package/lib/global/js/hooks/useFocus.js +5 -1
- package/lib/global/js/hooks/usePrefersReducedMotion.js +13 -7
- package/lib/global/js/package-settings.d.ts +1 -1
- package/lib/global/js/package-settings.js +1 -1
- package/lib/index.js +5 -0
- package/lib/settings.d.ts +1 -1
- package/package.json +7 -6
- package/scss/components/ConditionBuilder/_condition-builder.scss +1 -1
- package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +14 -2
- package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +31 -2
- package/scss/components/DataSpreadsheet/_data-spreadsheet.scss +17 -2
- package/scss/components/Datagrid/_datagrid.scss +0 -4
- package/scss/components/Datagrid/styles/_useInlineEdit.scss +13 -0
- package/scss/components/HTTPErrors/_http-errors.scss +77 -0
- package/scss/components/OptionsTile/_options-tile.scss +6 -6
- package/scss/components/SidePanel/_side-panel.scss +1 -1
- package/scss/components/StatusIcon/_status-icon.scss +4 -4
- package/scss/components/StringFormatter/_string-formatter.scss +2 -2
- package/scss/components/UserProfileImage/_user-profile-image.scss +6 -2
- package/scss/components/_index-released-only.scss +1 -0
- package/telemetry.yml +27 -5
- package/es/components/ConditionBuilder/utils/checkForHoldingKey.d.ts +0 -1
- package/es/components/ConditionBuilder/utils/checkForHoldingKey.js +0 -16
- package/es/global/js/utils/window.d.ts +0 -2
- package/es/global/js/utils/window.js +0 -12
- package/lib/components/ConditionBuilder/utils/checkForHoldingKey.d.ts +0 -1
- package/lib/components/ConditionBuilder/utils/checkForHoldingKey.js +0 -20
- package/lib/global/js/utils/window.d.ts +0 -2
- package/lib/global/js/utils/window.js +0 -16
@@ -16,20 +16,19 @@ var index = require('../../../node_modules/prop-types/index.js');
|
|
16
16
|
var cx = require('classnames');
|
17
17
|
var DataConfigs = require('../ConditionBuilderContext/DataConfigs.js');
|
18
18
|
var ConditionBuilderItem = require('../ConditionBuilderItem/ConditionBuilderItem.js');
|
19
|
-
var ConditionBuilderItemOption = require('../ConditionBuilderItem/ConditionBuilderItemOption/ConditionBuilderItemOption.js');
|
20
19
|
var util = require('../utils/util.js');
|
21
20
|
var ConditionConnector = require('../ConditionBuilderConnector/ConditionConnector.js');
|
22
21
|
var ConditionBuilderProvider = require('../ConditionBuilderContext/ConditionBuilderProvider.js');
|
23
22
|
var uuidv4 = require('../../../global/js/utils/uuidv4.js');
|
24
23
|
var ConditionPreview = require('../ConditionPreview/ConditionPreview.js');
|
24
|
+
var ItemOption = require('../ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js');
|
25
|
+
var useTranslations = require('../utils/useTranslations.js');
|
25
26
|
|
26
27
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
27
28
|
|
28
29
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
29
30
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
30
31
|
|
31
|
-
var _ConditionPreview, _ConditionPreview2;
|
32
|
-
|
33
32
|
/**
|
34
33
|
*
|
35
34
|
* state - this is the current group that is being rendered . This can be a inner group or outer group
|
@@ -38,12 +37,17 @@ var _ConditionPreview, _ConditionPreview2;
|
|
38
37
|
*/
|
39
38
|
|
40
39
|
var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
40
|
+
var _ConditionPreview, _ConditionPreview2;
|
41
41
|
var group = _ref.group,
|
42
42
|
aria = _ref.aria,
|
43
43
|
onRemove = _ref.onRemove,
|
44
44
|
onChange = _ref.onChange,
|
45
45
|
conditionBuilderRef = _ref.conditionBuilderRef,
|
46
46
|
className = _ref.className;
|
47
|
+
var _useTranslations = useTranslations.useTranslations(['condition_builder_group', 'conditionText']),
|
48
|
+
_useTranslations2 = _rollupPluginBabelHelpers.slicedToArray(_useTranslations, 2),
|
49
|
+
conditionBuilderGroupText = _useTranslations2[0],
|
50
|
+
conditionText = _useTranslations2[1];
|
47
51
|
var _useContext = React.useContext(ConditionBuilderProvider.ConditionBuilderContext),
|
48
52
|
variant = _useContext.variant;
|
49
53
|
var _useState = React.useState(-1),
|
@@ -54,14 +58,15 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
54
58
|
_useState4 = _rollupPluginBabelHelpers.slicedToArray(_useState3, 2),
|
55
59
|
showConditionSubGroupPreview = _useState4[0],
|
56
60
|
setShowConditionSubGroupPreview = _useState4[1];
|
57
|
-
var
|
61
|
+
var conditionBuilderContentRef = React.useRef();
|
62
|
+
var onRemoveHandler = function onRemoveHandler(conditionId, evt, conditionIndex) {
|
58
63
|
if (group.conditions.length > 1) {
|
64
|
+
variant == 'tree' ? handleFocusOnCloseTree(evt) : handleFocusOnClose(evt, conditionIndex);
|
59
65
|
onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, group), {}, {
|
60
66
|
conditions: group.conditions.filter(function (condition) {
|
61
67
|
return conditionId !== condition.id;
|
62
68
|
})
|
63
69
|
}));
|
64
|
-
handleFocusOnClose(evt);
|
65
70
|
} else {
|
66
71
|
onRemove(evt);
|
67
72
|
}
|
@@ -84,17 +89,55 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
84
89
|
conditions: [].concat(_rollupPluginBabelHelpers.toConsumableArray(group.conditions.slice(0, conditionIndex + 1)), [newCondition], _rollupPluginBabelHelpers.toConsumableArray(group.conditions.slice(conditionIndex + 1)))
|
85
90
|
}));
|
86
91
|
};
|
87
|
-
var handleFocusOnClose = function handleFocusOnClose(e) {
|
88
|
-
var _e$currentTarget;
|
89
|
-
|
90
|
-
if
|
91
|
-
|
92
|
+
var handleFocusOnClose = function handleFocusOnClose(e, conditionIndex) {
|
93
|
+
var _e$currentTarget$clos;
|
94
|
+
//get all close buttons.
|
95
|
+
//if the last condition is closing, focus the second last one.
|
96
|
+
//or focus the next one.
|
97
|
+
var currentGroupCloseButtons = (_e$currentTarget$clos = e.currentTarget.closest(".".concat(DataConfigs.blockClass, "__group"))) === null || _e$currentTarget$clos === void 0 ? void 0 : _e$currentTarget$clos.querySelectorAll('[data-name="closeCondition"]');
|
98
|
+
if (conditionIndex == currentGroupCloseButtons.length - 1) {
|
99
|
+
var _currentGroupCloseBut;
|
100
|
+
(_currentGroupCloseBut = currentGroupCloseButtons[conditionIndex - 1]) === null || _currentGroupCloseBut === void 0 || _currentGroupCloseBut.focus();
|
101
|
+
} else {
|
102
|
+
var _currentGroupCloseBut2;
|
103
|
+
(_currentGroupCloseBut2 = currentGroupCloseButtons[conditionIndex + 1]) === null || _currentGroupCloseBut2 === void 0 || _currentGroupCloseBut2.focus();
|
104
|
+
}
|
105
|
+
};
|
106
|
+
var handleFocusOnCloseTree = function handleFocusOnCloseTree(evt) {
|
107
|
+
var _evt$currentTarget, _evt$currentTarget2, _conditionBuilderCont, _conditionBuilderCont2;
|
108
|
+
//getting the current aria-level and aria-posinset.
|
109
|
+
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');
|
110
|
+
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');
|
111
|
+
|
112
|
+
//finding the next and previous items in same level
|
113
|
+
var nextElement = (_conditionBuilderCont = conditionBuilderContentRef.current) === null || _conditionBuilderCont === void 0 ? void 0 : _conditionBuilderCont.querySelector("[aria-level=\"".concat(currentLevel, "\"][aria-posinset=\"").concat(Number(currentPos) + 1, "\"]"));
|
114
|
+
var prevElement = (_conditionBuilderCont2 = conditionBuilderContentRef.current) === null || _conditionBuilderCont2 === void 0 ? void 0 : _conditionBuilderCont2.querySelector("[aria-level=\"".concat(currentLevel, "\"][aria-posinset=\"").concat(Number(currentPos) - 1, "\"]"));
|
115
|
+
//checking if next level is a valid condition. If then, focus the close button inside that condition
|
116
|
+
//Otherwise , check the previous item is a valid condition
|
117
|
+
|
118
|
+
if (nextElement !== null && nextElement !== void 0 && nextElement.classList.contains("".concat(DataConfigs.blockClass, "__condition-block"))) {
|
119
|
+
var _nextElement$querySel;
|
120
|
+
nextElement === null || nextElement === void 0 || (_nextElement$querySel = nextElement.querySelector('[data-name="closeCondition"]')) === null || _nextElement$querySel === void 0 || _nextElement$querySel.focus();
|
121
|
+
} else if (prevElement !== null && prevElement !== void 0 && prevElement.classList.contains("".concat(DataConfigs.blockClass, "__condition-block"))) {
|
122
|
+
var _prevElement$querySel;
|
123
|
+
prevElement === null || prevElement === void 0 || (_prevElement$querySel = prevElement.querySelector('[data-name="closeCondition"]')) === null || _prevElement$querySel === void 0 || _prevElement$querySel.focus();
|
124
|
+
}
|
125
|
+
//If there are no valid condition in this group, focus next or previous row
|
126
|
+
else {
|
127
|
+
var _conditionBuilderCont3, _conditionBuilderCont4;
|
128
|
+
var prevRows = (_conditionBuilderCont3 = conditionBuilderContentRef.current) === null || _conditionBuilderCont3 === void 0 ? void 0 : _conditionBuilderCont3.querySelectorAll("[aria-level=\"".concat(Number(currentLevel) - 1, "\"][role=\"row\"]"));
|
129
|
+
var nextRow = (_conditionBuilderCont4 = conditionBuilderContentRef.current) === null || _conditionBuilderCont4 === void 0 ? void 0 : _conditionBuilderCont4.querySelector("[aria-level=\"".concat(Number(currentLevel) + 1, "\"][role=\"row\"]"));
|
130
|
+
if (nextRow) {
|
131
|
+
nextRow === null || nextRow === void 0 || nextRow.focus();
|
132
|
+
} else if ((prevRows === null || prevRows === void 0 ? void 0 : prevRows.length) > 1) {
|
133
|
+
var _prevRows;
|
134
|
+
(_prevRows = prevRows[prevRows.length - 2]) === null || _prevRows === void 0 || _prevRows.focus();
|
135
|
+
}
|
92
136
|
}
|
93
137
|
};
|
94
138
|
var addConditionSubGroupHandler = function addConditionSubGroupHandler(conditionIndex) {
|
95
139
|
onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, group), {}, {
|
96
140
|
conditions: [].concat(_rollupPluginBabelHelpers.toConsumableArray(group.conditions.slice(0, conditionIndex + 1)), [{
|
97
|
-
groupSeparateOperator: null,
|
98
141
|
groupOperator: 'and',
|
99
142
|
statement: 'if',
|
100
143
|
conditions: [{
|
@@ -124,7 +167,12 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
124
167
|
setShowConditionPreview(-1);
|
125
168
|
};
|
126
169
|
var onStatementChangeHandler = function onStatementChangeHandler(updatedStatement) {
|
170
|
+
var _statementConfig$find;
|
171
|
+
var groupOperator = (_statementConfig$find = DataConfigs.statementConfig.find(function (statement) {
|
172
|
+
return statement.id == updatedStatement;
|
173
|
+
})) === null || _statementConfig$find === void 0 ? void 0 : _statementConfig$find.connector;
|
127
174
|
onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, group), {}, {
|
175
|
+
groupOperator: groupOperator,
|
128
176
|
statement: updatedStatement
|
129
177
|
}));
|
130
178
|
};
|
@@ -140,7 +188,7 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
140
188
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
141
189
|
className: "".concat(DataConfigs.blockClass, "__condition-wrapper"),
|
142
190
|
role: "grid",
|
143
|
-
"aria-label":
|
191
|
+
"aria-label": conditionBuilderGroupText
|
144
192
|
}, group === null || group === void 0 || (_group$conditions = group.conditions) === null || _group$conditions === void 0 ? void 0 : _group$conditions.map(function (eachCondition, conditionIndex) {
|
145
193
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
146
194
|
key: eachCondition.id,
|
@@ -161,7 +209,7 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
161
209
|
},
|
162
210
|
addConditionHandler: addConditionHandler,
|
163
211
|
onRemove: function onRemove(e) {
|
164
|
-
onRemoveHandler(eachCondition.id, e);
|
212
|
+
onRemoveHandler(eachCondition.id, e, conditionIndex);
|
165
213
|
},
|
166
214
|
onConnectorOperatorChange: onConnectorOperatorChange,
|
167
215
|
onStatementChange: onStatementChangeHandler,
|
@@ -174,7 +222,8 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
174
222
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
175
223
|
className: "".concat(className, " ").concat(DataConfigs.blockClass, "__condition-wrapper"),
|
176
224
|
role: aria.level === 1 ? 'rowgroup' : undefined,
|
177
|
-
"aria-label": aria.level == 1 ?
|
225
|
+
"aria-label": aria.level == 1 ? conditionBuilderGroupText : undefined,
|
226
|
+
ref: conditionBuilderContentRef
|
178
227
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
179
228
|
tabIndex: 0,
|
180
229
|
role: "row",
|
@@ -183,14 +232,14 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
183
232
|
"aria-setsize": aria.setsize
|
184
233
|
}, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
185
234
|
label: group.statement,
|
186
|
-
title:
|
235
|
+
title: conditionText,
|
187
236
|
"data-name": "connectorField",
|
188
237
|
popOverClassName: "".concat(DataConfigs.blockClass, "__gap"),
|
189
238
|
className: "".concat(DataConfigs.blockClass, "__statement-button")
|
190
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
239
|
+
}, /*#__PURE__*/React__default["default"].createElement(ItemOption.ItemOption, {
|
191
240
|
conditionState: {
|
192
241
|
value: group.statement,
|
193
|
-
label:
|
242
|
+
label: conditionText
|
194
243
|
},
|
195
244
|
onChange: function onChange(v, evt) {
|
196
245
|
util.focusThisField(evt);
|
@@ -223,7 +272,7 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
223
272
|
onRemoveHandler(eachCondition.id, e);
|
224
273
|
},
|
225
274
|
conditionBuilderRef: conditionBuilderRef
|
226
|
-
})) : /*#__PURE__*/React__default["default"].createElement(ConditionBlock["default"], {
|
275
|
+
})) : /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement(ConditionBlock["default"], {
|
227
276
|
conjunction: conditionIndex > 0 ? group.groupOperator : undefined,
|
228
277
|
aria: {
|
229
278
|
level: aria.level + 1,
|
@@ -253,10 +302,12 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
253
302
|
},
|
254
303
|
hideConditionPreviewHandler: hideConditionPreviewHandler,
|
255
304
|
isLastCondition: isLastCondition
|
256
|
-
}), conditionIndex == showConditionSubGroupPreview && (_ConditionPreview || (_ConditionPreview = /*#__PURE__*/React__default["default"].createElement(ConditionPreview["default"], {
|
257
|
-
previewType: "subGroup"
|
305
|
+
})), conditionIndex == showConditionSubGroupPreview && (_ConditionPreview || (_ConditionPreview = /*#__PURE__*/React__default["default"].createElement(ConditionPreview["default"], {
|
306
|
+
previewType: "subGroup",
|
307
|
+
group: group
|
258
308
|
}))), conditionIndex == showConditionPreview && (_ConditionPreview2 || (_ConditionPreview2 = /*#__PURE__*/React__default["default"].createElement(ConditionPreview["default"], {
|
259
|
-
previewType: "condition"
|
309
|
+
previewType: "condition",
|
310
|
+
group: group
|
260
311
|
}))));
|
261
312
|
}));
|
262
313
|
};
|
@@ -1,9 +1,11 @@
|
|
1
1
|
export default ConditionPreview;
|
2
|
-
declare function ConditionPreview({ previewType }: {
|
2
|
+
declare function ConditionPreview({ previewType, group }: {
|
3
3
|
previewType: any;
|
4
|
+
group: any;
|
4
5
|
}): import("react/jsx-runtime").JSX.Element;
|
5
6
|
declare namespace ConditionPreview {
|
6
7
|
namespace propTypes {
|
8
|
+
let group: PropTypes.Requireable<object>;
|
7
9
|
let previewType: PropTypes.Requireable<string>;
|
8
10
|
}
|
9
11
|
}
|
@@ -9,65 +9,92 @@
|
|
9
9
|
|
10
10
|
Object.defineProperty(exports, '__esModule', { value: true });
|
11
11
|
|
12
|
+
var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
|
12
13
|
var React = require('react');
|
14
|
+
var cx = require('classnames');
|
13
15
|
var index = require('../../../node_modules/prop-types/index.js');
|
14
16
|
var DataConfigs = require('../ConditionBuilderContext/DataConfigs.js');
|
15
17
|
var ConditionBuilderItem = require('../ConditionBuilderItem/ConditionBuilderItem.js');
|
16
18
|
var ConditionConnector = require('../ConditionBuilderConnector/ConditionConnector.js');
|
19
|
+
var useTranslations = require('../utils/useTranslations.js');
|
20
|
+
var icons = require('@carbon/react/icons');
|
17
21
|
|
18
22
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
19
23
|
|
20
24
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
25
|
+
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
21
26
|
|
22
27
|
var ConditionPreview = function ConditionPreview(_ref) {
|
23
|
-
var
|
28
|
+
var _ConditionBuilderItem, _ConditionBuilderItem2, _ConditionBuilderItem3;
|
29
|
+
var previewType = _ref.previewType,
|
30
|
+
group = _ref.group;
|
31
|
+
var _useState = React.useState(false),
|
32
|
+
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
33
|
+
animate = _useState2[0],
|
34
|
+
setAnimate = _useState2[1];
|
35
|
+
var _useTranslations = useTranslations.useTranslations(['valueText', 'operatorText', 'propertyText', 'ifText']),
|
36
|
+
_useTranslations2 = _rollupPluginBabelHelpers.slicedToArray(_useTranslations, 4),
|
37
|
+
propertyText = _useTranslations2[0],
|
38
|
+
operatorText = _useTranslations2[1],
|
39
|
+
valueText = _useTranslations2[2],
|
40
|
+
ifText = _useTranslations2[3];
|
41
|
+
React.useEffect(function () {
|
42
|
+
setAnimate(true);
|
43
|
+
}, []);
|
24
44
|
var getConditionSection = function getConditionSection() {
|
25
|
-
return /*#__PURE__*/React__default["default"].createElement("div",
|
26
|
-
|
27
|
-
}
|
28
|
-
label:
|
29
|
-
|
30
|
-
|
31
|
-
|
45
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
46
|
+
className: "".concat(DataConfigs.blockClass, "__preview-condition")
|
47
|
+
}, _ConditionBuilderItem || (_ConditionBuilderItem = /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
48
|
+
label: propertyText,
|
49
|
+
renderIcon: icons.Bee
|
50
|
+
})), _ConditionBuilderItem2 || (_ConditionBuilderItem2 = /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
51
|
+
label: operatorText
|
52
|
+
})), _ConditionBuilderItem3 || (_ConditionBuilderItem3 = /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
53
|
+
label: valueText
|
54
|
+
})));
|
32
55
|
};
|
33
56
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, previewType == 'newGroup' && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
34
|
-
className: "".concat(DataConfigs.blockClass, "__group__row ").concat(DataConfigs.blockClass, "__group-preview
|
57
|
+
className: cx__default["default"](["".concat(DataConfigs.blockClass, "__group__row ").concat(DataConfigs.blockClass, "__group-preview "), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__group-preview-animate"), animate)])
|
35
58
|
}, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
36
59
|
className: "".concat(DataConfigs.blockClass, "__statement-button"),
|
37
|
-
label:
|
60
|
+
label: group.groupOperator
|
38
61
|
})), /*#__PURE__*/React__default["default"].createElement("div", {
|
39
62
|
"aria-hidden": true,
|
40
|
-
className: "".concat(DataConfigs.blockClass, "__group ").concat(DataConfigs.blockClass, "__condition-wrapper ").concat(DataConfigs.blockClass, "__group-preview ").concat(DataConfigs.blockClass, "__group-wrapper")
|
63
|
+
className: cx__default["default"](["".concat(DataConfigs.blockClass, "__group ").concat(DataConfigs.blockClass, "__condition-wrapper ").concat(DataConfigs.blockClass, "__group-preview ").concat(DataConfigs.blockClass, "__group-wrapper "), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__group-preview-animate"), animate)])
|
41
64
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
42
65
|
className: "".concat(DataConfigs.blockClass, "__gap")
|
43
66
|
}, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
44
67
|
className: "".concat(DataConfigs.blockClass, "__statement-button"),
|
45
|
-
label:
|
68
|
+
label: ifText
|
46
69
|
})), getConditionSection())), previewType == 'subGroup' && /*#__PURE__*/React__default["default"].createElement("div", {
|
47
|
-
className: "".concat(DataConfigs.blockClass, "__group-preview")
|
70
|
+
className: cx__default["default"](["".concat(DataConfigs.blockClass, "__group__row ").concat(DataConfigs.blockClass, "__group-preview "), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__group-preview-animate"), animate)])
|
48
71
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
49
72
|
className: "".concat(DataConfigs.blockClass, "__condition-block ").concat(DataConfigs.blockClass, "__gap")
|
50
73
|
}, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
51
|
-
label:
|
74
|
+
label: group.groupOperator,
|
52
75
|
className: "".concat(DataConfigs.blockClass, "__statement-button"),
|
53
76
|
popOverClassName: "".concat(DataConfigs.blockClass, "__gap")
|
54
77
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
55
78
|
className: "".concat(DataConfigs.blockClass, "__group ").concat(DataConfigs.blockClass, "__condition-wrapper")
|
56
79
|
}, /*#__PURE__*/React__default["default"].createElement(ConditionConnector["default"], {
|
57
80
|
className: "".concat(DataConfigs.blockClass, "__gap ").concat(DataConfigs.blockClass, "__groupConnector"),
|
58
|
-
operator:
|
81
|
+
operator: ifText
|
59
82
|
}), getConditionSection()))), previewType == 'condition' && /*#__PURE__*/React__default["default"].createElement("div", {
|
60
|
-
className: "".concat(DataConfigs.blockClass, "__group-preview")
|
83
|
+
className: cx__default["default"](["".concat(DataConfigs.blockClass, "__group__row ").concat(DataConfigs.blockClass, "__group-preview "), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__group-preview-animate"), animate)])
|
61
84
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
62
85
|
className: "".concat(DataConfigs.blockClass, "__condition-block ").concat(DataConfigs.blockClass, "__gap")
|
63
86
|
}, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
64
|
-
label:
|
87
|
+
label: group.groupOperator,
|
65
88
|
className: "".concat(DataConfigs.blockClass, "__statement-button"),
|
66
89
|
popOverClassName: "".concat(DataConfigs.blockClass, "__gap")
|
67
90
|
}), getConditionSection())));
|
68
91
|
};
|
69
92
|
var ConditionPreview$1 = ConditionPreview;
|
70
93
|
ConditionPreview.propTypes = {
|
94
|
+
/**
|
95
|
+
* current conditional group
|
96
|
+
*/
|
97
|
+
group: index["default"].object,
|
71
98
|
/**
|
72
99
|
* type of review to be displayed
|
73
100
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
export function handleKeyDown(evt: any, conditionBuilderRef: any): void;
|
1
|
+
export function handleKeyDown(evt: any, conditionBuilderRef: any, variant: any): void;
|
@@ -11,21 +11,28 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
11
|
|
12
12
|
var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
|
13
13
|
var DataConfigs = require('../ConditionBuilderContext/DataConfigs.js');
|
14
|
-
var checkForHoldingKey = require('./checkForHoldingKey.js');
|
15
14
|
var util = require('./util.js');
|
16
15
|
|
17
|
-
var handleKeyDown = function handleKeyDown(evt, conditionBuilderRef) {
|
16
|
+
var handleKeyDown = function handleKeyDown(evt, conditionBuilderRef, variant) {
|
18
17
|
var activeElement = document.activeElement;
|
18
|
+
if (excludeKeyPress(evt)) {
|
19
|
+
return;
|
20
|
+
}
|
19
21
|
if (activeElement.closest("[role=\"dialog\"]")) {
|
20
22
|
handleKeyPressForPopover(evt, activeElement.closest("[role=\"dialog\"]"));
|
21
23
|
} else {
|
22
|
-
handleKeyPressForMainContent(evt, conditionBuilderRef);
|
24
|
+
handleKeyPressForMainContent(evt, conditionBuilderRef, variant);
|
23
25
|
}
|
24
26
|
};
|
27
|
+
//skipping keyboard handling for date and time fields to get take carbon's
|
28
|
+
var excludeKeyPress = function excludeKeyPress(evt) {
|
29
|
+
var _evt$target$closest, _evt$target$closest2;
|
30
|
+
return !['Escape'].includes(evt.key) && (((_evt$target$closest = evt.target.closest(".".concat(DataConfigs.blockClass, "__item-date"))) === null || _evt$target$closest === void 0 ? void 0 : _evt$target$closest.length) || ((_evt$target$closest2 = evt.target.closest(".".concat(DataConfigs.blockClass, "__item-time"))) === null || _evt$target$closest2 === void 0 ? void 0 : _evt$target$closest2.length));
|
31
|
+
};
|
25
32
|
var handleKeyPressForPopover = function handleKeyPressForPopover(evt, parentContainer) {
|
26
33
|
var _parentContainer$quer;
|
27
34
|
var key = evt.key;
|
28
|
-
var isHoldingShiftKey =
|
35
|
+
var isHoldingShiftKey = util.checkForHoldingKey(evt, 'shiftKey');
|
29
36
|
var isMultiSelect = (_parentContainer$quer = parentContainer.querySelector('ul')) === null || _parentContainer$quer === void 0 ? void 0 : _parentContainer$quer.dataset.multiSelect;
|
30
37
|
var allItems = [];
|
31
38
|
switch (key) {
|
@@ -67,8 +74,8 @@ var handleKeyPressForPopover = function handleKeyPressForPopover(evt, parentCont
|
|
67
74
|
if (document.activeElement.type !== 'button') {
|
68
75
|
var _document$activeEleme2;
|
69
76
|
//for button , enter key is click which already handled by framework, else trigger click
|
70
|
-
(_document$activeEleme2 = document.activeElement) === null || _document$activeEleme2 === void 0 || _document$activeEleme2.click();
|
71
77
|
util.focusThisField(evt);
|
78
|
+
(_document$activeEleme2 = document.activeElement) === null || _document$activeEleme2 === void 0 || _document$activeEleme2.click();
|
72
79
|
}
|
73
80
|
}
|
74
81
|
break;
|
@@ -78,8 +85,70 @@ var handleKeyPressForPopover = function handleKeyPressForPopover(evt, parentCont
|
|
78
85
|
break;
|
79
86
|
}
|
80
87
|
};
|
88
|
+
var handleKeyPressForMainContent = function handleKeyPressForMainContent(evt, conditionBuilderRef, variant) {
|
89
|
+
switch (evt.key) {
|
90
|
+
case 'ArrowRight':
|
91
|
+
evt.preventDefault();
|
92
|
+
if (variant == 'tree') {
|
93
|
+
var _evt$target$closest3;
|
94
|
+
var allCellsInRow = Array.from((_evt$target$closest3 = evt.target.closest('[role="row"]')) === null || _evt$target$closest3 === void 0 ? void 0 : _evt$target$closest3.querySelectorAll('[role="gridcell"] button'));
|
95
|
+
if (evt.target.getAttribute('role') == 'row') {
|
96
|
+
//when current focus is on a row, then we need to enter inside and focus the first cell of that row
|
97
|
+
if (allCellsInRow.length === 1) {
|
98
|
+
handleRowNavigationTree(evt, conditionBuilderRef, variant);
|
99
|
+
//focus next row
|
100
|
+
} else {
|
101
|
+
var _allCellsInRow$;
|
102
|
+
(_allCellsInRow$ = allCellsInRow[0]) === null || _allCellsInRow$ === void 0 || _allCellsInRow$.focus();
|
103
|
+
}
|
104
|
+
} else {
|
105
|
+
//finding the next cell to be focussed
|
106
|
+
//next cell = current cell index + 1
|
107
|
+
|
108
|
+
var currentItemIndex = allCellsInRow.indexOf(evt.target);
|
109
|
+
if (currentItemIndex < allCellsInRow.length - 1) {
|
110
|
+
util.focusThisItem(allCellsInRow[currentItemIndex + 1]);
|
111
|
+
}
|
112
|
+
}
|
113
|
+
} else {
|
114
|
+
handleCellNavigation(evt, conditionBuilderRef);
|
115
|
+
}
|
116
|
+
break;
|
117
|
+
case 'ArrowLeft':
|
118
|
+
evt.preventDefault();
|
119
|
+
if (variant == 'tree') {
|
120
|
+
if (evt.target.getAttribute('role') !== 'row') {
|
121
|
+
var _evt$target$closest4;
|
122
|
+
//when any cell is focussed, arrow left will select the previous cell or current row
|
123
|
+
|
124
|
+
var allItems = Array.from((_evt$target$closest4 = evt.target.closest('[role="row"]')) === null || _evt$target$closest4 === void 0 ? void 0 : _evt$target$closest4.querySelectorAll('[role="gridcell"] button'));
|
125
|
+
var _currentItemIndex = allItems.indexOf(evt.target);
|
126
|
+
if (_currentItemIndex > 0) {
|
127
|
+
util.focusThisItem(allItems[_currentItemIndex - 1]);
|
128
|
+
} else {
|
129
|
+
//focus the row
|
130
|
+
var wrapper = evt.target.closest("[role=\"row\"]");
|
131
|
+
wrapper.focus();
|
132
|
+
}
|
133
|
+
}
|
134
|
+
} else {
|
135
|
+
handleCellNavigation(evt, conditionBuilderRef);
|
136
|
+
}
|
137
|
+
break;
|
138
|
+
case 'ArrowUp':
|
139
|
+
case 'ArrowDown':
|
140
|
+
evt.preventDefault();
|
141
|
+
if (variant == 'tree') {
|
142
|
+
handleRowNavigationTree(evt, conditionBuilderRef, variant);
|
143
|
+
} else {
|
144
|
+
handleRowNavigation(evt, conditionBuilderRef, variant);
|
145
|
+
}
|
146
|
+
break;
|
147
|
+
}
|
148
|
+
};
|
81
149
|
var getRows = function getRows(conditionBuilderRef) {
|
82
|
-
|
150
|
+
var _conditionBuilderRef$;
|
151
|
+
return Array.from((_conditionBuilderRef$ = conditionBuilderRef.current) === null || _conditionBuilderRef$ === void 0 ? void 0 : _conditionBuilderRef$.querySelectorAll('[role="row"]'));
|
83
152
|
};
|
84
153
|
var getRowIndex = function getRowIndex(element, conditionBuilderRef) {
|
85
154
|
var rows = getRows(conditionBuilderRef);
|
@@ -87,14 +156,39 @@ var getRowIndex = function getRowIndex(element, conditionBuilderRef) {
|
|
87
156
|
return row.contains(element);
|
88
157
|
});
|
89
158
|
};
|
90
|
-
var handleRowNavigation = function handleRowNavigation(evt, conditionBuilderRef) {
|
159
|
+
var handleRowNavigation = function handleRowNavigation(evt, conditionBuilderRef, variant) {
|
91
160
|
var rows = getRows(conditionBuilderRef);
|
92
161
|
var currentRowIndex = getRowIndex(evt.target, conditionBuilderRef);
|
93
|
-
navigateToNextRowCell(evt, currentRowIndex, rows);
|
162
|
+
navigateToNextRowCell(evt, currentRowIndex, rows, variant);
|
94
163
|
};
|
95
|
-
|
96
|
-
var
|
97
|
-
|
164
|
+
function handleRowNavigationTree(evt, conditionBuilderRef, variant) {
|
165
|
+
var rows = getRows(conditionBuilderRef);
|
166
|
+
var currentRowIndex = getRowIndex(evt.target, conditionBuilderRef);
|
167
|
+
var nextRowIndex = currentRowIndex;
|
168
|
+
if (evt.target.getAttribute('role') == 'row') {
|
169
|
+
if (['ArrowDown', 'ArrowRight'].includes(evt.key)) {
|
170
|
+
nextRowIndex += 1;
|
171
|
+
} else if (evt.key === 'ArrowUp') {
|
172
|
+
nextRowIndex -= 1;
|
173
|
+
}
|
174
|
+
|
175
|
+
//maintaining selection for first and last rows
|
176
|
+
if (nextRowIndex < 0) {
|
177
|
+
nextRowIndex = 0;
|
178
|
+
} else if (nextRowIndex >= rows.length) {
|
179
|
+
nextRowIndex = rows.length - 1;
|
180
|
+
}
|
181
|
+
if (nextRowIndex !== currentRowIndex) {
|
182
|
+
rows[currentRowIndex].setAttribute('tabindex', '-1');
|
183
|
+
rows[nextRowIndex].setAttribute('tabindex', '0');
|
184
|
+
rows[nextRowIndex].focus();
|
185
|
+
}
|
186
|
+
} else {
|
187
|
+
navigateToNextRowCell(evt, currentRowIndex, rows, variant);
|
188
|
+
}
|
189
|
+
}
|
190
|
+
var navigateToNextRowCell = function navigateToNextRowCell(evt, currentRowIndex, rows, variant) {
|
191
|
+
//when the current focussed element is a cell of any row, arrow up/down will focus the next row same cell.
|
98
192
|
|
99
193
|
var nextRowIndex = currentRowIndex;
|
100
194
|
if (evt.key === 'ArrowUp') {
|
@@ -105,25 +199,22 @@ var navigateToNextRowCell = function navigateToNextRowCell(evt, currentRowIndex,
|
|
105
199
|
}
|
106
200
|
var nextRow = rows[nextRowIndex];
|
107
201
|
var itemName = evt.target.dataset.name;
|
108
|
-
nextRow
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
conditionBuilderRef.current.querySelectorAll("[role=\"gridcell\"] button").forEach(function (eachElem, index, allElements) {
|
115
|
-
if (evt.key === 'ArrowRight') {
|
116
|
-
util.traverseClockVise(eachElem, index, allElements);
|
117
|
-
} else {
|
118
|
-
util.traverseReverse(eachElem, index, allElements);
|
119
|
-
}
|
120
|
-
});
|
121
|
-
break;
|
122
|
-
case 'ArrowUp':
|
123
|
-
case 'ArrowDown':
|
124
|
-
handleRowNavigation(evt, conditionBuilderRef);
|
125
|
-
break;
|
202
|
+
if (nextRow !== null && nextRow !== void 0 && nextRow.querySelector("[data-name=\"".concat(itemName, "\"]"))) {
|
203
|
+
var _nextRow$querySelecto;
|
204
|
+
nextRow === null || nextRow === void 0 || (_nextRow$querySelecto = nextRow.querySelector("[data-name=\"".concat(itemName, "\"]"))) === null || _nextRow$querySelecto === void 0 || _nextRow$querySelecto.focus();
|
205
|
+
} else if (variant === 'tree') {
|
206
|
+
//when the next row is a if statement , then that row is focused. From any cell of last row of an group , arrow down select the next row (if)
|
207
|
+
nextRow === null || nextRow === void 0 || nextRow.focus();
|
126
208
|
}
|
127
209
|
};
|
210
|
+
var handleCellNavigation = function handleCellNavigation(evt, conditionBuilderRef) {
|
211
|
+
conditionBuilderRef.current.querySelectorAll("[role=\"gridcell\"] button").forEach(function (eachElem, index, allElements) {
|
212
|
+
if (evt.key === 'ArrowRight') {
|
213
|
+
util.traverseClockVise(eachElem, index, allElements);
|
214
|
+
} else {
|
215
|
+
util.traverseReverse(eachElem, index, allElements);
|
216
|
+
}
|
217
|
+
});
|
218
|
+
};
|
128
219
|
|
129
220
|
exports.handleKeyDown = handleKeyDown;
|
@@ -0,0 +1 @@
|
|
1
|
+
export function useTranslations(translationKeys: any): any;
|
@@ -0,0 +1,30 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2020, 2024
|
3
|
+
*
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
|
8
|
+
'use strict';
|
9
|
+
|
10
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
11
|
+
|
12
|
+
var React = require('react');
|
13
|
+
var ConditionBuilderProvider = require('../ConditionBuilderContext/ConditionBuilderProvider.js');
|
14
|
+
var translationObject = require('../ConditionBuilderContext/translationObject.js');
|
15
|
+
|
16
|
+
var useTranslations = function useTranslations(translationKeys) {
|
17
|
+
var _useContext = React.useContext(ConditionBuilderProvider.ConditionBuilderContext),
|
18
|
+
translateWithId = _useContext.translateWithId;
|
19
|
+
return translationKeys.map(function (translationKey) {
|
20
|
+
if (translateWithId !== null && translateWithId !== void 0 && translateWithId(translationKey)) {
|
21
|
+
return translateWithId(translationKey);
|
22
|
+
} else if (translationObject.translationsObject[translationKey]) {
|
23
|
+
return translationObject.translationsObject[translationKey];
|
24
|
+
} else {
|
25
|
+
return translationKey;
|
26
|
+
}
|
27
|
+
});
|
28
|
+
};
|
29
|
+
|
30
|
+
exports.useTranslations = useTranslations;
|
@@ -3,3 +3,4 @@ export function focusThisItem(currentElement: any): void;
|
|
3
3
|
export function traverseClockVise(eachElem: any, index: any, allElements: any, rotate: any, trapFocus: any): void;
|
4
4
|
export function traverseReverse(eachElem: any, index: any, allElements: any, rotate: any, trapFocus: any): void;
|
5
5
|
export function checkForHoldingKey(evt: any, key: any): any;
|
6
|
+
export function checkDuplicateAction(actionState: any, selectedId: any, currentActionId: any): boolean;
|
@@ -45,7 +45,15 @@ var traverseReverse = function traverseReverse(eachElem, index, allElements, rot
|
|
45
45
|
focusThisItem(allElements[allElements.length - 1]);
|
46
46
|
}
|
47
47
|
};
|
48
|
+
var checkForHoldingKey = function checkForHoldingKey(evt, key) {
|
49
|
+
// possible key inputs: altKey,ctrlKey,metaKey,shiftKey
|
50
|
+
if (key === 'cmd') {
|
51
|
+
return evt.metaKey || evt.ctrlKey;
|
52
|
+
}
|
53
|
+
return evt[key];
|
54
|
+
};
|
48
55
|
|
56
|
+
exports.checkForHoldingKey = checkForHoldingKey;
|
49
57
|
exports.focusThisField = focusThisField;
|
50
58
|
exports.focusThisItem = focusThisItem;
|
51
59
|
exports.traverseClockVise = traverseClockVise;
|
@@ -98,6 +98,7 @@ exports.CreateFullPage = /*#__PURE__*/React__default["default"].forwardRef(funct
|
|
98
98
|
_useState10 = _rollupPluginBabelHelpers.slicedToArray(_useState9, 2),
|
99
99
|
modalIsOpen = _useState10[0],
|
100
100
|
setModalIsOpen = _useState10[1];
|
101
|
+
// eslint-disable-next-line ssr-friendly/no-dom-globals-in-react-fc
|
101
102
|
var previousState = usePreviousValue.usePreviousValue({
|
102
103
|
currentStep: currentStep,
|
103
104
|
open: open
|
@@ -155,8 +156,7 @@ exports.CreateFullPage = /*#__PURE__*/React__default["default"].forwardRef(funct
|
|
155
156
|
useResetCreateComponent.useResetCreateComponent({
|
156
157
|
firstIncludedStep: firstIncludedStep,
|
157
158
|
previousState: previousState,
|
158
|
-
|
159
|
-
open: open,
|
159
|
+
open: true,
|
160
160
|
setCurrentStep: setCurrentStep,
|
161
161
|
stepData: stepData,
|
162
162
|
/**@ts-ignore */
|