"use strict";

exports.__esModule = true;
exports.default = void 0;

var _react = _interopRequireDefault(require("react"));

var _core = require("@superset-ui/core");

var _chartControls = require("@superset-ui/chart-controls");

var _types = require("./types");

var _react2 = require("@emotion/react");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
const config = {
  controlPanelSections: [{
    label: (0, _core.t)('Query'),
    expanded: true,
    controlSetRows: [[{
      name: 'groupby',
      config: { ..._chartControls.sharedControls.groupby,
        label: (0, _core.t)('Group by'),
        description: (0, _core.t)('Columns to group by')
      }
    }], ['metric'], ['adhoc_filters'], [{
      name: 'row_limit',
      config: { ..._chartControls.sharedControls.row_limit,
        choices: [...Array(10).keys()].map(n => n + 1),
        default: _types.DEFAULT_FORM_DATA.rowLimit
      }
    }]]
  }, {
    label: (0, _core.t)('Chart Options'),
    expanded: true,
    controlSetRows: [[(0, _react2.jsx)("h1", {
      className: "section-header"
    }, (0, _core.t)('General'))], [{
      name: 'min_val',
      config: {
        type: 'TextControl',
        isInt: true,
        default: String(_types.DEFAULT_FORM_DATA.minVal),
        validators: [_core.validateNonEmpty, _core.validateInteger],
        renderTrigger: true,
        label: (0, _core.t)('Min'),
        description: (0, _core.t)('Minimum value on the gauge axis')
      }
    }, {
      name: 'max_val',
      config: {
        type: 'TextControl',
        isInt: true,
        default: _types.DEFAULT_FORM_DATA.maxVal,
        validators: [_core.validateNonEmpty, _core.validateInteger],
        renderTrigger: true,
        label: (0, _core.t)('Max'),
        description: (0, _core.t)('Maximum value on the gauge axis')
      }
    }], [{
      name: 'start_angle',
      config: {
        type: 'TextControl',
        label: (0, _core.t)('Start angle'),
        description: (0, _core.t)('Angle at which to start progress axis'),
        renderTrigger: true,
        default: _types.DEFAULT_FORM_DATA.startAngle
      }
    }, {
      name: 'end_angle',
      config: {
        type: 'TextControl',
        label: (0, _core.t)('End angle'),
        description: (0, _core.t)('Angle at which to end progress axis'),
        renderTrigger: true,
        default: _types.DEFAULT_FORM_DATA.endAngle
      }
    }], ['color_scheme'], [{
      name: 'font_size',
      config: {
        type: 'SliderControl',
        label: (0, _core.t)('Font size'),
        description: (0, _core.t)('Font size for axis labels, detail value and other text elements'),
        renderTrigger: true,
        min: 10,
        max: 20,
        default: _types.DEFAULT_FORM_DATA.fontSize
      }
    }], [{
      name: 'number_format',
      config: {
        type: 'SelectControl',
        label: (0, _core.t)('Number format'),
        description: 'D3 format syntax: https://github.com/d3/d3-format',
        freeForm: true,
        renderTrigger: true,
        default: _types.DEFAULT_FORM_DATA.numberFormat,
        choices: _chartControls.D3_FORMAT_OPTIONS
      }
    }], [{
      name: 'value_formatter',
      config: {
        type: 'TextControl',
        label: (0, _core.t)('Value format'),
        description: (0, _core.t)('Additional text to add before or after the value, e.g. unit'),
        renderTrigger: true,
        default: _types.DEFAULT_FORM_DATA.valueFormatter
      }
    }], [{
      name: 'show_pointer',
      config: {
        type: 'CheckboxControl',
        label: (0, _core.t)('Show pointer'),
        description: (0, _core.t)('Whether to show the pointer'),
        renderTrigger: true,
        default: _types.DEFAULT_FORM_DATA.showPointer
      }
    }], [{
      name: 'animation',
      config: {
        type: 'CheckboxControl',
        label: (0, _core.t)('Animation'),
        description: (0, _core.t)('Whether to animate the progress and the value or just display them'),
        renderTrigger: true,
        default: _types.DEFAULT_FORM_DATA.animation
      }
    }], [(0, _react2.jsx)("h1", {
      className: "section-header"
    }, (0, _core.t)('Axis'))], [{
      name: 'show_axis_tick',
      config: {
        type: 'CheckboxControl',
        label: (0, _core.t)('Show axis line ticks'),
        description: (0, _core.t)('Whether to show minor ticks on the axis'),
        renderTrigger: true,
        default: _types.DEFAULT_FORM_DATA.showAxisTick
      }
    }], [{
      name: 'show_split_line',
      config: {
        type: 'CheckboxControl',
        label: (0, _core.t)('Show split lines'),
        description: (0, _core.t)('Whether to show the split lines on the axis'),
        renderTrigger: true,
        default: _types.DEFAULT_FORM_DATA.showSplitLine
      }
    }], [{
      name: 'split_number',
      config: {
        type: 'SliderControl',
        label: (0, _core.t)('Split number'),
        description: (0, _core.t)('Number of split segments on the axis'),
        renderTrigger: true,
        min: 3,
        max: 30,
        default: _types.DEFAULT_FORM_DATA.splitNumber
      }
    }], [(0, _react2.jsx)("h1", {
      className: "section-header"
    }, (0, _core.t)('Progress'))], [{
      name: 'show_progress',
      config: {
        type: 'CheckboxControl',
        label: (0, _core.t)('Show progress'),
        description: (0, _core.t)('Whether to show the progress of gauge chart'),
        renderTrigger: true,
        default: _types.DEFAULT_FORM_DATA.showProgress
      }
    }], [{
      name: 'overlap',
      config: {
        type: 'CheckboxControl',
        label: (0, _core.t)('Overlap'),
        description: (0, _core.t)('Whether the progress bar overlaps when there are multiple groups of data'),
        renderTrigger: true,
        default: _types.DEFAULT_FORM_DATA.overlap
      }
    }], [{
      name: 'round_cap',
      config: {
        type: 'CheckboxControl',
        label: (0, _core.t)('Round cap'),
        description: (0, _core.t)('Style the ends of the progress bar with a round cap'),
        renderTrigger: true,
        default: _types.DEFAULT_FORM_DATA.roundCap
      }
    }], [(0, _react2.jsx)("h1", {
      className: "section-header"
    }, (0, _core.t)('Intervals'))], [{
      name: 'intervals',
      config: {
        type: 'TextControl',
        label: (0, _core.t)('Interval bounds'),
        description: (0, _core.t)('Comma-separated interval bounds, e.g. 2,4,5 for intervals 0-2, 2-4 and 4-5. Last number should match the value provided for MAX.'),
        renderTrigger: true,
        default: _types.DEFAULT_FORM_DATA.intervals
      }
    }], [{
      name: 'interval_color_indices',
      config: {
        type: 'TextControl',
        label: (0, _core.t)('Interval colors'),
        description: (0, _core.t)('Comma-separated color picks for the intervals, e.g. 1,2,4. Integers denote colors from the chosen color scheme and are 1-indexed. Length must be matching that of interval bounds.'),
        renderTrigger: true,
        default: _types.DEFAULT_FORM_DATA.intervalColorIndices
      }
    }]]
  }]
};
var _default = config;
exports.default = _default;