@gooddata/react-components
Version:
GoodData.UI - A powerful JavaScript library for building analytical applications
41 lines • 2.25 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) 2019-2020 GoodData Corporation
var React = require("react");
var react_intl_1 = require("react-intl");
var get = require("lodash/get");
var DropdownControl_1 = require("./DropdownControl");
var dropdowns_1 = require("../../constants/dropdowns");
var translations_1 = require("../../utils/translations");
var DataLabelsControl = /** @class */ (function (_super) {
__extends(DataLabelsControl, _super);
function DataLabelsControl() {
return _super !== null && _super.apply(this, arguments) || this;
}
DataLabelsControl.prototype.render = function () {
var _a = this.props, pushData = _a.pushData, properties = _a.properties, intl = _a.intl, isDisabled = _a.isDisabled, showDisabledMessage = _a.showDisabledMessage, defaultValue = _a.defaultValue;
var dataLabels = get(properties, "controls.dataLabels.visible", defaultValue);
return (React.createElement("div", { className: "s-data-labels-config" },
React.createElement(DropdownControl_1.default, { value: dataLabels, valuePath: "dataLabels.visible", labelText: "properties.canvas.dataLabels", disabled: isDisabled, properties: properties, pushData: pushData, items: translations_1.getTranslatedDropdownItems(dropdowns_1.dataLabelsDropdownItems, intl), showDisabledMessage: showDisabledMessage })));
};
DataLabelsControl.defaultProps = {
defaultValue: "auto",
showDisabledMessage: false,
};
return DataLabelsControl;
}(React.Component));
exports.default = react_intl_1.injectIntl(DataLabelsControl);
//# sourceMappingURL=DataLabelsControl.js.map