@eccenca/gui-elements 25.0.0 → 25.1.0-changeupgradedtoreact18cmem6639.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +124 -0
- package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js +30 -26
- package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
- package/dist/cjs/cmem/ActivityControl/ActivityExecutionErrorReportModal.js +11 -5
- package/dist/cjs/cmem/ActivityControl/ActivityExecutionErrorReportModal.js.map +1 -1
- package/dist/cjs/cmem/ActivityControl/SilkActivityControl.js +1 -3
- package/dist/cjs/cmem/ActivityControl/SilkActivityControl.js.map +1 -1
- package/dist/cjs/cmem/ContentBlobToggler/ContentBlobToggler.js +13 -6
- package/dist/cjs/cmem/ContentBlobToggler/ContentBlobToggler.js.map +1 -1
- package/dist/cjs/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.js +49 -11
- package/dist/cjs/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.js.map +1 -1
- package/dist/cjs/cmem/markdown/Markdown.js +2 -2
- package/dist/cjs/cmem/markdown/Markdown.js.map +1 -1
- package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlowV12.js.map +1 -1
- package/dist/cjs/cmem/react-flow/StickyNoteModal/StickyNoteModal.js +1 -1
- package/dist/cjs/cmem/react-flow/StickyNoteModal/StickyNoteModal.js.map +1 -1
- package/dist/cjs/cmem/react-flow/configuration/graph.js +0 -2
- package/dist/cjs/cmem/react-flow/configuration/graph.js.map +1 -1
- package/dist/cjs/cmem/react-flow/configuration/linking.js +0 -2
- package/dist/cjs/cmem/react-flow/configuration/linking.js.map +1 -1
- package/dist/cjs/cmem/react-flow/configuration/workflow.js +0 -2
- package/dist/cjs/cmem/react-flow/configuration/workflow.js.map +1 -1
- package/dist/cjs/common/Intent/index.js +1 -1
- package/dist/cjs/common/Intent/index.js.map +1 -1
- package/dist/cjs/common/index.js +1 -0
- package/dist/cjs/common/index.js.map +1 -1
- package/dist/cjs/common/utils/CssCustomProperties.js.map +1 -1
- package/dist/cjs/common/utils/colorHash.js +26 -12
- package/dist/cjs/common/utils/colorHash.js.map +1 -1
- package/dist/cjs/components/Application/ApplicationSidebarNavigation.js.map +1 -1
- package/dist/cjs/components/Application/ApplicationTitle.js +5 -1
- package/dist/cjs/components/Application/ApplicationTitle.js.map +1 -1
- package/dist/cjs/components/Application/ApplicationViewability.js +33 -0
- package/dist/cjs/components/Application/ApplicationViewability.js.map +1 -0
- package/dist/cjs/components/Application/index.js +1 -0
- package/dist/cjs/components/Application/index.js.map +1 -1
- package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js +1 -1
- package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
- package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js.map +1 -1
- package/dist/cjs/components/AutocompleteField/AutoCompleteField.js +2 -9
- package/dist/cjs/components/AutocompleteField/AutoCompleteField.js.map +1 -1
- package/dist/cjs/components/AutocompleteField/autoCompleteFieldUtils.js.map +1 -1
- package/dist/cjs/components/Button/Button.js +6 -2
- package/dist/cjs/components/Button/Button.js.map +1 -1
- package/dist/cjs/components/ColorField/ColorField.js +114 -0
- package/dist/cjs/components/ColorField/ColorField.js.map +1 -0
- package/dist/cjs/components/ContentGroup/ContentGroup.js +19 -19
- package/dist/cjs/components/ContentGroup/ContentGroup.js.map +1 -1
- package/dist/cjs/components/ContextOverlay/ContextMenu.js +4 -4
- package/dist/cjs/components/ContextOverlay/ContextMenu.js.map +1 -1
- package/dist/cjs/components/ContextOverlay/ContextOverlay.js +3 -2
- package/dist/cjs/components/ContextOverlay/ContextOverlay.js.map +1 -1
- package/dist/cjs/components/DecoupledOverlay/DecoupledOverlay.js +48 -0
- package/dist/cjs/components/DecoupledOverlay/DecoupledOverlay.js.map +1 -0
- package/dist/cjs/components/Icon/IconButton.js +2 -2
- package/dist/cjs/components/Icon/IconButton.js.map +1 -1
- package/dist/cjs/components/Icon/canonicalIconNames.js +10 -1
- package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/cjs/components/Icon/transformIcon.js +14 -0
- package/dist/cjs/components/Icon/transformIcon.js.map +1 -0
- package/dist/cjs/components/MultiSelect/MultiSelect.js +63 -24
- package/dist/cjs/components/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/cjs/components/NotAvailable/NotAvailable.js +42 -0
- package/dist/cjs/components/NotAvailable/NotAvailable.js.map +1 -0
- package/dist/cjs/components/Notification/Notification.js.map +1 -1
- package/dist/cjs/components/OverviewItem/OverviewItemDepiction.js.map +1 -1
- package/dist/cjs/components/RadioButton/RadioButton.js +5 -2
- package/dist/cjs/components/RadioButton/RadioButton.js.map +1 -1
- package/dist/cjs/components/Select/Select.js +6 -4
- package/dist/cjs/components/Select/Select.js.map +1 -1
- package/dist/cjs/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/cjs/components/Table/Table.js.map +1 -1
- package/dist/cjs/components/Table/TableContainer.js +1 -1
- package/dist/cjs/components/Table/TableContainer.js.map +1 -1
- package/dist/cjs/components/Table/TableExpandRow.js +2 -2
- package/dist/cjs/components/Table/TableExpandRow.js.map +1 -1
- package/dist/cjs/components/TextField/useTextValidation.js +17 -8
- package/dist/cjs/components/TextField/useTextValidation.js.map +1 -1
- package/dist/cjs/components/Tooltip/Tooltip.js +11 -7
- package/dist/cjs/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/cjs/components/Typography/InlineText.js +29 -0
- package/dist/cjs/components/Typography/InlineText.js.map +1 -0
- package/dist/cjs/components/Typography/index.js +1 -0
- package/dist/cjs/components/Typography/index.js.map +1 -1
- package/dist/cjs/components/VisualTour/VisualTour.js +30 -36
- package/dist/cjs/components/VisualTour/VisualTour.js.map +1 -1
- package/dist/cjs/components/index.js +3 -0
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/extensions/codemirror/CodeMirror.js +59 -21
- package/dist/cjs/extensions/codemirror/CodeMirror.js.map +1 -1
- package/dist/cjs/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.js +1 -1
- package/dist/cjs/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.js.map +1 -1
- package/dist/cjs/extensions/codemirror/tests/codemirrorTestHelper.js +2 -2
- package/dist/cjs/extensions/codemirror/tests/codemirrorTestHelper.js.map +1 -1
- package/dist/cjs/extensions/codemirror/toolbars/EditorAppearanceConfigMenu.js +23 -0
- package/dist/cjs/extensions/codemirror/toolbars/EditorAppearanceConfigMenu.js.map +1 -0
- package/dist/cjs/extensions/codemirror/toolbars/markdown.toolbar.js +5 -2
- package/dist/cjs/extensions/codemirror/toolbars/markdown.toolbar.js.map +1 -1
- package/dist/cjs/extensions/react-flow/edges/EdgeLabel.js +8 -3
- package/dist/cjs/extensions/react-flow/edges/EdgeLabel.js.map +1 -1
- package/dist/cjs/extensions/react-flow/edges/EdgeNew.js +6 -4
- package/dist/cjs/extensions/react-flow/edges/EdgeNew.js.map +1 -1
- package/dist/cjs/extensions/react-flow/edges/EdgeTools.js +2 -2
- package/dist/cjs/extensions/react-flow/edges/EdgeTools.js.map +1 -1
- package/dist/cjs/extensions/react-flow/handles/HandleContent.js +5 -2
- package/dist/cjs/extensions/react-flow/handles/HandleContent.js.map +1 -1
- package/dist/cjs/extensions/react-flow/handles/HandleDefault.js +1 -1
- package/dist/cjs/extensions/react-flow/handles/HandleDefault.js.map +1 -1
- package/dist/cjs/extensions/react-flow/handles/HandleTools.js +2 -2
- package/dist/cjs/extensions/react-flow/handles/HandleTools.js.map +1 -1
- package/dist/cjs/extensions/react-flow/markers/ReactFlowMarkers.js.map +1 -1
- package/dist/cjs/extensions/react-flow/minimap/MiniMap.js +1 -1
- package/dist/cjs/extensions/react-flow/minimap/MiniMap.js.map +1 -1
- package/dist/cjs/extensions/react-flow/minimap/MiniMapV12.js.map +1 -1
- package/dist/cjs/extensions/react-flow/nodes/NodeContent.js +7 -5
- package/dist/cjs/extensions/react-flow/nodes/NodeContent.js.map +1 -1
- package/dist/cjs/extensions/react-flow/nodes/NodeDefault.js +5 -2
- package/dist/cjs/extensions/react-flow/nodes/NodeDefault.js.map +1 -1
- package/dist/cjs/extensions/react-flow/nodes/NodeTools.js +6 -2
- package/dist/cjs/extensions/react-flow/nodes/NodeTools.js.map +1 -1
- package/dist/cjs/extensions/react-flow/nodes/nodeUtils.js.map +1 -1
- package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js +19 -14
- package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
- package/dist/esm/cmem/ActivityControl/ActivityExecutionErrorReportModal.js +4 -1
- package/dist/esm/cmem/ActivityControl/ActivityExecutionErrorReportModal.js.map +1 -1
- package/dist/esm/cmem/ActivityControl/SilkActivityControl.js +1 -3
- package/dist/esm/cmem/ActivityControl/SilkActivityControl.js.map +1 -1
- package/dist/esm/cmem/ContentBlobToggler/ContentBlobToggler.js +9 -5
- package/dist/esm/cmem/ContentBlobToggler/ContentBlobToggler.js.map +1 -1
- package/dist/esm/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.js +57 -9
- package/dist/esm/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.js.map +1 -1
- package/dist/esm/cmem/markdown/Markdown.js +1 -1
- package/dist/esm/cmem/markdown/Markdown.js.map +1 -1
- package/dist/esm/cmem/react-flow/ReactFlow/ReactFlowV12.js.map +1 -1
- package/dist/esm/cmem/react-flow/StickyNoteModal/StickyNoteModal.js +1 -1
- package/dist/esm/cmem/react-flow/StickyNoteModal/StickyNoteModal.js.map +1 -1
- package/dist/esm/cmem/react-flow/configuration/graph.js +0 -2
- package/dist/esm/cmem/react-flow/configuration/graph.js.map +1 -1
- package/dist/esm/cmem/react-flow/configuration/linking.js +0 -2
- package/dist/esm/cmem/react-flow/configuration/linking.js.map +1 -1
- package/dist/esm/cmem/react-flow/configuration/workflow.js +0 -2
- package/dist/esm/cmem/react-flow/configuration/workflow.js.map +1 -1
- package/dist/esm/common/Intent/index.js +1 -1
- package/dist/esm/common/Intent/index.js.map +1 -1
- package/dist/esm/common/index.js +2 -1
- package/dist/esm/common/index.js.map +1 -1
- package/dist/esm/common/utils/CssCustomProperties.js.map +1 -1
- package/dist/esm/common/utils/colorHash.js +26 -13
- package/dist/esm/common/utils/colorHash.js.map +1 -1
- package/dist/esm/common/utils/reduceToText.js +1 -1
- package/dist/esm/components/Application/ApplicationSidebarNavigation.js.map +1 -1
- package/dist/esm/components/Application/ApplicationTitle.js +5 -1
- package/dist/esm/components/Application/ApplicationTitle.js.map +1 -1
- package/dist/esm/components/Application/ApplicationViewability.js +28 -0
- package/dist/esm/components/Application/ApplicationViewability.js.map +1 -0
- package/dist/esm/components/Application/index.js +1 -0
- package/dist/esm/components/Application/index.js.map +1 -1
- package/dist/esm/components/AutoSuggestion/AutoSuggestion.js +1 -1
- package/dist/esm/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
- package/dist/esm/components/AutoSuggestion/AutoSuggestionList.js.map +1 -1
- package/dist/esm/components/AutocompleteField/AutoCompleteField.js +9 -16
- package/dist/esm/components/AutocompleteField/AutoCompleteField.js.map +1 -1
- package/dist/esm/components/AutocompleteField/autoCompleteFieldUtils.js.map +1 -1
- package/dist/esm/components/Button/Button.js +6 -2
- package/dist/esm/components/Button/Button.js.map +1 -1
- package/dist/esm/components/ColorField/ColorField.js +140 -0
- package/dist/esm/components/ColorField/ColorField.js.map +1 -0
- package/dist/esm/components/ContentGroup/ContentGroup.js +1 -1
- package/dist/esm/components/ContentGroup/ContentGroup.js.map +1 -1
- package/dist/esm/components/ContextOverlay/ContextMenu.js +4 -4
- package/dist/esm/components/ContextOverlay/ContextMenu.js.map +1 -1
- package/dist/esm/components/ContextOverlay/ContextOverlay.js +3 -2
- package/dist/esm/components/ContextOverlay/ContextOverlay.js.map +1 -1
- package/dist/esm/components/DecoupledOverlay/DecoupledOverlay.js +42 -0
- package/dist/esm/components/DecoupledOverlay/DecoupledOverlay.js.map +1 -0
- package/dist/esm/components/Icon/IconButton.js +2 -2
- package/dist/esm/components/Icon/IconButton.js.map +1 -1
- package/dist/esm/components/Icon/canonicalIconNames.js +10 -1
- package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/esm/components/Icon/transformIcon.js +21 -0
- package/dist/esm/components/Icon/transformIcon.js.map +1 -0
- package/dist/esm/components/MultiSelect/MultiSelect.js +66 -27
- package/dist/esm/components/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/esm/components/NotAvailable/NotAvailable.js +46 -0
- package/dist/esm/components/NotAvailable/NotAvailable.js.map +1 -0
- package/dist/esm/components/Notification/Notification.js.map +1 -1
- package/dist/esm/components/OverviewItem/OverviewItemDepiction.js.map +1 -1
- package/dist/esm/components/RadioButton/RadioButton.js +6 -2
- package/dist/esm/components/RadioButton/RadioButton.js.map +1 -1
- package/dist/esm/components/Select/Select.js +3 -1
- package/dist/esm/components/Select/Select.js.map +1 -1
- package/dist/esm/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/esm/components/Table/Table.js.map +1 -1
- package/dist/esm/components/Table/TableContainer.js +1 -1
- package/dist/esm/components/Table/TableContainer.js.map +1 -1
- package/dist/esm/components/Table/TableExpandRow.js +1 -1
- package/dist/esm/components/Table/TableExpandRow.js.map +1 -1
- package/dist/esm/components/TextField/useTextValidation.js +39 -8
- package/dist/esm/components/TextField/useTextValidation.js.map +1 -1
- package/dist/esm/components/Tooltip/Tooltip.js +11 -7
- package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/components/Typography/InlineText.js +33 -0
- package/dist/esm/components/Typography/InlineText.js.map +1 -0
- package/dist/esm/components/Typography/index.js +1 -0
- package/dist/esm/components/Typography/index.js.map +1 -1
- package/dist/esm/components/VisualTour/VisualTour.js +31 -37
- package/dist/esm/components/VisualTour/VisualTour.js.map +1 -1
- package/dist/esm/components/index.js +3 -0
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/extensions/codemirror/CodeMirror.js +62 -24
- package/dist/esm/extensions/codemirror/CodeMirror.js.map +1 -1
- package/dist/esm/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.js +1 -1
- package/dist/esm/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.js.map +1 -1
- package/dist/esm/extensions/codemirror/tests/codemirrorTestHelper.js +3 -3
- package/dist/esm/extensions/codemirror/tests/codemirrorTestHelper.js.map +1 -1
- package/dist/esm/extensions/codemirror/toolbars/EditorAppearanceConfigMenu.js +47 -0
- package/dist/esm/extensions/codemirror/toolbars/EditorAppearanceConfigMenu.js.map +1 -0
- package/dist/esm/extensions/codemirror/toolbars/markdown.toolbar.js +16 -2
- package/dist/esm/extensions/codemirror/toolbars/markdown.toolbar.js.map +1 -1
- package/dist/esm/extensions/react-flow/edges/EdgeLabel.js +4 -2
- package/dist/esm/extensions/react-flow/edges/EdgeLabel.js.map +1 -1
- package/dist/esm/extensions/react-flow/edges/EdgeNew.js +3 -1
- package/dist/esm/extensions/react-flow/edges/EdgeNew.js.map +1 -1
- package/dist/esm/extensions/react-flow/edges/EdgeTools.js +1 -1
- package/dist/esm/extensions/react-flow/edges/EdgeTools.js.map +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleContent.js +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleContent.js.map +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleDefault.js +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleDefault.js.map +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleTools.js +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleTools.js.map +1 -1
- package/dist/esm/extensions/react-flow/markers/ReactFlowMarkers.js.map +1 -1
- package/dist/esm/extensions/react-flow/minimap/MiniMap.js +1 -1
- package/dist/esm/extensions/react-flow/minimap/MiniMap.js.map +1 -1
- package/dist/esm/extensions/react-flow/minimap/MiniMapV12.js.map +1 -1
- package/dist/esm/extensions/react-flow/nodes/NodeContent.js +4 -2
- package/dist/esm/extensions/react-flow/nodes/NodeContent.js.map +1 -1
- package/dist/esm/extensions/react-flow/nodes/NodeDefault.js +1 -1
- package/dist/esm/extensions/react-flow/nodes/NodeDefault.js.map +1 -1
- package/dist/esm/extensions/react-flow/nodes/NodeTools.js +2 -1
- package/dist/esm/extensions/react-flow/nodes/NodeTools.js.map +1 -1
- package/dist/esm/extensions/react-flow/nodes/nodeUtils.js.map +1 -1
- package/dist/types/cmem/ActivityControl/ActivityControlWidget.d.ts +13 -4
- package/dist/types/cmem/ActivityControl/ActivityExecutionErrorReportModal.d.ts +1 -1
- package/dist/types/cmem/ActivityControl/SilkActivityControl.d.ts +4 -4
- package/dist/types/cmem/ContentBlobToggler/ContentBlobToggler.d.ts +5 -1
- package/dist/types/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.d.ts +27 -11
- package/dist/types/cmem/markdown/Markdown.d.ts +2 -1
- package/dist/types/cmem/react-flow/configuration/graph.d.ts +2 -1
- package/dist/types/cmem/react-flow/configuration/linking.d.ts +2 -1
- package/dist/types/cmem/react-flow/configuration/workflow.d.ts +2 -1
- package/dist/types/common/index.d.ts +2 -1
- package/dist/types/common/utils/CssCustomProperties.d.ts +2 -2
- package/dist/types/common/utils/colorHash.d.ts +5 -4
- package/dist/types/components/Accordion/AccordionItem.d.ts +1 -1
- package/dist/types/components/Application/ApplicationSidebarNavigation.d.ts +2 -0
- package/dist/types/components/Application/ApplicationViewability.d.ts +36 -0
- package/dist/types/components/Application/index.d.ts +1 -0
- package/dist/types/components/AutoSuggestion/AutoSuggestion.d.ts +2 -2
- package/dist/types/components/AutocompleteField/AutoCompleteField.d.ts +2 -12
- package/dist/types/components/AutocompleteField/autoCompleteFieldUtils.d.ts +1 -1
- package/dist/types/components/Button/Button.d.ts +3 -3
- package/dist/types/components/Card/CardHeader.d.ts +1 -1
- package/dist/types/components/ColorField/ColorField.d.ts +30 -0
- package/dist/types/components/ContentGroup/ContentGroup.d.ts +1 -1
- package/dist/types/components/ContextOverlay/ContextMenu.d.ts +9 -3
- package/dist/types/components/ContextOverlay/ContextOverlay.d.ts +8 -2
- package/dist/types/components/DecoupledOverlay/DecoupledOverlay.d.ts +22 -0
- package/dist/types/components/Depiction/Depiction.d.ts +1 -1
- package/dist/types/components/Dialog/SimpleDialog.d.ts +1 -1
- package/dist/types/components/Form/FieldItem.d.ts +1 -1
- package/dist/types/components/Form/FieldSet.d.ts +3 -3
- package/dist/types/components/HoverToggler/HoverToggler.d.ts +2 -2
- package/dist/types/components/Icon/IconButton.d.ts +1 -1
- package/dist/types/components/Icon/canonicalIconNames.d.ts +9 -1
- package/dist/types/components/Icon/transformIcon.d.ts +2 -0
- package/dist/types/components/Label/Label.d.ts +3 -3
- package/dist/types/components/Menu/MenuItem.d.ts +1 -1
- package/dist/types/components/MultiSelect/MultiSelect.d.ts +17 -5
- package/dist/types/components/NotAvailable/NotAvailable.d.ts +32 -0
- package/dist/types/components/Notification/Notification.d.ts +2 -2
- package/dist/types/components/OverviewItem/OverviewItemActions.d.ts +1 -1
- package/dist/types/components/PropertyValuePair/PropertyValueList.d.ts +1 -1
- package/dist/types/components/RadioButton/RadioButton.d.ts +8 -2
- package/dist/types/components/Select/Select.d.ts +2 -1
- package/dist/types/components/Skeleton/Skeleton.d.ts +1 -1
- package/dist/types/components/Structure/TitleSubsection.d.ts +3 -6
- package/dist/types/components/SuggestField/index.d.ts +2 -2
- package/dist/types/components/Table/TableContainer.d.ts +3 -3
- package/dist/types/components/Tabs/Tab.d.ts +4 -10
- package/dist/types/components/Tabs/TabTitle.d.ts +1 -1
- package/dist/types/components/TextField/TextArea.d.ts +1 -1
- package/dist/types/components/Typography/InlineText.d.ts +13 -0
- package/dist/types/components/Typography/index.d.ts +1 -0
- package/dist/types/components/index.d.ts +3 -0
- package/dist/types/extensions/codemirror/CodeMirror.d.ts +12 -9
- package/dist/types/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.d.ts +1 -1
- package/dist/types/extensions/codemirror/tests/codemirrorTestHelper.d.ts +1 -1
- package/dist/types/extensions/codemirror/toolbars/EditorAppearanceConfigMenu.d.ts +24 -0
- package/dist/types/extensions/codemirror/toolbars/markdown.toolbar.d.ts +2 -0
- package/dist/types/extensions/react-flow/edges/EdgeLabel.d.ts +3 -3
- package/dist/types/extensions/react-flow/edges/EdgeTools.d.ts +1 -1
- package/dist/types/extensions/react-flow/handles/HandleContent.d.ts +2 -2
- package/dist/types/extensions/react-flow/handles/HandleTools.d.ts +2 -2
- package/dist/types/extensions/react-flow/nodes/NodeContent.d.ts +3 -3
- package/dist/types/extensions/react-flow/nodes/NodeTools.d.ts +2 -2
- package/package.json +65 -61
- package/src/_shame.scss +1 -35
- package/src/cmem/ActivityControl/ActivityControlWidget.stories.tsx +3 -8
- package/src/cmem/ActivityControl/ActivityControlWidget.tsx +74 -41
- package/src/cmem/ActivityControl/ActivityExecutionErrorReportModal.tsx +6 -4
- package/src/cmem/ActivityControl/SilkActivityControl.tsx +5 -5
- package/src/cmem/ContentBlobToggler/ContentBlobToggler.tsx +16 -6
- package/src/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.tsx +72 -19
- package/src/cmem/ContentBlobToggler/stories/StringPreviewContentBlobToggler.stories.tsx +27 -0
- package/src/cmem/ContentBlobToggler/tests/StringPreviewContentBlobToggler.test.tsx +98 -0
- package/src/cmem/markdown/Markdown.stories.tsx +2 -2
- package/src/cmem/markdown/Markdown.tsx +2 -1
- package/src/cmem/markdown/markdown.scss +1 -1
- package/src/cmem/react-flow/ReactFlow/ReactFlowV12.tsx +1 -0
- package/src/cmem/react-flow/StickyNoteModal/StickyNoteModal.tsx +1 -1
- package/src/cmem/react-flow/configuration/graph.ts +2 -3
- package/src/cmem/react-flow/configuration/linking.ts +2 -3
- package/src/cmem/react-flow/configuration/workflow.ts +2 -3
- package/src/common/Intent/index.ts +2 -1
- package/src/common/index.ts +2 -1
- package/src/common/scss/_accessibility-defaults.scss +101 -0
- package/src/common/utils/CssCustomProperties.ts +5 -3
- package/src/common/utils/colorHash.ts +38 -20
- package/src/components/Accordion/AccordionItem.tsx +1 -1
- package/src/components/Accordion/Stories/AccordionItem.stories.tsx +1 -1
- package/src/components/Application/ApplicationSidebarNavigation.tsx +5 -2
- package/src/components/Application/ApplicationTitle.tsx +7 -1
- package/src/components/Application/ApplicationViewability.tsx +61 -0
- package/src/components/Application/_colors.scss +15 -0
- package/src/components/Application/_content.scss +7 -0
- package/src/components/Application/_header.scss +45 -21
- package/src/components/Application/_sidebar.scss +6 -0
- package/src/components/Application/_toolbar.scss +3 -3
- package/src/components/Application/_viewability.scss +13 -0
- package/src/components/Application/application.scss +1 -0
- package/src/components/Application/index.ts +1 -0
- package/src/components/Application/stories/ApplicationViewability.stories.tsx +37 -0
- package/src/components/Application/stories/ColorPalettes.stories.tsx +4 -3
- package/src/components/Application/tests/ApplicationViewability.test.tsx +43 -0
- package/src/components/AutoSuggestion/AutoSuggestion.scss +3 -1
- package/src/components/AutoSuggestion/AutoSuggestion.tsx +4 -4
- package/src/components/AutoSuggestion/AutoSuggestionList.tsx +1 -1
- package/src/components/AutoSuggestion/tests/ExtendedCodeEditor.test.tsx +1 -1
- package/src/components/AutocompleteField/AutoCompleteField.tsx +9 -18
- package/src/components/AutocompleteField/autoCompleteFieldUtils.tsx +1 -1
- package/src/components/Badge/Badge.stories.tsx +1 -1
- package/src/components/Badge/Badge.test.tsx +22 -0
- package/src/components/Breadcrumb/breadcrumb.scss +2 -2
- package/src/components/Button/Button.test.tsx +16 -2
- package/src/components/Button/Button.tsx +11 -6
- package/src/components/Button/button.scss +2 -0
- package/src/components/Card/CardHeader.tsx +1 -1
- package/src/components/Card/card.scss +6 -0
- package/src/components/Card/stories/Card.stories.tsx +1 -1
- package/src/components/Checkbox/Stories/Checkbox.stories.tsx +1 -1
- package/src/components/Checkbox/checkbox.scss +23 -3
- package/src/components/ColorField/ColorField.stories.tsx +72 -0
- package/src/components/ColorField/ColorField.test.tsx +101 -0
- package/src/components/ColorField/ColorField.tsx +200 -0
- package/src/components/ColorField/_colorfield.scss +67 -0
- package/src/components/ContentGroup/ContentGroup.stories.tsx +1 -1
- package/src/components/ContentGroup/ContentGroup.tsx +3 -3
- package/src/components/ContentGroup/_contentgroup.scss +9 -0
- package/src/components/ContextOverlay/ContextMenu.tsx +10 -4
- package/src/components/ContextOverlay/ContextOverlay.tsx +23 -4
- package/src/components/DecoupledOverlay/DecoupledOverlay.stories.tsx +30 -0
- package/src/components/DecoupledOverlay/DecoupledOverlay.tsx +100 -0
- package/src/components/DecoupledOverlay/_decoupledoverlay.scss +46 -0
- package/src/components/Depiction/Depiction.tsx +1 -1
- package/src/components/Depiction/depiction.scss +6 -0
- package/src/components/Dialog/SimpleDialog.tsx +1 -1
- package/src/components/Dialog/dialog.scss +10 -2
- package/src/components/Dialog/stories/Modal.stories.tsx +1 -1
- package/src/components/FlexibleLayout/flexiblelayout.scss +16 -0
- package/src/components/Form/FieldItem.tsx +1 -1
- package/src/components/Form/FieldSet.tsx +3 -3
- package/src/components/Form/Stories/FieldItem.stories.tsx +1 -1
- package/src/components/Form/Stories/FieldSet.stories.tsx +1 -1
- package/src/components/Form/form.scss +2 -2
- package/src/components/Grid/grid.scss +17 -0
- package/src/components/Grid/stories/Grid.stories.tsx +10 -7
- package/src/components/Grid/stories/GridColumn.stories.tsx +1 -1
- package/src/components/Grid/stories/GridRow.stories.tsx +14 -8
- package/src/components/HoverToggler/HoverToggler.tsx +2 -2
- package/src/components/Icon/IconButton.tsx +3 -3
- package/src/components/Icon/canonicalIconNames.tsx +11 -1
- package/src/components/Icon/stories/IconButton.stories.tsx +1 -1
- package/src/components/Icon/stories/TestIcon.stories.tsx +1 -1
- package/src/components/Icon/transformIcon.tsx +17 -0
- package/src/components/Label/Label.tsx +3 -3
- package/src/components/Link/Link.stories.tsx +30 -0
- package/src/components/Link/link.scss +33 -8
- package/src/components/Menu/MenuItem.tsx +1 -1
- package/src/components/Menu/Stories/MenuItem.stories.tsx +1 -1
- package/src/components/MultiSelect/MultiSelect.tsx +104 -32
- package/src/components/MultiSuggestField/MultiSuggestField.stories.tsx +40 -1
- package/src/components/MultiSuggestField/_multisuggestfield.scss +18 -0
- package/src/components/MultiSuggestField/tests/MultiSuggestField.test.tsx +89 -37
- package/src/components/NotAvailable/NotAvailable.stories.tsx +15 -0
- package/src/components/NotAvailable/NotAvailable.tsx +71 -0
- package/src/components/Notification/Notification.stories.tsx +2 -1
- package/src/components/Notification/Notification.tsx +3 -3
- package/src/components/Notification/notification.scss +6 -0
- package/src/components/OverviewItem/OverviewItemActions.tsx +1 -1
- package/src/components/OverviewItem/OverviewItemDepiction.tsx +1 -1
- package/src/components/OverviewItem/overviewitem.scss +9 -0
- package/src/components/OverviewItem/stories/OverviewItem.stories.tsx +29 -1
- package/src/components/OverviewItem/stories/OverviewItemActions.stories.tsx +3 -3
- package/src/components/OverviewItem/stories/OverviewItemDepiction.stories.tsx +1 -1
- package/src/components/OverviewItem/stories/OverviewItemDescription.stories.tsx +2 -2
- package/src/components/OverviewItem/stories/OverviewItemLine.stories.tsx +1 -1
- package/src/components/Pagination/Stories/Pagination.stories.tsx +32 -0
- package/src/components/Pagination/pagination.scss +55 -5
- package/src/components/PropertyValuePair/PropertyValueList.tsx +1 -1
- package/src/components/PropertyValuePair/propertyvalue.scss +23 -1
- package/src/components/RadioButton/RadioButton.tsx +15 -3
- package/src/components/RadioButton/Stories/RadioButton.stories.tsx +1 -1
- package/src/components/RadioButton/radiobutton.scss +18 -1
- package/src/components/Select/Select.tsx +8 -6
- package/src/components/Separation/separation.scss +6 -0
- package/src/components/Skeleton/Skeleton.tsx +2 -2
- package/src/components/Structure/TitleSubsection.tsx +1 -1
- package/src/components/Table/Table.tsx +1 -1
- package/src/components/Table/TableContainer.tsx +4 -4
- package/src/components/Table/TableExpandRow.tsx +1 -1
- package/src/components/Table/table.scss +22 -0
- package/src/components/Tabs/TabTitle.tsx +1 -1
- package/src/components/Tabs/stories/TabTitle.stories.tsx +7 -2
- package/src/components/Tabs/tabs.scss +2 -2
- package/src/components/Tag/stories/Tag.stories.tsx +1 -1
- package/src/components/Tag/stories/TagList.stories.tsx +3 -3
- package/src/components/Tag/tag.scss +19 -9
- package/src/components/TextField/TextArea.tsx +1 -1
- package/src/components/TextField/stories/TextArea.stories.tsx +1 -1
- package/src/components/TextField/stories/TextField.stories.tsx +24 -3
- package/src/components/TextField/tests/useTextValidation.test.tsx +83 -0
- package/src/components/TextField/textfield.scss +20 -0
- package/src/components/TextField/useTextValidation.ts +17 -8
- package/src/components/TextReducer/TextReducer.stories.tsx +4 -1
- package/src/components/TextReducer/TextReducer.test.tsx +3 -3
- package/src/components/Toolbar/toolbar.scss +1 -2
- package/src/components/Tooltip/Tooltip.test.tsx +40 -5
- package/src/components/Tooltip/Tooltip.tsx +15 -11
- package/src/components/Typography/InlineText.tsx +24 -0
- package/src/components/Typography/_reset.scss +2 -0
- package/src/components/Typography/index.ts +1 -0
- package/src/components/Typography/stories/InlineText.stories.tsx +27 -0
- package/src/components/Typography/typography.scss +37 -3
- package/src/components/VisualTour/VisualTour.tsx +35 -55
- package/src/components/VisualTour/visualTour.scss +0 -34
- package/src/components/index.scss +2 -0
- package/src/components/index.ts +3 -0
- package/src/configuration/_customproperties.scss +32 -0
- package/src/configuration/stories/customproperties.stories.tsx +122 -0
- package/src/extensions/codemirror/CodeMirror.stories.tsx +9 -4
- package/src/extensions/codemirror/CodeMirror.tsx +93 -37
- package/src/extensions/codemirror/_codemirror.scss +18 -28
- package/src/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.ts +1 -2
- package/src/extensions/codemirror/tests/CodeEditor.test.tsx +138 -0
- package/src/extensions/codemirror/tests/EditorAppearanceConfigMenu.test.tsx +131 -0
- package/src/extensions/codemirror/tests/codemirrorTestHelper.ts +3 -3
- package/src/extensions/codemirror/toolbars/EditorAppearanceConfigMenu.tsx +59 -0
- package/src/extensions/codemirror/toolbars/markdown.toolbar.tsx +17 -3
- package/src/extensions/react-flow/_config.scss +3 -3
- package/src/extensions/react-flow/_react-flow_v12.scss +1 -1
- package/src/extensions/react-flow/edges/EdgeLabel.tsx +15 -11
- package/src/extensions/react-flow/edges/EdgeNew.tsx +6 -6
- package/src/extensions/react-flow/edges/EdgeTools.tsx +5 -6
- package/src/extensions/react-flow/edges/_edges.scss +3 -2
- package/src/extensions/react-flow/edges/stories/EdgeLabel.stories.tsx +2 -1
- package/src/extensions/react-flow/handles/HandleContent.tsx +4 -4
- package/src/extensions/react-flow/handles/HandleDefault.tsx +3 -3
- package/src/extensions/react-flow/handles/HandleTools.tsx +3 -3
- package/src/extensions/react-flow/handles/_handles.scss +3 -3
- package/src/extensions/react-flow/markers/ReactFlowMarkers.tsx +1 -1
- package/src/extensions/react-flow/minimap/MiniMap.tsx +2 -1
- package/src/extensions/react-flow/minimap/MiniMapV12.tsx +1 -1
- package/src/extensions/react-flow/nodes/NodeContent.tsx +20 -19
- package/src/extensions/react-flow/nodes/NodeDefault.tsx +1 -1
- package/src/extensions/react-flow/nodes/NodeDefaultV12.tsx +1 -2
- package/src/extensions/react-flow/nodes/NodeTools.tsx +8 -8
- package/src/extensions/react-flow/nodes/_nodes.scss +4 -3
- package/src/extensions/react-flow/nodes/nodeUtils.tsx +1 -0
- package/src/extensions/react-flow/nodes/stories/NodeContent.stories.tsx +3 -1
- package/src/includes/carbon-components/_requisits.scss +3 -1
- package/src/index.scss +2 -0
- package/src/test/setupTests.js +1 -1
|
@@ -10,17 +10,30 @@ import { removeExtraSpaces } from "../../common/utils/stringUtils";
|
|
|
10
10
|
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
11
11
|
import { TestableComponent } from "../interfaces";
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
ContextOverlayProps,
|
|
15
|
+
Highlighter,
|
|
16
|
+
highlighterUtils,
|
|
17
|
+
IconButton,
|
|
18
|
+
MenuItem,
|
|
19
|
+
OverflowText,
|
|
20
|
+
Spinner,
|
|
21
|
+
} from "./../../index";
|
|
14
22
|
|
|
15
23
|
export interface MultiSuggestFieldSelectionProps<T> {
|
|
16
24
|
newlySelected?: T;
|
|
25
|
+
newlyRemoved?: T;
|
|
17
26
|
selectedItems: T[];
|
|
18
27
|
createdItems: Partial<T>[];
|
|
19
28
|
}
|
|
20
29
|
|
|
21
|
-
interface MultiSuggestFieldCommonProps<T>
|
|
30
|
+
export interface MultiSuggestFieldCommonProps<T>
|
|
22
31
|
extends TestableComponent,
|
|
23
|
-
Pick<
|
|
32
|
+
Pick<
|
|
33
|
+
BlueprintMultiSelectProps<T>,
|
|
34
|
+
"items" | "placeholder" | "openOnKeyDown" | "noResults" | "createNewItemRenderer"
|
|
35
|
+
>,
|
|
36
|
+
Partial<Pick<BlueprintMultiSelectProps<T>, "itemRenderer">> {
|
|
24
37
|
/**
|
|
25
38
|
* Additional class name, space separated.
|
|
26
39
|
*/
|
|
@@ -53,7 +66,7 @@ interface MultiSuggestFieldCommonProps<T>
|
|
|
53
66
|
/**
|
|
54
67
|
* prop to listen for query changes, when text is entered in the multi-select input
|
|
55
68
|
*/
|
|
56
|
-
runOnQueryChange?: (query: string) => Promise<T[] | undefined
|
|
69
|
+
runOnQueryChange?: (query: string) => Promise<T[] | undefined> | (T[] | undefined);
|
|
57
70
|
/**
|
|
58
71
|
* Whether the component should take up the full width of its container.
|
|
59
72
|
* This overrides `tagInputProps.fill`.
|
|
@@ -70,9 +83,11 @@ interface MultiSuggestFieldCommonProps<T>
|
|
|
70
83
|
*/
|
|
71
84
|
newItemCreationText?: string;
|
|
72
85
|
/**
|
|
73
|
-
* Allows to
|
|
86
|
+
* Allows to create new item from a given query. If this is not provided then no new items can be created.
|
|
74
87
|
*/
|
|
75
88
|
createNewItemFromQuery?: (query: string) => T;
|
|
89
|
+
/** Validates if a new item can be created from the current query string. */
|
|
90
|
+
isValidNewOption?: (query: string) => boolean;
|
|
76
91
|
/**
|
|
77
92
|
* Items that were newly created and not taken from the list will be post-fixed with this string.
|
|
78
93
|
*/
|
|
@@ -103,9 +118,20 @@ interface MultiSuggestFieldCommonProps<T>
|
|
|
103
118
|
wrapperProps?: React.HTMLAttributes<HTMLDivElement>;
|
|
104
119
|
/**
|
|
105
120
|
* Function that allows us to filter values from the option list.
|
|
106
|
-
*
|
|
121
|
+
*
|
|
122
|
+
* @deprecated (v26) use `searchListPredicate` instead.
|
|
107
123
|
*/
|
|
108
124
|
searchPredicate?: (item: T, query: string) => boolean;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Returns the filtered the search option list.
|
|
128
|
+
* By default, a case-insensitive multi-word filtering is applied.
|
|
129
|
+
*
|
|
130
|
+
* @param items The options.
|
|
131
|
+
* @param query The search query.
|
|
132
|
+
*/
|
|
133
|
+
searchListPredicate?: (items: T[], query: string) => T[];
|
|
134
|
+
|
|
109
135
|
/**
|
|
110
136
|
* Limits the height of the input target plus its dropdown menu when it is opened.
|
|
111
137
|
* Need to be a `number not greater than 100` (as `vh`, a unit describing a length relative to the viewport height) or `true` (equals 100).
|
|
@@ -159,6 +185,7 @@ export function MultiSuggestField<T>({
|
|
|
159
185
|
newItemPostfix = " (new item)",
|
|
160
186
|
disabled,
|
|
161
187
|
createNewItemFromQuery,
|
|
188
|
+
isValidNewOption,
|
|
162
189
|
requestDelay = 0,
|
|
163
190
|
clearQueryOnSelection = false,
|
|
164
191
|
className,
|
|
@@ -166,13 +193,16 @@ export function MultiSuggestField<T>({
|
|
|
166
193
|
"data-testid": dataTestid,
|
|
167
194
|
wrapperProps,
|
|
168
195
|
searchPredicate,
|
|
196
|
+
searchListPredicate,
|
|
169
197
|
limitHeightOpened,
|
|
170
198
|
intent,
|
|
171
199
|
...otherMultiSelectProps
|
|
172
200
|
}: MultiSuggestFieldProps<T>) {
|
|
201
|
+
type SelectionChange = { type: "selected"; item: T } | { type: "removed"; item: T } | { type: "none" };
|
|
202
|
+
|
|
173
203
|
// Options created by a user
|
|
174
204
|
const createdItems = useRef<T[]>([]);
|
|
175
|
-
// Options passed
|
|
205
|
+
// Options passed outside (f.e. from the backend)
|
|
176
206
|
const [externalItems, setExternalItems] = React.useState<T[]>([...items]);
|
|
177
207
|
// All options (created and passed) that match the query
|
|
178
208
|
const [filteredItems, setFilteredItems] = React.useState<T[]>([]);
|
|
@@ -183,14 +213,15 @@ export function MultiSuggestField<T>({
|
|
|
183
213
|
// Max height of the menu
|
|
184
214
|
const [calculatedMaxHeight, setCalculatedMaxHeight] = React.useState<string | null>(null);
|
|
185
215
|
|
|
186
|
-
//
|
|
187
|
-
const
|
|
216
|
+
// The active popover item is only needed for keyboard interaction and should not trigger rerenders.
|
|
217
|
+
const focusedItemRef = React.useRef<T | null>(null);
|
|
188
218
|
const [showSpinner, setShowSpinner] = React.useState(false);
|
|
189
219
|
const inputRef = React.useRef<HTMLInputElement>(null);
|
|
190
220
|
const requestState = useRef<{
|
|
191
221
|
query?: string;
|
|
192
222
|
timeoutId?: number;
|
|
193
223
|
}>({});
|
|
224
|
+
const selectionChange = useRef<SelectionChange>({ type: "none" });
|
|
194
225
|
|
|
195
226
|
/** Update external items when they change
|
|
196
227
|
* e.g for auto-complete when query change
|
|
@@ -201,11 +232,21 @@ export function MultiSuggestField<T>({
|
|
|
201
232
|
}, [items.map((item) => itemId(item)).join("|")]);
|
|
202
233
|
|
|
203
234
|
React.useEffect(() => {
|
|
204
|
-
|
|
205
|
-
newlySelected: selectedItems.slice(-1)[0],
|
|
235
|
+
const selectionParams: MultiSuggestFieldSelectionProps<T> = {
|
|
206
236
|
createdItems: createdItems.current,
|
|
207
237
|
selectedItems,
|
|
208
|
-
}
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
if (selectionChange.current.type === "selected") {
|
|
241
|
+
selectionParams.newlySelected = selectionChange.current.item;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
if (selectionChange.current.type === "removed") {
|
|
245
|
+
selectionParams.newlyRemoved = selectionChange.current.item;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
onSelection?.(selectionParams);
|
|
249
|
+
selectionChange.current = { type: "none" };
|
|
209
250
|
}, [
|
|
210
251
|
onSelection,
|
|
211
252
|
selectedItems.map((item) => itemId(item)).join("|"),
|
|
@@ -220,6 +261,7 @@ export function MultiSuggestField<T>({
|
|
|
220
261
|
return;
|
|
221
262
|
}
|
|
222
263
|
|
|
264
|
+
selectionChange.current = { type: "none" };
|
|
223
265
|
setSelectedItems(externalSelectedItems);
|
|
224
266
|
}, [externalSelectedItems?.map((item) => itemId(item)).join("|")]);
|
|
225
267
|
|
|
@@ -260,12 +302,22 @@ export function MultiSuggestField<T>({
|
|
|
260
302
|
* @param matcher
|
|
261
303
|
*/
|
|
262
304
|
const removeItemSelection = (matcher: string) => {
|
|
263
|
-
|
|
264
|
-
|
|
305
|
+
setSelectedItems((items) => {
|
|
306
|
+
const removedItem = items.find((item) => itemId(item) === matcher);
|
|
307
|
+
|
|
308
|
+
selectionChange.current = removedItem ? { type: "removed", item: removedItem } : { type: "none" };
|
|
309
|
+
|
|
310
|
+
return items.filter((item) => itemId(item) !== matcher);
|
|
311
|
+
});
|
|
265
312
|
};
|
|
266
313
|
|
|
267
|
-
|
|
268
|
-
|
|
314
|
+
/** Does a case-insensitive multi-word search in the item label. */
|
|
315
|
+
const defaultSearchListPredicate = (items: T[], query: string): T[] => {
|
|
316
|
+
const searchWords = highlighterUtils.extractSearchWords(query, true);
|
|
317
|
+
return items.filter((item) => {
|
|
318
|
+
const searchIn = itemLabel(item).toLowerCase();
|
|
319
|
+
return highlighterUtils.matchesAllWords(searchIn, searchWords);
|
|
320
|
+
});
|
|
269
321
|
};
|
|
270
322
|
|
|
271
323
|
/**
|
|
@@ -277,6 +329,7 @@ export function MultiSuggestField<T>({
|
|
|
277
329
|
if (itemHasBeenSelectedAlready(itemId(item))) {
|
|
278
330
|
removeItemSelection(itemId(item));
|
|
279
331
|
} else {
|
|
332
|
+
selectionChange.current = { type: "selected", item };
|
|
280
333
|
setSelectedItems((items) => [...items, item]);
|
|
281
334
|
}
|
|
282
335
|
|
|
@@ -293,24 +346,28 @@ export function MultiSuggestField<T>({
|
|
|
293
346
|
* @param query
|
|
294
347
|
*/
|
|
295
348
|
const onQueryChange = (query: string) => {
|
|
296
|
-
setFilteredItems([]);
|
|
297
349
|
if (query.length && query !== requestState.current.query) {
|
|
298
350
|
requestState.current.query = query;
|
|
299
351
|
if (requestState.current.timeoutId) {
|
|
300
352
|
clearTimeout(requestState.current.timeoutId);
|
|
301
353
|
}
|
|
354
|
+
setShowSpinner(true);
|
|
355
|
+
setFilteredItems([]);
|
|
302
356
|
const fn = async () => {
|
|
303
|
-
setShowSpinner(true);
|
|
304
|
-
setFilteredItems([]);
|
|
305
357
|
const resultFromQuery = runOnQueryChange && (await runOnQueryChange(removeExtraSpaces(query)));
|
|
306
358
|
if (requestState.current.query === query) {
|
|
307
359
|
// Only use most recent request
|
|
308
360
|
const outsideOptions = [...(resultFromQuery ?? externalItems)];
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
361
|
+
let itemFilter = defaultSearchListPredicate;
|
|
362
|
+
if (searchListPredicate) {
|
|
363
|
+
itemFilter = searchListPredicate;
|
|
364
|
+
} else if (searchPredicate) {
|
|
365
|
+
itemFilter = (items, query) => {
|
|
366
|
+
return items.filter((item) => searchPredicate(item, query));
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
setFilteredItems(itemFilter([...outsideOptions, ...createdItems.current], query));
|
|
314
371
|
setShowSpinner(false);
|
|
315
372
|
}
|
|
316
373
|
};
|
|
@@ -356,6 +413,7 @@ export function MultiSuggestField<T>({
|
|
|
356
413
|
const handleClear = () => {
|
|
357
414
|
requestState.current.query = "";
|
|
358
415
|
|
|
416
|
+
selectionChange.current = { type: "none" };
|
|
359
417
|
setSelectedItems([]);
|
|
360
418
|
setFilteredItems([...externalItems, ...createdItems.current]);
|
|
361
419
|
};
|
|
@@ -366,7 +424,13 @@ export function MultiSuggestField<T>({
|
|
|
366
424
|
* @param index
|
|
367
425
|
*/
|
|
368
426
|
const removeTagFromSelectionViaIndex = (_label: React.ReactNode, index: number) => {
|
|
369
|
-
setSelectedItems(
|
|
427
|
+
setSelectedItems((items) => {
|
|
428
|
+
const removedItem = items[index];
|
|
429
|
+
|
|
430
|
+
selectionChange.current = removedItem ? { type: "removed", item: removedItem } : { type: "none" };
|
|
431
|
+
|
|
432
|
+
return [...items.slice(0, index), ...items.slice(index + 1)];
|
|
433
|
+
});
|
|
370
434
|
};
|
|
371
435
|
|
|
372
436
|
/**
|
|
@@ -387,7 +451,9 @@ export function MultiSuggestField<T>({
|
|
|
387
451
|
*/
|
|
388
452
|
const handleOnKeyUp = (event: React.KeyboardEvent<HTMLElement>) => {
|
|
389
453
|
if (event.key === "Enter" && !filteredItems.length && !!requestState.current.query && createNewItemFromQuery) {
|
|
390
|
-
|
|
454
|
+
if (!isValidNewOption || isValidNewOption(requestState.current.query)) {
|
|
455
|
+
createNewItem(requestState.current.query);
|
|
456
|
+
}
|
|
391
457
|
}
|
|
392
458
|
inputRef.current?.focus();
|
|
393
459
|
};
|
|
@@ -400,10 +466,14 @@ export function MultiSuggestField<T>({
|
|
|
400
466
|
const handleOnKeyDown = (event: React.KeyboardEvent<HTMLElement>) => {
|
|
401
467
|
if (event.key === "Tab" && !!requestState.current.query) {
|
|
402
468
|
event.preventDefault();
|
|
403
|
-
if (
|
|
404
|
-
onItemSelect(
|
|
469
|
+
if (focusedItemRef.current) {
|
|
470
|
+
onItemSelect(focusedItemRef.current);
|
|
405
471
|
} else {
|
|
406
|
-
|
|
472
|
+
if (!isValidNewOption || isValidNewOption(requestState.current.query)) {
|
|
473
|
+
onItemSelect(createNewItem(requestState.current.query));
|
|
474
|
+
} else {
|
|
475
|
+
return;
|
|
476
|
+
}
|
|
407
477
|
}
|
|
408
478
|
requestState.current.query = "";
|
|
409
479
|
setTimeout(() => inputRef.current?.focus());
|
|
@@ -418,7 +488,7 @@ export function MultiSuggestField<T>({
|
|
|
418
488
|
* @returns
|
|
419
489
|
*/
|
|
420
490
|
const newItemRenderer = (label: string, active: boolean, handleClick: React.MouseEventHandler<HTMLElement>) => {
|
|
421
|
-
if (!createNewItemFromQuery) return undefined;
|
|
491
|
+
if (!createNewItemFromQuery || (isValidNewOption && !isValidNewOption(label))) return undefined;
|
|
422
492
|
const clickHandler = (e: React.MouseEvent<HTMLElement>) => {
|
|
423
493
|
createNewItem(label);
|
|
424
494
|
handleClick(e);
|
|
@@ -460,7 +530,6 @@ export function MultiSuggestField<T>({
|
|
|
460
530
|
? "Search for item, or enter term to create new one..."
|
|
461
531
|
: undefined
|
|
462
532
|
}
|
|
463
|
-
{...otherMultiSelectProps}
|
|
464
533
|
query={requestState.current.query}
|
|
465
534
|
onQueryChange={onQueryChange}
|
|
466
535
|
items={filteredItems}
|
|
@@ -471,7 +540,9 @@ export function MultiSuggestField<T>({
|
|
|
471
540
|
noResults={<MenuItem disabled={true} text={noResultText} />}
|
|
472
541
|
tagRenderer={(item) => itemLabel(item)}
|
|
473
542
|
createNewItemRenderer={newItemRenderer}
|
|
474
|
-
onActiveItemChange={(activeItem) =>
|
|
543
|
+
onActiveItemChange={(activeItem) => {
|
|
544
|
+
focusedItemRef.current = activeItem;
|
|
545
|
+
}}
|
|
475
546
|
fill={fullWidth}
|
|
476
547
|
createNewItemFromQuery={createNewItemFromQuery}
|
|
477
548
|
disabled={disabled}
|
|
@@ -529,6 +600,7 @@ export function MultiSuggestField<T>({
|
|
|
529
600
|
: undefined,
|
|
530
601
|
} as BlueprintMultiSelectProps<T>["popoverContentProps"]
|
|
531
602
|
}
|
|
603
|
+
{...otherMultiSelectProps}
|
|
532
604
|
/>
|
|
533
605
|
);
|
|
534
606
|
|
|
@@ -5,6 +5,8 @@ import { Meta, StoryFn } from "@storybook/react";
|
|
|
5
5
|
import { fn } from "@storybook/test";
|
|
6
6
|
|
|
7
7
|
import { helpersArgTypes } from "../../../.storybook/helpers";
|
|
8
|
+
import { Notification } from "../Notification/Notification";
|
|
9
|
+
import Spacing from "../Separation/Spacing";
|
|
8
10
|
|
|
9
11
|
import { MultiSuggestField, MultiSuggestFieldSelectionProps, SimpleDialog } from "./../../../index";
|
|
10
12
|
|
|
@@ -61,7 +63,7 @@ Default.args = {
|
|
|
61
63
|
|
|
62
64
|
/**
|
|
63
65
|
* Display always the dropdown after the element was clicked on.
|
|
64
|
-
* Do not wait until the query input was
|
|
66
|
+
* Do not wait until the query input was started.
|
|
65
67
|
*/
|
|
66
68
|
export const dropdownOnFocus = Template.bind({});
|
|
67
69
|
dropdownOnFocus.args = {
|
|
@@ -259,3 +261,40 @@ CustomSearch.args = {
|
|
|
259
261
|
return item.testId.toLowerCase().includes(query) || item.testLabel.toLowerCase().includes(query);
|
|
260
262
|
},
|
|
261
263
|
};
|
|
264
|
+
|
|
265
|
+
const SelectionNotificationComponent = (): React.JSX.Element => {
|
|
266
|
+
const [notification, setNotification] = useState<string | null>(null);
|
|
267
|
+
|
|
268
|
+
const availableItems = useMemo<string[]>(() => ["existing item"], []);
|
|
269
|
+
|
|
270
|
+
const identity = useCallback((item: string): string => item, []);
|
|
271
|
+
|
|
272
|
+
const handleOnSelect = useCallback((params: MultiSuggestFieldSelectionProps<string>) => {
|
|
273
|
+
if (params.newlySelected) {
|
|
274
|
+
setNotification(`Element added: ${params.newlySelected}`);
|
|
275
|
+
} else if (params.newlyRemoved) {
|
|
276
|
+
setNotification(`Element removed: ${params.newlyRemoved}`);
|
|
277
|
+
}
|
|
278
|
+
}, []);
|
|
279
|
+
|
|
280
|
+
return (
|
|
281
|
+
<OverlaysProvider>
|
|
282
|
+
{notification && <Notification intent={"info"}>{notification}</Notification>}
|
|
283
|
+
<Spacing size={"medium"} />
|
|
284
|
+
<MultiSuggestField<string>
|
|
285
|
+
items={availableItems}
|
|
286
|
+
prePopulateWithItems={true}
|
|
287
|
+
onSelection={handleOnSelect}
|
|
288
|
+
itemId={identity}
|
|
289
|
+
itemLabel={identity}
|
|
290
|
+
createNewItemFromQuery={identity}
|
|
291
|
+
/>
|
|
292
|
+
</OverlaysProvider>
|
|
293
|
+
);
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Demonstrates the `newlySelected` and `newlyRemoved` properties of the `onSelection` callback.
|
|
298
|
+
* A notification appears when an element is added or removed from the selection.
|
|
299
|
+
*/
|
|
300
|
+
export const selectionNotification = SelectionNotificationComponent.bind({});
|
|
@@ -6,3 +6,21 @@
|
|
|
6
6
|
max-height: var(--eccgui-multisuggestfield-max-height, 45vh);
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
+
|
|
10
|
+
.#{$eccgui}-multisuggestfield {
|
|
11
|
+
--#{$eccgui}-a11y-outline-color: #{$eccgui-color-accent};
|
|
12
|
+
|
|
13
|
+
&.#{$ns}-intent-success {
|
|
14
|
+
--#{$eccgui}-a11y-outline-color: #{$eccgui-color-success-text};
|
|
15
|
+
}
|
|
16
|
+
&.#{$ns}-intent-warning {
|
|
17
|
+
--#{$eccgui}-a11y-outline-color: #{$eccgui-color-warning-text};
|
|
18
|
+
}
|
|
19
|
+
&.#{$ns}-intent-danger {
|
|
20
|
+
--#{$eccgui}-a11y-outline-color: #{$eccgui-color-danger-text};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&:focus-within {
|
|
24
|
+
@extend .#{$eccgui}-a11y-focus-by-keyboard-static;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { fireEvent, render, screen, waitFor } from "@testing-library/react";
|
|
3
3
|
|
|
4
4
|
import "@testing-library/jest-dom";
|
|
@@ -13,39 +13,6 @@ const items = new Array(50).fill(undefined).map((_, id) => {
|
|
|
13
13
|
return { testLabel, testId: `${testLabel}-id` };
|
|
14
14
|
});
|
|
15
15
|
|
|
16
|
-
export const TestComponent = (): JSX.Element => {
|
|
17
|
-
const copy: Array<{ testLabel: string; testId: string }> = [items[2]];
|
|
18
|
-
|
|
19
|
-
const [selected, setSelected] = useState(copy);
|
|
20
|
-
|
|
21
|
-
const handleOnSelect = useCallback((params) => {
|
|
22
|
-
const items = params.selectedItems;
|
|
23
|
-
setSelected(items);
|
|
24
|
-
}, []);
|
|
25
|
-
|
|
26
|
-
const handleReset = (): void => {
|
|
27
|
-
setSelected(copy);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<div>
|
|
32
|
-
<button data-testid="reset-button" onClick={handleReset}>
|
|
33
|
-
Reset
|
|
34
|
-
</button>
|
|
35
|
-
<br />
|
|
36
|
-
<br />
|
|
37
|
-
<MultiSuggestField<{ testLabel: string; testId: string }>
|
|
38
|
-
items={items}
|
|
39
|
-
createNewItemFromQuery={(query) => ({ testId: `${query}-id`, testLabel: query })}
|
|
40
|
-
onSelection={handleOnSelect}
|
|
41
|
-
itemId={({ testId }) => testId}
|
|
42
|
-
itemLabel={({ testLabel }) => testLabel}
|
|
43
|
-
selectedItems={selected}
|
|
44
|
-
/>
|
|
45
|
-
</div>
|
|
46
|
-
);
|
|
47
|
-
};
|
|
48
|
-
|
|
49
16
|
describe("MultiSuggestField", () => {
|
|
50
17
|
describe("uncontrolled (when only selectedItems or onSelect is provided)", () => {
|
|
51
18
|
it("should render default input", () => {
|
|
@@ -261,6 +228,86 @@ describe("MultiSuggestField", () => {
|
|
|
261
228
|
});
|
|
262
229
|
});
|
|
263
230
|
|
|
231
|
+
it("should set newlySelected only when an item is added", async () => {
|
|
232
|
+
const onSelection = jest.fn();
|
|
233
|
+
const initiallySelected = predefinedNotControlledValues.args.selectedItems;
|
|
234
|
+
|
|
235
|
+
const { container } = render(
|
|
236
|
+
<MultiSuggestField
|
|
237
|
+
{...dropdownOnFocus.args}
|
|
238
|
+
items={items}
|
|
239
|
+
selectedItems={initiallySelected}
|
|
240
|
+
onSelection={onSelection}
|
|
241
|
+
/>
|
|
242
|
+
);
|
|
243
|
+
|
|
244
|
+
await waitFor(() => {
|
|
245
|
+
expect(onSelection).toHaveBeenCalledWith({
|
|
246
|
+
createdItems: [],
|
|
247
|
+
selectedItems: initiallySelected,
|
|
248
|
+
});
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
onSelection.mockClear();
|
|
252
|
+
|
|
253
|
+
const [inputContainer] = container.getElementsByClassName("eccgui-multiselect");
|
|
254
|
+
const [input] = inputContainer.getElementsByTagName("input");
|
|
255
|
+
|
|
256
|
+
fireEvent.click(input);
|
|
257
|
+
|
|
258
|
+
await waitFor(() => {
|
|
259
|
+
const listbox = screen.getByRole("listbox");
|
|
260
|
+
const menuItems = listbox.getElementsByClassName("eccgui-menu__item");
|
|
261
|
+
|
|
262
|
+
expect(menuItems.length).toBe(dropdownOnFocus.args.items.length);
|
|
263
|
+
|
|
264
|
+
fireEvent.click(menuItems[2]);
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
await waitFor(() => {
|
|
268
|
+
expect(onSelection).toHaveBeenLastCalledWith({
|
|
269
|
+
createdItems: [],
|
|
270
|
+
newlySelected: items[2],
|
|
271
|
+
selectedItems: [...initiallySelected, items[2]],
|
|
272
|
+
});
|
|
273
|
+
});
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
it("should set newlyRemoved only when an item is removed", async () => {
|
|
277
|
+
const onSelection = jest.fn();
|
|
278
|
+
const initiallySelected = predefinedNotControlledValues.args.selectedItems;
|
|
279
|
+
|
|
280
|
+
const { container } = render(
|
|
281
|
+
<MultiSuggestField
|
|
282
|
+
{...predefinedNotControlledValues.args}
|
|
283
|
+
selectedItems={initiallySelected}
|
|
284
|
+
onSelection={onSelection}
|
|
285
|
+
/>
|
|
286
|
+
);
|
|
287
|
+
|
|
288
|
+
await waitFor(() => {
|
|
289
|
+
expect(onSelection).toHaveBeenCalledWith({
|
|
290
|
+
createdItems: [],
|
|
291
|
+
selectedItems: initiallySelected,
|
|
292
|
+
});
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
onSelection.mockClear();
|
|
296
|
+
|
|
297
|
+
const [firstTag] = Array.from(container.querySelectorAll("span[data-tag-index]"));
|
|
298
|
+
const removeTagButton = firstTag.querySelector("button");
|
|
299
|
+
|
|
300
|
+
fireEvent.click(removeTagButton!);
|
|
301
|
+
|
|
302
|
+
await waitFor(() => {
|
|
303
|
+
expect(onSelection).toHaveBeenLastCalledWith({
|
|
304
|
+
createdItems: [],
|
|
305
|
+
newlyRemoved: initiallySelected[0],
|
|
306
|
+
selectedItems: initiallySelected.slice(1),
|
|
307
|
+
});
|
|
308
|
+
});
|
|
309
|
+
});
|
|
310
|
+
|
|
264
311
|
it("should filter items by custom search function", async () => {
|
|
265
312
|
const { container } = render(<MultiSuggestField {...CustomSearch.args} items={items} />);
|
|
266
313
|
|
|
@@ -340,6 +387,13 @@ describe("MultiSuggestField", () => {
|
|
|
340
387
|
expect(getByText(firstSelected)).toBeInTheDocument();
|
|
341
388
|
expect(getByText(secondSelected)).toBeInTheDocument();
|
|
342
389
|
});
|
|
390
|
+
|
|
391
|
+
await waitFor(() => {
|
|
392
|
+
expect(onSelection).toHaveBeenCalledWith({
|
|
393
|
+
createdItems: [],
|
|
394
|
+
selectedItems: predefinedNotControlledValues.args.selectedItems,
|
|
395
|
+
});
|
|
396
|
+
});
|
|
343
397
|
});
|
|
344
398
|
|
|
345
399
|
it("should call onSelection function with the selected items", async () => {
|
|
@@ -485,7 +539,6 @@ describe("MultiSuggestField", () => {
|
|
|
485
539
|
await waitFor(() => {
|
|
486
540
|
const expectedObject = {
|
|
487
541
|
createdItems: [],
|
|
488
|
-
newlySelected: items.at(-1),
|
|
489
542
|
selectedItems: items,
|
|
490
543
|
};
|
|
491
544
|
expect(onSelection).toHaveBeenCalledWith(expectedObject);
|
|
@@ -513,7 +566,6 @@ describe("MultiSuggestField", () => {
|
|
|
513
566
|
await waitFor(() => {
|
|
514
567
|
const expectedObject = {
|
|
515
568
|
createdItems: [],
|
|
516
|
-
newlySelected: items.at(-1),
|
|
517
569
|
selectedItems: items,
|
|
518
570
|
};
|
|
519
571
|
expect(onSelection).toHaveBeenCalledWith(expectedObject);
|
|
@@ -536,7 +588,7 @@ describe("MultiSuggestField", () => {
|
|
|
536
588
|
|
|
537
589
|
const expectedObject = {
|
|
538
590
|
createdItems: [],
|
|
539
|
-
|
|
591
|
+
newlyRemoved: items[i],
|
|
540
592
|
selectedItems: selected,
|
|
541
593
|
};
|
|
542
594
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Meta, StoryFn } from "@storybook/react";
|
|
3
|
+
|
|
4
|
+
import { NotAvailable } from "../../../index";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Components/NotAvailable",
|
|
8
|
+
component: NotAvailable,
|
|
9
|
+
argTypes: {},
|
|
10
|
+
} as Meta<typeof NotAvailable>;
|
|
11
|
+
|
|
12
|
+
const TemplateFull: StoryFn<typeof NotAvailable> = (args) => <NotAvailable {...args} />;
|
|
13
|
+
|
|
14
|
+
export const Default = TemplateFull.bind({});
|
|
15
|
+
Default.args = {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import { CLASSPREFIX as eccgui, Tag, TagProps, Tooltip, TooltipProps } from "../../index";
|
|
4
|
+
import { TestableComponent } from "../interfaces";
|
|
5
|
+
export interface NotAvailableProps
|
|
6
|
+
extends TestableComponent,
|
|
7
|
+
Pick<TagProps, "icon" | "className">,
|
|
8
|
+
Pick<TooltipProps, "intent"> {
|
|
9
|
+
/**
|
|
10
|
+
* Text displayed by the element.
|
|
11
|
+
*/
|
|
12
|
+
label?: TagProps["children"];
|
|
13
|
+
/**
|
|
14
|
+
* Add a tooltip to the element.
|
|
15
|
+
* You need to set an empty string `""` to remove it.
|
|
16
|
+
*/
|
|
17
|
+
tooltip?: TooltipProps["content"];
|
|
18
|
+
/**
|
|
19
|
+
* Specify the display of the used `Tag` component.
|
|
20
|
+
*/
|
|
21
|
+
tagProps?: Omit<TagProps, "icon" | "intent" | "children">;
|
|
22
|
+
/**
|
|
23
|
+
* Specify the display of the used `Tooltip` component.
|
|
24
|
+
*/
|
|
25
|
+
tooltipProps?: Omit<TooltipProps, "content" | "intent" | "children">;
|
|
26
|
+
/**
|
|
27
|
+
* Do not use the `Tag` component for the display.
|
|
28
|
+
* The `intent` state can be displayed only on the tooltip then.
|
|
29
|
+
*/
|
|
30
|
+
noTag?: boolean;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Simple placeholder element that can be used to display info about missing data.
|
|
35
|
+
*/
|
|
36
|
+
export const NotAvailable = ({
|
|
37
|
+
label = "n/a",
|
|
38
|
+
tooltip = "not available",
|
|
39
|
+
icon,
|
|
40
|
+
intent,
|
|
41
|
+
tagProps,
|
|
42
|
+
tooltipProps,
|
|
43
|
+
className,
|
|
44
|
+
noTag = false,
|
|
45
|
+
...otherProps
|
|
46
|
+
}: NotAvailableProps) => {
|
|
47
|
+
const defaultTagProps: TagProps = {
|
|
48
|
+
icon,
|
|
49
|
+
intent,
|
|
50
|
+
emphasis: "weaker",
|
|
51
|
+
className: `${eccgui}-notavailable` + className ? ` ${className}` : "",
|
|
52
|
+
};
|
|
53
|
+
const naElement =
|
|
54
|
+
noTag === false ? (
|
|
55
|
+
<Tag {...defaultTagProps} {...tagProps} {...otherProps}>
|
|
56
|
+
{label ?? "n/a"}
|
|
57
|
+
</Tag>
|
|
58
|
+
) : (
|
|
59
|
+
<>{label ?? "n/a"}</>
|
|
60
|
+
);
|
|
61
|
+
const defaultTooltipProps: TooltipProps = {
|
|
62
|
+
children: naElement,
|
|
63
|
+
content: tooltip,
|
|
64
|
+
intent,
|
|
65
|
+
addIndicator: noTag,
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
return tooltip ? <Tooltip {...defaultTooltipProps} {...tooltipProps} /> : naElement;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export default NotAvailable;
|
|
@@ -3,7 +3,8 @@ import { LoremIpsum, loremIpsum } from "react-lorem-ipsum";
|
|
|
3
3
|
import { Meta, StoryFn } from "@storybook/react";
|
|
4
4
|
|
|
5
5
|
import { helpersArgTypes } from "../../../.storybook/helpers";
|
|
6
|
-
import {
|
|
6
|
+
import { Markdown } from "../../cmem";
|
|
7
|
+
import { Button, HtmlContentBlock, Notification, Spacing } from "../../components";
|
|
7
8
|
|
|
8
9
|
export default {
|
|
9
10
|
title: "Components/Notification",
|
|
@@ -20,11 +20,11 @@ export interface NotificationProps
|
|
|
20
20
|
/**
|
|
21
21
|
* Extra user action elements
|
|
22
22
|
*/
|
|
23
|
-
actions?: JSX.Element | JSX.Element[];
|
|
23
|
+
actions?: React.JSX.Element | React.JSX.Element[];
|
|
24
24
|
/**
|
|
25
25
|
* Notification message that can be used as alternative to children elements.
|
|
26
26
|
*/
|
|
27
|
-
message?: JSX.Element | string;
|
|
27
|
+
message?: React.JSX.Element | string;
|
|
28
28
|
/**
|
|
29
29
|
* Intent state of the notification.
|
|
30
30
|
*/
|
|
@@ -97,7 +97,7 @@ export const Notification = ({
|
|
|
97
97
|
timeout={timeout ? timeout : 0}
|
|
98
98
|
icon={
|
|
99
99
|
notificationIcon
|
|
100
|
-
? React.cloneElement(notificationIcon as JSX.Element, {
|
|
100
|
+
? React.cloneElement(notificationIcon as React.JSX.Element, {
|
|
101
101
|
className: (notificationIcon.props.className ?? "") + ` ${BlueprintClassNames.ICON}`,
|
|
102
102
|
})
|
|
103
103
|
: undefined
|