"use strict";

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

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

var _styledComponents = _interopRequireWildcard(require("styled-components"));

var _Field = _interopRequireWildcard(require("./Field"));

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

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

(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();

(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();

var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};

var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};

var CombiningRow = _styledComponents.default.div.withConfig({
  displayName: "Combination__CombiningRow",
  componentId: "sc-yii6w9-0"
})(["display:flex;flex-direction:row;& > ", "{margin-top:0;margin-right:15px;}& > ", ":last-child{margin-right:0;}", ";"], _Field.FieldBox, _Field.FieldBox, function (props) {
  return props.proportions.map(function (width, index) {
    return width ? (0, _styledComponents.css)(["& > ", ":nth-child(", "){flex:", ";}"], _Field.FieldBox, index + 1, typeof width === "string" ? "0 0 " + width : "0 1 " + width + "%") : "";
  });
});

exports.CombiningRow = CombiningRow;

var CombinationField = function CombinationField(_ref) {
  var label = _ref.label,
      children = _ref.children,
      _ref$proportions = _ref.proportions,
      proportions = _ref$proportions === void 0 ? [] : _ref$proportions;
  return /*#__PURE__*/_react.default.createElement(_Field.default, {
    label: label
  }, /*#__PURE__*/_react.default.createElement(CombiningRow, {
    proportions: proportions
  }, children));
};

var _default = CombinationField;
var _default2 = _default;
var _default3 = _default2;
exports.default = _default3;
;

(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;

  if (!reactHotLoader) {
    return;
  }

  reactHotLoader.register(CombiningRow, "CombiningRow", "/home/vsts/work/1/s/src/components/Form/Combination.js");
  reactHotLoader.register(CombinationField, "CombinationField", "/home/vsts/work/1/s/src/components/Form/Combination.js");
  reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/components/Form/Combination.js");
})();

;

(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();

;

(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;

  if (!reactHotLoader) {
    return;
  }

  reactHotLoader.register(CombiningRow, "CombiningRow", "/home/vsts/work/1/s/src/components/Form/Combination.js");
  reactHotLoader.register(CombinationField, "CombinationField", "/home/vsts/work/1/s/src/components/Form/Combination.js");
  reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/components/Form/Combination.js");
})();

;

(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();