@eccenca/gui-elements 6.1.0 → 22.0.0-rc.6
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 +98 -866
- package/LICENSE +202 -0
- package/README.md +56 -1240
- package/blueprint/constants.ts +7 -0
- package/blueprint/toaster/index.tsx +1 -0
- package/dist/cmem/ActivityControl/ActivityControlTypes.d.ts +15 -0
- package/dist/cmem/ActivityControl/ActivityControlTypes.js +1 -0
- package/dist/cmem/ActivityControl/ActivityControlWidget.d.ts +32 -0
- package/dist/cmem/ActivityControl/ActivityControlWidget.js +92 -0
- package/dist/cmem/ActivityControl/ActivityControlWidget.jsx +45 -0
- package/dist/cmem/ActivityControl/ActivityExecutionErrorReportModal.d.ts +12 -0
- package/dist/cmem/ActivityControl/ActivityExecutionErrorReportModal.js +59 -0
- package/dist/cmem/ActivityControl/ActivityExecutionErrorReportModal.jsx +76 -0
- package/dist/cmem/ActivityControl/SilkActivityControl.d.ts +62 -0
- package/dist/cmem/ActivityControl/SilkActivityControl.js +219 -0
- package/dist/cmem/ActivityControl/SilkActivityControl.jsx +217 -0
- package/dist/cmem/ContentBlobToggler/ContentBlobToggler.d.ts +34 -0
- package/dist/cmem/ContentBlobToggler/ContentBlobToggler.js +56 -0
- package/dist/cmem/ContentBlobToggler/ContentBlobToggler.jsx +62 -0
- package/dist/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.d.ts +42 -0
- package/dist/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.js +52 -0
- package/dist/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.jsx +17 -0
- package/dist/cmem/DateTimeDisplay/ElapsedDateTimeDisplay.d.ts +15 -0
- package/dist/cmem/DateTimeDisplay/ElapsedDateTimeDisplay.js +80 -0
- package/dist/cmem/DateTimeDisplay/ElapsedDateTimeDisplay.jsx +77 -0
- package/dist/cmem/index.d.ts +10 -0
- package/dist/cmem/index.js +67 -0
- package/dist/cmem/markdown/Markdown.d.ts +16 -0
- package/dist/cmem/markdown/Markdown.js +75 -0
- package/dist/cmem/markdown/Markdown.jsx +87 -0
- package/dist/cmem/markdown/highlightSearchWords.js +84 -0
- package/dist/common/Intent/index.d.ts +7 -0
- package/dist/common/Intent/index.js +33 -0
- package/dist/common/utils/openInNewTab.d.ts +3 -0
- package/dist/common/utils/openInNewTab.js +22 -0
- package/dist/components/Accordion/Accordion.d.ts +3 -0
- package/dist/components/Accordion/Accordion.js +31 -0
- package/dist/components/Accordion/Accordion.jsx +21 -0
- package/dist/components/Accordion/AccordionItem.d.ts +15 -0
- package/dist/components/Accordion/AccordionItem.js +37 -0
- package/dist/components/Accordion/AccordionItem.jsx +27 -0
- package/dist/components/Application/ApplicationContainer.d.ts +6 -0
- package/dist/components/Application/ApplicationContainer.js +27 -0
- package/dist/components/Application/ApplicationContainer.jsx +20 -0
- package/dist/components/Application/ApplicationContent.d.ts +22 -0
- package/dist/components/Application/ApplicationContent.js +48 -0
- package/dist/components/Application/ApplicationContent.jsx +34 -0
- package/dist/components/Application/ApplicationHeader.d.ts +3 -0
- package/dist/components/Application/ApplicationHeader.js +29 -0
- package/dist/components/Application/ApplicationHeader.jsx +22 -0
- package/dist/components/Application/ApplicationSidebarNavigation.d.ts +12 -0
- package/dist/components/Application/ApplicationSidebarNavigation.js +36 -0
- package/dist/components/Application/ApplicationSidebarNavigation.jsx +22 -0
- package/dist/components/Application/ApplicationSidebarToggler.d.ts +3 -0
- package/dist/components/Application/ApplicationSidebarToggler.js +28 -0
- package/dist/components/Application/ApplicationSidebarToggler.jsx +19 -0
- package/dist/components/Application/ApplicationTitle.d.ts +40 -0
- package/dist/components/Application/ApplicationTitle.js +53 -0
- package/dist/components/Application/ApplicationTitle.jsx +39 -0
- package/dist/components/Application/ApplicationToolbar.d.ts +3 -0
- package/dist/components/Application/ApplicationToolbar.js +30 -0
- package/dist/components/Application/ApplicationToolbar.jsx +22 -0
- package/dist/components/Application/ApplicationToolbarAction.d.ts +3 -0
- package/dist/components/Application/ApplicationToolbarAction.js +30 -0
- package/dist/components/Application/ApplicationToolbarAction.jsx +22 -0
- package/dist/components/Application/ApplicationToolbarPanel.d.ts +3 -0
- package/dist/components/Application/ApplicationToolbarPanel.js +30 -0
- package/dist/components/Application/ApplicationToolbarPanel.jsx +22 -0
- package/dist/components/Application/ApplicationToolbarSection.d.ts +3 -0
- package/dist/components/Application/ApplicationToolbarSection.js +27 -0
- package/dist/components/Application/ApplicationToolbarSection.jsx +20 -0
- package/dist/components/AutocompleteField/AutoCompleteField.d.ts +110 -0
- package/dist/components/AutocompleteField/AutoCompleteField.js +309 -0
- package/dist/components/AutocompleteField/AutoCompleteField.jsx +295 -0
- package/dist/components/AutocompleteField/autoCompleteFieldUtils.js +42 -0
- package/dist/components/Breadcrumb/BreadcrumbItem.d.ts +5 -0
- package/dist/components/Breadcrumb/BreadcrumbItem.js +45 -0
- package/dist/components/Breadcrumb/BreadcrumbItem.jsx +30 -0
- package/dist/components/Breadcrumb/BreadcrumbList.d.ts +24 -0
- package/dist/components/Breadcrumb/BreadcrumbList.js +60 -0
- package/dist/components/Breadcrumb/BreadcrumbList.jsx +35 -0
- package/dist/components/Button/Button.d.ts +58 -0
- package/dist/components/Button/Button.js +84 -0
- package/dist/components/Button/Button.jsx +48 -0
- package/dist/components/Card/Card.d.ts +23 -0
- package/dist/components/Card/Card.js +44 -0
- package/dist/components/Card/Card.jsx +31 -0
- package/dist/components/Card/CardActions.d.ts +14 -0
- package/dist/components/Card/CardActions.js +33 -0
- package/dist/components/Card/CardActions.jsx +27 -0
- package/dist/components/Card/CardActionsAux.d.ts +9 -0
- package/dist/components/Card/CardActionsAux.js +32 -0
- package/dist/components/Card/CardActionsAux.jsx +26 -0
- package/dist/components/Card/CardContent.d.ts +9 -0
- package/dist/components/Card/CardContent.js +32 -0
- package/dist/components/Card/CardContent.jsx +25 -0
- package/dist/components/Card/CardHeader.d.ts +7 -0
- package/dist/components/Card/CardHeader.js +52 -0
- package/dist/components/Card/CardHeader.jsx +41 -0
- package/dist/components/Card/CardOptions.d.ts +11 -0
- package/dist/components/Card/CardOptions.js +35 -0
- package/dist/components/Card/CardOptions.jsx +28 -0
- package/dist/components/Card/CardTitle.d.ts +13 -0
- package/dist/components/Card/CardTitle.js +37 -0
- package/dist/components/Card/CardTitle.jsx +26 -0
- package/dist/components/Card/index.d.ts +8 -0
- package/dist/components/Card/index.js +63 -0
- package/dist/components/Card/index.jsx +8 -0
- package/dist/components/Checkbox/Checkbox.d.ts +3 -0
- package/dist/components/Checkbox/Checkbox.js +30 -0
- package/dist/components/Checkbox/Checkbox.jsx +22 -0
- package/dist/components/ContextOverlay/ContextMenu.d.ts +3 -0
- package/dist/components/ContextOverlay/ContextMenu.js +48 -0
- package/dist/components/ContextOverlay/ContextMenu.jsx +30 -0
- package/dist/components/ContextOverlay/ContextOverlay.d.ts +3 -0
- package/dist/components/ContextOverlay/ContextOverlay.js +37 -0
- package/dist/components/ContextOverlay/ContextOverlay.jsx +27 -0
- package/dist/components/Dialog/AlertDialog.d.ts +22 -0
- package/dist/components/Dialog/AlertDialog.js +56 -0
- package/dist/components/Dialog/AlertDialog.jsx +39 -0
- package/dist/components/Dialog/Modal.d.ts +25 -0
- package/dist/components/Dialog/Modal.js +67 -0
- package/dist/components/Dialog/Modal.jsx +49 -0
- package/dist/components/Dialog/SimpleDialog.d.ts +41 -0
- package/dist/components/Dialog/SimpleDialog.js +62 -0
- package/dist/components/Dialog/SimpleDialog.jsx +50 -0
- package/dist/components/Form/FieldItem.d.ts +16 -0
- package/dist/components/Form/FieldItem.js +82 -0
- package/dist/components/Form/FieldItem.jsx +48 -0
- package/dist/components/Form/FieldItemRow.d.ts +3 -0
- package/dist/components/Form/FieldItemRow.js +30 -0
- package/dist/components/Form/FieldItemRow.jsx +23 -0
- package/dist/components/Form/FieldSet.d.ts +3 -0
- package/dist/components/Form/FieldSet.js +73 -0
- package/dist/components/Form/FieldSet.jsx +49 -0
- package/dist/components/Grid/Grid.d.ts +3 -0
- package/dist/components/Grid/Grid.js +33 -0
- package/dist/components/Grid/Grid.jsx +25 -0
- package/dist/components/Grid/GridColumn.d.ts +3 -0
- package/dist/components/Grid/GridColumn.js +43 -0
- package/dist/components/Grid/GridColumn.jsx +29 -0
- package/dist/components/Grid/GridRow.d.ts +3 -0
- package/dist/components/Grid/GridRow.js +33 -0
- package/dist/components/Grid/GridRow.jsx +26 -0
- package/dist/components/Icon/Icon.d.ts +20 -0
- package/dist/components/Icon/Icon.js +91 -0
- package/dist/components/Icon/Icon.jsx +88 -0
- package/dist/components/Icon/IconButton.d.ts +17 -0
- package/dist/components/Icon/IconButton.js +49 -0
- package/dist/components/Icon/IconButton.jsx +21 -0
- package/dist/components/Icon/canonicalIconNames.d.ts +10 -0
- package/dist/components/Icon/canonicalIconNames.js +547 -0
- package/dist/components/Icon/canonicalIconNames.jsx +534 -0
- package/dist/components/Iframe/Iframe.d.ts +18 -0
- package/dist/components/Iframe/Iframe.js +92 -0
- package/dist/components/Iframe/Iframe.jsx +79 -0
- package/dist/components/Iframe/IframeModal.d.ts +12 -0
- package/dist/components/Iframe/IframeModal.js +66 -0
- package/dist/components/Iframe/IframeModal.jsx +49 -0
- package/dist/components/Label/Label.d.ts +3 -0
- package/dist/components/Label/Label.js +58 -0
- package/dist/components/Label/Label.jsx +32 -0
- package/dist/components/Link/Link.d.ts +3 -0
- package/dist/components/Link/Link.js +36 -0
- package/dist/components/Link/Link.jsx +22 -0
- package/dist/components/List/List.d.ts +17 -0
- package/dist/components/List/List.js +50 -0
- package/dist/components/List/List.jsx +44 -0
- package/dist/components/Menu/Menu.d.ts +3 -0
- package/dist/components/Menu/Menu.js +29 -0
- package/dist/components/Menu/Menu.jsx +19 -0
- package/dist/components/Menu/MenuDivider.d.ts +3 -0
- package/dist/components/Menu/MenuDivider.js +29 -0
- package/dist/components/Menu/MenuDivider.jsx +19 -0
- package/dist/components/Menu/MenuItem.d.ts +13 -0
- package/dist/components/Menu/MenuItem.js +45 -0
- package/dist/components/Menu/MenuItem.jsx +27 -0
- package/dist/components/Notification/Notification.d.ts +3 -0
- package/dist/components/Notification/Notification.js +79 -0
- package/dist/components/Notification/Notification.jsx +48 -0
- package/dist/components/Notification/Toast.d.ts +3 -0
- package/dist/components/Notification/Toast.js +31 -0
- package/dist/components/Notification/Toast.jsx +21 -0
- package/dist/components/NumericInput/NumericInput.d.ts +4 -0
- package/dist/components/NumericInput/NumericInput.js +14 -0
- package/dist/components/NumericInput/NumericInput.jsx +3 -0
- package/dist/components/OverviewItem/OverviewItem.d.ts +17 -0
- package/dist/components/OverviewItem/OverviewItem.js +45 -0
- package/dist/components/OverviewItem/OverviewItem.jsx +37 -0
- package/dist/components/OverviewItem/OverviewItemActions.d.ts +13 -0
- package/dist/components/OverviewItem/OverviewItemActions.js +32 -0
- package/dist/components/OverviewItem/OverviewItemActions.jsx +26 -0
- package/dist/components/OverviewItem/OverviewItemDepiction.d.ts +6 -0
- package/dist/components/OverviewItem/OverviewItemDepiction.js +28 -0
- package/dist/components/OverviewItem/OverviewItemDepiction.jsx +22 -0
- package/dist/components/OverviewItem/OverviewItemDescription.d.ts +3 -0
- package/dist/components/OverviewItem/OverviewItemDescription.js +27 -0
- package/dist/components/OverviewItem/OverviewItemDescription.jsx +20 -0
- package/dist/components/OverviewItem/OverviewItemLine.d.ts +19 -0
- package/dist/components/OverviewItem/OverviewItemLine.js +35 -0
- package/dist/components/OverviewItem/OverviewItemLine.jsx +29 -0
- package/dist/components/OverviewItem/OverviewItemList.d.ts +26 -0
- package/dist/components/OverviewItem/OverviewItemList.js +38 -0
- package/dist/components/OverviewItem/OverviewItemList.jsx +31 -0
- package/dist/components/OverviewItem/index.d.ts +7 -0
- package/dist/components/OverviewItem/index.js +55 -0
- package/dist/components/OverviewItem/index.jsx +7 -0
- package/dist/components/Pagination/Pagination.d.ts +17 -0
- package/dist/components/Pagination/Pagination.js +80 -0
- package/dist/components/Pagination/Pagination.jsx +81 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts +3 -0
- package/dist/components/ProgressBar/ProgressBar.js +12 -0
- package/dist/components/ProgressBar/ProgressBar.jsx +3 -0
- package/dist/components/PropertyValuePair/PropertyName.d.ts +3 -0
- package/dist/components/PropertyValuePair/PropertyName.js +32 -0
- package/dist/components/PropertyValuePair/PropertyName.jsx +21 -0
- package/dist/components/PropertyValuePair/PropertyValue.d.ts +3 -0
- package/dist/components/PropertyValuePair/PropertyValue.js +27 -0
- package/dist/components/PropertyValuePair/PropertyValue.jsx +20 -0
- package/dist/components/PropertyValuePair/PropertyValueList.d.ts +3 -0
- package/dist/components/PropertyValuePair/PropertyValueList.js +27 -0
- package/dist/components/PropertyValuePair/PropertyValueList.jsx +20 -0
- package/dist/components/PropertyValuePair/PropertyValuePair.d.ts +3 -0
- package/dist/components/PropertyValuePair/PropertyValuePair.js +29 -0
- package/dist/components/PropertyValuePair/PropertyValuePair.jsx +23 -0
- package/dist/components/PropertyValuePair/index.d.ts +5 -0
- package/dist/components/PropertyValuePair/index.js +39 -0
- package/dist/components/PropertyValuePair/index.jsx +5 -0
- package/dist/components/RadioButton/RadioButton.d.ts +3 -0
- package/dist/components/RadioButton/RadioButton.js +30 -0
- package/dist/components/RadioButton/RadioButton.jsx +22 -0
- package/dist/components/Separation/Divider.d.ts +3 -0
- package/dist/components/Separation/Divider.js +23 -0
- package/dist/components/Separation/Divider.jsx +7 -0
- package/dist/components/Separation/Spacing.d.ts +9 -0
- package/dist/components/Separation/Spacing.js +27 -0
- package/dist/components/Separation/Spacing.jsx +11 -0
- package/dist/components/SimpleTable/TableContainer.d.ts +3 -0
- package/dist/components/SimpleTable/TableContainer.js +37 -0
- package/dist/components/SimpleTable/TableContainer.jsx +27 -0
- package/dist/components/SimpleTable/index.d.ts +3 -0
- package/dist/components/SimpleTable/index.js +53 -0
- package/dist/components/SimpleTable/index.jsx +3 -0
- package/dist/components/Spinner/Spinner.d.ts +19 -0
- package/dist/components/Spinner/Spinner.js +98 -0
- package/dist/components/Spinner/Spinner.jsx +83 -0
- package/dist/components/Structure/Section.d.ts +3 -0
- package/dist/components/Structure/Section.js +27 -0
- package/dist/components/Structure/Section.jsx +20 -0
- package/dist/components/Structure/SectionHeader.d.ts +3 -0
- package/dist/components/Structure/SectionHeader.js +27 -0
- package/dist/components/Structure/SectionHeader.jsx +20 -0
- package/dist/components/Structure/TitleMainsection.d.ts +3 -0
- package/dist/components/Structure/TitleMainsection.js +35 -0
- package/dist/components/Structure/TitleMainsection.jsx +26 -0
- package/dist/components/Structure/TitlePage.d.ts +3 -0
- package/dist/components/Structure/TitlePage.js +35 -0
- package/dist/components/Structure/TitlePage.jsx +26 -0
- package/dist/components/Structure/TitleSubsection.d.ts +3 -0
- package/dist/components/Structure/TitleSubsection.js +32 -0
- package/dist/components/Structure/TitleSubsection.jsx +23 -0
- package/dist/components/Switch/Switch.d.ts +4 -0
- package/dist/components/Switch/Switch.js +39 -0
- package/dist/components/Switch/Switch.jsx +22 -0
- package/dist/components/Tabs/Tabs.d.ts +24 -0
- package/dist/components/Tabs/Tabs.js +95 -0
- package/dist/components/Tabs/Tabs.jsx +49 -0
- package/dist/components/Tag/Tag.d.ts +27 -0
- package/dist/components/Tag/Tag.js +50 -0
- package/dist/components/Tag/Tag.jsx +46 -0
- package/dist/components/Tag/TagList.d.ts +3 -0
- package/dist/components/Tag/TagList.js +44 -0
- package/dist/components/Tag/TagList.jsx +38 -0
- package/dist/components/TextField/SearchField.d.ts +23 -0
- package/dist/components/TextField/SearchField.js +54 -0
- package/dist/components/TextField/SearchField.jsx +27 -0
- package/dist/components/TextField/TextArea.d.ts +22 -0
- package/dist/components/TextField/TextArea.js +60 -0
- package/dist/components/TextField/TextArea.jsx +36 -0
- package/dist/components/TextField/TextField.d.ts +34 -0
- package/dist/components/TextField/TextField.js +73 -0
- package/dist/components/TextField/TextField.jsx +40 -0
- package/dist/components/Toolbar/Toolbar.d.ts +18 -0
- package/dist/components/Toolbar/Toolbar.js +32 -0
- package/dist/components/Toolbar/Toolbar.jsx +26 -0
- package/dist/components/Toolbar/ToolbarSection.d.ts +22 -0
- package/dist/components/Toolbar/ToolbarSection.js +34 -0
- package/dist/components/Toolbar/ToolbarSection.jsx +28 -0
- package/dist/components/Tooltip/Tooltip.d.ts +17 -0
- package/dist/components/Tooltip/Tooltip.js +40 -0
- package/dist/components/Tooltip/Tooltip.jsx +25 -0
- package/dist/components/Typography/Highlighter.d.ts +18 -0
- package/dist/components/Typography/Highlighter.js +89 -0
- package/dist/components/Typography/Highlighter.jsx +58 -0
- package/dist/components/Typography/HtmlContentBlock.d.ts +6 -0
- package/dist/components/Typography/HtmlContentBlock.js +38 -0
- package/dist/components/Typography/HtmlContentBlock.jsx +31 -0
- package/dist/components/Typography/OverflowText.d.ts +12 -0
- package/dist/components/Typography/OverflowText.js +34 -0
- package/dist/components/Typography/OverflowText.jsx +31 -0
- package/dist/components/Typography/WhiteSpaceContainer.d.ts +5 -0
- package/dist/components/Typography/WhiteSpaceContainer.js +38 -0
- package/dist/components/Typography/WhiteSpaceContainer.jsx +34 -0
- package/dist/components/Typography/classnames.d.ts +7 -0
- package/dist/components/Typography/classnames.js +24 -0
- package/dist/components/Workspace/WorkspaceContent.d.ts +3 -0
- package/dist/components/Workspace/WorkspaceContent.js +34 -0
- package/dist/components/Workspace/WorkspaceContent.jsx +25 -0
- package/dist/components/Workspace/WorkspaceHeader.d.ts +10 -0
- package/dist/components/Workspace/WorkspaceHeader.js +27 -0
- package/dist/components/Workspace/WorkspaceHeader.jsx +20 -0
- package/dist/components/Workspace/WorkspaceMain.d.ts +3 -0
- package/dist/components/Workspace/WorkspaceMain.js +30 -0
- package/dist/components/Workspace/WorkspaceMain.jsx +22 -0
- package/dist/components/Workspace/WorkspaceSide.d.ts +3 -0
- package/dist/components/Workspace/WorkspaceSide.js +34 -0
- package/dist/components/Workspace/WorkspaceSide.jsx +22 -0
- package/dist/components/interfaces.d.ts +3 -0
- package/dist/components/interfaces.js +1 -0
- package/dist/configuration/constants.d.ts +1 -0
- package/dist/configuration/constants.js +9 -0
- package/dist/extensions/react-flow/edges/EdgeDefault.d.ts +10 -0
- package/dist/extensions/react-flow/edges/EdgeDefault.js +62 -0
- package/dist/extensions/react-flow/edges/EdgeDefault.jsx +45 -0
- package/dist/extensions/react-flow/edges/EdgeStep.d.ts +9 -0
- package/dist/extensions/react-flow/edges/EdgeStep.js +27 -0
- package/dist/extensions/react-flow/edges/EdgeStep.jsx +6 -0
- package/dist/extensions/react-flow/edges/EdgeTools.d.ts +12 -0
- package/dist/extensions/react-flow/edges/EdgeTools.js +48 -0
- package/dist/extensions/react-flow/edges/EdgeTools.jsx +32 -0
- package/dist/extensions/react-flow/edges/edgeTypes.d.ts +15 -0
- package/dist/extensions/react-flow/edges/edgeTypes.js +32 -0
- package/dist/extensions/react-flow/edges/utils.d.ts +4 -0
- package/dist/extensions/react-flow/edges/utils.js +41 -0
- package/dist/extensions/react-flow/handles/HandleContent.d.ts +6 -0
- package/dist/extensions/react-flow/handles/HandleContent.js +40 -0
- package/dist/extensions/react-flow/handles/HandleContent.jsx +15 -0
- package/dist/extensions/react-flow/handles/HandleDefault.d.ts +9 -0
- package/dist/extensions/react-flow/handles/HandleDefault.js +33 -0
- package/dist/extensions/react-flow/handles/HandleDefault.jsx +23 -0
- package/dist/extensions/react-flow/index.d.ts +14 -0
- package/dist/extensions/react-flow/index.js +83 -0
- package/dist/extensions/react-flow/minimap/MiniMap.d.ts +8 -0
- package/dist/extensions/react-flow/minimap/MiniMap.js +111 -0
- package/dist/extensions/react-flow/minimap/MiniMap.jsx +83 -0
- package/dist/extensions/react-flow/minimap/utils.d.ts +2 -0
- package/dist/extensions/react-flow/minimap/utils.js +29 -0
- package/dist/extensions/react-flow/nodes/NodeContentExtension.js +56 -0
- package/dist/extensions/react-flow/nodes/NodeDefault.d.ts +133 -0
- package/dist/extensions/react-flow/nodes/NodeDefault.js +223 -0
- package/dist/extensions/react-flow/nodes/NodeDefault.jsx +175 -0
- package/dist/extensions/react-flow/nodes/NodeTools.d.ts +9 -0
- package/dist/extensions/react-flow/nodes/NodeTools.js +58 -0
- package/dist/extensions/react-flow/nodes/NodeTools.jsx +46 -0
- package/dist/extensions/react-flow/nodes/nodeTypes.d.ts +13 -0
- package/dist/extensions/react-flow/nodes/nodeTypes.js +22 -0
- package/dist/index.d.ts +92 -0
- package/dist/index.js +876 -0
- package/dist/legacy-replacements/Button/AffirmativeButton.js +23 -0
- package/dist/legacy-replacements/Button/Button.js +91 -0
- package/dist/legacy-replacements/Button/DismissiveButton.js +23 -0
- package/dist/legacy-replacements/Button/DisruptiveButton.js +23 -0
- package/dist/legacy-replacements/Checkbox/Checkbox.js +66 -0
- package/dist/legacy-replacements/Radio/RadioButton.js +48 -0
- package/dist/legacy-replacements/TextField/TextField.js +96 -0
- package/package.json +151 -71
- package/src/_shame.scss +111 -0
- package/src/cmem/ActivityControl/ActivityControlTypes.ts +28 -0
- package/src/cmem/ActivityControl/ActivityControlWidget.tsx +165 -0
- package/src/cmem/ActivityControl/ActivityExecutionErrorReportModal.tsx +55 -0
- package/src/cmem/ActivityControl/SilkActivityControl.tsx +303 -0
- package/src/cmem/ActivityControl/activitycontrol.scss +27 -0
- package/src/cmem/ContentBlobToggler/ContentBlobToggler.tsx +95 -0
- package/src/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.tsx +76 -0
- package/src/cmem/DateTimeDisplay/ElapsedDateTimeDisplay.tsx +69 -0
- package/src/cmem/DateTimeDisplay/tests/ElapsedDateTimeDisplay.test.tsx +29 -0
- package/src/cmem/_index.scss +2 -0
- package/src/cmem/index.ts +35 -0
- package/src/cmem/markdown/Markdown.tsx +89 -0
- package/src/cmem/markdown/highlightSearchWords.test.ts +36 -0
- package/src/cmem/markdown/highlightSearchWords.ts +67 -0
- package/src/cmem/markdown/markdown.scss +32 -0
- package/src/common/Intent/index.ts +23 -0
- package/src/common/utils/openInNewTab.ts +17 -0
- package/src/components/Accordion/Accordion.tsx +13 -0
- package/src/components/Accordion/AccordionItem.tsx +73 -0
- package/src/components/Accordion/accordion.scss +96 -0
- package/src/components/Application/ApplicationContainer.tsx +21 -0
- package/src/components/Application/ApplicationContent.tsx +57 -0
- package/src/components/Application/ApplicationHeader.tsx +14 -0
- package/src/components/Application/ApplicationSidebarNavigation.tsx +39 -0
- package/src/components/Application/ApplicationSidebarToggler.tsx +15 -0
- package/src/components/Application/ApplicationTitle.tsx +95 -0
- package/src/components/Application/ApplicationToolbar.tsx +17 -0
- package/src/components/Application/ApplicationToolbarAction.tsx +17 -0
- package/src/components/Application/ApplicationToolbarPanel.tsx +17 -0
- package/src/components/Application/ApplicationToolbarSection.tsx +15 -0
- package/src/components/Application/_config.scss +40 -0
- package/src/components/Application/_content.scss +27 -0
- package/src/components/Application/_header.scss +237 -0
- package/src/components/Application/_sidebar.scss +37 -0
- package/src/components/Application/_toolbar.scss +75 -0
- package/src/components/Application/application.scss +9 -0
- package/src/components/AutocompleteField/AutoCompleteField.tsx +399 -0
- package/src/components/AutocompleteField/autoCompleteFieldUtils.tsx +32 -0
- package/src/components/AutocompleteField/autocompletefield.scss +6 -0
- package/src/components/Breadcrumb/BreadcrumbItem.tsx +46 -0
- package/src/components/Breadcrumb/BreadcrumbList.tsx +81 -0
- package/src/components/Breadcrumb/breadcrumb.scss +47 -0
- package/src/components/Button/Button.stories.tsx +199 -0
- package/src/components/Button/Button.test.tsx +37 -0
- package/src/components/Button/Button.tsx +127 -0
- package/src/components/Button/button.scss +55 -0
- package/src/components/Card/Card.tsx +58 -0
- package/src/components/Card/CardActions.tsx +36 -0
- package/src/components/Card/CardActionsAux.tsx +29 -0
- package/src/components/Card/CardContent.tsx +26 -0
- package/src/components/Card/CardHeader.tsx +44 -0
- package/src/components/Card/CardOptions.tsx +32 -0
- package/src/components/Card/CardTitle.tsx +32 -0
- package/src/components/Card/card.scss +138 -0
- package/src/components/Card/index.tsx +17 -0
- package/src/components/Card/stories/Card.stories.tsx +82 -0
- package/src/components/Card/stories/CardActions.stories.tsx +41 -0
- package/src/components/Card/stories/CardContent.stories.tsx +28 -0
- package/src/components/Card/stories/CardHeader.stories.tsx +38 -0
- package/src/components/Card/stories/CardOptions.stories.tsx +27 -0
- package/src/components/Card/stories/CardTitle.stories.tsx +27 -0
- package/src/components/Checkbox/Checkbox.tsx +20 -0
- package/src/components/Checkbox/checkbox.scss +61 -0
- package/src/components/ContextOverlay/ContextMenu.tsx +36 -0
- package/src/components/ContextOverlay/ContextOverlay.tsx +29 -0
- package/src/components/ContextOverlay/contextoverlay.scss +15 -0
- package/src/components/Dialog/AlertDialog.tsx +52 -0
- package/src/components/Dialog/Modal.tsx +86 -0
- package/src/components/Dialog/SimpleDialog.tsx +113 -0
- package/src/components/Dialog/dialog.scss +75 -0
- package/src/components/Dialog/stories/AlertDialog.stories.tsx +42 -0
- package/src/components/Dialog/stories/Modal.stories.tsx +88 -0
- package/src/components/Dialog/stories/SimpleDialog.stories.tsx +39 -0
- package/src/components/Form/FieldItem.tsx +95 -0
- package/src/components/Form/FieldItemRow.tsx +14 -0
- package/src/components/Form/FieldSet.tsx +71 -0
- package/src/components/Form/form.scss +159 -0
- package/src/components/Grid/Grid.tsx +29 -0
- package/src/components/Grid/GridColumn.tsx +33 -0
- package/src/components/Grid/GridRow.tsx +30 -0
- package/src/components/Grid/grid.scss +89 -0
- package/src/components/Icon/Icon.tsx +96 -0
- package/src/components/Icon/IconButton.tsx +59 -0
- package/src/components/Icon/canonicalIconNames.json +120 -0
- package/src/components/Icon/canonicalIconNames.tsx +661 -0
- package/src/components/Icon/icon.scss +40 -0
- package/src/components/Iframe/Iframe.tsx +89 -0
- package/src/components/Iframe/IframeModal.tsx +77 -0
- package/src/components/Iframe/iframe.scss +49 -0
- package/src/components/Label/Label.tsx +43 -0
- package/src/components/Label/label.scss +75 -0
- package/src/components/Link/Link.tsx +19 -0
- package/src/components/Link/link.scss +6 -0
- package/src/components/List/List.tsx +46 -0
- package/src/components/Menu/Menu.tsx +9 -0
- package/src/components/Menu/MenuDivider.tsx +9 -0
- package/src/components/Menu/MenuItem.tsx +46 -0
- package/src/components/Menu/menu.scss +79 -0
- package/src/components/Notification/Notification.tsx +69 -0
- package/src/components/Notification/Toast.tsx +17 -0
- package/src/components/Notification/notification.scss +83 -0
- package/src/components/NumericInput/NumericInput.tsx +4 -0
- package/src/components/OverviewItem/OverviewItem.tsx +61 -0
- package/src/components/OverviewItem/OverviewItemActions.tsx +35 -0
- package/src/components/OverviewItem/OverviewItemDepiction.tsx +29 -0
- package/src/components/OverviewItem/OverviewItemDescription.tsx +16 -0
- package/src/components/OverviewItem/OverviewItemLine.tsx +43 -0
- package/src/components/OverviewItem/OverviewItemList.tsx +58 -0
- package/src/components/OverviewItem/index.tsx +15 -0
- package/src/components/OverviewItem/overviewitem.scss +193 -0
- package/src/components/OverviewItem/stories/OverviewItem.stories.tsx +56 -0
- package/src/components/OverviewItem/stories/OverviewItemActions.stories.tsx +31 -0
- package/src/components/OverviewItem/stories/OverviewItemDepiction.stories.tsx +26 -0
- package/src/components/OverviewItem/stories/OverviewItemDescription.stories.tsx +32 -0
- package/src/components/OverviewItem/stories/OverviewItemLine.stories.tsx +25 -0
- package/src/components/OverviewItem/stories/OverviewItemList.stories.tsx +41 -0
- package/src/components/Pagination/Pagination.tsx +80 -0
- package/src/components/Pagination/pagination.scss +47 -0
- package/src/components/ProgressBar/ProgressBar.tsx +8 -0
- package/src/components/PropertyValuePair/PropertyName.tsx +13 -0
- package/src/components/PropertyValuePair/PropertyValue.tsx +12 -0
- package/src/components/PropertyValuePair/PropertyValueList.tsx +12 -0
- package/src/components/PropertyValuePair/PropertyValuePair.tsx +20 -0
- package/src/components/PropertyValuePair/index.tsx +6 -0
- package/src/components/PropertyValuePair/propertyvalue.scss +56 -0
- package/src/components/RadioButton/RadioButton.tsx +20 -0
- package/src/components/RadioButton/radiobutton.scss +29 -0
- package/src/components/Separation/Divider.tsx +8 -0
- package/src/components/Separation/Spacing.tsx +25 -0
- package/src/components/Separation/separation.scss +77 -0
- package/src/components/SimpleTable/TableContainer.tsx +20 -0
- package/src/components/SimpleTable/index.tsx +4 -0
- package/src/components/SimpleTable/simpletable.scss +121 -0
- package/src/components/Spinner/Spinner.tsx +113 -0
- package/src/components/Spinner/spinner.scss +85 -0
- package/src/components/Structure/Section.tsx +15 -0
- package/src/components/Structure/SectionHeader.tsx +15 -0
- package/src/components/Structure/TitleMainsection.tsx +29 -0
- package/src/components/Structure/TitlePage.tsx +29 -0
- package/src/components/Structure/TitleSubsection.tsx +16 -0
- package/src/components/Structure/_titles.scss +56 -0
- package/src/components/Switch/Switch.tsx +17 -0
- package/src/components/Switch/switch.scss +4 -0
- package/src/components/Tabs/Tabs.tsx +121 -0
- package/src/components/Tabs/tabs.scss +65 -0
- package/src/components/Tag/Tag.stories.tsx +41 -0
- package/src/components/Tag/Tag.tsx +84 -0
- package/src/components/Tag/TagList.tsx +51 -0
- package/src/components/Tag/tag.scss +132 -0
- package/src/components/TagInput/taginput.scss +1 -0
- package/src/components/TextField/SearchField.tsx +71 -0
- package/src/components/TextField/TextArea.tsx +66 -0
- package/src/components/TextField/TextField.tsx +96 -0
- package/src/components/TextField/stories/SearchField.stories.tsx +40 -0
- package/src/components/TextField/stories/TextArea.stories.tsx +39 -0
- package/src/components/TextField/stories/TextField.stories.tsx +99 -0
- package/src/components/TextField/textfield.scss +63 -0
- package/src/components/Toolbar/Toolbar.stories.tsx +41 -0
- package/src/components/Toolbar/Toolbar.tsx +42 -0
- package/src/components/Toolbar/ToolbarSection.tsx +48 -0
- package/src/components/Toolbar/toolbar.scss +52 -0
- package/src/components/Tooltip/Tooltip.tsx +53 -0
- package/src/components/Tooltip/tooltip.scss +37 -0
- package/src/components/Typography/Highlighter.tsx +70 -0
- package/src/components/Typography/HtmlContentBlock.tsx +30 -0
- package/src/components/Typography/OverflowText.tsx +46 -0
- package/src/components/Typography/WhiteSpaceContainer.tsx +41 -0
- package/src/components/Typography/_reset.scss +36 -0
- package/src/components/Typography/classnames.ts +10 -0
- package/src/components/Typography/typography.scss +282 -0
- package/src/components/Workspace/WorkspaceContent.tsx +22 -0
- package/src/components/Workspace/WorkspaceHeader.tsx +20 -0
- package/src/components/Workspace/WorkspaceMain.tsx +14 -0
- package/src/components/Workspace/WorkspaceSide.tsx +18 -0
- package/src/components/Workspace/_header.scss +9 -0
- package/src/components/Workspace/workspace.scss +1 -0
- package/src/components/interfaces.ts +3 -0
- package/src/configuration/_variables.scss +130 -0
- package/src/configuration/constants.ts +2 -0
- package/src/extensions/_index.scss +1 -0
- package/src/extensions/react-flow/_config.scss +16 -0
- package/src/extensions/react-flow/_react-flow.scss +5 -0
- package/src/extensions/react-flow/edges/EdgeDefault.tsx +77 -0
- package/src/extensions/react-flow/edges/EdgeStep.tsx +19 -0
- package/src/extensions/react-flow/edges/EdgeTools.tsx +39 -0
- package/src/extensions/react-flow/edges/_edges.scss +181 -0
- package/src/extensions/react-flow/edges/edgeTypes.ts +24 -0
- package/src/extensions/react-flow/edges/utils.ts +32 -0
- package/src/extensions/react-flow/handles/HandleContent.tsx +39 -0
- package/src/extensions/react-flow/handles/HandleDefault.tsx +29 -0
- package/src/extensions/react-flow/handles/_handles.scss +208 -0
- package/src/extensions/react-flow/index.ts +15 -0
- package/src/extensions/react-flow/minimap/MiniMap.tsx +110 -0
- package/src/extensions/react-flow/minimap/_minimap.scss +79 -0
- package/src/extensions/react-flow/minimap/utils.ts +13 -0
- package/src/extensions/react-flow/nodes/NodeContent.stories.tsx +83 -0
- package/src/extensions/react-flow/nodes/NodeContentExtension.stories.tsx +36 -0
- package/src/extensions/react-flow/nodes/NodeContentExtension.tsx +87 -0
- package/src/extensions/react-flow/nodes/NodeDefault.stories.tsx +138 -0
- package/src/extensions/react-flow/nodes/NodeDefault.tsx +376 -0
- package/src/extensions/react-flow/nodes/NodeTools.tsx +48 -0
- package/src/extensions/react-flow/nodes/_nodes.scss +490 -0
- package/src/extensions/react-flow/nodes/nodeTypes.ts +14 -0
- package/src/includes/blueprintjs/_variables.scss +195 -0
- package/src/includes/carbon-components/_variables.scss +107 -0
- package/src/index.scss +190 -0
- package/src/index.ts +238 -0
- package/src/legacy-replacements/Button/AffirmativeButton.tsx +16 -0
- package/src/legacy-replacements/Button/Button.tsx +73 -0
- package/src/legacy-replacements/Button/DismissiveButton.tsx +16 -0
- package/src/legacy-replacements/Button/DisruptiveButton.tsx +16 -0
- package/src/legacy-replacements/Checkbox/Checkbox.tsx +54 -0
- package/src/legacy-replacements/Radio/RadioButton.tsx +38 -0
- package/src/legacy-replacements/TextField/TextField.tsx +90 -0
- package/src/test/setupTests.js +2 -0
- package/.cached-fonts +0 -1
- package/Ruleset.md +0 -93
- package/additionalLicenses.yml +0 -21
- package/buildConfig.js +0 -25
- package/dist/fonts/iconfont/MaterialIcons-Regular.woff +0 -0
- package/dist/fonts/iconfont/MaterialIcons-Regular.woff2 +0 -0
- package/dist/fonts/iconfont/codepoints +0 -932
- package/dist/fonts/roboto/Black/Roboto-Black.woff +0 -0
- package/dist/fonts/roboto/Black/Roboto-Black.woff2 +0 -0
- package/dist/fonts/roboto/BlackItalic/Roboto-BlackItalic.woff +0 -0
- package/dist/fonts/roboto/BlackItalic/Roboto-BlackItalic.woff2 +0 -0
- package/dist/fonts/roboto/Bold/Roboto-Bold.woff +0 -0
- package/dist/fonts/roboto/Bold/Roboto-Bold.woff2 +0 -0
- package/dist/fonts/roboto/BoldItalic/Roboto-BoldItalic.woff +0 -0
- package/dist/fonts/roboto/BoldItalic/Roboto-BoldItalic.woff2 +0 -0
- package/dist/fonts/roboto/Italic/Roboto-Italic.woff +0 -0
- package/dist/fonts/roboto/Italic/Roboto-Italic.woff2 +0 -0
- package/dist/fonts/roboto/Light/Roboto-Light.woff +0 -0
- package/dist/fonts/roboto/Light/Roboto-Light.woff2 +0 -0
- package/dist/fonts/roboto/LightItalic/Roboto-LightItalic.woff +0 -0
- package/dist/fonts/roboto/LightItalic/Roboto-LightItalic.woff2 +0 -0
- package/dist/fonts/roboto/Medium/Roboto-Medium.woff +0 -0
- package/dist/fonts/roboto/Medium/Roboto-Medium.woff2 +0 -0
- package/dist/fonts/roboto/MediumItalic/Roboto-MediumItalic.woff +0 -0
- package/dist/fonts/roboto/MediumItalic/Roboto-MediumItalic.woff2 +0 -0
- package/dist/fonts/roboto/Regular/Roboto-Regular.woff +0 -0
- package/dist/fonts/roboto/Regular/Roboto-Regular.woff2 +0 -0
- package/dist/fonts/roboto/Thin/Roboto-Thin.woff +0 -0
- package/dist/fonts/roboto/Thin/Roboto-Thin.woff2 +0 -0
- package/dist/fonts/roboto/ThinItalic/Roboto-ThinItalic.woff +0 -0
- package/dist/fonts/roboto/ThinItalic/Roboto-ThinItalic.woff2 +0 -0
- package/docs/README.md +0 -951
- package/docs/docTemplate.md +0 -140
- package/es5/component.js +0 -6653
- package/index.js +0 -136
- package/jest.config.js +0 -42
- package/src/_configuration.default.scss +0 -97
- package/src/_configuration.mdl.scss +0 -518
- package/src/elements/Alert/Alert.jsx +0 -141
- package/src/elements/Alert/Error.jsx +0 -22
- package/src/elements/Alert/Info.jsx +0 -21
- package/src/elements/Alert/Success.jsx +0 -20
- package/src/elements/Alert/Warning.jsx +0 -19
- package/src/elements/Alert/_alert.scss +0 -93
- package/src/elements/Alert/index.js +0 -13
- package/src/elements/AutoCompleteBox/AutoCompleteBox.jsx +0 -149
- package/src/elements/AutoCompleteBox/_autocomplete.scss +0 -33
- package/src/elements/Breadcrumbs/BreadcrumbItem.jsx +0 -34
- package/src/elements/Breadcrumbs/BreadcrumbList.jsx +0 -56
- package/src/elements/Breadcrumbs/_breadcrumbs.scss +0 -47
- package/src/elements/Breadcrumbs/index.js +0 -7
- package/src/elements/Button/AffirmativeButton.jsx +0 -73
- package/src/elements/Button/Button.jsx +0 -216
- package/src/elements/Button/DismissiveButton.jsx +0 -77
- package/src/elements/Button/DisruptiveButton.jsx +0 -74
- package/src/elements/Button/ProgressButton.jsx +0 -95
- package/src/elements/Button/_button.scss +0 -61
- package/src/elements/Button/index.js +0 -13
- package/src/elements/Card/Card.jsx +0 -61
- package/src/elements/Card/CardActions.jsx +0 -37
- package/src/elements/Card/CardTitle.jsx +0 -78
- package/src/elements/Card/FloatingActionList.jsx +0 -260
- package/src/elements/Card/_card.scss +0 -179
- package/src/elements/Card/index.js +0 -18
- package/src/elements/Checkbox/Checkbox.jsx +0 -113
- package/src/elements/Checkbox/_checkbox.scss +0 -14
- package/src/elements/Chip/Chip.jsx +0 -118
- package/src/elements/Chip/ChipVisual.jsx +0 -88
- package/src/elements/Chip/_chip.scss +0 -49
- package/src/elements/Chip/index.js +0 -7
- package/src/elements/ContextMenu/ContextMenu.jsx +0 -101
- package/src/elements/ContextMenu/_contextmenu.scss +0 -23
- package/src/elements/DateField/DateField.jsx +0 -178
- package/src/elements/DateField/DateTimefield.jsx +0 -20
- package/src/elements/DateField/_datefield.scss +0 -116
- package/src/elements/DateField/index.js +0 -7
- package/src/elements/Dialog/BaseDialog.jsx +0 -161
- package/src/elements/Dialog/ConfirmationDialog.jsx +0 -48
- package/src/elements/Dialog/_dialog.scss +0 -58
- package/src/elements/Dialog/index.js +0 -7
- package/src/elements/Footer/Footer.jsx +0 -171
- package/src/elements/Footer/_footer.scss +0 -17
- package/src/elements/Grid/_grid.scss +0 -18
- package/src/elements/Icon/Icon.jsx +0 -97
- package/src/elements/Icon/canonicalicons.json +0 -32
- package/src/elements/Icon/canonicaltooltips.json +0 -32
- package/src/elements/Icon/icontable.json +0 -934
- package/src/elements/Layout/_layout.scss +0 -82
- package/src/elements/NotAvailable/NotAvailable.jsx +0 -87
- package/src/elements/NotAvailable/_notavailable.scss +0 -18
- package/src/elements/Pagination/Pagination.jsx +0 -414
- package/src/elements/Pagination/_pagination.scss +0 -98
- package/src/elements/Progressbar/Progressbar.jsx +0 -34
- package/src/elements/Progressbar/_progressbar.scss +0 -22
- package/src/elements/Radio/RadioButton.jsx +0 -129
- package/src/elements/Radio/RadioGroup.jsx +0 -35
- package/src/elements/Radio/_radio.scss +0 -46
- package/src/elements/Radio/index.js +0 -7
- package/src/elements/SelectBox/SelectBox.jsx +0 -321
- package/src/elements/SelectBox/_selectbox.scss +0 -144
- package/src/elements/Spinner/Spinner.jsx +0 -44
- package/src/elements/Spinner/_spinner.scss +0 -20
- package/src/elements/Switch/Switch.jsx +0 -38
- package/src/elements/Table/Table.jsx +0 -100
- package/src/elements/Table/TableBody.jsx +0 -66
- package/src/elements/Table/TableCell.jsx +0 -94
- package/src/elements/Table/TableHead.jsx +0 -66
- package/src/elements/Table/TableRow.jsx +0 -78
- package/src/elements/Table/_datatable.scss +0 -78
- package/src/elements/Table/_table.scss +0 -143
- package/src/elements/Tabs/Tabs.jsx +0 -116
- package/src/elements/TextField/TextField.jsx +0 -172
- package/src/elements/TextField/_textfield.scss +0 -80
- package/src/elements/Tooltip/Tooltip.jsx +0 -3
- package/src/elements/Tooltip/_tooltip.scss +0 -21
- package/src/elements/Version/Version.jsx +0 -19
- package/src/hocs/ScrollingHOC.js +0 -122
- package/src/main.scss +0 -83
- package/src/scss/_adjustments.scss +0 -16
- package/src/scss/_helpers.scss +0 -29
- package/src/scss/_iconfont.scss +0 -35
- package/src/scss/_patches.scss +0 -19
- package/src/scss/_roboto.scss +0 -30
- package/src/scss/main.build-css.scss +0 -4
- package/src/utils/classnameSeperator.js +0 -10
- package/src/utils/extendedOnChangeBoolean.jsx +0 -14
- package/src/utils/uniqueId.jsx +0 -36
- package/style/test.scss +0 -30
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
import React, {useEffect, useRef, useState} from "react";
|
|
2
|
+
import {HTMLInputProps, IInputGroupProps, InputGroupProps, IPopoverProps, IRefObject} from "@blueprintjs/core";
|
|
3
|
+
import {Suggest} from "@blueprintjs/select";
|
|
4
|
+
import {Highlighter, IconButton, Menu, MenuItem, OverflowText, Spinner} from "../../index";
|
|
5
|
+
import {CLASSPREFIX as eccgui} from "../../configuration/constants";
|
|
6
|
+
|
|
7
|
+
type SearchFunction<T extends any> = (value: string) => T[];
|
|
8
|
+
type AsyncSearchFunction<T extends any> = (value: string) => Promise<T[]>;
|
|
9
|
+
|
|
10
|
+
export interface IRenderModifiers {
|
|
11
|
+
active: boolean
|
|
12
|
+
disabled?: boolean
|
|
13
|
+
// The width styles that should be given to the rendered option items
|
|
14
|
+
styleWidth: IElementWidth
|
|
15
|
+
highlightingEnabled: boolean
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Parameters for the auto-complete field parameterized by T and U.
|
|
19
|
+
* @param T is the input data structure/type of the items that can be selected.
|
|
20
|
+
* @param U is the output data structure/type that is output on changes of the selected item, i.e. it may get converted first
|
|
21
|
+
* before onChange is called.
|
|
22
|
+
*/
|
|
23
|
+
export interface IAutoCompleteFieldProps<T extends any, U extends any> {
|
|
24
|
+
/**
|
|
25
|
+
* Fired when text is typed into the input field. Returns a list of items of type T.
|
|
26
|
+
*/
|
|
27
|
+
onSearch: SearchFunction<T> | AsyncSearchFunction<T>;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Fired when value selected from input
|
|
31
|
+
* @param value The value that has been converted with itemValueSelector.
|
|
32
|
+
* @param e The event
|
|
33
|
+
*/
|
|
34
|
+
onChange?(value: U, e?: React.SyntheticEvent<HTMLElement>): any;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The initial value for the auto-complete input field
|
|
38
|
+
*/
|
|
39
|
+
initialValue?: T;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Returns the UI representation of the selectable items.
|
|
43
|
+
* If the return value is a string, a default render component will be displayed with search highlighting.
|
|
44
|
+
*
|
|
45
|
+
* @param item The item that should be displayed as an option in the select list.
|
|
46
|
+
* @param query The current search query
|
|
47
|
+
* @param modifiers Modifiers for rendered elements, e.g. active, disabled.
|
|
48
|
+
* @param handleClick The function that needs to be called when the rendered item gets clicked. Else a selection
|
|
49
|
+
* via mouse is not possible. This only needs to be used when returning a JSX.Element.
|
|
50
|
+
*/
|
|
51
|
+
itemRenderer(item: T, query: string, modifiers: IRenderModifiers, handleClick: () => any): string | JSX.Element;
|
|
52
|
+
|
|
53
|
+
/** Renders the string that should be displayed in the input field after the item has been selected.
|
|
54
|
+
*/
|
|
55
|
+
itemValueRenderer(item: T): string;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Selects the part from the auto-completion item that is called with the onChange callback.
|
|
59
|
+
* @param item The selected item that should be converted to the value that onChange is called with.
|
|
60
|
+
*/
|
|
61
|
+
itemValueSelector(item: T): U;
|
|
62
|
+
|
|
63
|
+
/** The text that should be displayed when no search result has been found and no custom entry can be created. */
|
|
64
|
+
noResultText: string
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Props to spread to the underlying input field. This is BlueprintJs specific. To control this input, use
|
|
68
|
+
* `query` and `onQueryChange` instead of `inputProps.value` and
|
|
69
|
+
* `inputProps.onChange`.
|
|
70
|
+
*/
|
|
71
|
+
inputProps?: IInputGroupProps & HTMLInputProps;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Optional props of the BlueprintJs specific popover element.
|
|
75
|
+
*/
|
|
76
|
+
popoverProps?: Partial<IPopoverProps>
|
|
77
|
+
|
|
78
|
+
/** Defines if a value can be reset, i.e. a reset icon is shown and the value is set to a specific value.
|
|
79
|
+
* When undefined, a value cannot be reset.
|
|
80
|
+
*/
|
|
81
|
+
reset?: {
|
|
82
|
+
/** Returns true if the currently set value can be reset, i.e. set to the resetValue. The reset icon is only
|
|
83
|
+
* shown if true is returned. */
|
|
84
|
+
resettableValue(value: T): boolean;
|
|
85
|
+
|
|
86
|
+
/** The value onChange is called with when a reset action is triggered. */
|
|
87
|
+
resetValue: U;
|
|
88
|
+
|
|
89
|
+
/** The reset button text that is shown on hovering over the reset icon. */
|
|
90
|
+
resetButtonText: string
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
/** If enabled the auto completion component will auto focus. */
|
|
94
|
+
autoFocus?: boolean;
|
|
95
|
+
|
|
96
|
+
/** Contains methods for new item creation. If undefined no new, custom items can be created. */
|
|
97
|
+
createNewItem?: {
|
|
98
|
+
/** Creates a new item from the query. */
|
|
99
|
+
itemFromQuery: (query: string) => T;
|
|
100
|
+
|
|
101
|
+
/** Renders how the option to newly create an item should look like in the selection list. */
|
|
102
|
+
itemRenderer: (
|
|
103
|
+
query: string,
|
|
104
|
+
modifiers: IRenderModifiers,
|
|
105
|
+
handleClick: React.MouseEventHandler<HTMLElement>
|
|
106
|
+
) => JSX.Element | undefined;
|
|
107
|
+
|
|
108
|
+
/** If the new item option will always be shown as the first entry in the suggestion list, else it will be the last entry.
|
|
109
|
+
* @default false
|
|
110
|
+
*/
|
|
111
|
+
showNewItemOptionFirst?: boolean
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
/** If true the input field will be disabled. */
|
|
115
|
+
disabled?: boolean;
|
|
116
|
+
|
|
117
|
+
/** The value to which the search query should be reset after the popover closes.
|
|
118
|
+
* By default the query is reset to the result of itemValueRenderer(selectedValue).
|
|
119
|
+
*
|
|
120
|
+
* @param selectedValue The currently selected value.
|
|
121
|
+
*/
|
|
122
|
+
resetQueryToValue?(selectedValue: T): string
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
AutoCompleteField.defaultProps = {
|
|
126
|
+
autoFocus: false,
|
|
127
|
+
disabled: false,
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
/** Style object to be used in menu option items. */
|
|
131
|
+
export interface IElementWidth {
|
|
132
|
+
width: string
|
|
133
|
+
maxWidth: string
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/** Hook that returns the element width of the given ref.*/
|
|
137
|
+
const elementWidth = (elRef: IRefObject<HTMLInputElement> | null): IElementWidth => {
|
|
138
|
+
if(elRef && elRef.current) {
|
|
139
|
+
return { width: elRef.current.offsetWidth + "px", maxWidth: "90vw" }
|
|
140
|
+
} else {
|
|
141
|
+
return { width: "40rem", maxWidth: "90vw" }
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/** Auto-complete input widget. */
|
|
146
|
+
export function AutoCompleteField<T extends any, U extends any>(props: IAutoCompleteFieldProps<T, U>) {
|
|
147
|
+
const {
|
|
148
|
+
reset,
|
|
149
|
+
noResultText,
|
|
150
|
+
disabled,
|
|
151
|
+
itemValueSelector,
|
|
152
|
+
itemRenderer,
|
|
153
|
+
onSearch,
|
|
154
|
+
onChange,
|
|
155
|
+
initialValue,
|
|
156
|
+
autoFocus,
|
|
157
|
+
createNewItem,
|
|
158
|
+
itemValueRenderer,
|
|
159
|
+
resetQueryToValue,
|
|
160
|
+
...otherProps
|
|
161
|
+
} = props;
|
|
162
|
+
const [selectedItem, setSelectedItem] = useState<T | undefined>(initialValue);
|
|
163
|
+
// If the selection list elements are currently fetched from the backend
|
|
164
|
+
const [listLoading, setListLoading] = useState<boolean>(false);
|
|
165
|
+
|
|
166
|
+
const [query, setQuery] = useState<string>("");
|
|
167
|
+
const [hasFocus, setHasFocus] = useState<boolean>(false);
|
|
168
|
+
const [highlightingEnabled, setHighlightingEnabled] = useState<boolean>(true);
|
|
169
|
+
|
|
170
|
+
// The suggestions that match the user's input
|
|
171
|
+
const [filtered, setFiltered] = useState<T[]>([]);
|
|
172
|
+
|
|
173
|
+
const SuggestAutocomplete = Suggest.ofType<T>();
|
|
174
|
+
|
|
175
|
+
// Sets the query to the item value if it has a valid string value
|
|
176
|
+
const setQueryToSelectedValue = (item?: T) => {
|
|
177
|
+
if (item) {
|
|
178
|
+
// If new values can be created, always reset the query value to the actual value of the selected item.
|
|
179
|
+
// This e.g. prevents that the "create new" option will be shown, since an item with the same value already exists.
|
|
180
|
+
const defaultResetValue: string = createNewItem && typeof itemValueSelector(item) === "string" ? (
|
|
181
|
+
itemValueSelector(item) as string
|
|
182
|
+
) : itemValueRenderer(item)
|
|
183
|
+
const resetVal = resetQueryToValue ? resetQueryToValue(item) : defaultResetValue
|
|
184
|
+
setQuery(resetVal)
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
const fieldRef = useRef(null)
|
|
189
|
+
|
|
190
|
+
// The key for the option elements
|
|
191
|
+
const itemKey = (item: T): string => {
|
|
192
|
+
let itemValue: U | string = itemValueSelector(item);
|
|
193
|
+
if (typeof itemValue !== "string") {
|
|
194
|
+
itemValue = itemValueRenderer(item);
|
|
195
|
+
}
|
|
196
|
+
return itemValue;
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
useEffect(() => {
|
|
200
|
+
setQueryToSelectedValue(selectedItem);
|
|
201
|
+
},
|
|
202
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
203
|
+
[selectedItem]
|
|
204
|
+
);
|
|
205
|
+
|
|
206
|
+
useEffect(() => {
|
|
207
|
+
if (!disabled && hasFocus) {
|
|
208
|
+
setListLoading(true);
|
|
209
|
+
const timeout: number = window.setTimeout(async () => {
|
|
210
|
+
fetchQueryResults(query);
|
|
211
|
+
}, 200);
|
|
212
|
+
return () => {
|
|
213
|
+
clearTimeout(timeout);
|
|
214
|
+
setListLoading(false);
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
219
|
+
[hasFocus, query]
|
|
220
|
+
);
|
|
221
|
+
|
|
222
|
+
const fieldWidthLimits = elementWidth(fieldRef);
|
|
223
|
+
|
|
224
|
+
// We need to fire some actions when the auto-complete widget gets or loses focus
|
|
225
|
+
const handleOnFocusIn = () => {
|
|
226
|
+
setHasFocus(true);
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
const handleOnFocusOut = () => {
|
|
230
|
+
setHasFocus(false);
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
// On popover close reset query to selected item
|
|
234
|
+
const onPopoverClose = () => {
|
|
235
|
+
// Reset query to selected value when loosing focus, so the selected value can always be edited.
|
|
236
|
+
setQueryToSelectedValue(selectedItem);
|
|
237
|
+
// Reset option list when the popover closes, so next use there is not displayed a stale list
|
|
238
|
+
setFiltered([]);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// Triggered when an item from the selection list gets selected
|
|
242
|
+
const onSelectionChange = (value: any, e: any) => {
|
|
243
|
+
setSelectedItem(value);
|
|
244
|
+
onChange?.(itemValueSelector(value), e);
|
|
245
|
+
setQueryToSelectedValue(value);
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
const areEqualItems = (itemA: any, itemB: any) => itemValueSelector(itemA) === itemValueSelector(itemB);
|
|
249
|
+
|
|
250
|
+
// Return the index of the item in the array based on the itemValueRenderer value
|
|
251
|
+
const itemIndexOf = (arr: T[], searchItem: T): number => {
|
|
252
|
+
let idx = -1;
|
|
253
|
+
const searchItemString = itemValueSelector(searchItem);
|
|
254
|
+
arr.forEach((v, i) => {
|
|
255
|
+
if (itemValueSelector(v) === searchItemString) {
|
|
256
|
+
idx = i;
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
return idx;
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
// Fetches the results for the given query
|
|
263
|
+
const fetchQueryResults = async (input: string) => {
|
|
264
|
+
setListLoading(true);
|
|
265
|
+
try {
|
|
266
|
+
let result = await onSearch(input);
|
|
267
|
+
const onlySelectItemReturned = result.length <= 1 && selectedItem && input.length > 0 &&
|
|
268
|
+
(itemValueRenderer(selectedItem) === input || itemValueSelector(selectedItem) === input)
|
|
269
|
+
let enableHighlighting = true;
|
|
270
|
+
if (onlySelectItemReturned) {
|
|
271
|
+
// If the auto-completion only returns no suggestion or the selected item itself, query with empty string.
|
|
272
|
+
const emptyStringResults = await onSearch("");
|
|
273
|
+
// Disable highlighting, since we used empty string search
|
|
274
|
+
enableHighlighting = false;
|
|
275
|
+
// Put selected item at the top if it is not in the result list
|
|
276
|
+
if (!!selectedItem && itemIndexOf(emptyStringResults, selectedItem) === -1) {
|
|
277
|
+
result = [selectedItem, ...emptyStringResults];
|
|
278
|
+
} else {
|
|
279
|
+
result = emptyStringResults;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
setHighlightingEnabled(enableHighlighting);
|
|
283
|
+
setFiltered(result);
|
|
284
|
+
} catch (e) {
|
|
285
|
+
console.log(e);
|
|
286
|
+
} finally {
|
|
287
|
+
setListLoading(false);
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
// Renders the item in the selection list
|
|
292
|
+
const optionRenderer = (item: any, { handleClick, modifiers, query }: {handleClick: any, modifiers: any, query: any}) => {
|
|
293
|
+
if (!modifiers.matchesPredicate) {
|
|
294
|
+
return null;
|
|
295
|
+
}
|
|
296
|
+
const relevantModifiers: IRenderModifiers = {
|
|
297
|
+
active: modifiers.active,
|
|
298
|
+
disabled: modifiers.disabled,
|
|
299
|
+
styleWidth: fieldWidthLimits,
|
|
300
|
+
highlightingEnabled: highlightingEnabled,
|
|
301
|
+
}
|
|
302
|
+
const renderedItem = itemRenderer(item, query, relevantModifiers, handleClick);
|
|
303
|
+
if (typeof renderedItem === "string") {
|
|
304
|
+
return (
|
|
305
|
+
<MenuItem
|
|
306
|
+
active={modifiers.active}
|
|
307
|
+
disabled={modifiers.disabled}
|
|
308
|
+
key={itemKey(item)}
|
|
309
|
+
onClick={handleClick}
|
|
310
|
+
text={
|
|
311
|
+
<OverflowText style={fieldWidthLimits}>
|
|
312
|
+
{!highlightingEnabled ? renderedItem : <Highlighter label={renderedItem} searchValue={query} />}
|
|
313
|
+
</OverflowText>
|
|
314
|
+
}
|
|
315
|
+
/>
|
|
316
|
+
);
|
|
317
|
+
} else {
|
|
318
|
+
return renderedItem;
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
// Resets the selection
|
|
322
|
+
const clearSelection = (resetValue: U) => () => {
|
|
323
|
+
setSelectedItem(undefined);
|
|
324
|
+
onChange?.(resetValue);
|
|
325
|
+
setQuery("");
|
|
326
|
+
};
|
|
327
|
+
// Optional clear button to reset the selected value
|
|
328
|
+
const clearButton = reset &&
|
|
329
|
+
selectedItem != null &&
|
|
330
|
+
reset.resettableValue(selectedItem) ? (
|
|
331
|
+
<IconButton
|
|
332
|
+
data-test-id={
|
|
333
|
+
(otherProps.inputProps?.id ? `${otherProps.inputProps.id}-` : "") + "auto-complete-clear-btn"
|
|
334
|
+
}
|
|
335
|
+
name="operation-clear"
|
|
336
|
+
text={reset.resetButtonText}
|
|
337
|
+
onClick={clearSelection(reset.resetValue)}
|
|
338
|
+
/>
|
|
339
|
+
) : undefined;
|
|
340
|
+
// Additional properties for the input element of the auto-completion widget
|
|
341
|
+
const updatedInputProps: InputGroupProps & HTMLInputProps = {
|
|
342
|
+
rightElement: clearButton,
|
|
343
|
+
autoFocus: autoFocus,
|
|
344
|
+
onBlur: handleOnFocusOut,
|
|
345
|
+
onFocus: handleOnFocusIn,
|
|
346
|
+
...otherProps.inputProps,
|
|
347
|
+
};
|
|
348
|
+
const updatedPopOverProps: Partial<IPopoverProps> = {
|
|
349
|
+
minimal: true,
|
|
350
|
+
position: "bottom",
|
|
351
|
+
popoverClassName: `${eccgui}-autocompletefield__options`,
|
|
352
|
+
wrapperTagName: "div",
|
|
353
|
+
onClosed: onPopoverClose,
|
|
354
|
+
...otherProps.popoverProps,
|
|
355
|
+
}
|
|
356
|
+
if(selectedItem !== undefined) {
|
|
357
|
+
// Makes sure that even when an empty string is selected, the placeholder won't be shown.
|
|
358
|
+
updatedInputProps.placeholder = ""
|
|
359
|
+
}
|
|
360
|
+
// For some reason Typescript is not able to infer the union type from the ternary expression
|
|
361
|
+
const createNewItemPosition: "first" | "last" = createNewItem?.showNewItemOptionFirst ? "first" : "last"
|
|
362
|
+
const createNewItemProps = createNewItem ? {
|
|
363
|
+
createNewItemFromQuery: createNewItem.itemFromQuery,
|
|
364
|
+
createNewItemRenderer: (query: string, active: boolean, handleClick: React.MouseEventHandler<HTMLElement>) => {
|
|
365
|
+
if(selectedItem && query === itemValueSelector(selectedItem)) {
|
|
366
|
+
// Never show create new item option if the same item is already selected
|
|
367
|
+
return undefined
|
|
368
|
+
} else {
|
|
369
|
+
return createNewItem!!.itemRenderer(query, {active, styleWidth: fieldWidthLimits, highlightingEnabled: false}, handleClick)
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
createNewItemPosition
|
|
373
|
+
} : {}
|
|
374
|
+
return (
|
|
375
|
+
<div ref={fieldRef}>
|
|
376
|
+
<SuggestAutocomplete
|
|
377
|
+
className={`${eccgui}-autocompletefield__input`}
|
|
378
|
+
disabled={disabled}
|
|
379
|
+
items={filtered}
|
|
380
|
+
inputValueRenderer={selectedItem !== undefined ? itemValueRenderer : () => ""}
|
|
381
|
+
itemRenderer={optionRenderer}
|
|
382
|
+
itemsEqual={areEqualItems}
|
|
383
|
+
noResults={<MenuItem disabled={true} text={noResultText} style={fieldWidthLimits} />}
|
|
384
|
+
onItemSelect={onSelectionChange}
|
|
385
|
+
onQueryChange={(q) => setQuery(q)}
|
|
386
|
+
closeOnSelect={true}
|
|
387
|
+
query={query}
|
|
388
|
+
// FIXME: This leads to odd compile errors without "as any"
|
|
389
|
+
popoverProps={updatedPopOverProps as any}
|
|
390
|
+
selectedItem={selectedItem}
|
|
391
|
+
fill
|
|
392
|
+
{...createNewItemProps}
|
|
393
|
+
// FIXME: This leads to odd compile errors without "as any"
|
|
394
|
+
inputProps={updatedInputProps as any}
|
|
395
|
+
itemListRenderer={listLoading ? () => <Menu><MenuItem disabled={true} text={<Spinner position={"inline"} />} style={fieldWidthLimits} /></Menu> : undefined}
|
|
396
|
+
/>
|
|
397
|
+
</div>
|
|
398
|
+
);
|
|
399
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {IElementWidth, IRenderModifiers} from "./AutoCompleteField";
|
|
3
|
+
import OverflowText from "../Typography/OverflowText";
|
|
4
|
+
import MenuItem from "../Menu/MenuItem";
|
|
5
|
+
|
|
6
|
+
/** Returns a function to be used in an AutoComplete widget for rendering custom elements based on the query string.
|
|
7
|
+
*
|
|
8
|
+
* @param itemTextRenderer The text or element that should be displayed for the new custom item suggestion.
|
|
9
|
+
* @param iconName Optional icon to show left to the text.
|
|
10
|
+
*/
|
|
11
|
+
export const createNewItemRendererFactory = (
|
|
12
|
+
itemTextRenderer: (query: string, styleWidth: IElementWidth) => string | JSX.Element,
|
|
13
|
+
iconName?: string) => {
|
|
14
|
+
// Return custom render function
|
|
15
|
+
return (query: string, modifiers: IRenderModifiers, handleClick: React.MouseEventHandler<HTMLElement>) => {
|
|
16
|
+
let textElement = itemTextRenderer(query, modifiers.styleWidth)
|
|
17
|
+
if(typeof textElement === "string") {
|
|
18
|
+
textElement = <OverflowText style={modifiers.styleWidth}>
|
|
19
|
+
{`Create option '${query}'`}
|
|
20
|
+
</OverflowText>
|
|
21
|
+
}
|
|
22
|
+
return (
|
|
23
|
+
<MenuItem
|
|
24
|
+
icon={iconName}
|
|
25
|
+
active={modifiers.active}
|
|
26
|
+
key={query}
|
|
27
|
+
onClick={handleClick}
|
|
28
|
+
text={textElement}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
// import PropTypes from 'prop-types';
|
|
3
|
+
import {
|
|
4
|
+
Breadcrumb as BlueprintBreadcrumbItem,
|
|
5
|
+
IBreadcrumbProps as IBlueprintBreadcrumbItemProps,
|
|
6
|
+
} from "@blueprintjs/core";
|
|
7
|
+
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
8
|
+
import { openInNewTab } from "../../common/utils/openInNewTab";
|
|
9
|
+
|
|
10
|
+
// TODO: enforce href and remove onClick later
|
|
11
|
+
export type IBreadcrumbItemProps = Omit<
|
|
12
|
+
IBlueprintBreadcrumbItemProps,
|
|
13
|
+
// we remove some properties that are currently not necessary, required usage should be discussed
|
|
14
|
+
"icon" |
|
|
15
|
+
"iconTitle" |
|
|
16
|
+
"intent" |
|
|
17
|
+
"target"
|
|
18
|
+
>;
|
|
19
|
+
|
|
20
|
+
function BreadcrumbItem({
|
|
21
|
+
className = "",
|
|
22
|
+
onClick,
|
|
23
|
+
href,
|
|
24
|
+
//itemDivider='',
|
|
25
|
+
...otherBlueprintBreadcrumbProps
|
|
26
|
+
}: IBreadcrumbItemProps) {
|
|
27
|
+
|
|
28
|
+
/*
|
|
29
|
+
TODO: adding `data-divider` does not work this way because BlueprintJS
|
|
30
|
+
breadcrumb component does not support (and forward) it on HTML element
|
|
31
|
+
level. The idea is to add the divider as data-* property to use it via
|
|
32
|
+
CSS/Sass as content for the pseudo element, currently done static in CSS
|
|
33
|
+
with slash char.
|
|
34
|
+
*/
|
|
35
|
+
return (
|
|
36
|
+
<BlueprintBreadcrumbItem
|
|
37
|
+
{...otherBlueprintBreadcrumbProps}
|
|
38
|
+
href={href}
|
|
39
|
+
onClick={(e) => openInNewTab(e, onClick, href)}
|
|
40
|
+
className={`${eccgui}-breadcrumb__item ` + className}
|
|
41
|
+
/* data-divider={itemDivider ? itemDivider : ''} */
|
|
42
|
+
/>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export default BreadcrumbItem;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
Breadcrumbs as BlueprintBreadcrumbList,
|
|
4
|
+
IBreadcrumbsProps as IBlueprintBreadcrumbsProps,
|
|
5
|
+
} from "@blueprintjs/core";
|
|
6
|
+
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
7
|
+
import BreadcrumbItem from "./BreadcrumbItem";
|
|
8
|
+
import { IBreadcrumbItemProps } from "./BreadcrumbItem";
|
|
9
|
+
|
|
10
|
+
type ReducedBreadcrumbsProps = Omit<
|
|
11
|
+
IBlueprintBreadcrumbsProps,
|
|
12
|
+
// we remove some properties that are currently not necessary, required usage should be discussed
|
|
13
|
+
"breadcrumbRenderer" |
|
|
14
|
+
"collapseFrom" |
|
|
15
|
+
"currentBreadcrumbRenderer" |
|
|
16
|
+
"minVisibleItems" |
|
|
17
|
+
"overflowListProps" |
|
|
18
|
+
"popoverProps"
|
|
19
|
+
>;
|
|
20
|
+
|
|
21
|
+
// TODO: enforce onItemClick later
|
|
22
|
+
interface IBreadcrumbListProps extends ReducedBreadcrumbsProps {
|
|
23
|
+
/**
|
|
24
|
+
list of breadcrumb items to display
|
|
25
|
+
*/
|
|
26
|
+
items: IBreadcrumbItemProps[];
|
|
27
|
+
/**
|
|
28
|
+
click handler used on breadcrumb items
|
|
29
|
+
*/
|
|
30
|
+
onItemClick?(itemUrl: string, event: object): any;
|
|
31
|
+
/**
|
|
32
|
+
native attributes for the unordered HTML list (ul)
|
|
33
|
+
*/
|
|
34
|
+
htmlUlProps?: React.HTMLAttributes<HTMLUListElement>;
|
|
35
|
+
/**
|
|
36
|
+
char that devides breadcrumb items, default: "/" (currently unsupported)
|
|
37
|
+
*/
|
|
38
|
+
itemDivider?: never;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function BreadcrumbList({
|
|
42
|
+
className = "",
|
|
43
|
+
// itemDivider = "/",
|
|
44
|
+
onItemClick,
|
|
45
|
+
htmlUlProps,
|
|
46
|
+
...otherBlueprintBreadcrumbsProps
|
|
47
|
+
}: IBreadcrumbListProps) {
|
|
48
|
+
const renderBreadcrumb = (propsBreadcrumb: any) => {
|
|
49
|
+
const {onClick, ...otherProps} = propsBreadcrumb;
|
|
50
|
+
return (
|
|
51
|
+
<BreadcrumbItem
|
|
52
|
+
/*itemDivider="/"*/
|
|
53
|
+
{...otherProps}
|
|
54
|
+
onClick={
|
|
55
|
+
onItemClick
|
|
56
|
+
? (e) => {
|
|
57
|
+
onItemClick(propsBreadcrumb.href, e);
|
|
58
|
+
}
|
|
59
|
+
: onClick
|
|
60
|
+
}
|
|
61
|
+
/>
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const renderCurrentBreadcrumb = (propsBreadcrumb: any) => {
|
|
66
|
+
return <BreadcrumbItem {...propsBreadcrumb} current={true} href={null} onClick={null} /*itemDivider={itemDivider}*/ />;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<BlueprintBreadcrumbList
|
|
71
|
+
{...otherBlueprintBreadcrumbsProps}
|
|
72
|
+
{...htmlUlProps}
|
|
73
|
+
className={`${eccgui}-breadcrumb__list ` + className}
|
|
74
|
+
minVisibleItems={1}
|
|
75
|
+
breadcrumbRenderer={renderBreadcrumb}
|
|
76
|
+
currentBreadcrumbRenderer={renderCurrentBreadcrumb}
|
|
77
|
+
/>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export default BreadcrumbList;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
@import "~@blueprintjs/core/src/components/breadcrumbs/breadcrumbs";
|
|
2
|
+
@import "~@blueprintjs/core/src/components/overflow-list/overflow-list";
|
|
3
|
+
|
|
4
|
+
.#{$eccgui}-breadcrumb__list {
|
|
5
|
+
height: auto;
|
|
6
|
+
|
|
7
|
+
& > li {
|
|
8
|
+
|
|
9
|
+
&:last-of-type {
|
|
10
|
+
min-width: 0;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
& > li::after {
|
|
15
|
+
background: none;
|
|
16
|
+
margin: 0;
|
|
17
|
+
height: auto;
|
|
18
|
+
width: auto;
|
|
19
|
+
display: inline-block;
|
|
20
|
+
vertical-align: middle;
|
|
21
|
+
content: "/";
|
|
22
|
+
width: $eccgui-size-block-whitespace;
|
|
23
|
+
text-align: center;
|
|
24
|
+
flex-shrink: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.#{$ns}-breadcrumbs-collapsed {
|
|
28
|
+
padding: 0;
|
|
29
|
+
margin: 0;
|
|
30
|
+
|
|
31
|
+
&:before {
|
|
32
|
+
width: $eccgui-size-block-whitespace * 2;
|
|
33
|
+
height: $eccgui-size-block-whitespace;
|
|
34
|
+
background-image: url("~@carbon/icons/svg/32/overflow-menu--horizontal.svg");
|
|
35
|
+
background-repeat: no-repeat;
|
|
36
|
+
background-position: center;
|
|
37
|
+
background-size: cover;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.#{$eccgui}-breadcrumb__item {
|
|
43
|
+
font-size: inherit;
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
text-overflow: ellipsis;
|
|
46
|
+
display: inline-block;
|
|
47
|
+
}
|