@carbon/ibm-products 2.43.2-canary.9 → 2.43.2-canary.92
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 +427 -139
- 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 +218 -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 +247 -101
- 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 +348 -125
- 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/ActionBar/ActionBarItem.js +1 -1
- package/es/components/Coachmark/Coachmark.d.ts +6 -1
- package/es/components/Coachmark/Coachmark.js +47 -11
- package/es/components/Coachmark/CoachmarkOverlay.js +2 -4
- package/es/components/CoachmarkBeacon/CoachmarkBeacon.js +1 -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 +76 -55
- package/es/components/ConditionBuilder/ConditionBuilder.js +82 -25
- package/es/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.d.ts +15 -0
- package/es/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +154 -0
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +3 -1
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +29 -13
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +8 -1
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +30 -8
- package/es/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +14 -9
- package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +19 -11
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +9 -13
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +75 -62
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +13 -7
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +31 -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 +40 -36
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +40 -36
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +6 -2
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +98 -40
- 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} +71 -38
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.d.ts +5 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +22 -9
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +1 -1
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts +1 -3
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +121 -40
- 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 +2 -1
- package/es/components/ConditionBuilder/utils/handleKeyboardEvents.js +137 -40
- 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 +6 -4
- package/es/components/ConditionBuilder/utils/util.js +42 -17
- package/es/components/CreateFullPage/CreateFullPage.js +2 -2
- package/es/components/DataSpreadsheet/DataSpreadsheet.d.ts +26 -0
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +129 -53
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +16 -0
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +32 -7
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +8 -0
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +16 -3
- package/es/components/DataSpreadsheet/types/index.d.ts +1 -0
- 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/CustomizeColumns/CustomizeColumnsTearsheet.js +34 -10
- 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 +54 -17
- 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 +57 -9
- 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/useDisableSelectRows.d.ts +2 -1
- package/es/components/Datagrid/useDisableSelectRows.js +27 -22
- 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/StringFormatter/StringFormatter.js +14 -3
- package/es/components/StringFormatter/utils/enums.d.ts +20 -1
- package/es/components/StringFormatter/utils/enums.js +22 -2
- 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 +28 -7
- 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/node_modules/@carbon/icon-helpers/es/index.js +49 -62
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-2.js +1020 -1058
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-9.js +881 -758
- package/es/settings.d.ts +1 -1
- package/lib/components/ActionBar/ActionBarItem.js +1 -1
- package/lib/components/Coachmark/Coachmark.d.ts +6 -1
- package/lib/components/Coachmark/Coachmark.js +46 -10
- package/lib/components/Coachmark/CoachmarkOverlay.js +2 -4
- package/lib/components/CoachmarkBeacon/CoachmarkBeacon.js +1 -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 +74 -53
- package/lib/components/ConditionBuilder/ConditionBuilder.js +82 -25
- package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.d.ts +15 -0
- package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +163 -0
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +3 -1
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +28 -11
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +8 -1
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +29 -7
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +12 -7
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +18 -10
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +9 -13
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +73 -60
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +13 -7
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +31 -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 +40 -36
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +40 -36
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +6 -2
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +96 -38
- 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} +68 -35
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.d.ts +5 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +21 -8
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +1 -1
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts +1 -3
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +118 -37
- 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 +2 -1
- package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.js +137 -39
- 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 +6 -4
- package/lib/components/ConditionBuilder/utils/util.js +44 -16
- package/lib/components/CreateFullPage/CreateFullPage.js +2 -2
- package/lib/components/DataSpreadsheet/DataSpreadsheet.d.ts +26 -0
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +129 -53
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +16 -0
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +32 -7
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +8 -0
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +16 -3
- package/lib/components/DataSpreadsheet/types/index.d.ts +1 -0
- 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/CustomizeColumns/CustomizeColumnsTearsheet.js +34 -10
- 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 +53 -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 +57 -9
- 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/useDisableSelectRows.d.ts +2 -1
- package/lib/components/Datagrid/useDisableSelectRows.js +27 -22
- 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/StringFormatter/StringFormatter.js +13 -2
- package/lib/components/StringFormatter/utils/enums.d.ts +20 -1
- package/lib/components/StringFormatter/utils/enums.js +23 -1
- 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 +26 -5
- 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/node_modules/@carbon/icon-helpers/es/index.js +49 -62
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-2.js +1036 -1074
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-9.js +946 -823
- package/lib/settings.d.ts +1 -1
- package/package.json +9 -8
- package/scss/components/Coachmark/_coachmark-overlay.scss +6 -70
- package/scss/components/Coachmark/_coachmark.scss +5 -4
- package/scss/components/CoachmarkBeacon/_coachmark-beacon.scss +1 -3
- package/scss/components/ConditionBuilder/_condition-builder.scss +5 -1
- package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +20 -3
- package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +32 -3
- package/scss/components/DataSpreadsheet/_data-spreadsheet.scss +16 -2
- package/scss/components/Datagrid/_datagrid.scss +0 -4
- package/scss/components/Datagrid/styles/_useInlineEdit.scss +13 -0
- package/scss/components/Datagrid/styles/addons/_CustomizeColumnsTearsheet.scss +7 -5
- package/scss/components/Datagrid/styles/addons/_FilterFlyout.scss +5 -4
- 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 +32 -19
- 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
@@ -26,7 +26,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
26
26
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
27
27
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
28
28
|
|
29
|
-
var _excluded = ["className", "inputConfig", "startConditionLabel", "popOverSearchThreshold", "getOptions", "initialState", "getConditionState", "variant"];
|
29
|
+
var _excluded = ["className", "inputConfig", "startConditionLabel", "popOverSearchThreshold", "getOptions", "initialState", "getConditionState", "getActionsState", "variant", "actions", "translateWithId"];
|
30
30
|
|
31
31
|
// Carbon and package components we use.
|
32
32
|
/* TODO: @import(s) of carbon components and other package components. */
|
@@ -61,18 +61,24 @@ exports.ConditionBuilder = /*#__PURE__*/React__default["default"].forwardRef(fun
|
|
61
61
|
getOptions = _ref.getOptions,
|
62
62
|
initialState = _ref.initialState,
|
63
63
|
getConditionState = _ref.getConditionState,
|
64
|
-
|
64
|
+
getActionsState = _ref.getActionsState,
|
65
|
+
_ref$variant = _ref.variant,
|
66
|
+
variant = _ref$variant === void 0 ? 'sentence' : _ref$variant,
|
67
|
+
actions = _ref.actions,
|
68
|
+
translateWithId = _ref.translateWithId,
|
65
69
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
66
70
|
var localRef = React.useRef();
|
67
71
|
var conditionBuilderRef = ref || localRef;
|
68
72
|
var handleKeyDownHandler = function handleKeyDownHandler(evt) {
|
69
|
-
handleKeyboardEvents.handleKeyDown(evt, conditionBuilderRef);
|
73
|
+
handleKeyboardEvents.handleKeyDown(evt, conditionBuilderRef, variant);
|
70
74
|
};
|
71
75
|
return /*#__PURE__*/React__default["default"].createElement(ConditionBuilderProvider.ConditionBuilderProvider, {
|
72
76
|
inputConfig: inputConfig,
|
73
77
|
popOverSearchThreshold: popOverSearchThreshold,
|
74
78
|
getOptions: getOptions,
|
75
|
-
variant: variant
|
79
|
+
variant: variant,
|
80
|
+
translateWithId: translateWithId,
|
81
|
+
conditionBuilderRef: conditionBuilderRef
|
76
82
|
}, /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({}, rest, {
|
77
83
|
className: cx__default["default"](DataConfigs.blockClass,
|
78
84
|
// Apply the block class to the main HTML element
|
@@ -90,9 +96,10 @@ exports.ConditionBuilder = /*#__PURE__*/React__default["default"].forwardRef(fun
|
|
90
96
|
onKeyDown: handleKeyDownHandler
|
91
97
|
}, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderContent["default"], {
|
92
98
|
startConditionLabel: startConditionLabel,
|
93
|
-
conditionBuilderRef: conditionBuilderRef,
|
94
99
|
getConditionState: getConditionState,
|
95
|
-
|
100
|
+
getActionsState: getActionsState,
|
101
|
+
initialState: initialState,
|
102
|
+
actions: actions
|
96
103
|
}))));
|
97
104
|
});
|
98
105
|
|
@@ -108,27 +115,66 @@ exports.ConditionBuilder.displayName = componentName;
|
|
108
115
|
// See https://www.npmjs.com/package/prop-types#usage.
|
109
116
|
exports.ConditionBuilder.propTypes = {
|
110
117
|
/**
|
111
|
-
*
|
118
|
+
* optional array of actions
|
112
119
|
*/
|
113
|
-
|
114
|
-
|
120
|
+
actions: index["default"].arrayOf(index["default"].shape({
|
121
|
+
id: index["default"].oneOfType([index["default"].string, index["default"].number]).isRequired,
|
122
|
+
label: index["default"].string.isRequired
|
123
|
+
})),
|
115
124
|
/**
|
116
125
|
* Provide an optional class to be applied to the containing node.
|
117
126
|
*/
|
118
127
|
className: index["default"].string,
|
128
|
+
/**
|
129
|
+
* This is a callback that gives back the updated action state
|
130
|
+
*/
|
131
|
+
getActionsState: index["default"].func,
|
132
|
+
/**
|
133
|
+
* This is a callback that gives back updated condition state
|
134
|
+
*/
|
119
135
|
getConditionState: index["default"].func.isRequired,
|
136
|
+
/**
|
137
|
+
* This is a callback that get triggered when you want to dynamically fetch options.
|
138
|
+
* Component call this when the option array is not passed against a property with type as option in the input config.
|
139
|
+
* This is an asynchronous callback that can return a promise , and you need to resolve the promise with options array in the valid format.
|
140
|
+
* You will receive the root condition state and current condition as the 2 arguments.
|
141
|
+
* eg: const getOptions = async (conditionState,condition) => {
|
142
|
+
switch (condition.property) {
|
143
|
+
case 'continent':
|
144
|
+
return new Promise((resolve) => {
|
145
|
+
const continents=[{
|
146
|
+
label: 'Africa',
|
147
|
+
id: 'Africa',
|
148
|
+
},...]
|
149
|
+
resolve(continents);
|
150
|
+
});
|
151
|
+
default:
|
152
|
+
return [];
|
153
|
+
}
|
154
|
+
};
|
155
|
+
*/
|
120
156
|
getOptions: index["default"].func,
|
157
|
+
/**
|
158
|
+
* Optional prop if you want to pass a saved condition state.
|
159
|
+
* This object should respect the structure of condition state that is available in getConditionState callback
|
160
|
+
*/
|
121
161
|
initialState: index["default"].shape({
|
122
162
|
groups: index["default"].arrayOf(index["default"].shape({
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
163
|
+
groupOperator: index["default"].string.isRequired,
|
164
|
+
statement: index["default"].string.isRequired,
|
165
|
+
conditions: index["default"].arrayOf(index["default"].oneOfType([index["default"].shape({
|
166
|
+
property: index["default"].string.isRequired,
|
167
|
+
operator: index["default"].string.isRequired,
|
168
|
+
value: index["default"].oneOfType([index["default"].string, index["default"].arrayOf(index["default"].shape({
|
169
|
+
id: index["default"].string,
|
170
|
+
label: index["default"].string
|
171
|
+
})), index["default"].shape({
|
172
|
+
id: index["default"].string,
|
173
|
+
label: index["default"].string
|
174
|
+
})])
|
175
|
+
}), index["default"].object]))
|
176
|
+
})),
|
177
|
+
operator: index["default"].string
|
132
178
|
}),
|
133
179
|
/**
|
134
180
|
* This is a mandatory prop that defines the input to the condition builder.
|
@@ -136,17 +182,21 @@ exports.ConditionBuilder.propTypes = {
|
|
136
182
|
*/
|
137
183
|
inputConfig: index["default"].shape({
|
138
184
|
properties: index["default"].arrayOf(index["default"].shape({
|
139
|
-
id: index["default"].string,
|
140
|
-
label: index["default"].string,
|
185
|
+
id: index["default"].string.isRequired,
|
186
|
+
label: index["default"].string.isRequired,
|
141
187
|
icon: index["default"].oneOfType([index["default"].func, index["default"].object]),
|
142
|
-
type: index["default"].oneOf(['text', 'number', 'date', 'option', 'time']),
|
188
|
+
type: index["default"].oneOf(['text', 'textarea', 'number', 'date', 'option', 'time', 'custom']).isRequired,
|
143
189
|
config: index["default"].shape({
|
144
190
|
options: index["default"].arrayOf(index["default"].shape({
|
145
|
-
id: index["default"].string,
|
146
|
-
label: index["default"].string,
|
191
|
+
id: index["default"].string.isRequired,
|
192
|
+
label: index["default"].string.isRequired,
|
147
193
|
icon: index["default"].oneOfType([index["default"].func, index["default"].object])
|
148
194
|
})),
|
149
|
-
|
195
|
+
component: index["default"].func,
|
196
|
+
operators: index["default"].arrayOf(index["default"].shape({
|
197
|
+
id: index["default"].string.isRequired,
|
198
|
+
label: index["default"].string.isRequired
|
199
|
+
}))
|
150
200
|
})
|
151
201
|
}))
|
152
202
|
}).isRequired,
|
@@ -158,9 +208,16 @@ exports.ConditionBuilder.propTypes = {
|
|
158
208
|
* Provide a label to the button that starts condition builder
|
159
209
|
*/
|
160
210
|
startConditionLabel: index["default"].string.isRequired,
|
211
|
+
/**
|
212
|
+
* Optional prop, if you need to pass translations to the texts on the component instead of the defined defaults.
|
213
|
+
* This callback function will receive the message id and you need to return the corresponding text for that id.
|
214
|
+
* The message id will be one of [ "ifText","addConditionText", "addConditionGroupText", "addSubgroupText", "conditionText", "propertyText", "operatorText", "valueText", "connectorText", "conditionRowText","conditionRowGroupText","conditionBuilderText","actionSectionText", "removeConditionText", "addConditionRowText", "startText", "endText", "clearSearchText", "actionsText", "then", "removeActionText", "addActionText", "invalidText", "invalidNumberWarnText"]
|
215
|
+
]
|
216
|
+
*/
|
217
|
+
translateWithId: index["default"].func,
|
161
218
|
/* TODO: add types and DocGen for all props. */
|
162
219
|
/**
|
163
220
|
* Provide the condition builder variant: sentence/ tree
|
164
221
|
*/
|
165
|
-
variant: index["default"].
|
222
|
+
variant: index["default"].oneOf(['tree', 'sentence'])
|
166
223
|
};
|
@@ -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';
|
@@ -0,0 +1,163 @@
|
|
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 _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
|
13
|
+
var React = require('react');
|
14
|
+
var index = require('../../../node_modules/prop-types/index.js');
|
15
|
+
var cx = require('classnames');
|
16
|
+
var icons = require('@carbon/react/icons');
|
17
|
+
var react = require('@carbon/react');
|
18
|
+
var ConditionBuilderItem = require('../ConditionBuilderItem/ConditionBuilderItem.js');
|
19
|
+
var DataConfigs = require('../ConditionBuilderContext/DataConfigs.js');
|
20
|
+
var ConditionBuilderProvider = require('../ConditionBuilderContext/ConditionBuilderProvider.js');
|
21
|
+
var ConditionBuilderAdd = require('../ConditionBuilderAdd/ConditionBuilderAdd.js');
|
22
|
+
var uuidv4 = require('../../../global/js/utils/uuidv4.js');
|
23
|
+
var ConditionBuilderButton = require('../ConditionBuilderButton/ConditionBuilderButton.js');
|
24
|
+
var useTranslations = require('../utils/useTranslations.js');
|
25
|
+
var ItemOptionForValueField = require('../ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js');
|
26
|
+
|
27
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
28
|
+
|
29
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
30
|
+
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
31
|
+
|
32
|
+
var ConditionBuilderActions = function ConditionBuilderActions(_ref) {
|
33
|
+
var actions = _ref.actions,
|
34
|
+
className = _ref.className;
|
35
|
+
var _useContext = React.useContext(ConditionBuilderProvider.ConditionBuilderContext),
|
36
|
+
actionState = _useContext.actionState,
|
37
|
+
setActionState = _useContext.setActionState;
|
38
|
+
var _useState = React.useState(-1),
|
39
|
+
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
40
|
+
showDeletionPreview = _useState2[0],
|
41
|
+
setShowDeletionPreview = _useState2[1];
|
42
|
+
var _useTranslations = useTranslations.useTranslations(['actionsText', 'then', 'and', 'removeActionText', 'addActionText', 'actionSectionText']),
|
43
|
+
_useTranslations2 = _rollupPluginBabelHelpers.slicedToArray(_useTranslations, 6),
|
44
|
+
actionsText = _useTranslations2[0],
|
45
|
+
thenText = _useTranslations2[1],
|
46
|
+
andText = _useTranslations2[2],
|
47
|
+
removeActionText = _useTranslations2[3],
|
48
|
+
addActionText = _useTranslations2[4],
|
49
|
+
actionSectionText = _useTranslations2[5];
|
50
|
+
var addActionHandler = function addActionHandler() {
|
51
|
+
var action = {
|
52
|
+
id: uuidv4["default"](),
|
53
|
+
label: undefined,
|
54
|
+
popoverToOpen: 'valueField'
|
55
|
+
};
|
56
|
+
setActionState([].concat(_rollupPluginBabelHelpers.toConsumableArray(actionState), [action]));
|
57
|
+
};
|
58
|
+
var onchangeHandler = function onchangeHandler(selectedId, actionIndex) {
|
59
|
+
var action = actions.find(function (action) {
|
60
|
+
return action.id === selectedId;
|
61
|
+
}); //fetch the selected action from the input action array
|
62
|
+
|
63
|
+
// same actions can be added multiple times
|
64
|
+
var newAction = _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, action), {}, {
|
65
|
+
id: actionState[actionIndex].id
|
66
|
+
});
|
67
|
+
setActionState([].concat(_rollupPluginBabelHelpers.toConsumableArray(actionState.slice(0, actionIndex)), [newAction], _rollupPluginBabelHelpers.toConsumableArray(actionState.slice(actionIndex + 1))));
|
68
|
+
};
|
69
|
+
var onRemove = function onRemove(selectedId) {
|
70
|
+
setActionState(actionState.filter(function (action) {
|
71
|
+
return action.id !== selectedId;
|
72
|
+
}));
|
73
|
+
};
|
74
|
+
var handleShowDeletionPreview = function handleShowDeletionPreview(index) {
|
75
|
+
setShowDeletionPreview(index);
|
76
|
+
};
|
77
|
+
var handleHideDeletionPreview = function handleHideDeletionPreview() {
|
78
|
+
setShowDeletionPreview(-1);
|
79
|
+
};
|
80
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
81
|
+
className: className
|
82
|
+
}, /*#__PURE__*/React__default["default"].createElement(react.Section, {
|
83
|
+
className: "".concat(DataConfigs.blockClass, "__heading"),
|
84
|
+
level: 4
|
85
|
+
}, /*#__PURE__*/React__default["default"].createElement(react.Heading, null, actionsText)), /*#__PURE__*/React__default["default"].createElement("div", {
|
86
|
+
className: "".concat(DataConfigs.blockClass, "__condition-wrapper"),
|
87
|
+
role: "grid",
|
88
|
+
"aria-label": actionSectionText
|
89
|
+
}, actionState === null || actionState === void 0 ? void 0 : actionState.map(function (action, index) {
|
90
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
91
|
+
key: action.id,
|
92
|
+
role: "row",
|
93
|
+
className: cx__default["default"]("".concat(DataConfigs.blockClass, "__condition-block ").concat(DataConfigs.blockClass, "__gap ").concat(DataConfigs.blockClass, "__gap-bottom"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__condition__deletion-preview"), showDeletionPreview == index))
|
94
|
+
}, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
95
|
+
className: "".concat(DataConfigs.blockClass, "__statement-button"),
|
96
|
+
tabIndex: 0,
|
97
|
+
popOverClassName: "".concat(DataConfigs.blockClass, "__gap"),
|
98
|
+
label: index === 0 ? thenText : andText
|
99
|
+
}), /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
100
|
+
label: action.label,
|
101
|
+
title: actionsText,
|
102
|
+
condition: action,
|
103
|
+
"data-name": "valueField",
|
104
|
+
type: "option"
|
105
|
+
}, /*#__PURE__*/React__default["default"].createElement(ItemOptionForValueField.ItemOptionForValueField, {
|
106
|
+
conditionState: {
|
107
|
+
value: action.label
|
108
|
+
},
|
109
|
+
onChange: function onChange(selection) {
|
110
|
+
return onchangeHandler(selection.id, index);
|
111
|
+
},
|
112
|
+
config: {
|
113
|
+
options: actions
|
114
|
+
}
|
115
|
+
})), /*#__PURE__*/React__default["default"].createElement("span", {
|
116
|
+
role: "gridcell",
|
117
|
+
"aria-label": removeActionText
|
118
|
+
}, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderButton.ConditionBuilderButton, {
|
119
|
+
hideLabel: true,
|
120
|
+
label: removeActionText,
|
121
|
+
onClick: function onClick() {
|
122
|
+
return onRemove(action.id);
|
123
|
+
},
|
124
|
+
onMouseEnter: function onMouseEnter() {
|
125
|
+
return handleShowDeletionPreview(index);
|
126
|
+
},
|
127
|
+
onMouseLeave: handleHideDeletionPreview,
|
128
|
+
onFocus: function onFocus() {
|
129
|
+
return handleShowDeletionPreview(index);
|
130
|
+
},
|
131
|
+
onBlur: handleHideDeletionPreview,
|
132
|
+
renderIcon: icons.Close,
|
133
|
+
className: "".concat(DataConfigs.blockClass, "__close-condition"),
|
134
|
+
"data-name": "closeCondition"
|
135
|
+
})), actionState.length === index + 1 && /*#__PURE__*/React__default["default"].createElement(ConditionBuilderAdd["default"], {
|
136
|
+
onClick: addActionHandler,
|
137
|
+
className: "".concat(DataConfigs.blockClass, "__gap ").concat(DataConfigs.blockClass, "__gap-left"),
|
138
|
+
buttonLabel: addActionText,
|
139
|
+
tabIndex: 0
|
140
|
+
}));
|
141
|
+
}), actionState.length === 0 && /*#__PURE__*/React__default["default"].createElement(ConditionBuilderAdd["default"], {
|
142
|
+
onClick: addActionHandler,
|
143
|
+
className: "".concat(DataConfigs.blockClass, "__gap ").concat(DataConfigs.blockClass, "__gap-left"),
|
144
|
+
buttonLabel: addActionText,
|
145
|
+
tabIndex: 0
|
146
|
+
})));
|
147
|
+
};
|
148
|
+
var ConditionBuilderActions$1 = ConditionBuilderActions;
|
149
|
+
ConditionBuilderActions.propTypes = {
|
150
|
+
/**
|
151
|
+
* optional array of object that give the list of actions.
|
152
|
+
*/
|
153
|
+
actions: index["default"].arrayOf(index["default"].shape({
|
154
|
+
id: index["default"].oneOfType([index["default"].string, index["default"].number]).isRequired,
|
155
|
+
label: index["default"].string.isRequired
|
156
|
+
})),
|
157
|
+
/**
|
158
|
+
* Provide an optional class to be applied to the containing node.
|
159
|
+
*/
|
160
|
+
className: index["default"].string
|
161
|
+
};
|
162
|
+
|
163
|
+
exports["default"] = ConditionBuilderActions$1;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
export default ConditionBuilderAdd;
|
2
|
-
declare function ConditionBuilderAdd({ className, onClick, addConditionSubGroupHandler, showConditionSubGroupPreviewHandler, hideConditionSubGroupPreviewHandler, showConditionPreviewHandler, hideConditionPreviewHandler, enableSubGroup, buttonLabel, }: {
|
2
|
+
declare function ConditionBuilderAdd({ className, onClick, addConditionSubGroupHandler, showConditionSubGroupPreviewHandler, hideConditionSubGroupPreviewHandler, showConditionPreviewHandler, hideConditionPreviewHandler, enableSubGroup, buttonLabel, tabIndex, }: {
|
3
3
|
className: any;
|
4
4
|
onClick: any;
|
5
5
|
addConditionSubGroupHandler: any;
|
@@ -9,6 +9,7 @@ declare function ConditionBuilderAdd({ className, onClick, addConditionSubGroupH
|
|
9
9
|
hideConditionPreviewHandler: any;
|
10
10
|
enableSubGroup: any;
|
11
11
|
buttonLabel: any;
|
12
|
+
tabIndex: any;
|
12
13
|
}): import("react/jsx-runtime").JSX.Element;
|
13
14
|
declare namespace ConditionBuilderAdd {
|
14
15
|
namespace propTypes {
|
@@ -21,6 +22,7 @@ declare namespace ConditionBuilderAdd {
|
|
21
22
|
let onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
22
23
|
let showConditionPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
|
23
24
|
let showConditionSubGroupPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
|
25
|
+
let tabIndex: PropTypes.Requireable<number>;
|
24
26
|
}
|
25
27
|
}
|
26
28
|
import PropTypes from 'prop-types';
|
@@ -11,14 +11,17 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
11
|
|
12
12
|
var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
|
13
13
|
var React = require('react');
|
14
|
+
var cx = require('classnames');
|
14
15
|
var icons = require('@carbon/react/icons');
|
15
16
|
var ConditionBuilderButton = require('../ConditionBuilderButton/ConditionBuilderButton.js');
|
16
17
|
var index = require('../../../node_modules/prop-types/index.js');
|
17
18
|
var DataConfigs = require('../ConditionBuilderContext/DataConfigs.js');
|
19
|
+
var useTranslations = require('../utils/useTranslations.js');
|
18
20
|
|
19
21
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
20
22
|
|
21
23
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
24
|
+
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
22
25
|
|
23
26
|
var ConditionBuilderAdd = function ConditionBuilderAdd(_ref) {
|
24
27
|
var className = _ref.className,
|
@@ -29,11 +32,17 @@ var ConditionBuilderAdd = function ConditionBuilderAdd(_ref) {
|
|
29
32
|
showConditionPreviewHandler = _ref.showConditionPreviewHandler,
|
30
33
|
hideConditionPreviewHandler = _ref.hideConditionPreviewHandler,
|
31
34
|
enableSubGroup = _ref.enableSubGroup,
|
32
|
-
buttonLabel = _ref.buttonLabel
|
35
|
+
buttonLabel = _ref.buttonLabel,
|
36
|
+
tabIndex = _ref.tabIndex;
|
33
37
|
var _useState = React.useState(false),
|
34
38
|
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
35
39
|
isAddSubgroup = _useState2[0],
|
36
40
|
setIsAddSubgroup = _useState2[1];
|
41
|
+
var _useTranslations = useTranslations.useTranslations(['addConditionText', 'addConditionRowText', 'addSubgroupText']),
|
42
|
+
_useTranslations2 = _rollupPluginBabelHelpers.slicedToArray(_useTranslations, 3),
|
43
|
+
addConditionText = _useTranslations2[0],
|
44
|
+
addConditionRowText = _useTranslations2[1],
|
45
|
+
addSubgroupText = _useTranslations2[2];
|
37
46
|
var showAddSubGroup = function showAddSubGroup() {
|
38
47
|
setIsAddSubgroup(true);
|
39
48
|
};
|
@@ -60,14 +69,16 @@ var ConditionBuilderAdd = function ConditionBuilderAdd(_ref) {
|
|
60
69
|
onBlur: hideConditionSubGroupPreviewHandler
|
61
70
|
};
|
62
71
|
};
|
72
|
+
var getAriaLabel = function getAriaLabel() {
|
73
|
+
return buttonLabel ? buttonLabel : !enableSubGroup ? addConditionRowText : undefined;
|
74
|
+
};
|
63
75
|
var wrapperProps = enableSubGroup ? {
|
64
|
-
role: 'gridcell'
|
65
|
-
'aria-label': DataConfigs.translateWithId('add-condition')
|
76
|
+
role: 'gridcell'
|
66
77
|
} : {};
|
67
78
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
68
79
|
className: "".concat(className, " ").concat(DataConfigs.blockClass, "__add-button-wrapper"),
|
69
80
|
role: !enableSubGroup ? 'gridcell' : 'none',
|
70
|
-
"aria-label":
|
81
|
+
"aria-label": getAriaLabel(),
|
71
82
|
onMouseEnter: showAddSubGroup,
|
72
83
|
onMouseLeave: hideAddSubGroup,
|
73
84
|
onFocus: showAddSubGroup,
|
@@ -76,18 +87,20 @@ var ConditionBuilderAdd = function ConditionBuilderAdd(_ref) {
|
|
76
87
|
renderIcon: icons.AddAlt,
|
77
88
|
onClick: onClickHandler
|
78
89
|
}, previewHandlers(), {
|
90
|
+
wrapperProps: wrapperProps,
|
79
91
|
className: "".concat(DataConfigs.blockClass, "__add-button"),
|
80
92
|
hideLabel: true,
|
81
93
|
"data-name": "addButton",
|
82
|
-
label: buttonLabel !== null && buttonLabel !== void 0 ? buttonLabel :
|
83
|
-
|
84
|
-
})),
|
94
|
+
label: buttonLabel !== null && buttonLabel !== void 0 ? buttonLabel : addConditionText,
|
95
|
+
tabIndex: tabIndex
|
96
|
+
})), enableSubGroup && /*#__PURE__*/React__default["default"].createElement(ConditionBuilderButton.ConditionBuilderButton, _rollupPluginBabelHelpers["extends"]({
|
85
97
|
renderIcon: icons.TextNewLine,
|
86
98
|
onClick: addConditionSubGroupHandler,
|
87
|
-
className: "".concat(DataConfigs.blockClass, "__add-condition-group ").concat(DataConfigs.blockClass, "__gap-left"),
|
99
|
+
className: cx__default["default"]("".concat(DataConfigs.blockClass, "__add-condition-sub-group ").concat(DataConfigs.blockClass, "__gap-left")),
|
88
100
|
hideLabel: true,
|
89
|
-
label:
|
90
|
-
wrapperProps: wrapperProps
|
101
|
+
label: addSubgroupText,
|
102
|
+
wrapperProps: wrapperProps,
|
103
|
+
wrapperClassName: cx__default["default"]("".concat(DataConfigs.blockClass, "__add-condition-sub-group-wrapper"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__add-condition-sub-group-wrapper--show"), isAddSubgroup))
|
91
104
|
}, previewHandlersForSubgroup())));
|
92
105
|
};
|
93
106
|
var ConditionBuilderAdd$1 = ConditionBuilderAdd;
|
@@ -122,10 +135,14 @@ ConditionBuilderAdd.propTypes = {
|
|
122
135
|
*/
|
123
136
|
onClick: index["default"].func,
|
124
137
|
showConditionPreviewHandler: index["default"].func,
|
125
|
-
showConditionSubGroupPreviewHandler: index["default"].func
|
138
|
+
showConditionSubGroupPreviewHandler: index["default"].func,
|
126
139
|
/**
|
127
140
|
* handler for hiding sub group preview
|
128
141
|
*/
|
142
|
+
/**
|
143
|
+
* Tab index
|
144
|
+
*/
|
145
|
+
tabIndex: index["default"].number
|
129
146
|
};
|
130
147
|
|
131
148
|
exports["default"] = ConditionBuilderAdd$1;
|
@@ -1,4 +1,5 @@
|
|
1
|
-
export function ConditionBuilderButton({ className, label, hideLabel, tooltipAlign, renderIcon: Icon, onClick, showToolTip, wrapperProps, onBlur, onFocus, onMouseEnter, onMouseLeave, }: {
|
1
|
+
export function ConditionBuilderButton({ className, label, hideLabel, tooltipAlign, renderIcon: Icon, onClick, showToolTip, wrapperProps, onBlur, onFocus, onMouseEnter, onMouseLeave, isInvalid, wrapperClassName, tabIndex, ...rest }: {
|
2
|
+
[x: string]: any;
|
2
3
|
className: any;
|
3
4
|
label: any;
|
4
5
|
hideLabel: any;
|
@@ -11,11 +12,15 @@ export function ConditionBuilderButton({ className, label, hideLabel, tooltipAli
|
|
11
12
|
onFocus: any;
|
12
13
|
onMouseEnter: any;
|
13
14
|
onMouseLeave: any;
|
15
|
+
isInvalid: any;
|
16
|
+
wrapperClassName: any;
|
17
|
+
tabIndex: any;
|
14
18
|
}): import("react/jsx-runtime").JSX.Element;
|
15
19
|
export namespace ConditionBuilderButton {
|
16
20
|
namespace propTypes {
|
17
21
|
let className: PropTypes.Requireable<string>;
|
18
22
|
let hideLabel: PropTypes.Requireable<boolean>;
|
23
|
+
let isInvalid: PropTypes.Requireable<boolean>;
|
19
24
|
let label: PropTypes.Requireable<string>;
|
20
25
|
let onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
21
26
|
let onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
@@ -24,7 +29,9 @@ export namespace ConditionBuilderButton {
|
|
24
29
|
let onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
|
25
30
|
let renderIcon: PropTypes.Requireable<object>;
|
26
31
|
let showToolTip: PropTypes.Requireable<boolean>;
|
32
|
+
let tabIndex: PropTypes.Requireable<number>;
|
27
33
|
let tooltipAlign: PropTypes.Requireable<string>;
|
34
|
+
let wrapperClassName: PropTypes.Requireable<string>;
|
28
35
|
let wrapperProps: PropTypes.Requireable<object>;
|
29
36
|
}
|
30
37
|
}
|
@@ -15,12 +15,15 @@ var cx = require('classnames');
|
|
15
15
|
var index = require('../../../node_modules/prop-types/index.js');
|
16
16
|
var react = require('@carbon/react');
|
17
17
|
var DataConfigs = require('../ConditionBuilderContext/DataConfigs.js');
|
18
|
+
var icons = require('@carbon/react/icons');
|
18
19
|
|
19
20
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
20
21
|
|
21
22
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
22
23
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
23
24
|
|
25
|
+
var _WarningAltFilled;
|
26
|
+
var _excluded = ["className", "label", "hideLabel", "tooltipAlign", "renderIcon", "onClick", "showToolTip", "wrapperProps", "onBlur", "onFocus", "onMouseEnter", "onMouseLeave", "isInvalid", "wrapperClassName", "tabIndex"];
|
24
27
|
var ConditionBuilderButton = function ConditionBuilderButton(_ref) {
|
25
28
|
var _Icon, _span;
|
26
29
|
var className = _ref.className,
|
@@ -34,24 +37,31 @@ var ConditionBuilderButton = function ConditionBuilderButton(_ref) {
|
|
34
37
|
onBlur = _ref.onBlur,
|
35
38
|
onFocus = _ref.onFocus,
|
36
39
|
onMouseEnter = _ref.onMouseEnter,
|
37
|
-
onMouseLeave = _ref.onMouseLeave
|
40
|
+
onMouseLeave = _ref.onMouseLeave,
|
41
|
+
isInvalid = _ref.isInvalid,
|
42
|
+
wrapperClassName = _ref.wrapperClassName,
|
43
|
+
tabIndex = _ref.tabIndex,
|
44
|
+
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
38
45
|
var Button = function Button() {
|
39
|
-
|
46
|
+
var _rest$dataName;
|
47
|
+
var dataName = (_rest$dataName = rest['data-name']) !== null && _rest$dataName !== void 0 ? _rest$dataName : '';
|
48
|
+
return /*#__PURE__*/React__default["default"].createElement("button", _rollupPluginBabelHelpers["extends"]({
|
40
49
|
// role={'gridcell'}
|
41
|
-
tabIndex: -1,
|
42
|
-
className: cx__default["default"]([className, "".concat(DataConfigs.blockClass, "__button"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__text-ellipsis"), showToolTip && !hideLabel)]),
|
50
|
+
tabIndex: tabIndex != undefined ? tabIndex : -1,
|
51
|
+
className: cx__default["default"]([className, "".concat(DataConfigs.blockClass, "__button"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__text-ellipsis"), showToolTip && !hideLabel && !isInvalid), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__invalid-input"), isInvalid)]),
|
43
52
|
type: "button",
|
44
53
|
onClick: onClick,
|
45
54
|
onBlur: onBlur,
|
46
55
|
onFocus: onFocus,
|
47
56
|
onMouseEnter: onMouseEnter,
|
48
|
-
onMouseLeave: onMouseLeave
|
49
|
-
|
57
|
+
onMouseLeave: onMouseLeave,
|
58
|
+
"data-name": dataName
|
59
|
+
}, rest), Icon && (_Icon || (_Icon = /*#__PURE__*/React__default["default"].createElement(Icon, null))), !hideLabel && (_span || (_span = /*#__PURE__*/React__default["default"].createElement("span", null, label))), isInvalid && (_WarningAltFilled || (_WarningAltFilled = /*#__PURE__*/React__default["default"].createElement(icons.WarningAltFilled, null))));
|
50
60
|
};
|
51
61
|
return hideLabel || showToolTip ? /*#__PURE__*/React__default["default"].createElement(react.Tooltip, _rollupPluginBabelHelpers["extends"]({
|
52
62
|
label: label,
|
53
63
|
align: tooltipAlign,
|
54
|
-
className: "".concat(
|
64
|
+
className: "".concat(wrapperClassName)
|
55
65
|
}, wrapperProps), Button()) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, Button());
|
56
66
|
};
|
57
67
|
ConditionBuilderButton.propTypes = {
|
@@ -63,6 +73,10 @@ ConditionBuilderButton.propTypes = {
|
|
63
73
|
* decides if label and tooltip to be hidden
|
64
74
|
*/
|
65
75
|
hideLabel: index["default"].bool,
|
76
|
+
/**
|
77
|
+
* boolean to know the updated value in not valid
|
78
|
+
*/
|
79
|
+
isInvalid: index["default"].bool,
|
66
80
|
/**
|
67
81
|
* label of the button
|
68
82
|
*/
|
@@ -88,10 +102,18 @@ ConditionBuilderButton.propTypes = {
|
|
88
102
|
*decides if tooltip to be shown
|
89
103
|
*/
|
90
104
|
showToolTip: index["default"].bool,
|
105
|
+
/**
|
106
|
+
* Tab index
|
107
|
+
*/
|
108
|
+
tabIndex: index["default"].number,
|
91
109
|
/**
|
92
110
|
* tooltip position
|
93
111
|
*/
|
94
112
|
tooltipAlign: index["default"].string,
|
113
|
+
/**
|
114
|
+
* classname applies to the wrapper of popover
|
115
|
+
*/
|
116
|
+
wrapperClassName: index["default"].string,
|
95
117
|
/**
|
96
118
|
* optional props for tree grid to add role and aria-label to wrapper span
|
97
119
|
*/
|