@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,6 +16,8 @@ import { CoachmarkOverlay } from '../Coachmark/CoachmarkOverlay.js';
|
|
16
16
|
import { CoachmarkTagline } from '../Coachmark/CoachmarkTagline.js';
|
17
17
|
import { CoachmarkContext } from '../Coachmark/utils/context.js';
|
18
18
|
import { COACHMARK_OVERLAY_KIND } from '../Coachmark/utils/enums.js';
|
19
|
+
import { useReducedMotion } from 'framer-motion';
|
20
|
+
import { useIsomorphicEffect } from '../../global/js/hooks/useIsomorphicEffect.js';
|
19
21
|
|
20
22
|
var _excluded = ["children", "className", "onClose", "portalTarget", "tagline", "theme"];
|
21
23
|
// Carbon and package components we use.
|
@@ -39,7 +41,6 @@ var defaults = {
|
|
39
41
|
* This variant allows the a coachmark overlay to be displayed by interacting with the tagline.
|
40
42
|
*/
|
41
43
|
var CoachmarkFixed = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
42
|
-
var _document$querySelect;
|
43
44
|
var children = _ref.children,
|
44
45
|
className = _ref.className,
|
45
46
|
_ref$onClose = _ref.onClose,
|
@@ -51,7 +52,7 @@ var CoachmarkFixed = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
51
52
|
theme = _ref$theme === void 0 ? defaults.theme : _ref$theme,
|
52
53
|
rest = _objectWithoutProperties(_ref, _excluded);
|
53
54
|
var overlayRef = useRef(null);
|
54
|
-
var portalNode =
|
55
|
+
var portalNode = useRef(null);
|
55
56
|
var _useState = useState(false),
|
56
57
|
_useState2 = _slicedToArray(_useState, 2),
|
57
58
|
isOpen = _useState2[0],
|
@@ -75,17 +76,19 @@ var CoachmarkFixed = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
75
76
|
_useState10 = _slicedToArray(_useState9, 2),
|
76
77
|
fixedIsVisible = _useState10[0],
|
77
78
|
setFixedIsVisible = _useState10[1];
|
78
|
-
var
|
79
|
+
var shouldReduceMotion = useReducedMotion();
|
80
|
+
useIsomorphicEffect(function () {
|
81
|
+
var _document$querySelect, _document, _document2, _document3;
|
82
|
+
portalNode.current = portalTarget ? (_document$querySelect = (_document = document) === null || _document === void 0 ? void 0 : _document.querySelector(portalTarget)) !== null && _document$querySelect !== void 0 ? _document$querySelect : (_document2 = document) === null || _document2 === void 0 ? void 0 : _document2.querySelector('body') : (_document3 = document) === null || _document3 === void 0 ? void 0 : _document3.querySelector('body');
|
83
|
+
}, [portalTarget]);
|
79
84
|
var handleClose = useCallback(function () {
|
80
|
-
|
81
|
-
if (prefersReducedMotion.matches) {
|
85
|
+
if (shouldReduceMotion) {
|
82
86
|
setIsOpen(false);
|
83
87
|
} else {
|
84
88
|
setFixedIsVisible(false);
|
85
89
|
}
|
86
|
-
}, [
|
90
|
+
}, [shouldReduceMotion]);
|
87
91
|
var handleTransitionEnd = function handleTransitionEnd(e) {
|
88
|
-
console.log('Here at transition end... ', e.propertyName === 'transform' && !fixedIsVisible);
|
89
92
|
if (e.propertyName === 'transform' && !fixedIsVisible) {
|
90
93
|
setIsOpen(false);
|
91
94
|
onClose();
|
@@ -164,7 +167,7 @@ var CoachmarkFixed = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
164
167
|
}, getDevtoolsProps(componentName)), /*#__PURE__*/React__default.createElement(CoachmarkTagline, {
|
165
168
|
title: tagline,
|
166
169
|
onClose: onClose
|
167
|
-
}), isOpen && /*#__PURE__*/createPortal( /*#__PURE__*/React__default.createElement(CoachmarkOverlay, {
|
170
|
+
}), isOpen && (portalNode === null || portalNode === void 0 ? void 0 : portalNode.current) && /*#__PURE__*/createPortal( /*#__PURE__*/React__default.createElement(CoachmarkOverlay, {
|
168
171
|
ref: overlayRef,
|
169
172
|
fixedIsVisible: fixedIsVisible,
|
170
173
|
kind: COACHMARK_OVERLAY_KIND.FIXED,
|
@@ -172,9 +175,8 @@ var CoachmarkFixed = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
172
175
|
onTransitionEnd: handleTransitionEnd,
|
173
176
|
theme: theme,
|
174
177
|
className: cx(fixedIsVisible && "".concat(overlayBlockClass, "--is-visible"), overlayBlockClass)
|
175
|
-
}, children),
|
176
|
-
|
177
|
-
portalNode || document.body)));
|
178
|
+
}, children), // Default to `document.body` when `portalNode` is `null`
|
179
|
+
portalNode === null || portalNode === void 0 ? void 0 : portalNode.current)));
|
178
180
|
});
|
179
181
|
|
180
182
|
// Return a placeholder if not released and not enabled by feature flag
|
@@ -17,6 +17,7 @@ import { CoachmarkStackHome } from './CoachmarkStackHome.js';
|
|
17
17
|
import { CoachmarkTagline } from '../Coachmark/CoachmarkTagline.js';
|
18
18
|
import { CoachmarkContext } from '../Coachmark/utils/context.js';
|
19
19
|
import { COACHMARK_OVERLAY_KIND } from '../Coachmark/utils/enums.js';
|
20
|
+
import { useIsomorphicEffect } from '../../global/js/hooks/useIsomorphicEffect.js';
|
20
21
|
|
21
22
|
var _excluded = ["children", "className", "onClose", "description", "media", "navLinkLabels", "portalTarget", "closeButtonLabel", "tagline", "theme", "title"];
|
22
23
|
|
@@ -47,7 +48,6 @@ var defaults = {
|
|
47
48
|
* This variant allows the stacking of multiple coachmark overlays to be displayed by interacting with the tagline.
|
48
49
|
*/
|
49
50
|
var CoachmarkStack = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
50
|
-
var _document$querySelect;
|
51
51
|
var children = _ref.children,
|
52
52
|
className = _ref.className,
|
53
53
|
_ref$onClose = _ref.onClose,
|
@@ -63,7 +63,11 @@ var CoachmarkStack = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
63
63
|
theme = _ref$theme === void 0 ? defaults.theme : _ref$theme,
|
64
64
|
title = _ref.title,
|
65
65
|
rest = _objectWithoutProperties(_ref, _excluded);
|
66
|
-
var portalNode =
|
66
|
+
var portalNode = useRef();
|
67
|
+
useIsomorphicEffect(function () {
|
68
|
+
var _document$querySelect, _document, _document2, _document3;
|
69
|
+
portalNode.current = portalTarget ? (_document$querySelect = (_document = document) === null || _document === void 0 ? void 0 : _document.querySelector(portalTarget)) !== null && _document$querySelect !== void 0 ? _document$querySelect : (_document2 = document) === null || _document2 === void 0 ? void 0 : _document2.querySelector('body') : (_document3 = document) === null || _document3 === void 0 ? void 0 : _document3.querySelector('body');
|
70
|
+
}, [portalTarget]);
|
67
71
|
var stackHomeRef = useRef();
|
68
72
|
var stackedCoachmarkRefs = useRef([]);
|
69
73
|
var _useState = useState(false),
|
@@ -206,7 +210,7 @@ var CoachmarkStack = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
206
210
|
portalTarget: portalTarget,
|
207
211
|
closeButtonLabel: closeButtonLabel,
|
208
212
|
title: title
|
209
|
-
}), /*#__PURE__*/createPortal(wrappedChildren, portalNode)));
|
213
|
+
}), portalNode !== null && portalNode !== void 0 && portalNode.current ? /*#__PURE__*/createPortal(wrappedChildren, portalNode === null || portalNode === void 0 ? void 0 : portalNode.current) : null));
|
210
214
|
});
|
211
215
|
|
212
216
|
// Return a placeholder if not released and not enabled by feature flag
|
@@ -16,6 +16,7 @@ import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
|
|
16
16
|
import { pkg } from '../../settings.js';
|
17
17
|
import { createPortal } from 'react-dom';
|
18
18
|
import { CoachmarkHeader } from '../Coachmark/CoachmarkHeader.js';
|
19
|
+
import { useIsomorphicEffect } from '../../global/js/hooks/useIsomorphicEffect.js';
|
19
20
|
import { SteppedAnimatedMedia } from '../SteppedAnimatedMedia/SteppedAnimatedMedia.js';
|
20
21
|
|
21
22
|
var _excluded = ["className", "description", "isOpen", "media", "navLinkLabels", "onClickNavItem", "onClose", "portalTarget", "closeButtonLabel", "title"];
|
@@ -33,7 +34,6 @@ var componentName = 'CoachmarkStackHome';
|
|
33
34
|
* of other Onboarding components.
|
34
35
|
*/
|
35
36
|
var CoachmarkStackHome = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
36
|
-
var _document$querySelect;
|
37
37
|
var className = _ref.className,
|
38
38
|
description = _ref.description,
|
39
39
|
isOpen = _ref.isOpen,
|
@@ -57,11 +57,15 @@ var CoachmarkStackHome = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
57
57
|
}
|
58
58
|
}, 100);
|
59
59
|
}, [isOpen]);
|
60
|
+
var portalNode = useRef();
|
61
|
+
useIsomorphicEffect(function () {
|
62
|
+
var _document$querySelect, _document, _document2, _document3;
|
63
|
+
portalNode.current = portalTarget ? (_document$querySelect = (_document = document) === null || _document === void 0 ? void 0 : _document.querySelector(portalTarget)) !== null && _document$querySelect !== void 0 ? _document$querySelect : (_document2 = document) === null || _document2 === void 0 ? void 0 : _document2.querySelector('body') : (_document3 = document) === null || _document3 === void 0 ? void 0 : _document3.querySelector('body');
|
64
|
+
}, [portalTarget]);
|
60
65
|
if (!navLinkLabels) {
|
61
66
|
return pconsole.warn("".concat(componentName, " is an Onboarding internal component and is not intended for general use."));
|
62
67
|
}
|
63
|
-
|
64
|
-
return /*#__PURE__*/createPortal( /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
68
|
+
return portalNode !== null && portalNode !== void 0 && portalNode.current ? /*#__PURE__*/createPortal( /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
65
69
|
className: cx(blockClass, className),
|
66
70
|
ref: ref,
|
67
71
|
role: "main"
|
@@ -103,7 +107,7 @@ var CoachmarkStackHome = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
103
107
|
setLinkFocusIndex(0);
|
104
108
|
_onClose();
|
105
109
|
}
|
106
|
-
}, closeButtonLabel))))), portalNode);
|
110
|
+
}, closeButtonLabel))))), portalNode === null || portalNode === void 0 ? void 0 : portalNode.current) : null;
|
107
111
|
function renderNavLink(index, label) {
|
108
112
|
var ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
109
113
|
return /*#__PURE__*/React__default.createElement("li", {
|
@@ -10,8 +10,7 @@ import React__default, { useContext, useState } from 'react';
|
|
10
10
|
import { Close } from '@carbon/react/icons';
|
11
11
|
import { ConditionBuilderItem } from '../ConditionBuilderItem/ConditionBuilderItem.js';
|
12
12
|
import PropTypes from '../../../node_modules/prop-types/index.js';
|
13
|
-
import { blockClass,
|
14
|
-
import { ConditionBuilderItemOption } from '../ConditionBuilderItem/ConditionBuilderItemOption/ConditionBuilderItemOption.js';
|
13
|
+
import { blockClass, statementConfig, operatorConfig } from '../ConditionBuilderContext/DataConfigs.js';
|
15
14
|
import cx from 'classnames';
|
16
15
|
import ConditionConnector from '../ConditionBuilderConnector/ConditionConnector.js';
|
17
16
|
import { ConditionBuilderItemNumber } from '../ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js';
|
@@ -22,8 +21,12 @@ import { ConditionBuilderButton } from '../ConditionBuilderButton/ConditionBuild
|
|
22
21
|
import { focusThisField } from '../utils/util.js';
|
23
22
|
import { ConditionBuilderItemTime } from '../ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js';
|
24
23
|
import ConditionBuilderAdd from '../ConditionBuilderAdd/ConditionBuilderAdd.js';
|
24
|
+
import { ItemOption } from '../ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js';
|
25
|
+
import { ItemOptionForValueField } from '../ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js';
|
26
|
+
import { useTranslations } from '../utils/useTranslations.js';
|
25
27
|
|
26
28
|
var _div;
|
29
|
+
|
27
30
|
/**
|
28
31
|
* This component build each block of condition consisting of property, operator value and close button.
|
29
32
|
*/
|
@@ -53,18 +56,17 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
53
56
|
var _useContext = useContext(ConditionBuilderContext),
|
54
57
|
inputConfig = _useContext.inputConfig,
|
55
58
|
variant = _useContext.variant;
|
56
|
-
//Below possible input types expected for value field.
|
57
|
-
var itemComponents = {
|
58
|
-
option: ConditionBuilderItemOption,
|
59
|
-
text: ConditionBuilderItemText,
|
60
|
-
number: ConditionBuilderItemNumber,
|
61
|
-
date: ConditionBuilderItemDate,
|
62
|
-
time: ConditionBuilderItemTime
|
63
|
-
};
|
64
59
|
var _useState = useState(false),
|
65
60
|
_useState2 = _slicedToArray(_useState, 2),
|
66
61
|
showDeletionPreview = _useState2[0],
|
67
62
|
setShowDeletionPreview = _useState2[1];
|
63
|
+
var _useTranslations = useTranslations(['conditionRowText', 'conditionText', 'propertyText', 'operatorText', 'removeConditionText']),
|
64
|
+
_useTranslations2 = _slicedToArray(_useTranslations, 5),
|
65
|
+
conditionRowText = _useTranslations2[0],
|
66
|
+
conditionText = _useTranslations2[1],
|
67
|
+
propertyText = _useTranslations2[2],
|
68
|
+
operatorText = _useTranslations2[3],
|
69
|
+
removeConditionText = _useTranslations2[4];
|
68
70
|
|
69
71
|
//filtering the current property to access its properties and config options
|
70
72
|
var getCurrentConfig = function getCurrentConfig(property) {
|
@@ -78,13 +80,18 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
78
80
|
type = _getCurrentConfig.type,
|
79
81
|
config = _getCurrentConfig.config,
|
80
82
|
label = _getCurrentConfig.label;
|
81
|
-
var ItemComponent;
|
82
|
-
// if (type == 'custom') {
|
83
|
-
// ItemComponent = config.component;
|
84
|
-
// } else {
|
85
|
-
ItemComponent = property ? itemComponents[type] : null;
|
86
|
-
//}
|
87
83
|
|
84
|
+
//Below possible input types expected for value field.
|
85
|
+
var itemComponents = {
|
86
|
+
text: ConditionBuilderItemText,
|
87
|
+
number: ConditionBuilderItemNumber,
|
88
|
+
date: ConditionBuilderItemDate,
|
89
|
+
time: ConditionBuilderItemTime,
|
90
|
+
option: ItemOptionForValueField,
|
91
|
+
custom: config === null || config === void 0 ? void 0 : config.component,
|
92
|
+
textarea: ConditionBuilderItemText
|
93
|
+
};
|
94
|
+
var ItemComponent = property ? itemComponents[type] : null;
|
88
95
|
var onStatementChangeHandler = function onStatementChangeHandler(v, evt) {
|
89
96
|
focusThisField(evt);
|
90
97
|
onStatementChange(v);
|
@@ -105,9 +112,10 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
105
112
|
}));
|
106
113
|
};
|
107
114
|
var onValueChangeHandler = function onValueChangeHandler(newValue) {
|
108
|
-
|
109
|
-
|
110
|
-
|
115
|
+
var currentCondition = _objectSpread2({}, condition);
|
116
|
+
delete currentCondition.popoverToOpen;
|
117
|
+
onChange(_objectSpread2(_objectSpread2({}, currentCondition), {}, {
|
118
|
+
value: newValue
|
111
119
|
}));
|
112
120
|
};
|
113
121
|
var handleShowDeletionPreview = function handleShowDeletionPreview() {
|
@@ -117,6 +125,9 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
117
125
|
setShowDeletionPreview(false);
|
118
126
|
};
|
119
127
|
var getOperators = function getOperators() {
|
128
|
+
if (config !== null && config !== void 0 && config.operators) {
|
129
|
+
return config.operators;
|
130
|
+
}
|
120
131
|
return operatorConfig.filter(function (operator) {
|
121
132
|
return operator.type.indexOf(type) != -1 || operator.type == 'all';
|
122
133
|
});
|
@@ -128,11 +139,23 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
128
139
|
'aria-setsize': aria.setsize
|
129
140
|
} : {};
|
130
141
|
};
|
142
|
+
var renderChildren = function renderChildren(popoverRef) {
|
143
|
+
return /*#__PURE__*/React__default.createElement(ItemComponent, {
|
144
|
+
conditionState: {
|
145
|
+
property: property,
|
146
|
+
operator: operator,
|
147
|
+
value: value
|
148
|
+
},
|
149
|
+
onChange: onValueChangeHandler,
|
150
|
+
config: config,
|
151
|
+
"data-name": "valueField",
|
152
|
+
parentRef: popoverRef
|
153
|
+
});
|
154
|
+
};
|
131
155
|
return /*#__PURE__*/React__default.createElement("div", _extends({
|
132
156
|
className: cx("".concat(blockClass, "__condition-block"), _defineProperty({}, "".concat(blockClass, "__condition__deletion-preview"), showDeletionPreview), _defineProperty({}, "".concat(blockClass, "__gap-bottom"), variant == 'tree' && !(conditionIndex + 1 >= group.conditions.length)), _defineProperty({}, "".concat(blockClass, "__gap ").concat(blockClass, "__gap-bottom"), variant == 'sentence')),
|
133
157
|
role: "row",
|
134
|
-
"aria-label":
|
135
|
-
tabIndex: -1
|
158
|
+
"aria-label": conditionRowText
|
136
159
|
}, getAriaAttributes()), conjunction ? /*#__PURE__*/React__default.createElement(ConditionConnector, {
|
137
160
|
className: "".concat(blockClass, "__gap"),
|
138
161
|
operator: conjunction,
|
@@ -143,14 +166,14 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
143
166
|
role: "gridcell"
|
144
167
|
})), isStatement && /*#__PURE__*/React__default.createElement(ConditionBuilderItem, {
|
145
168
|
label: group.statement,
|
146
|
-
title:
|
169
|
+
title: conditionText,
|
147
170
|
"data-name": "connectorField",
|
148
171
|
popOverClassName: "".concat(blockClass, "__gap"),
|
149
172
|
className: "".concat(blockClass, "__statement-button")
|
150
|
-
}, /*#__PURE__*/React__default.createElement(
|
173
|
+
}, /*#__PURE__*/React__default.createElement(ItemOption, {
|
151
174
|
conditionState: {
|
152
175
|
value: group.statement,
|
153
|
-
label:
|
176
|
+
label: conditionText
|
154
177
|
},
|
155
178
|
onChange: onStatementChangeHandler,
|
156
179
|
config: {
|
@@ -158,16 +181,16 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
158
181
|
}
|
159
182
|
})), /*#__PURE__*/React__default.createElement(ConditionBuilderItem, {
|
160
183
|
label: label,
|
161
|
-
title:
|
184
|
+
title: propertyText,
|
162
185
|
renderIcon: icon !== null && icon !== void 0 ? icon : null,
|
163
186
|
className: "".concat(blockClass, "__property-field"),
|
164
187
|
"data-name": "propertyField",
|
165
188
|
condition: condition,
|
166
189
|
type: type
|
167
|
-
}, /*#__PURE__*/React__default.createElement(
|
190
|
+
}, /*#__PURE__*/React__default.createElement(ItemOption, {
|
168
191
|
conditionState: {
|
169
192
|
value: property,
|
170
|
-
label:
|
193
|
+
label: propertyText
|
171
194
|
},
|
172
195
|
onChange: onPropertyChangeHandler,
|
173
196
|
config: {
|
@@ -175,17 +198,17 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
175
198
|
}
|
176
199
|
})), property && /*#__PURE__*/React__default.createElement(ConditionBuilderItem, {
|
177
200
|
label: operator,
|
178
|
-
title:
|
201
|
+
title: operatorText,
|
179
202
|
"data-name": "operatorField",
|
180
203
|
condition: condition,
|
181
204
|
type: type
|
182
|
-
}, /*#__PURE__*/React__default.createElement(
|
205
|
+
}, /*#__PURE__*/React__default.createElement(ItemOption, {
|
183
206
|
config: {
|
184
207
|
options: getOperators()
|
185
208
|
},
|
186
209
|
conditionState: {
|
187
210
|
value: operator,
|
188
|
-
label:
|
211
|
+
label: operatorText
|
189
212
|
},
|
190
213
|
onChange: onOperatorChangeHandler
|
191
214
|
})), property && operator && /*#__PURE__*/React__default.createElement(ConditionBuilderItem, {
|
@@ -195,22 +218,14 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
195
218
|
showToolTip: true,
|
196
219
|
"data-name": "valueField",
|
197
220
|
condition: condition,
|
198
|
-
config: config
|
199
|
-
}, /*#__PURE__*/React__default.createElement(ItemComponent, {
|
200
|
-
conditionState: {
|
201
|
-
property: property,
|
202
|
-
operator: operator,
|
203
|
-
value: value
|
204
|
-
},
|
205
|
-
onChange: onValueChangeHandler,
|
206
221
|
config: config,
|
207
|
-
|
208
|
-
})
|
222
|
+
renderChildren: renderChildren
|
223
|
+
}), /*#__PURE__*/React__default.createElement("span", {
|
209
224
|
role: "gridcell",
|
210
|
-
"aria-label":
|
225
|
+
"aria-label": removeConditionText
|
211
226
|
}, /*#__PURE__*/React__default.createElement(ConditionBuilderButton, {
|
212
227
|
hideLabel: true,
|
213
|
-
label:
|
228
|
+
label: removeConditionText,
|
214
229
|
onClick: onRemove,
|
215
230
|
onMouseEnter: handleShowDeletionPreview,
|
216
231
|
onMouseLeave: handleHideDeletionPreview,
|
@@ -17,7 +17,7 @@ import { pkg } from '../../settings.js';
|
|
17
17
|
import { blockClass } from './ConditionBuilderContext/DataConfigs.js';
|
18
18
|
import { handleKeyDown } from './utils/handleKeyboardEvents.js';
|
19
19
|
|
20
|
-
var _excluded = ["className", "inputConfig", "startConditionLabel", "popOverSearchThreshold", "getOptions", "initialState", "getConditionState", "variant"];
|
20
|
+
var _excluded = ["className", "inputConfig", "startConditionLabel", "popOverSearchThreshold", "getOptions", "initialState", "getConditionState", "getActionsState", "variant", "actions", "translateWithId"];
|
21
21
|
|
22
22
|
// Carbon and package components we use.
|
23
23
|
/* TODO: @import(s) of carbon components and other package components. */
|
@@ -52,18 +52,23 @@ var ConditionBuilder = /*#__PURE__*/React__default.forwardRef(function (_ref, re
|
|
52
52
|
getOptions = _ref.getOptions,
|
53
53
|
initialState = _ref.initialState,
|
54
54
|
getConditionState = _ref.getConditionState,
|
55
|
-
|
55
|
+
getActionsState = _ref.getActionsState,
|
56
|
+
_ref$variant = _ref.variant,
|
57
|
+
variant = _ref$variant === void 0 ? 'sentence' : _ref$variant,
|
58
|
+
actions = _ref.actions,
|
59
|
+
translateWithId = _ref.translateWithId,
|
56
60
|
rest = _objectWithoutProperties(_ref, _excluded);
|
57
61
|
var localRef = useRef();
|
58
62
|
var conditionBuilderRef = ref || localRef;
|
59
63
|
var handleKeyDownHandler = function handleKeyDownHandler(evt) {
|
60
|
-
handleKeyDown(evt, conditionBuilderRef);
|
64
|
+
handleKeyDown(evt, conditionBuilderRef, variant);
|
61
65
|
};
|
62
66
|
return /*#__PURE__*/React__default.createElement(ConditionBuilderProvider, {
|
63
67
|
inputConfig: inputConfig,
|
64
68
|
popOverSearchThreshold: popOverSearchThreshold,
|
65
69
|
getOptions: getOptions,
|
66
|
-
variant: variant
|
70
|
+
variant: variant,
|
71
|
+
translateWithId: translateWithId
|
67
72
|
}, /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
68
73
|
className: cx(blockClass,
|
69
74
|
// Apply the block class to the main HTML element
|
@@ -83,7 +88,9 @@ var ConditionBuilder = /*#__PURE__*/React__default.forwardRef(function (_ref, re
|
|
83
88
|
startConditionLabel: startConditionLabel,
|
84
89
|
conditionBuilderRef: conditionBuilderRef,
|
85
90
|
getConditionState: getConditionState,
|
86
|
-
|
91
|
+
getActionsState: getActionsState,
|
92
|
+
initialState: initialState,
|
93
|
+
actions: actions
|
87
94
|
}))));
|
88
95
|
});
|
89
96
|
|
@@ -99,27 +106,66 @@ ConditionBuilder.displayName = componentName;
|
|
99
106
|
// See https://www.npmjs.com/package/prop-types#usage.
|
100
107
|
ConditionBuilder.propTypes = {
|
101
108
|
/**
|
102
|
-
*
|
109
|
+
* optional array of actions
|
103
110
|
*/
|
104
|
-
|
105
|
-
|
111
|
+
actions: PropTypes.arrayOf(PropTypes.shape({
|
112
|
+
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
113
|
+
label: PropTypes.string.isRequired
|
114
|
+
})),
|
106
115
|
/**
|
107
116
|
* Provide an optional class to be applied to the containing node.
|
108
117
|
*/
|
109
118
|
className: PropTypes.string,
|
119
|
+
/**
|
120
|
+
* This is a callback that gives back the updated action state
|
121
|
+
*/
|
122
|
+
getActionsState: PropTypes.func,
|
123
|
+
/**
|
124
|
+
* This is a callback that gives back updated condition state
|
125
|
+
*/
|
110
126
|
getConditionState: PropTypes.func.isRequired,
|
127
|
+
/**
|
128
|
+
* This is a callback that get triggered when you want to dynamically fetch options.
|
129
|
+
* Component call this when the option array is not passed against a property with type as option in the input config.
|
130
|
+
* This is an asynchronous callback that can return a promise , and you need to resolve the promise with options array in the valid format.
|
131
|
+
* You will receive the root condition state and current condition as the 2 arguments.
|
132
|
+
* eg: const getOptions = async (conditionState,condition) => {
|
133
|
+
switch (condition.property) {
|
134
|
+
case 'continent':
|
135
|
+
return new Promise((resolve) => {
|
136
|
+
const continents=[{
|
137
|
+
label: 'Africa',
|
138
|
+
id: 'Africa',
|
139
|
+
},...]
|
140
|
+
resolve(continents);
|
141
|
+
});
|
142
|
+
default:
|
143
|
+
return [];
|
144
|
+
}
|
145
|
+
};
|
146
|
+
*/
|
111
147
|
getOptions: PropTypes.func,
|
148
|
+
/**
|
149
|
+
* Optional prop if you want to pass a saved condition state.
|
150
|
+
* This object should respect the structure of condition state that is available in getConditionState callback
|
151
|
+
*/
|
112
152
|
initialState: PropTypes.shape({
|
113
153
|
groups: PropTypes.arrayOf(PropTypes.shape({
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
154
|
+
groupOperator: PropTypes.string.isRequired,
|
155
|
+
statement: PropTypes.string.isRequired,
|
156
|
+
conditions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.shape({
|
157
|
+
property: PropTypes.string.isRequired,
|
158
|
+
operator: PropTypes.string.isRequired,
|
159
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.shape({
|
160
|
+
id: PropTypes.string,
|
161
|
+
label: PropTypes.string
|
162
|
+
})), PropTypes.shape({
|
163
|
+
id: PropTypes.string,
|
164
|
+
label: PropTypes.string
|
165
|
+
})])
|
166
|
+
}), PropTypes.object]))
|
167
|
+
})),
|
168
|
+
operator: PropTypes.string
|
123
169
|
}),
|
124
170
|
/**
|
125
171
|
* This is a mandatory prop that defines the input to the condition builder.
|
@@ -127,17 +173,21 @@ ConditionBuilder.propTypes = {
|
|
127
173
|
*/
|
128
174
|
inputConfig: PropTypes.shape({
|
129
175
|
properties: PropTypes.arrayOf(PropTypes.shape({
|
130
|
-
id: PropTypes.string,
|
131
|
-
label: PropTypes.string,
|
176
|
+
id: PropTypes.string.isRequired,
|
177
|
+
label: PropTypes.string.isRequired,
|
132
178
|
icon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
133
|
-
type: PropTypes.oneOf(['text', 'number', 'date', 'option', 'time']),
|
179
|
+
type: PropTypes.oneOf(['text', 'textarea', 'number', 'date', 'option', 'time', 'custom']).isRequired,
|
134
180
|
config: PropTypes.shape({
|
135
181
|
options: PropTypes.arrayOf(PropTypes.shape({
|
136
|
-
id: PropTypes.string,
|
137
|
-
label: PropTypes.string,
|
182
|
+
id: PropTypes.string.isRequired,
|
183
|
+
label: PropTypes.string.isRequired,
|
138
184
|
icon: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
139
185
|
})),
|
140
|
-
|
186
|
+
component: PropTypes.func,
|
187
|
+
operators: PropTypes.arrayOf(PropTypes.shape({
|
188
|
+
id: PropTypes.string.isRequired,
|
189
|
+
label: PropTypes.string.isRequired
|
190
|
+
}))
|
141
191
|
})
|
142
192
|
}))
|
143
193
|
}).isRequired,
|
@@ -149,11 +199,18 @@ ConditionBuilder.propTypes = {
|
|
149
199
|
* Provide a label to the button that starts condition builder
|
150
200
|
*/
|
151
201
|
startConditionLabel: PropTypes.string.isRequired,
|
202
|
+
/**
|
203
|
+
* Optional prop, if you need to pass translations to the texts on the component instead of the defined defaults.
|
204
|
+
* This callback function will receive the message id and you need to return the corresponding text for that id.
|
205
|
+
* The message id will be one of [ "ifText","addConditionText", "addConditionGroupText", "addSubgroupText", "conditionText", "propertyText", "operatorText", "valueText", "connectorText", "conditionRowText", "removeConditionText", "addConditionRowText", "startText", "endText", "clearSearchText", "actionsText", "then", "removeActionText", "addActionText", "invalidText", "invalidDateText", "invalidNumberWarnText"]
|
206
|
+
]
|
207
|
+
*/
|
208
|
+
translateWithId: PropTypes.func,
|
152
209
|
/* TODO: add types and DocGen for all props. */
|
153
210
|
/**
|
154
211
|
* Provide the condition builder variant: sentence/ tree
|
155
212
|
*/
|
156
|
-
variant: PropTypes.
|
213
|
+
variant: PropTypes.oneOf(['tree', 'sentence'])
|
157
214
|
};
|
158
215
|
|
159
216
|
export { ConditionBuilder };
|
@@ -0,0 +1,15 @@
|
|
1
|
+
export default ConditionBuilderActions;
|
2
|
+
declare function ConditionBuilderActions({ actions, className }: {
|
3
|
+
actions: any;
|
4
|
+
className: any;
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
6
|
+
declare namespace ConditionBuilderActions {
|
7
|
+
namespace propTypes {
|
8
|
+
let actions: PropTypes.Requireable<(PropTypes.InferProps<{
|
9
|
+
id: PropTypes.Validator<NonNullable<NonNullable<string | number | null | undefined>>>;
|
10
|
+
label: PropTypes.Validator<string>;
|
11
|
+
}> | null | undefined)[]>;
|
12
|
+
let className: PropTypes.Requireable<string>;
|
13
|
+
}
|
14
|
+
}
|
15
|
+
import PropTypes from 'prop-types';
|