"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.scaleTypes = exports.elementType = exports.name = exports["default"] = void 0;

var _extendType = _interopRequireDefault(require("./_extendType"));

var _number = _interopRequireDefault(require("./number"));

var _reactIntl = require("react-intl");

var _default = (0, _extendType["default"])(_number["default"], function (_ref) {
  var config = _ref.config;
  return function (props) {
    var _props$uiSchema;

    if (config.numberDefault === undefined || config.numberDefault > config.maximum || config.numberDefault < config.minimum) {
      var _config$minimum;

      props.schema["default"] = (_config$minimum = config.minimum) !== null && _config$minimum !== void 0 ? _config$minimum : 0;
    }

    (_props$uiSchema = props.uiSchema) !== null && _props$uiSchema !== void 0 ? _props$uiSchema : props.uiSchema = {};
    props.uiSchema['ui:widget'] = 'range';
  };
});

exports["default"] = _default;
var name = (0, _reactIntl.defineMessage)({
  id: "Lop88a",
  defaultMessage: [{
    "type": 0,
    "value": "Liukusäädin"
  }]
});
exports.name = name;
var elementType = 'field';
exports.elementType = elementType;
var scaleTypes = [{
  value: 'noScale',
  message: (0, _reactIntl.defineMessage)({
    id: "IED1vq",
    defaultMessage: [{
      "type": 0,
      "value": "Ei asteikkoa"
    }]
  })
}, {
  value: 'automaticScale',
  message: (0, _reactIntl.defineMessage)({
    id: "7suTBl",
    defaultMessage: [{
      "type": 0,
      "value": "Automaattinen asteikko"
    }]
  })
}, {
  value: 'customScale',
  message: (0, _reactIntl.defineMessage)({
    id: "17f1+3",
    defaultMessage: [{
      "type": 0,
      "value": "Määrittele oma asteikko"
    }]
  })
}];
exports.scaleTypes = scaleTypes;
//# sourceMappingURL=range.cjs.map