Screenshot
This is a dialog to enable a user to copy some given text into the OS's clipboard.
Before click on button

After click on button

API
The API of ewc-dialog applies to this component as well, because it derives from ewc-dialog.
However because this is a single purpose specialisation of ewc-dialog, there should be no need to specialise it any further.
This component introduces the following properties:
- clipboardContent - the given string is displayed in the dialog and copied into the clipboard.
- messages - an object specifying the text messages of the dialog. For details, see Translation.
The properties can be modified at runtime.
Please see usage-example/ directory for examples on how to use this component.
Translation
The following object is defined internally to specify the default texts.
{
title: "Embed visualisation",
prompt: "Copy the following code or click the button to automatically copy to clipboard.",
buttonText: "Copy to clipboard",
outcomeSuccess: "Copied to clipboard",
outcomeFailure: "Code could not be copied to clipboard"
}
The texts can be changed by supplying an object w/ the properties shown above to the messages setter.
Note that it is mandatory to set each property in the given object - supplying an object w/ only some of the properties results in undefined behaviour.
The examples in the usage-example/ directory also contain this use case.