'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

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

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

exports.default = function (pluginContext) {
  var _dimensionSubGroup, _dimensionSubGroupLis, _measuredPartGroup, _measuredPartGroupLis;

  var _pluginContext$inputC = pluginContext.inputComponents,
      AutocompleteInput = _pluginContext$inputC.AutocompleteInput,
      CompoundInput = _pluginContext$inputC.CompoundInput,
      DateInput = _pluginContext$inputC.DateInput,
      OptionPickerInput = _pluginContext$inputC.OptionPickerInput,
      TextInput = _pluginContext$inputC.TextInput;
  var config = pluginContext.configHelpers.configKey;
  var _pluginContext$dataTy = pluginContext.dataTypes,
      DATA_TYPE_FLOAT = _pluginContext$dataTy.DATA_TYPE_FLOAT,
      DATA_TYPE_DATE = _pluginContext$dataTy.DATA_TYPE_DATE;


  return {
    measuredPartGroupList: (_measuredPartGroupLis = {}, _defineProperty(_measuredPartGroupLis, config, {
      view: {
        type: CompoundInput
      }
    }), _defineProperty(_measuredPartGroupLis, 'measuredPartGroup', (_measuredPartGroup = {}, _defineProperty(_measuredPartGroup, config, {
      messages: (0, _reactIntl.defineMessages)({
        name: {
          'id': 'field.ext.dimension.measuredPartGroup.name',
          'defaultMessage': 'Dimensions'
        }
      }),
      repeating: true,
      view: {
        type: CompoundInput
      }
    }), _defineProperty(_measuredPartGroup, 'measuredPart', _defineProperty({}, config, {
      messages: (0, _reactIntl.defineMessages)({
        name: {
          'id': 'field.ext.dimension.measuredPart.name',
          'defaultMessage': 'Part'
        }
      }),
      view: {
        type: OptionPickerInput,
        props: {
          source: 'measuredParts'
        }
      }
    })), _defineProperty(_measuredPartGroup, 'dimensionSummary', _defineProperty({}, config, {
      messages: (0, _reactIntl.defineMessages)({
        name: {
          'id': 'field.ext.dimension.dimensionSummary.name',
          'defaultMessage': 'Summary'
        }
      }),
      view: {
        type: TextInput
      }
    })), _defineProperty(_measuredPartGroup, 'dimensionSubGroupList', (_dimensionSubGroupLis = {}, _defineProperty(_dimensionSubGroupLis, config, {
      view: {
        type: CompoundInput
      }
    }), _defineProperty(_dimensionSubGroupLis, 'dimensionSubGroup', (_dimensionSubGroup = {}, _defineProperty(_dimensionSubGroup, config, {
      messages: (0, _reactIntl.defineMessages)({
        name: {
          'id': 'field.ext.dimension.dimensionSubGroup.name',
          'defaultMessage': 'Measurement'
        }
      }),
      repeating: true,
      view: {
        type: CompoundInput,
        props: {
          tabular: true
        }
      }
    }), _defineProperty(_dimensionSubGroup, 'dimension', _defineProperty({}, config, {
      messages: (0, _reactIntl.defineMessages)({
        name: {
          'id': 'field.ext.dimension.dimension.name',
          'defaultMessage': 'Dimension'
        }
      }),
      view: {
        type: OptionPickerInput,
        props: {
          source: 'dimensions'
        }
      }
    })), _defineProperty(_dimensionSubGroup, 'measuredBy', _defineProperty({}, config, {
      messages: (0, _reactIntl.defineMessages)({
        name: {
          'id': 'field.ext.dimension.measuredBy.name',
          'defaultMessage': 'Measured by'
        }
      }),
      view: {
        type: AutocompleteInput,
        props: {
          source: 'person/local,person/shared,organization/local,organization/shared'
        }
      }
    })), _defineProperty(_dimensionSubGroup, 'measurementMethod', _defineProperty({}, config, {
      messages: (0, _reactIntl.defineMessages)({
        name: {
          'id': 'field.ext.dimension.measurementMethod.name',
          'defaultMessage': 'Method'
        }
      }),
      view: {
        type: OptionPickerInput,
        props: {
          source: 'measurementMethods'
        }
      }
    })), _defineProperty(_dimensionSubGroup, 'value', _defineProperty({}, config, {
      dataType: DATA_TYPE_FLOAT,
      messages: (0, _reactIntl.defineMessages)({
        fullName: {
          'id': 'field.ext.dimension.value.fullName',
          'defaultMessage': 'Measurement value'
        },
        name: {
          'id': 'field.ext.dimension.value.name',
          'defaultMessage': 'Value'
        }
      }),
      view: {
        type: TextInput
      }
    })), _defineProperty(_dimensionSubGroup, 'measurementUnit', _defineProperty({}, config, {
      messages: (0, _reactIntl.defineMessages)({
        name: {
          'id': 'field.ext.dimension.measurementUnit.name',
          'defaultMessage': 'Unit'
        }
      }),
      view: {
        type: OptionPickerInput,
        props: {
          source: 'measurementUnits'
        }
      }
    })), _defineProperty(_dimensionSubGroup, 'valueQualifier', _defineProperty({}, config, {
      messages: (0, _reactIntl.defineMessages)({
        name: {
          'id': 'field.ext.dimension.valueQualifier.name',
          'defaultMessage': 'Qualifier'
        }
      }),
      view: {
        type: TextInput
      }
    })), _defineProperty(_dimensionSubGroup, 'valueDate', _defineProperty({}, config, {
      dataType: DATA_TYPE_DATE,
      messages: (0, _reactIntl.defineMessages)({
        name: {
          'id': 'field.ext.dimension.valueDate.name',
          'defaultMessage': 'Date'
        },
        fullName: {
          'id': 'field.ext.dimension.valueDate.fullName',
          'defaultMessage': 'Measurement date'
        }
      }),
      view: {
        type: DateInput
      }
    })), _dimensionSubGroup)), _dimensionSubGroupLis)), _measuredPartGroup)), _measuredPartGroupLis)
  };
};