'use strict';

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

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

exports.default = pluginContext => {
  var _pluginContext$inputC = pluginContext.inputComponents;
  const CompoundInput = _pluginContext$inputC.CompoundInput,
        OptionPickerInput = _pluginContext$inputC.OptionPickerInput,
        TextInput = _pluginContext$inputC.TextInput,
        AutocompleteInput = _pluginContext$inputC.AutocompleteInput;
  const config = pluginContext.configHelpers.configKey;
  const DATA_TYPE_INT = pluginContext.dataTypes.DATA_TYPE_INT;
  const extensions = pluginContext.config.extensions;


  return {
    document: Object.assign({
      [config]: {
        view: {
          type: CompoundInput,
          props: {
            defaultChildSubpath: 'ns2:pottags_common'
          }
        }
      }
    }, extensions.core.fields, {
      'ns2:pottags_common': {
        [config]: {
          service: {
            ns: 'http://collectionspace.org/services/pottag'
          }
        },
        family: {
          [config]: {
            messages: (0, _reactIntl.defineMessages)({
              name: {
                'id': 'field.pottags_common.family.name',
                'defaultMessage': 'Family'
              }
            }),
            view: {
              type: AutocompleteInput,
              props: {
                source: 'taxon/local'
              }
            }
          }
        },
        commonName: {
          [config]: {
            messages: (0, _reactIntl.defineMessages)({
              name: {
                'id': 'field.pottags_common.commonName.name',
                'defaultMessage': 'Common name'
              }
            }),
            view: {
              type: TextInput
            }
          }
        },
        locale: {
          [config]: {
            messages: (0, _reactIntl.defineMessages)({
              name: {
                'id': 'field.pottags_common.locale.name',
                'defaultMessage': 'Country name/locale'
              }
            }),
            view: {
              type: TextInput
            }
          }
        },
        taxonName: {
          [config]: {
            messages: (0, _reactIntl.defineMessages)({
              name: {
                'id': 'field.pottags_common.taxonName.name',
                'defaultMessage': 'Taxon name'
              }
            }),
            view: {
              type: AutocompleteInput,
              props: {
                source: 'taxon/local'
              }
            }
          }
        },
        labelData: {
          [config]: {
            messages: (0, _reactIntl.defineMessages)({
              name: {
                'id': 'field.pottags_common.labelData.name',
                'defaultMessage': 'Label data'
              }
            }),
            view: {
              type: TextInput,
              props: {
                multiline: true
              }
            }
          }
        },
        numberOfLabels: {
          [config]: {
            dataType: DATA_TYPE_INT,
            messages: (0, _reactIntl.defineMessages)({
              name: {
                'id': 'field.pottags_common.numberOfLabels.name',
                'defaultMessage': 'Number of labels'
              }
            }),
            view: {
              type: TextInput
            }
          }
        },
        printLabels: {
          [config]: {
            messages: (0, _reactIntl.defineMessages)({
              name: {
                'id': 'field.pottags_common.printLabels.name',
                'defaultMessage': 'Print labels'
              }
            }),
            view: {
              type: OptionPickerInput,
              props: {
                source: 'printLabelOptions'
              }
            }
          }
        }
      }
    })
  };
};