'use strict';

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

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

var _cspaceRefname = require('cspace-refname');

var _formatHelpers = require('../../../helpers/formatHelpers');

exports.default = {
  default: [{
    name: 'docNumber',
    messages: (0, _reactIntl.defineMessages)({
      label: {
        'id': 'column.refs.default.docNumber',
        'defaultMessage': 'Record'
      }
    }),
    // The value -might- be a refname.
    // FIXME: It could also be an option list value. How to tell?
    formatValue: function formatValue(value) {
      return (0, _cspaceRefname.getDisplayName)(value) || value;
    },
    width: 200
  }, {
    name: 'docName',
    messages: (0, _reactIntl.defineMessages)({
      label: {
        'id': 'column.refs.default.docName',
        'defaultMessage': 'Summary'
      }
    }),
    // The value -might- be a refname.
    // FIXME: It could also be an option list value. How to tell?
    formatValue: function formatValue(value) {
      return (0, _cspaceRefname.getDisplayName)(value) || value;
    },
    width: 300
  }, {
    name: 'docType',
    messages: (0, _reactIntl.defineMessages)({
      label: {
        'id': 'column.refs.default.docType',
        'defaultMessage': 'Type'
      }
    }),
    formatValue: function formatValue(value, formatterContext) {
      return (0, _formatHelpers.formatServiceObjectName)(value, formatterContext);
    },
    width: 150
  }, {
    name: 'sourceField',
    messages: (0, _reactIntl.defineMessages)({
      label: {
        'id': 'column.refs.default.sourceField',
        'defaultMessage': 'Field'
      }
    }),
    formatValue: function formatValue(value, formatterContext) {
      return (0, _formatHelpers.formatForeignSourceField)(value, formatterContext);
    },
    width: 250
  }],
  narrow: [{
    name: 'docNumber',
    messages: (0, _reactIntl.defineMessages)({
      label: {
        'id': 'column.refs.narrow.docNumber',
        'defaultMessage': 'Record'
      }
    }),
    // The value -might- be a refname.
    // FIXME: It could also be an option list value. How to tell?
    formatValue: function formatValue(value) {
      return (0, _cspaceRefname.getDisplayName)(value) || value;
    },
    width: 200
  }, {
    name: 'docName',
    messages: (0, _reactIntl.defineMessages)({
      label: {
        'id': 'column.refs.narrow.docName',
        'defaultMessage': 'Summary'
      }
    }),
    // The value -might- be a refname.
    // FIXME: It could also be an option list value. How to tell?
    formatValue: function formatValue(value) {
      return (0, _cspaceRefname.getDisplayName)(value) || value;
    },
    width: 300
  }, {
    name: 'docType',
    messages: (0, _reactIntl.defineMessages)({
      label: {
        'id': 'column.refs.narrow.docType',
        'defaultMessage': 'Type'
      }
    }),
    formatValue: function formatValue(value, formatterContext) {
      return (0, _formatHelpers.formatServiceObjectName)(value, formatterContext);
    },
    width: 150
  }, {
    name: 'sourceField',
    messages: (0, _reactIntl.defineMessages)({
      label: {
        'id': 'column.refs.narrow.sourceField',
        'defaultMessage': 'Field'
      }
    }),
    formatValue: function formatValue(value, formatterContext) {
      return (0, _formatHelpers.formatForeignSourceField)(value, formatterContext);
    },
    width: 250
  }]
};