UNPKG

@gooddata/react-components

Version:

GoodData.UI - A powerful JavaScript library for building analytical applications

43 lines 2.54 kB
"use strict"; 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 ConfigSubsection_1 = require("../../configurationControls/ConfigSubsection"); var get = require("lodash/get"); var LabelRotationControl_1 = require("./LabelRotationControl"); var LabelSubsection = /** @class */ (function (_super) { __extends(LabelSubsection, _super); function LabelSubsection() { return _super !== null && _super.apply(this, arguments) || this; } LabelSubsection.prototype.render = function () { var _a = this.getControlProperties(), axisVisible = _a.axisVisible, axisLabelsEnabled = _a.axisLabelsEnabled; return (React.createElement(ConfigSubsection_1.default, { title: "properties.axis.labels", valuePath: this.props.axis + ".labelsEnabled", properties: this.props.properties, pushData: this.props.pushData, canBeToggled: true, toggledOn: axisLabelsEnabled, toggleDisabled: this.props.disabled || !axisVisible, showDisabledMessage: !this.props.configPanelDisabled && this.props.disabled }, React.createElement(LabelRotationControl_1.default, { disabled: this.props.disabled, configPanelDisabled: this.props.configPanelDisabled, axis: this.props.axis, properties: this.props.properties, pushData: this.props.pushData }))); }; LabelSubsection.prototype.getControlProperties = function () { var axisVisible = get(this.props, "properties.controls." + this.props.axis + ".visible", true); var axisLabelsEnabled = get(this.props, "properties.controls." + this.props.axis + ".labelsEnabled", true); return { axisVisible: axisVisible, axisLabelsEnabled: axisLabelsEnabled, }; }; return LabelSubsection; }(React.PureComponent)); exports.default = react_intl_1.injectIntl(LabelSubsection); //# sourceMappingURL=LabelSubsection.js.map