UNPKG

alm

Version:

The best IDE for TypeScript

50 lines (49 loc) 1.86 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var React = require("react"); var csx = require("../base/csx"); var ui_1 = require("../ui"); var ui = require("../ui"); var typestyle = require("typestyle"); var buttonClassName = typestyle.style({ height: '18px', padding: '2px 3px', display: 'inline-flex', cursor: 'pointer', backgroundImage: 'linear-gradient(#7B7B7B, #353434)', border: '1px solid #464646', borderRadius: '3px', userSelect: 'none', outline: '0px', $nest: { '&:active': { backgroundImage: 'linear-gradient(#353434, #7B7B7B)', } } }); var clippy = { width: '12px', height: '12px' }; var Clipboard = /** @class */ (function (_super) { __extends(Clipboard, _super); function Clipboard() { return _super !== null && _super.apply(this, arguments) || this; } Clipboard.prototype.render = function () { return (React.createElement("button", { className: buttonClassName, style: csx.extend(csx.center), "data-clipboard-text": this.props.text, onClick: function (event) { return event.stopPropagation() || ui.notifyInfoQuickDisappear("Copied"); } }, React.createElement("img", { src: "assets/clippy.svg", style: clippy }))); }; return Clipboard; }(ui_1.BaseComponent)); exports.Clipboard = Clipboard;