UNPKG

@gooddata/react-components

Version:

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

63 lines 3.6 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 noop = require("lodash/noop"); var mdObjectHelper_1 = require("../../utils/mdObjectHelper"); var ColorsSection_1 = require("../configurationControls/colors/ColorsSection"); var LegendSection_1 = require("../configurationControls/legend/LegendSection"); var internalIntlProvider_1 = require("../../utils/internalIntlProvider"); var localization_1 = require("../../../constants/localization"); var ConfigurationPanelContent = /** @class */ (function (_super) { __extends(ConfigurationPanelContent, _super); function ConfigurationPanelContent() { return _super !== null && _super.apply(this, arguments) || this; } ConfigurationPanelContent.prototype.render = function () { return (React.createElement("div", { key: "config-" + this.props.type }, React.createElement(internalIntlProvider_1.InternalIntlWrapper, { locale: this.props.locale }, this.renderConfigurationPanel()))); }; ConfigurationPanelContent.prototype.isControlDisabled = function () { var _a = this.props, mdObject = _a.mdObject, isError = _a.isError, isLoading = _a.isLoading; return !mdObjectHelper_1.hasMeasures(mdObject) || isError || isLoading; }; ConfigurationPanelContent.prototype.renderColorSection = function () { var _a = this.props, properties = _a.properties, propertiesMeta = _a.propertiesMeta, pushData = _a.pushData, colors = _a.colors, featureFlags = _a.featureFlags, references = _a.references, mdObject = _a.mdObject, isLoading = _a.isLoading; var controlsDisabled = this.isControlDisabled(); return (React.createElement(ColorsSection_1.default, { properties: properties, propertiesMeta: propertiesMeta, references: references, colors: colors, controlsDisabled: controlsDisabled, pushData: pushData, hasMeasures: mdObjectHelper_1.hasMeasures(mdObject), showCustomPicker: featureFlags.enableCustomColorPicker, isLoading: isLoading })); }; ConfigurationPanelContent.prototype.renderLegendSection = function () { var _a = this.props, properties = _a.properties, propertiesMeta = _a.propertiesMeta, pushData = _a.pushData; var controlsDisabled = this.isControlDisabled(); return (React.createElement(LegendSection_1.default, { properties: properties, propertiesMeta: propertiesMeta, controlsDisabled: controlsDisabled, pushData: pushData })); }; ConfigurationPanelContent.defaultProps = { properties: null, references: null, propertiesMeta: null, colors: null, locale: localization_1.DEFAULT_LOCALE, isError: false, isLoading: false, mdObject: null, pushData: noop, featureFlags: {}, axis: null, }; return ConfigurationPanelContent; }(React.PureComponent)); exports.default = ConfigurationPanelContent; //# sourceMappingURL=ConfigurationPanelContent.js.map