@gooddata/react-components
Version:
GoodData.UI - A powerful JavaScript library for building analytical applications
48 lines • 2.39 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
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 });
// (C) 2020 GoodData Corporation
var React = require("react");
var classnames_1 = require("classnames");
var react_intl_1 = require("react-intl");
var PreviewRows_1 = require("../shared/PreviewRows");
var ExtendedPreview = /** @class */ (function (_super) {
__extends(ExtendedPreview, _super);
function ExtendedPreview() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.state = {
expanded: false,
};
_this.openExtendedPreview = function () {
_this.setState({ expanded: true });
};
return _this;
}
ExtendedPreview.prototype.render = function () {
var expanded = this.state.expanded;
var _a = this.props, format = _a.format, separators = _a.separators;
return (React.createElement("div", { className: "gd-measure-format-extended-preview s-custom-format-dialog-extended-preview" },
React.createElement("div", { className: classnames_1.default("s-custom-format-dialog-extended-preview-button gd-measure-format-button", {
hidden: expanded,
}), onClick: this.openExtendedPreview },
React.createElement("div", { className: "icon-navigateright gd-measure-format-button-icon-left" }),
React.createElement("span", null,
React.createElement(react_intl_1.FormattedMessage, { id: "measureNumberCustomFormatDialog.extendedPreview.button" }))),
expanded && React.createElement(PreviewRows_1.default, { format: format, separators: separators })));
};
return ExtendedPreview;
}(React.Component));
exports.ExtendedPreview = ExtendedPreview;
//# sourceMappingURL=ExtendedPreview.js.map