@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,95 @@
|
|
|
1
|
+
import React, {useState} from "react";
|
|
2
|
+
import {Link, Spacing} from "../../index";
|
|
3
|
+
|
|
4
|
+
interface IContentBlobTogglerProps
|
|
5
|
+
extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
/**
|
|
7
|
+
space-delimited list of class names
|
|
8
|
+
*/
|
|
9
|
+
className?: string;
|
|
10
|
+
/**
|
|
11
|
+
text label used for toggler when preview is displayed
|
|
12
|
+
*/
|
|
13
|
+
toggleExtendText: string;
|
|
14
|
+
/**
|
|
15
|
+
text label used for toggler when full view is displayed
|
|
16
|
+
*/
|
|
17
|
+
toggleReduceText: string;
|
|
18
|
+
/**
|
|
19
|
+
content that is displayed as preview
|
|
20
|
+
*/
|
|
21
|
+
previewContent: React.ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
content that is displayed as extended full view
|
|
24
|
+
*/
|
|
25
|
+
fullviewContent: React.ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
Show extended full view initially. Default: false
|
|
28
|
+
*/
|
|
29
|
+
startExtended?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
Callback if toggler is necessary. Default: true
|
|
32
|
+
*/
|
|
33
|
+
enableToggler?: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Shows a preview with the option to expand to a full view (and back). */
|
|
37
|
+
export function ContentBlobToggler({
|
|
38
|
+
className = "",
|
|
39
|
+
toggleExtendText,
|
|
40
|
+
toggleReduceText,
|
|
41
|
+
previewContent,
|
|
42
|
+
fullviewContent,
|
|
43
|
+
startExtended = false,
|
|
44
|
+
enableToggler = true,
|
|
45
|
+
...otherProps
|
|
46
|
+
}: IContentBlobTogglerProps) {
|
|
47
|
+
const [isExtended, setViewState] = useState(startExtended);
|
|
48
|
+
const handlerToggleView = (event: any) => {
|
|
49
|
+
event.preventDefault();
|
|
50
|
+
event.stopPropagation();
|
|
51
|
+
setViewState(!isExtended);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<div className={className} {...otherProps}>
|
|
56
|
+
{!isExtended ? (
|
|
57
|
+
<>
|
|
58
|
+
{previewContent}
|
|
59
|
+
{enableToggler && (
|
|
60
|
+
<>
|
|
61
|
+
…{" "}
|
|
62
|
+
<Link
|
|
63
|
+
href="#more"
|
|
64
|
+
data-test-id={"content-blob-toggler-more-link"}
|
|
65
|
+
onClick={(e: any) => {
|
|
66
|
+
handlerToggleView(e);
|
|
67
|
+
}}
|
|
68
|
+
>
|
|
69
|
+
{toggleExtendText}
|
|
70
|
+
</Link>
|
|
71
|
+
</>
|
|
72
|
+
)}
|
|
73
|
+
</>
|
|
74
|
+
) : (
|
|
75
|
+
<>
|
|
76
|
+
{fullviewContent}
|
|
77
|
+
{enableToggler && (
|
|
78
|
+
<div>
|
|
79
|
+
<Spacing size="small" />
|
|
80
|
+
<Link
|
|
81
|
+
data-test-id={"content-blob-toggler-less-link"}
|
|
82
|
+
href="#less"
|
|
83
|
+
onClick={(e: any) => {
|
|
84
|
+
handlerToggleView(e);
|
|
85
|
+
}}
|
|
86
|
+
>
|
|
87
|
+
{toggleReduceText}
|
|
88
|
+
</Link>
|
|
89
|
+
</div>
|
|
90
|
+
)}
|
|
91
|
+
</>
|
|
92
|
+
)}
|
|
93
|
+
</div>
|
|
94
|
+
);
|
|
95
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ContentBlobToggler, Markdown } from "../";
|
|
3
|
+
|
|
4
|
+
interface IStringPreviewContentBlobTogglerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
/**
|
|
6
|
+
space-delimited list of class names
|
|
7
|
+
*/
|
|
8
|
+
className?: string;
|
|
9
|
+
/**
|
|
10
|
+
The preview content will be cut to this length if it is too long.
|
|
11
|
+
*/
|
|
12
|
+
previewMaxLength?: number;
|
|
13
|
+
/**
|
|
14
|
+
text label used for toggler when preview is displayed
|
|
15
|
+
*/
|
|
16
|
+
toggleExtendText: string;
|
|
17
|
+
/**
|
|
18
|
+
text label used for toggler when full view is displayed
|
|
19
|
+
*/
|
|
20
|
+
toggleReduceText: string;
|
|
21
|
+
/**
|
|
22
|
+
The content string. If it is smaller than previewMaxLength this will be displayed in full, else fullviewContent will be displayed.
|
|
23
|
+
*/
|
|
24
|
+
content: string;
|
|
25
|
+
/**
|
|
26
|
+
Content that is displayed as extended full view
|
|
27
|
+
*/
|
|
28
|
+
fullviewContent: React.ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
show extended full view initially
|
|
31
|
+
*/
|
|
32
|
+
startExtended?: boolean;
|
|
33
|
+
/** If only the first non-empty line should be shown in the preview. This will in addition also be shortened according to previewMaxLength. */
|
|
34
|
+
firstNonEmptyLineOnly?: boolean
|
|
35
|
+
/** If enabled the preview is rendered as markdown. */
|
|
36
|
+
renderPreviewAsMarkdown?: boolean
|
|
37
|
+
/** White-listing of HTML elements that will be rendered when renderPreviewAsMarkdown is enabled. */
|
|
38
|
+
allowedHtmlElementsInPreview?: string[]
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Version of the content toggler for text only content. */
|
|
42
|
+
export function StringPreviewContentBlobToggler({
|
|
43
|
+
className = "",
|
|
44
|
+
previewMaxLength,
|
|
45
|
+
toggleExtendText,
|
|
46
|
+
toggleReduceText,
|
|
47
|
+
content,
|
|
48
|
+
fullviewContent,
|
|
49
|
+
startExtended,
|
|
50
|
+
firstNonEmptyLineOnly,
|
|
51
|
+
renderPreviewAsMarkdown = false,
|
|
52
|
+
allowedHtmlElementsInPreview
|
|
53
|
+
}: IStringPreviewContentBlobTogglerProps) {
|
|
54
|
+
const previewMaybeFirstLine = firstNonEmptyLineOnly ? firstNonEmptyLine(content) : content
|
|
55
|
+
const previewString = previewMaxLength ? previewMaybeFirstLine.substr(0, previewMaxLength) : previewMaybeFirstLine
|
|
56
|
+
const enableToggler = previewString !== content
|
|
57
|
+
|
|
58
|
+
return <ContentBlobToggler
|
|
59
|
+
className={className}
|
|
60
|
+
previewContent={renderPreviewAsMarkdown ? <Markdown allowedElements={allowedHtmlElementsInPreview}>{previewString}</Markdown> : previewString}
|
|
61
|
+
toggleExtendText={toggleExtendText}
|
|
62
|
+
toggleReduceText={toggleReduceText}
|
|
63
|
+
fullviewContent={fullviewContent}
|
|
64
|
+
startExtended={startExtended}
|
|
65
|
+
enableToggler={enableToggler}
|
|
66
|
+
/>
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const newLineRegex = new RegExp("\r|\n"); // eslint-disable-line
|
|
70
|
+
|
|
71
|
+
/** Takes the first non-empty line from a preview string. */
|
|
72
|
+
export function firstNonEmptyLine(preview: string) {
|
|
73
|
+
const previewString = preview.trim();
|
|
74
|
+
const result = newLineRegex.exec(previewString);
|
|
75
|
+
return result !== null ? previewString.substr(0, result.index) : previewString;
|
|
76
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React, {useEffect, useState} from "react";
|
|
2
|
+
import {TestableComponent} from "../../components/interfaces";
|
|
3
|
+
|
|
4
|
+
interface IProps extends TestableComponent {
|
|
5
|
+
// The date time given as string (parseable by Date) or number (ms since 1970-01-01 00:00:00 UTC)
|
|
6
|
+
dateTime: string | number
|
|
7
|
+
// String to put before the elapsed time
|
|
8
|
+
prefix?: string
|
|
9
|
+
// String to put after the elapsed time
|
|
10
|
+
suffix?: string
|
|
11
|
+
// If the date time string should be shown as tooltip
|
|
12
|
+
showDateTimeTooltip?: boolean
|
|
13
|
+
// Translate time related vocabulary
|
|
14
|
+
translateUnits: (unit: TimeUnits) => string
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export type TimeUnits = "minute" | "minutes" | "hour" | "hours" | "day" | "days"
|
|
18
|
+
|
|
19
|
+
const dateTimeToElapsedTimeInMs = (dateTime: string | number) => {
|
|
20
|
+
const absoluteMs = typeof dateTime === "number" ? dateTime : new Date(dateTime).getTime()
|
|
21
|
+
return new Date().getTime() - absoluteMs
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Returns a segmentation of the elapsed time, i.e. an array with the nr of days, hours, minutes, seconds
|
|
25
|
+
export const elapsedTimeSegmented = (elapsedTimeInMs: number): number[] => {
|
|
26
|
+
// In how many segments the time should be split, i.e. hours, minutes, seconds
|
|
27
|
+
const segmentSteps = [24, 60, 60]
|
|
28
|
+
// First convert to time in seconds
|
|
29
|
+
let remaining = Math.floor(elapsedTimeInMs / 1000)
|
|
30
|
+
const segmentValues: number[] = []
|
|
31
|
+
segmentSteps.reverse().forEach((segmentSize) => {
|
|
32
|
+
const segmentValue = remaining % segmentSize
|
|
33
|
+
remaining = Math.floor(remaining / segmentSize)
|
|
34
|
+
segmentValues.push(segmentValue)
|
|
35
|
+
})
|
|
36
|
+
segmentValues.push(remaining)
|
|
37
|
+
return segmentValues.reverse()
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Returns the simplified elapsed time
|
|
41
|
+
export const simplifiedElapsedTime = (timeSegments: number[], translateUnits: (unit: TimeUnits) => string) => {
|
|
42
|
+
const units: TimeUnits[] = ["day", "hour", "minute"]
|
|
43
|
+
// Find first non-null value
|
|
44
|
+
let idx = 0
|
|
45
|
+
while(idx < 3 && timeSegments[idx] === 0) {
|
|
46
|
+
idx++
|
|
47
|
+
}
|
|
48
|
+
if(idx === 3) {
|
|
49
|
+
// Do not show exact seconds
|
|
50
|
+
return `< 1 ${translateUnits("minute")}`
|
|
51
|
+
} else {
|
|
52
|
+
return `${timeSegments[idx]} ${translateUnits(units[idx] + (timeSegments[idx] > 1 ? "s": "") as TimeUnits)}`
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/** Displays the elapsed time in a human readable way. */
|
|
56
|
+
export const ElapsedDateTimeDisplay = ({dateTime, prefix = "", suffix = "", showDateTimeTooltip = true, translateUnits, ...otherProps}: IProps) => {
|
|
57
|
+
const [elapsedTime, setElapsedTime] = useState<number>(dateTimeToElapsedTimeInMs(dateTime))
|
|
58
|
+
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
const timeout = setInterval(() => {
|
|
61
|
+
setElapsedTime(dateTimeToElapsedTimeInMs(dateTime))
|
|
62
|
+
}, 1000)
|
|
63
|
+
return () => clearInterval(timeout)
|
|
64
|
+
}, [dateTime])
|
|
65
|
+
|
|
66
|
+
return <span data-test-id={otherProps["data-test-id"]} title={showDateTimeTooltip ? new Date(dateTime).toString() : ""}>
|
|
67
|
+
{prefix + simplifiedElapsedTime(elapsedTimeSegmented(elapsedTime), translateUnits) + suffix}
|
|
68
|
+
</span>
|
|
69
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {simplifiedElapsedTime, elapsedTimeSegmented, TimeUnits} from "../ElapsedDateTimeDisplay";
|
|
2
|
+
|
|
3
|
+
describe("Elapsed time component", () => {
|
|
4
|
+
const checkMS = (timeInMs: number, expectedString: string) => expect(elapsedTimeSegmented(timeInMs).join(":")).toBe(expectedString)
|
|
5
|
+
const checkS = (timeInSeconds: number, expectedString: string) => checkMS(timeInSeconds * 1000, expectedString)
|
|
6
|
+
const translate = (timeUnit: TimeUnits) => timeUnit
|
|
7
|
+
const checkHumanReadable = (timeInSeconds: number, expectedString: string) => expect(simplifiedElapsedTime(elapsedTimeSegmented(timeInSeconds * 1000), translate)).toBe(expectedString)
|
|
8
|
+
it("should segment the time", () => {
|
|
9
|
+
checkMS(2123, "0:0:0:2")
|
|
10
|
+
checkS(2, "0:0:0:2")
|
|
11
|
+
checkS(12, "0:0:0:12")
|
|
12
|
+
checkS(62, "0:0:1:2")
|
|
13
|
+
checkS(72, "0:0:1:12")
|
|
14
|
+
checkS(10*60, "0:0:10:0")
|
|
15
|
+
checkS(10*60 + 2, "0:0:10:2")
|
|
16
|
+
checkS(3600 * 123 + 60 * 42 + 23, "5:3:42:23")
|
|
17
|
+
})
|
|
18
|
+
it("should return a human-readable representation of the time", () => {
|
|
19
|
+
checkHumanReadable(2, "< 1 minute")
|
|
20
|
+
checkHumanReadable(59, "< 1 minute")
|
|
21
|
+
checkHumanReadable(60, "1 minute")
|
|
22
|
+
checkHumanReadable(2 * 60, "2 minutes")
|
|
23
|
+
checkHumanReadable(3600, "1 hour")
|
|
24
|
+
checkHumanReadable(3600 + 1, "1 hour")
|
|
25
|
+
checkHumanReadable(2 * 3600, "2 hours")
|
|
26
|
+
checkHumanReadable(24 * 3600, "1 day")
|
|
27
|
+
checkHumanReadable(2 * 24 * 3600 + 123, "2 days")
|
|
28
|
+
})
|
|
29
|
+
})
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ActivityControlWidget } from "./ActivityControl/ActivityControlWidget";
|
|
2
|
+
import { ActivityExecutionErrorReportModal } from "./ActivityControl/ActivityExecutionErrorReportModal";
|
|
3
|
+
import {
|
|
4
|
+
ActivityAction,
|
|
5
|
+
SilkActivityControl,
|
|
6
|
+
IActivityControlLayoutProps,
|
|
7
|
+
} from "./ActivityControl/SilkActivityControl";
|
|
8
|
+
import { IActivityStatus } from "./ActivityControl/ActivityControlTypes";
|
|
9
|
+
import { ContentBlobToggler } from "./ContentBlobToggler/ContentBlobToggler";
|
|
10
|
+
import {
|
|
11
|
+
ElapsedDateTimeDisplay,
|
|
12
|
+
TimeUnits
|
|
13
|
+
} from "./DateTimeDisplay/ElapsedDateTimeDisplay";
|
|
14
|
+
import { Markdown } from "./markdown/Markdown";
|
|
15
|
+
import {
|
|
16
|
+
StringPreviewContentBlobToggler,
|
|
17
|
+
firstNonEmptyLine,
|
|
18
|
+
} from "./ContentBlobToggler/StringPreviewContentBlobToggler";
|
|
19
|
+
|
|
20
|
+
export {
|
|
21
|
+
ActivityControlWidget,
|
|
22
|
+
ActivityExecutionErrorReportModal,
|
|
23
|
+
ContentBlobToggler,
|
|
24
|
+
Markdown,
|
|
25
|
+
StringPreviewContentBlobToggler,
|
|
26
|
+
SilkActivityControl,
|
|
27
|
+
ElapsedDateTimeDisplay,
|
|
28
|
+
firstNonEmptyLine,
|
|
29
|
+
}
|
|
30
|
+
export type {
|
|
31
|
+
IActivityStatus,
|
|
32
|
+
ActivityAction,
|
|
33
|
+
IActivityControlLayoutProps,
|
|
34
|
+
TimeUnits,
|
|
35
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import ReactMarkdown from "react-markdown";
|
|
2
|
+
import rehypeRaw from "rehype-raw";
|
|
3
|
+
import remarkGfm from "remark-gfm";
|
|
4
|
+
//@ts-ignore
|
|
5
|
+
import remarkTypograf from "@mavrin/remark-typograf";
|
|
6
|
+
import {remarkDefinitionList} from 'remark-definition-list';
|
|
7
|
+
import React from "react";
|
|
8
|
+
import { HtmlContentBlock } from "../../index";
|
|
9
|
+
import { PluggableList } from "react-markdown/lib/react-markdown";
|
|
10
|
+
|
|
11
|
+
interface MarkdownParserProps {
|
|
12
|
+
children: string;
|
|
13
|
+
// allow HTML as partial content, otherwise escape HTML tags (pls use with caution)
|
|
14
|
+
allowHtml?: boolean;
|
|
15
|
+
// return an object that only contains simple text without any HTML
|
|
16
|
+
removeMarkup?: boolean;
|
|
17
|
+
// If defined, only elements from this list will be rendered. This overwrites the removeMarkup parameter if both are set.
|
|
18
|
+
allowedElements?: string[];
|
|
19
|
+
// do not wrap it in a content block element
|
|
20
|
+
inheritBlock?: boolean;
|
|
21
|
+
/** Additional reHype plugins to execute.
|
|
22
|
+
* @see https://github.com/remarkjs/react-markdown#architecture
|
|
23
|
+
*/
|
|
24
|
+
reHypePlugins?: PluggableList;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const configDefault = {
|
|
28
|
+
/*
|
|
29
|
+
Using React Markdown configuration
|
|
30
|
+
@see https://github.com/remarkjs/react-markdown#api
|
|
31
|
+
*/
|
|
32
|
+
// @see https://github.com/remarkjs/remark/blob/main/doc/plugins.md#list-of-plugins
|
|
33
|
+
remarkPlugins: [remarkGfm, remarkTypograf, remarkDefinitionList] as PluggableList,
|
|
34
|
+
// @see https://github.com/rehypejs/rehype/blob/main/doc/plugins.md#list-of-plugins
|
|
35
|
+
rehypePlugins: [] as PluggableList,
|
|
36
|
+
allowedElements: [
|
|
37
|
+
// default markdown
|
|
38
|
+
"a", "blockquote", "code", "em", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "img", "li", "ol", "p", "pre", "strong", "ul",
|
|
39
|
+
// gfm (Github Flavoured Markdown) extensions
|
|
40
|
+
"del", "input", "table", "tbody", "td", "th", "thead", "tr",
|
|
41
|
+
// other stuff
|
|
42
|
+
"mark", "dl", "dt", "dd"
|
|
43
|
+
],
|
|
44
|
+
// remove all unwanted HTML markup
|
|
45
|
+
unwrapDisallowed: true,
|
|
46
|
+
// show escaped HTML
|
|
47
|
+
skipHtml: false,
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** Renders a markdown string. */
|
|
51
|
+
export const Markdown = ({
|
|
52
|
+
children,
|
|
53
|
+
allowHtml = false,
|
|
54
|
+
removeMarkup = false,
|
|
55
|
+
inheritBlock = false,
|
|
56
|
+
allowedElements,
|
|
57
|
+
reHypePlugins
|
|
58
|
+
}: MarkdownParserProps) => {
|
|
59
|
+
|
|
60
|
+
const configHtml = allowHtml ? {
|
|
61
|
+
rehypePlugins: [...configDefault.rehypePlugins].concat([rehypeRaw]),
|
|
62
|
+
// switch from allowed list to disallowed list
|
|
63
|
+
allowedElements: undefined,
|
|
64
|
+
disallowedElements: [ "applet", "script", "style", "link", "iframe", "form", "button" ],
|
|
65
|
+
} : { };
|
|
66
|
+
|
|
67
|
+
const configTextOnly = removeMarkup ? {
|
|
68
|
+
skipHtml: true,
|
|
69
|
+
allowedElements: [],
|
|
70
|
+
disallowedElements: undefined,
|
|
71
|
+
} : { };
|
|
72
|
+
|
|
73
|
+
const reactMarkdownProperties = {
|
|
74
|
+
children: children.trim(),
|
|
75
|
+
...configDefault,
|
|
76
|
+
...configHtml,
|
|
77
|
+
...configTextOnly,
|
|
78
|
+
};
|
|
79
|
+
allowedElements && (reactMarkdownProperties.allowedElements = allowedElements)
|
|
80
|
+
reHypePlugins && reHypePlugins.forEach(plugin => reactMarkdownProperties.rehypePlugins = [...reactMarkdownProperties.rehypePlugins, plugin])
|
|
81
|
+
|
|
82
|
+
return inheritBlock ? (
|
|
83
|
+
<ReactMarkdown {...reactMarkdownProperties} />
|
|
84
|
+
) : (
|
|
85
|
+
<HtmlContentBlock>
|
|
86
|
+
<ReactMarkdown {...reactMarkdownProperties} />
|
|
87
|
+
</HtmlContentBlock>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {VFile} from "vfile";
|
|
2
|
+
import {Root, Parent, Element, Text} from "hast";
|
|
3
|
+
import highlightSearchWordsPluginFactory from "./highlightSearchWords";
|
|
4
|
+
|
|
5
|
+
describe("Highlight search words reHype plugin", () => {
|
|
6
|
+
it("should highlight search words", () => {
|
|
7
|
+
const searchQuery = "abc xyz"
|
|
8
|
+
const highlightSearchWordsPlugin = highlightSearchWordsPluginFactory(searchQuery)
|
|
9
|
+
const highlightSearchWordTransformer = highlightSearchWordsPlugin()
|
|
10
|
+
const textNode = (text: string): Text => ({type: "text", value: text})
|
|
11
|
+
const markNode = (text: string): Element => ({type: "element", tagName: "mark", children: [textNode(text)]})
|
|
12
|
+
const result = highlightSearchWordTransformer({
|
|
13
|
+
type: "root",
|
|
14
|
+
children: [
|
|
15
|
+
{
|
|
16
|
+
type: "element",
|
|
17
|
+
tagName: "p",
|
|
18
|
+
children: [textNode("Text with abc query words xyz.")]
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
new VFile(),
|
|
23
|
+
() => {
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
const rootChildren = (result as Root).children
|
|
27
|
+
expect(rootChildren.length).toBe(1)
|
|
28
|
+
expect((rootChildren[0] as Parent).children).toStrictEqual([
|
|
29
|
+
textNode("Text with "),
|
|
30
|
+
markNode("abc"),
|
|
31
|
+
textNode(" query words "),
|
|
32
|
+
markNode("xyz"),
|
|
33
|
+
textNode(".")
|
|
34
|
+
])
|
|
35
|
+
})
|
|
36
|
+
})
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import {Content, Parent, Root, Text} from "hast";
|
|
2
|
+
import {Transformer} from "unified"
|
|
3
|
+
import {Node} from "unist";
|
|
4
|
+
import {createMultiWordRegex, extractSearchWords} from "../../components/Typography/Highlighter";
|
|
5
|
+
|
|
6
|
+
/** Creates a react-markdown reHype plugin that marks text based on a multi-word search query. */
|
|
7
|
+
export default function highlightSearchWordsPluginFactory(searchQuery: string | undefined) {
|
|
8
|
+
const searchStringParts = searchQuery ? extractSearchWords(searchQuery) : []
|
|
9
|
+
const multiWordRegex = createMultiWordRegex(searchStringParts);
|
|
10
|
+
const createTextNode = (text: string): Text => ({type: "text", value: text})
|
|
11
|
+
|
|
12
|
+
// Highlight a text node by returning an array of text and mark elements
|
|
13
|
+
const highlightTextNode = (textNode: Text): Content[] => {
|
|
14
|
+
if (searchStringParts.length === 0) {
|
|
15
|
+
return [textNode];
|
|
16
|
+
}
|
|
17
|
+
const result: Content[] = [];
|
|
18
|
+
|
|
19
|
+
const text = textNode.value
|
|
20
|
+
let offset = 0;
|
|
21
|
+
// loop through matches and add unmatched and matched parts to result array
|
|
22
|
+
let matchArray = multiWordRegex.exec(text);
|
|
23
|
+
while (matchArray !== null) {
|
|
24
|
+
result.push(createTextNode(text.slice(offset, matchArray.index)));
|
|
25
|
+
result.push({type: "element", tagName: "mark", children: [createTextNode(matchArray[0])]});
|
|
26
|
+
offset = multiWordRegex.lastIndex;
|
|
27
|
+
matchArray = multiWordRegex.exec(text);
|
|
28
|
+
}
|
|
29
|
+
// Add remaining unmatched string
|
|
30
|
+
result.push(createTextNode(text.slice(offset)));
|
|
31
|
+
return result;
|
|
32
|
+
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Upper level highlight function
|
|
36
|
+
const highlightRootNode = (node: Root): Root => highlightParentNode(node)
|
|
37
|
+
|
|
38
|
+
// Highlight function to be called on Parent nodes
|
|
39
|
+
const highlightParentNode = <T extends Parent>(parentNode: T): T => {
|
|
40
|
+
const newChildren: Content[] = [];
|
|
41
|
+
parentNode.children.forEach(child => {
|
|
42
|
+
const highlightedChild = highlightTextNodes(child)
|
|
43
|
+
if(Array.isArray(highlightedChild)) {
|
|
44
|
+
newChildren.push(...highlightedChild as Content[])
|
|
45
|
+
} else {
|
|
46
|
+
newChildren.push(highlightedChild as Content)
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
return {...parentNode, children: newChildren} as T
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Highlight function to be called on generic inner nodes
|
|
53
|
+
const highlightTextNodes = (node: Node): Node | Node[] => {
|
|
54
|
+
if(node.type === "text") {
|
|
55
|
+
return highlightTextNode(node as Text)
|
|
56
|
+
} else {
|
|
57
|
+
if((node as Parent).children) {
|
|
58
|
+
return highlightParentNode(node as Parent)
|
|
59
|
+
} else {
|
|
60
|
+
return node
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return function highlightSearchWords(): Transformer<Root, Root> {
|
|
65
|
+
return (input: Root) => highlightRootNode(input)
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.footnote-ref {
|
|
2
|
+
&::before {
|
|
3
|
+
content: "[";
|
|
4
|
+
}
|
|
5
|
+
&::after {
|
|
6
|
+
content: "]";
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
vertical-align: super;
|
|
10
|
+
font-size: $eccgui-size-typo-caption;
|
|
11
|
+
margin-left: $eccgui-size-inline-whitespace / 2;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.footnote-back {
|
|
15
|
+
&::before {
|
|
16
|
+
content: "[";
|
|
17
|
+
}
|
|
18
|
+
&::after {
|
|
19
|
+
content: "]";
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
margin-left: $eccgui-size-inline-whitespace;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
.task-list-item {
|
|
27
|
+
list-style: none;
|
|
28
|
+
|
|
29
|
+
input:first-child {
|
|
30
|
+
margin-left: $eccgui-size-block-whitespace * -2;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
2
|
+
|
|
3
|
+
export const Definitions: { [key: string]: string; } = {
|
|
4
|
+
PRIMARY: "primary" as "primary",
|
|
5
|
+
ACCENT: "accent" as "accent",
|
|
6
|
+
NEUTRAL: "neutral" as "neutral",
|
|
7
|
+
SUCCESS: "success" as "success",
|
|
8
|
+
INFO: "info" as "info",
|
|
9
|
+
WARNING: "warning" as "warning",
|
|
10
|
+
DANGER: "danger" as "danger",
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const classNamesCreation = () => {
|
|
14
|
+
const intentClasses = {...Definitions};
|
|
15
|
+
for (let intentDefinition in Definitions) {
|
|
16
|
+
intentClasses[intentDefinition] = `${eccgui}-intent--${Definitions[intentDefinition]}`;
|
|
17
|
+
}
|
|
18
|
+
return intentClasses;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const ClassNames = classNamesCreation();
|
|
22
|
+
|
|
23
|
+
export type IntentTypes = typeof Definitions[keyof typeof Definitions];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Wrapper for an onClick handler on link-like components, i.e. that navigate to a different URL on click.
|
|
2
|
+
* Opens a link (url) in a new tab when CMD or CTRL key is pressed at click time. */
|
|
3
|
+
export const openInNewTab = (
|
|
4
|
+
event: React.MouseEvent<HTMLElement>,
|
|
5
|
+
handler?: (e: React.MouseEvent<HTMLElement>) => void,
|
|
6
|
+
url?: string
|
|
7
|
+
) => {
|
|
8
|
+
//if ctrl key or cmd key bypass click handler and delegation open in the background new tab
|
|
9
|
+
if (url && (event.ctrlKey || event.metaKey)) {
|
|
10
|
+
event.preventDefault();
|
|
11
|
+
event.nativeEvent.stopImmediatePropagation();
|
|
12
|
+
event.stopPropagation();
|
|
13
|
+
window.open(url, "_blank");
|
|
14
|
+
} else if(handler) {
|
|
15
|
+
handler(event);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Accordion as CarbonAccordion} from "carbon-components-react";
|
|
3
|
+
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
4
|
+
|
|
5
|
+
function Accordion({ children, className = "", align = "start", ...otherProps }: any) {
|
|
6
|
+
return (
|
|
7
|
+
<CarbonAccordion className={`${eccgui}-accordion__container ` + className} align={align} {...otherProps}>
|
|
8
|
+
{children}
|
|
9
|
+
</CarbonAccordion>
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default Accordion;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {AccordionItem as CarbonAccordionItem} from "carbon-components-react";
|
|
3
|
+
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
4
|
+
|
|
5
|
+
export interface AccordionItemProps extends React.LiHTMLAttributes<HTMLLIElement> {
|
|
6
|
+
/*
|
|
7
|
+
additional user class name
|
|
8
|
+
*/
|
|
9
|
+
className?: string;
|
|
10
|
+
/*
|
|
11
|
+
content of accordion item
|
|
12
|
+
*/
|
|
13
|
+
children: string | JSX.Element | JSX.Element[];
|
|
14
|
+
/*
|
|
15
|
+
disable accordion item
|
|
16
|
+
*/
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/*
|
|
19
|
+
set accordion item expliciteky as open when displayed first
|
|
20
|
+
*/
|
|
21
|
+
open?: boolean;
|
|
22
|
+
/*
|
|
23
|
+
header of accordion item
|
|
24
|
+
*/
|
|
25
|
+
label: string | JSX.Element;
|
|
26
|
+
/*
|
|
27
|
+
use full available width for content
|
|
28
|
+
*/
|
|
29
|
+
fullWidth?: boolean;
|
|
30
|
+
/*
|
|
31
|
+
minimize white space and paddings
|
|
32
|
+
*/
|
|
33
|
+
condensed?: boolean;
|
|
34
|
+
/*
|
|
35
|
+
do not use borders as visible separations on accordion item
|
|
36
|
+
*/
|
|
37
|
+
noBorder?: boolean;
|
|
38
|
+
/*
|
|
39
|
+
highlight accordion item by different background color
|
|
40
|
+
*/
|
|
41
|
+
elevated?: boolean;
|
|
42
|
+
title?: never;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
function AccordionItem({
|
|
46
|
+
children,
|
|
47
|
+
label,
|
|
48
|
+
className = "",
|
|
49
|
+
fullWidth = false,
|
|
50
|
+
elevated = false,
|
|
51
|
+
condensed = false,
|
|
52
|
+
noBorder = false,
|
|
53
|
+
...otherProps
|
|
54
|
+
}: AccordionItemProps) {
|
|
55
|
+
return (
|
|
56
|
+
<CarbonAccordionItem
|
|
57
|
+
className={
|
|
58
|
+
`${eccgui}-accordion__item` +
|
|
59
|
+
(!!className ? " " + className : "") +
|
|
60
|
+
(fullWidth ? ` ${eccgui}-accordion__item--fullwidth` : "") +
|
|
61
|
+
(elevated ? ` ${eccgui}-accordion__item--elevated` : "") +
|
|
62
|
+
(condensed ? ` ${eccgui}-accordion__item--condensed` : "") +
|
|
63
|
+
(noBorder ? ` ${eccgui}-accordion__item--noborder` : "")
|
|
64
|
+
}
|
|
65
|
+
title={label}
|
|
66
|
+
{...otherProps}
|
|
67
|
+
>
|
|
68
|
+
{children}
|
|
69
|
+
</CarbonAccordionItem>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export default AccordionItem;
|