@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
@@ -1,38 +1,42 @@
|
|
1
1
|
export namespace translationsObject {
|
2
|
-
let
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
2
|
+
let ifText: string;
|
3
|
+
let excl_if: string;
|
4
|
+
let and: string;
|
5
|
+
let or: string;
|
6
|
+
let is: string;
|
7
|
+
let greater: string;
|
8
|
+
let greaterEqual: string;
|
9
|
+
let lower: string;
|
10
|
+
let lowerEqual: string;
|
11
|
+
let startsWith: string;
|
12
|
+
let endsWith: string;
|
13
|
+
let contains: string;
|
14
|
+
let oneOf: string;
|
15
|
+
let before: string;
|
16
|
+
let after: string;
|
17
|
+
let between: string;
|
18
|
+
let addConditionText: string;
|
19
|
+
let addConditionGroupText: string;
|
20
|
+
let addSubgroupText: string;
|
21
|
+
let conditionText: string;
|
22
|
+
let propertyText: string;
|
23
|
+
let operatorText: string;
|
24
|
+
let valueText: string;
|
25
|
+
let connectorText: string;
|
26
|
+
let conditionRowText: string;
|
27
|
+
let conditionRowGroupText: string;
|
28
|
+
let removeConditionText: string;
|
29
|
+
let addConditionRowText: string;
|
30
|
+
let startText: string;
|
31
|
+
let endText: string;
|
32
|
+
let clearSearchText: string;
|
33
|
+
let actionsText: string;
|
34
|
+
let then: string;
|
35
|
+
let removeActionText: string;
|
36
|
+
let addActionText: string;
|
37
|
+
let invalidText: string;
|
38
|
+
let invalidNumberWarnText: string;
|
39
|
+
let conditionBuilderText: string;
|
40
|
+
let actionSectionText: string;
|
41
|
+
let conditionHeadingText: string;
|
38
42
|
}
|
@@ -6,42 +6,46 @@
|
|
6
6
|
*/
|
7
7
|
|
8
8
|
var translationsObject = {
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
9
|
+
ifText: 'if',
|
10
|
+
excl_if: 'excl.if',
|
11
|
+
and: 'and',
|
12
|
+
or: 'or',
|
13
|
+
is: 'is',
|
14
|
+
greater: 'is greater than',
|
15
|
+
greaterEqual: 'is greater than or equal to',
|
16
|
+
lower: 'is lower than',
|
17
|
+
lowerEqual: 'is lower than or equal to',
|
18
|
+
startsWith: 'starts with',
|
19
|
+
endsWith: 'ends with',
|
20
|
+
contains: 'contains',
|
21
|
+
oneOf: 'is one of',
|
22
|
+
before: 'is before',
|
23
|
+
after: 'is after',
|
24
|
+
between: 'is between',
|
25
|
+
addConditionText: 'Add condition',
|
26
|
+
addConditionGroupText: 'Add condition group',
|
27
|
+
addSubgroupText: 'Add subgroup',
|
28
|
+
conditionText: 'Condition',
|
29
|
+
propertyText: 'Property',
|
30
|
+
operatorText: 'Operator',
|
31
|
+
valueText: 'Value',
|
32
|
+
connectorText: 'Connector',
|
33
|
+
conditionRowText: 'Condition row',
|
34
|
+
conditionRowGroupText: 'Condition row group',
|
35
|
+
removeConditionText: 'Remove condition',
|
36
|
+
addConditionRowText: 'Add condition row',
|
37
|
+
startText: 'Start',
|
38
|
+
endText: 'End',
|
39
|
+
clearSearchText: 'Clear search input',
|
40
|
+
actionsText: 'Actions',
|
41
|
+
then: 'then',
|
42
|
+
removeActionText: 'Remove Action',
|
43
|
+
addActionText: 'Add action',
|
44
|
+
invalidText: 'Incomplete',
|
45
|
+
invalidNumberWarnText: 'Invalid number, must be 0 or greater',
|
46
|
+
conditionBuilderText: 'Condition Builder',
|
47
|
+
actionSectionText: 'Action Section',
|
48
|
+
conditionHeadingText: 'Condition'
|
45
49
|
};
|
46
50
|
|
47
51
|
export { translationsObject };
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export function ConditionBuilderItem({ children, className, label, renderIcon, title, type, showToolTip, condition, popOverClassName, config, ...rest }: {
|
1
|
+
export function ConditionBuilderItem({ children, className, label, renderIcon, title, type, showToolTip, condition, popOverClassName, config, renderChildren, onChange, ...rest }: {
|
2
2
|
[x: string]: any;
|
3
3
|
children: any;
|
4
4
|
className: any;
|
@@ -10,6 +10,8 @@ export function ConditionBuilderItem({ children, className, label, renderIcon, t
|
|
10
10
|
condition: any;
|
11
11
|
popOverClassName: any;
|
12
12
|
config: any;
|
13
|
+
renderChildren: any;
|
14
|
+
onChange: any;
|
13
15
|
}): import("react/jsx-runtime").JSX.Element;
|
14
16
|
export namespace ConditionBuilderItem {
|
15
17
|
namespace propTypes {
|
@@ -17,8 +19,10 @@ export namespace ConditionBuilderItem {
|
|
17
19
|
let className: PropTypes.Requireable<string>;
|
18
20
|
let condition: PropTypes.Requireable<object>;
|
19
21
|
let config: PropTypes.Requireable<object>;
|
20
|
-
let label: PropTypes.Requireable<NonNullable<string |
|
22
|
+
let label: PropTypes.Requireable<NonNullable<string | object | null | undefined>>;
|
23
|
+
let onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
21
24
|
let popOverClassName: PropTypes.Requireable<string>;
|
25
|
+
let renderChildren: PropTypes.Requireable<(...args: any[]) => any>;
|
22
26
|
let renderIcon: PropTypes.Requireable<object>;
|
23
27
|
let showToolTip: PropTypes.Requireable<boolean>;
|
24
28
|
let title: PropTypes.Requireable<string>;
|
@@ -6,14 +6,17 @@
|
|
6
6
|
*/
|
7
7
|
|
8
8
|
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
9
|
-
import React__default, { useRef, useState, useEffect } from 'react';
|
9
|
+
import React__default, { useRef, useState, useContext, useEffect } from 'react';
|
10
10
|
import { Popover, PopoverContent, Layer } from '@carbon/react';
|
11
11
|
import PropTypes from '../../../node_modules/prop-types/index.js';
|
12
12
|
import { Add } from '@carbon/react/icons';
|
13
|
-
import {
|
13
|
+
import { blockClass, valueRenderers } from '../ConditionBuilderContext/DataConfigs.js';
|
14
14
|
import { ConditionBuilderButton } from '../ConditionBuilderButton/ConditionBuilderButton.js';
|
15
|
+
import { useTranslations } from '../utils/useTranslations.js';
|
16
|
+
import { ConditionBuilderContext } from '../ConditionBuilderContext/ConditionBuilderProvider.js';
|
17
|
+
import { handleKeyDownForPopover } from '../utils/handleKeyboardEvents.js';
|
15
18
|
|
16
|
-
var _excluded = ["children", "className", "label", "renderIcon", "title", "type", "showToolTip", "condition", "popOverClassName", "config"];
|
19
|
+
var _excluded = ["children", "className", "label", "renderIcon", "title", "type", "showToolTip", "condition", "popOverClassName", "config", "renderChildren", "onChange"];
|
17
20
|
var ConditionBuilderItem = function ConditionBuilderItem(_ref) {
|
18
21
|
var children = _ref.children,
|
19
22
|
className = _ref.className,
|
@@ -25,21 +28,40 @@ var ConditionBuilderItem = function ConditionBuilderItem(_ref) {
|
|
25
28
|
condition = _ref.condition,
|
26
29
|
popOverClassName = _ref.popOverClassName,
|
27
30
|
config = _ref.config,
|
31
|
+
renderChildren = _ref.renderChildren,
|
32
|
+
onChange = _ref.onChange,
|
28
33
|
rest = _objectWithoutProperties(_ref, _excluded);
|
29
|
-
var
|
30
|
-
var _useState = useState(
|
34
|
+
var popoverRef = useRef(null);
|
35
|
+
var _useState = useState(false),
|
31
36
|
_useState2 = _slicedToArray(_useState, 2),
|
32
|
-
|
33
|
-
|
34
|
-
var
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
37
|
+
open = _useState2[0],
|
38
|
+
setOpen = _useState2[1];
|
39
|
+
var _useTranslations = useTranslations(['invalidText', 'addConditionText', label]),
|
40
|
+
_useTranslations2 = _slicedToArray(_useTranslations, 3),
|
41
|
+
invalidText = _useTranslations2[0],
|
42
|
+
addConditionText = _useTranslations2[1],
|
43
|
+
labelText = _useTranslations2[2];
|
44
|
+
var _useContext = useContext(ConditionBuilderContext),
|
45
|
+
conditionBuilderRef = _useContext.conditionBuilderRef;
|
46
|
+
var getPropertyDetails = function getPropertyDetails() {
|
47
|
+
var _ref2 = condition || {},
|
48
|
+
property = _ref2.property,
|
49
|
+
operator = _ref2.operator;
|
50
|
+
if (label === 'INVALID' || rest['data-name'] === 'propertyField' && property === 'INVALID' || rest['data-name'] === 'operatorField' && operator === 'INVALID') {
|
51
|
+
return {
|
52
|
+
propertyLabel: invalidText,
|
53
|
+
isInvalid: true
|
54
|
+
};
|
55
|
+
}
|
56
|
+
var propertyId = rest['data-name'] == 'valueField' && type ? valueRenderers[type](label, config) : labelText;
|
57
|
+
return {
|
58
|
+
isInvalid: false,
|
59
|
+
propertyLabel: propertyId
|
60
|
+
};
|
61
|
+
};
|
62
|
+
var _getPropertyDetails = getPropertyDetails(),
|
63
|
+
propertyLabel = _getPropertyDetails.propertyLabel,
|
64
|
+
isInvalid = _getPropertyDetails.isInvalid;
|
43
65
|
useEffect(function () {
|
44
66
|
/**
|
45
67
|
* rest['data-name'] holds the current field name
|
@@ -50,59 +72,87 @@ var ConditionBuilderItem = function ConditionBuilderItem(_ref) {
|
|
50
72
|
//if any condition is changed, state prop is triggered
|
51
73
|
if (condition.popoverToOpen && currentField !== condition.popoverToOpen) {
|
52
74
|
// close the previous popover
|
53
|
-
|
54
|
-
} else if (currentField == 'valueField' && type == 'option' && condition.operator !== '
|
75
|
+
closePopover();
|
76
|
+
} else if (currentField == 'valueField' && type == 'option' && condition.operator !== 'oneOf') {
|
55
77
|
//close the current popover if the field is valueField and is a single select dropdown. For all other inputs ,popover need to be open on value changes.
|
56
|
-
|
78
|
+
closePopover();
|
57
79
|
}
|
58
80
|
if (condition.popoverToOpen == currentField) {
|
59
81
|
//current popover need to be opened
|
60
|
-
|
82
|
+
openPopOver();
|
61
83
|
}
|
62
84
|
} else {
|
63
85
|
// when we change any statement(if/ excl.if) which is not part of condition state, label change is triggered.
|
64
86
|
//close popOver when statement is changed.
|
65
|
-
|
87
|
+
closePopover();
|
66
88
|
}
|
67
89
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
68
90
|
}, [condition, label]);
|
69
91
|
useEffect(function () {
|
70
92
|
//this will focus the first input field in the popover
|
71
|
-
if (open &&
|
72
|
-
var firstFocusableElement =
|
93
|
+
if (open && popoverRef.current) {
|
94
|
+
var firstFocusableElement = popoverRef.current.querySelector('input,textarea');
|
73
95
|
if (firstFocusableElement) {
|
74
|
-
|
96
|
+
setTimeout(function () {
|
97
|
+
return firstFocusableElement.focus();
|
98
|
+
}, 0);
|
75
99
|
}
|
76
100
|
}
|
77
|
-
}, [
|
101
|
+
}, [popoverRef, open]);
|
102
|
+
var manageInvalidSelection = function manageInvalidSelection() {
|
103
|
+
//when the user didn't select any value , we need to show as incomplete
|
104
|
+
if (rest['data-name'] === 'propertyField' && !(condition !== null && condition !== void 0 && condition.property) || rest['data-name'] === 'operatorField' && !(condition !== null && condition !== void 0 && condition.operator) || rest['data-name'] === 'valueField' && !(condition !== null && condition !== void 0 && condition.value)) {
|
105
|
+
onChange === null || onChange === void 0 || onChange('INVALID');
|
106
|
+
}
|
107
|
+
};
|
108
|
+
var closePopover = function closePopover() {
|
109
|
+
if (open) {
|
110
|
+
manageInvalidSelection();
|
111
|
+
}
|
112
|
+
setOpen(false);
|
113
|
+
};
|
114
|
+
var openPopOver = function openPopOver() {
|
115
|
+
return setOpen(true);
|
116
|
+
};
|
117
|
+
var togglePopover = function togglePopover() {
|
118
|
+
if (children || renderChildren) {
|
119
|
+
setOpen(!open);
|
120
|
+
}
|
121
|
+
};
|
122
|
+
var handleKeyDownHandler = function handleKeyDownHandler(evt) {
|
123
|
+
handleKeyDownForPopover(evt, conditionBuilderRef, popoverRef);
|
124
|
+
if (evt.key === 'Escape') {
|
125
|
+
manageInvalidSelection();
|
126
|
+
}
|
127
|
+
};
|
78
128
|
return /*#__PURE__*/React__default.createElement(Popover, {
|
79
129
|
open: open,
|
80
130
|
isTabTip: true,
|
81
131
|
role: "gridcell",
|
82
|
-
className: popOverClassName,
|
83
|
-
|
84
|
-
|
85
|
-
}
|
132
|
+
className: "".concat(popOverClassName, " ").concat(blockClass, "__popover"),
|
133
|
+
ref: popoverRef,
|
134
|
+
onRequestClose: closePopover
|
86
135
|
}, /*#__PURE__*/React__default.createElement(ConditionBuilderButton, _extends({
|
87
|
-
label: propertyLabel !== null && propertyLabel !== void 0 ? propertyLabel :
|
136
|
+
label: propertyLabel !== null && propertyLabel !== void 0 ? propertyLabel : addConditionText,
|
88
137
|
hideLabel: !label ? true : false,
|
89
|
-
onClick:
|
90
|
-
children ? setOpen(!open) : null;
|
91
|
-
},
|
138
|
+
onClick: togglePopover,
|
92
139
|
className: className,
|
93
140
|
"aria-haspopup": true,
|
94
141
|
"aria-expanded": open,
|
95
142
|
renderIcon: renderIcon ? renderIcon : label == undefined ? Add : null,
|
96
|
-
showToolTip: showToolTip
|
97
|
-
|
98
|
-
|
143
|
+
showToolTip: showToolTip,
|
144
|
+
isInvalid: isInvalid,
|
145
|
+
condition: condition
|
146
|
+
}, rest)), open && /*#__PURE__*/React__default.createElement(PopoverContent, {
|
147
|
+
className: "".concat(blockClass, "__popover-content-wrapper"),
|
99
148
|
role: "dialog",
|
100
|
-
"aria-label":
|
149
|
+
"aria-label": title,
|
150
|
+
onKeyDown: handleKeyDownHandler
|
101
151
|
}, /*#__PURE__*/React__default.createElement(Layer, null, /*#__PURE__*/React__default.createElement("h1", {
|
102
152
|
className: "".concat(blockClass, "__item__title")
|
103
153
|
}, title), /*#__PURE__*/React__default.createElement("div", {
|
104
|
-
|
105
|
-
},
|
154
|
+
className: "".concat(blockClass, "__popover-content")
|
155
|
+
}, renderChildren ? renderChildren(popoverRef) : children))));
|
106
156
|
};
|
107
157
|
ConditionBuilderItem.propTypes = {
|
108
158
|
/**
|
@@ -125,11 +175,19 @@ ConditionBuilderItem.propTypes = {
|
|
125
175
|
/**
|
126
176
|
* text to be displayed in the field
|
127
177
|
*/
|
128
|
-
label: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
|
178
|
+
label: PropTypes.oneOfType([PropTypes.string, PropTypes.array, PropTypes.object]),
|
179
|
+
/**
|
180
|
+
* callback to update the current condition of the state tree
|
181
|
+
*/
|
182
|
+
onChange: PropTypes.func,
|
129
183
|
/**
|
130
184
|
* class name for popover
|
131
185
|
*/
|
132
186
|
popOverClassName: PropTypes.string,
|
187
|
+
/**
|
188
|
+
* callback prop that returns the jsx for children
|
189
|
+
*/
|
190
|
+
renderChildren: PropTypes.func,
|
133
191
|
/**
|
134
192
|
* Optional prop to allow overriding the icon rendering.
|
135
193
|
*/
|
@@ -1,11 +1,13 @@
|
|
1
|
-
export function ConditionBuilderItemDate({ conditionState, onChange }: {
|
1
|
+
export function ConditionBuilderItemDate({ conditionState, onChange, parentRef, }: {
|
2
2
|
conditionState: any;
|
3
3
|
onChange: any;
|
4
|
+
parentRef: any;
|
4
5
|
}): import("react/jsx-runtime").JSX.Element;
|
5
6
|
export namespace ConditionBuilderItemDate {
|
6
7
|
namespace propTypes {
|
7
8
|
let conditionState: PropTypes.Requireable<object>;
|
8
9
|
let onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
10
|
+
let parentRef: PropTypes.Requireable<object>;
|
9
11
|
}
|
10
12
|
}
|
11
13
|
import PropTypes from 'prop-types';
|
@@ -5,26 +5,36 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
|
8
|
+
import { slicedToArray as _slicedToArray } from '../../../../_virtual/_rollupPluginBabelHelpers.js';
|
8
9
|
import React__default, { useRef } from 'react';
|
9
10
|
import { DatePicker, DatePickerInput } from '@carbon/react';
|
10
11
|
import { pkg } from '../../../../settings.js';
|
11
12
|
import PropTypes from '../../../../node_modules/prop-types/index.js';
|
12
|
-
import {
|
13
|
+
import { useTranslations } from '../../utils/useTranslations.js';
|
13
14
|
|
14
15
|
var blockClass = "".concat(pkg.prefix, "--condition-builder");
|
15
16
|
var ConditionBuilderItemDate = function ConditionBuilderItemDate(_ref) {
|
16
17
|
var conditionState = _ref.conditionState,
|
17
|
-
onChange = _ref.onChange
|
18
|
+
onChange = _ref.onChange,
|
19
|
+
parentRef = _ref.parentRef;
|
18
20
|
var DatePickerInputRef = useRef();
|
21
|
+
var _useTranslations = useTranslations(['startText', 'endText']),
|
22
|
+
_useTranslations2 = _slicedToArray(_useTranslations, 2),
|
23
|
+
startText = _useTranslations2[0],
|
24
|
+
endText = _useTranslations2[1];
|
19
25
|
var datePickerType = conditionState.operator == 'between' ? 'range' : 'single';
|
26
|
+
var onCloseHandler = function onCloseHandler(selectedDate) {
|
27
|
+
onChange(selectedDate && selectedDate.length > 0 ? selectedDate : 'INVALID');
|
28
|
+
};
|
20
29
|
return /*#__PURE__*/React__default.createElement("div", {
|
21
30
|
className: "".concat(blockClass, "__item-date ")
|
22
31
|
}, datePickerType == 'single' && /*#__PURE__*/React__default.createElement(DatePicker, {
|
23
32
|
ref: DatePickerInputRef,
|
24
33
|
dateFormat: "d/m/Y",
|
25
34
|
datePickerType: "single",
|
26
|
-
|
27
|
-
|
35
|
+
value: conditionState.value,
|
36
|
+
onClose: onCloseHandler,
|
37
|
+
appendTo: parentRef === null || parentRef === void 0 ? void 0 : parentRef.current
|
28
38
|
}, /*#__PURE__*/React__default.createElement(DatePickerInput, {
|
29
39
|
id: "datePicker",
|
30
40
|
placeholder: "dd/mm/yyyy",
|
@@ -33,16 +43,17 @@ var ConditionBuilderItemDate = function ConditionBuilderItemDate(_ref) {
|
|
33
43
|
ref: DatePickerInputRef,
|
34
44
|
dateFormat: "d/m/Y",
|
35
45
|
datePickerType: datePickerType,
|
36
|
-
onClose:
|
37
|
-
value: conditionState.value
|
46
|
+
onClose: onCloseHandler,
|
47
|
+
value: conditionState.value,
|
48
|
+
appendTo: parentRef === null || parentRef === void 0 ? void 0 : parentRef.current
|
38
49
|
}, /*#__PURE__*/React__default.createElement(DatePickerInput, {
|
39
50
|
id: "datePickerStart",
|
40
51
|
placeholder: "dd/mm/yyyy",
|
41
|
-
labelText:
|
52
|
+
labelText: startText
|
42
53
|
}), /*#__PURE__*/React__default.createElement(DatePickerInput, {
|
43
54
|
id: "datePickerEnd",
|
44
55
|
placeholder: "dd/mm/yyyy",
|
45
|
-
labelText:
|
56
|
+
labelText: endText
|
46
57
|
})));
|
47
58
|
};
|
48
59
|
ConditionBuilderItemDate.propTypes = {
|
@@ -53,7 +64,11 @@ ConditionBuilderItemDate.propTypes = {
|
|
53
64
|
/**
|
54
65
|
* callback to update state oin date change
|
55
66
|
*/
|
56
|
-
onChange: PropTypes.func
|
67
|
+
onChange: PropTypes.func,
|
68
|
+
/**
|
69
|
+
* reference to the popover node
|
70
|
+
*/
|
71
|
+
parentRef: PropTypes.object
|
57
72
|
};
|
58
73
|
|
59
74
|
export { ConditionBuilderItemDate };
|
@@ -5,34 +5,52 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
|
8
|
+
import { slicedToArray as _slicedToArray, extends as _extends } from '../../../../_virtual/_rollupPluginBabelHelpers.js';
|
8
9
|
import React__default from 'react';
|
9
10
|
import { NumberInput } from '@carbon/react';
|
10
|
-
import { pkg } from '../../../../settings.js';
|
11
11
|
import PropTypes from '../../../../node_modules/prop-types/index.js';
|
12
|
+
import { blockClass } from '../../ConditionBuilderContext/DataConfigs.js';
|
13
|
+
import { useTranslations } from '../../utils/useTranslations.js';
|
12
14
|
|
13
|
-
var blockClass = "".concat(pkg.prefix, "--condition-builder");
|
14
15
|
var ConditionBuilderItemNumber = function ConditionBuilderItemNumber(_ref) {
|
15
16
|
var _conditionState$prope;
|
16
17
|
var conditionState = _ref.conditionState,
|
17
18
|
config = _ref.config,
|
18
19
|
onChange = _ref.onChange;
|
20
|
+
var _useTranslations = useTranslations(['invalidNumberWarnText']),
|
21
|
+
_useTranslations2 = _slicedToArray(_useTranslations, 1),
|
22
|
+
invalidNumberWarnText = _useTranslations2[0];
|
19
23
|
var onChangeHandler = function onChangeHandler(e, _ref2) {
|
20
24
|
var value = _ref2.value;
|
21
|
-
|
25
|
+
if (value !== '' && !isNaN(value) && checkIfValid(value)) {
|
26
|
+
var _config$unit;
|
27
|
+
onChange("".concat(value, " ").concat((_config$unit = config.unit) !== null && _config$unit !== void 0 ? _config$unit : ''));
|
28
|
+
} else {
|
29
|
+
onChange('INVALID');
|
30
|
+
}
|
31
|
+
};
|
32
|
+
var checkIfValid = function checkIfValid(value) {
|
33
|
+
if (value > config.max || value < config.min) {
|
34
|
+
return false;
|
35
|
+
}
|
36
|
+
return true;
|
37
|
+
};
|
38
|
+
var getDefaultValue = function getDefaultValue() {
|
39
|
+
var _conditionState$value, _conditionState$value2;
|
40
|
+
return (_conditionState$value = (_conditionState$value2 = conditionState.value) === null || _conditionState$value2 === void 0 || (_conditionState$value2 = _conditionState$value2.split(' ')) === null || _conditionState$value2 === void 0 ? void 0 : _conditionState$value2[0]) !== null && _conditionState$value !== void 0 ? _conditionState$value : '';
|
22
41
|
};
|
23
42
|
return /*#__PURE__*/React__default.createElement("div", {
|
24
43
|
className: "".concat(blockClass, "__item-number")
|
25
|
-
}, /*#__PURE__*/React__default.createElement(NumberInput, {
|
44
|
+
}, /*#__PURE__*/React__default.createElement(NumberInput, _extends({
|
26
45
|
label: conditionState.property,
|
27
46
|
hideLabel: true,
|
28
47
|
id: (_conditionState$prope = conditionState.property) === null || _conditionState$prope === void 0 ? void 0 : _conditionState$prope.replace(/\s/g, ''),
|
29
|
-
|
30
|
-
min: config.min,
|
31
|
-
max: config.max,
|
32
|
-
step: config.step,
|
48
|
+
invalidText: invalidNumberWarnText,
|
33
49
|
allowEmpty: true,
|
34
50
|
onChange: onChangeHandler
|
35
|
-
}
|
51
|
+
}, config, {
|
52
|
+
defaultValue: getDefaultValue()
|
53
|
+
})));
|
36
54
|
};
|
37
55
|
ConditionBuilderItemNumber.propTypes = {
|
38
56
|
/**
|
@@ -0,0 +1,13 @@
|
|
1
|
+
export function ItemOption({ conditionState, config, onChange }: {
|
2
|
+
conditionState?: {} | undefined;
|
3
|
+
config?: {} | undefined;
|
4
|
+
onChange: any;
|
5
|
+
}): import("react/jsx-runtime").JSX.Element | undefined;
|
6
|
+
export namespace ItemOption {
|
7
|
+
namespace propTypes {
|
8
|
+
let conditionState: PropTypes.Requireable<object>;
|
9
|
+
let config: PropTypes.Requireable<object>;
|
10
|
+
let onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
11
|
+
}
|
12
|
+
}
|
13
|
+
import PropTypes from 'prop-types';
|