// # field mixin

/*
This mixin gets mixed into all field components.
*/

'use strict';

import shared from './shared';

export default {
  ...shared,

  // Signal a change in value.
  onChangeValue: function(value) {
    this.props.onChange(value, {
      field: this.props.field,
    });
  },

  // Bubble up a value.
  onBubbleValue: function(value, info) {
    this.props.onChange(value, info);
  },

  // Delegate rendering back to config so it can be wrapped.
  renderWithConfig: function() {
    return this.props.config.renderFieldComponent(this);
  },
};

@@ -145,16 +145,215 @@
 hared,%0A%0A
+  // Create a unique id for the field%0A  getInitialState: function() %7B%0A    return %7B%0A      id: Math.random()%0A        .toString(36)%0A        .replace(/%5B%5Ea-z%5D+/g, '')%0A        .substr(0, 20),%0A    %7D;%0A  %7D,%0A%0A
   // Sig

add id support to field mixin