exmg-copy-to-clipboard
Version:
Helper element to create a copy to clipboard button
267 lines (266 loc) • 8.14 kB
JSON
{
"schema_version": "1.0.0",
"namespaces": [
{
"name": "Exmg",
"description": "",
"summary": "",
"sourceRange": {
"file": "exmg-copy-to-clipboard.html",
"start": {
"line": 188,
"column": 2
},
"end": {
"line": 188,
"column": 34
}
},
"elements": [
{
"description": "`<exmg-copy-to-clipboard>` Helper element to create icon/buttons that\nlets the user copy content to the clipboard. Just wrap it arround\nthe button or icon and set the value that needs to be copied.\n\n```html\n <exmg-copy-to-clipboard value=\"mark@test.com\">\n <paper-icon-button icon=\"content-copy\"></paper-icon-button>\n </exmg-copy-to-clipboard>\n```\n\nExample of how to set the default date pattern in the global scope\n```html\n window.Exmg.defaultDatePattern = 'dd/MM/yy';\n```\n\n### Styling\n\nCustom property | Description | Default\n----------------|-------------|----------\n`--exmg-copy-to-clipboard` | Mixin applied to host element | `{}`",
"summary": "",
"path": "exmg-copy-to-clipboard.html",
"properties": [
{
"name": "value",
"type": "string",
"description": "Property value used for clipboard copy action",
"privacy": "public",
"sourceRange": {
"start": {
"line": 46,
"column": 8
},
"end": {
"line": 48,
"column": 9
}
},
"metadata": {
"polymer": {}
}
},
{
"name": "_isCopySupported",
"type": "boolean",
"description": "Boolean indicating if document.execCommand('copy') is supported",
"privacy": "protected",
"sourceRange": {
"start": {
"line": 53,
"column": 8
},
"end": {
"line": 56,
"column": 9
}
},
"metadata": {
"polymer": {}
},
"defaultValue": "false"
},
{
"name": "bubbles",
"type": "boolean",
"description": "By default, exmg-web-socket events do not bubble. Setting this attribute will cause its\nevents to bubble to the window object.",
"privacy": "public",
"sourceRange": {
"start": {
"line": 62,
"column": 8
},
"end": {
"line": 65,
"column": 9
}
},
"metadata": {
"polymer": {}
},
"defaultValue": "false"
}
],
"methods": [
{
"name": "_initSlottedElement",
"description": "initializes the slotted content and adds a event listener to the html element provided",
"privacy": "protected",
"sourceRange": {
"start": {
"line": 90,
"column": 4
},
"end": {
"line": 94,
"column": 5
}
},
"metadata": {},
"params": []
},
{
"name": "connectedCallback",
"description": "Monitor if button is replaced at a later moment and as a result update reference",
"privacy": "public",
"sourceRange": {
"start": {
"line": 99,
"column": 4
},
"end": {
"line": 105,
"column": 5
}
},
"metadata": {},
"params": []
},
{
"name": "disconnectCallback",
"description": "Cleanup node observer",
"privacy": "public",
"sourceRange": {
"start": {
"line": 117,
"column": 4
},
"end": {
"line": 126,
"column": 5
}
},
"metadata": {},
"params": []
},
{
"name": "copyToClipboard",
"description": "Copy the given value to the clipboard",
"privacy": "public",
"sourceRange": {
"start": {
"line": 131,
"column": 4
},
"end": {
"line": 150,
"column": 5
}
},
"metadata": {},
"params": []
},
{
"name": "_hideCopy",
"description": "Hide button when copy functionality is not supported in browser",
"privacy": "protected",
"sourceRange": {
"start": {
"line": 155,
"column": 4
},
"end": {
"line": 160,
"column": 5
}
},
"metadata": {},
"params": [
{
"name": "_isCopySupported"
},
{
"name": "_htmlElement"
}
]
},
{
"name": "_handleCopy",
"description": "Handle button tap event and trigger the actual copy to clipboard",
"privacy": "protected",
"sourceRange": {
"start": {
"line": 165,
"column": 4
},
"end": {
"line": 168,
"column": 5
}
},
"metadata": {},
"params": [
{
"name": "e"
}
]
}
],
"staticMethods": [],
"demos": [
{
"url": "demo/index.html",
"description": ""
}
],
"metadata": {},
"sourceRange": {
"start": {
"line": 36,
"column": 2
},
"end": {
"line": 169,
"column": 3
}
},
"privacy": "public",
"superclass": "HTMLElement",
"name": "Exmg.CopyToClipboardElement",
"attributes": [
{
"name": "value",
"description": "Property value used for clipboard copy action",
"sourceRange": {
"start": {
"line": 46,
"column": 8
},
"end": {
"line": 48,
"column": 9
}
},
"metadata": {},
"type": "string"
},
{
"name": "bubbles",
"description": "By default, exmg-web-socket events do not bubble. Setting this attribute will cause its\nevents to bubble to the window object.",
"sourceRange": {
"start": {
"line": 62,
"column": 8
},
"end": {
"line": 65,
"column": 9
}
},
"metadata": {},
"type": "boolean"
}
],
"events": [],
"styling": {
"cssVariables": [],
"selectors": []
},
"slots": [],
"tagname": "exmg-copy-to-clipboard"
}
]
}
]
}