<html><head><link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../marked-element/marked-element.html">
<link rel="import" href="iron-doc-property-styles.html">



</head><body><dom-module id="iron-doc-property">
  <template>
    <style include="iron-doc-property-styles"></style>

    <div id="transitionMask">
      <div id="signature">
        <a id$="[[anchorId]]" href$="#[[anchorId]]" class="name deeplink">{{descriptor.name}}</a><span class="params">(<span>{{_paramText}}</span>)</span>
        <span class="return" hidden$="{{!descriptor.return}}">➙ <span class="type">{{descriptor.return.type}}</span></span>
      </div>
      <div id="details">
        <div id="meta" hidden$="{{_computeHideMeta(descriptor)}}">
          <span id="type" class="type">{{descriptor.type}}</span>
          <span class="annotation">[[_getAnnotation(descriptor)]]</span>
        </div>
        <ol id="params" hidden$="{{_computeHideParams(descriptor,return)}}">
          <template is="dom-repeat" items="{{descriptor.params}}">
            <li hidden$="{{!item.type}}">
              <span class="name">{{item.name}}</span>
              <span class="type">{{item.type}}</span>
              <marked-element markdown="{{item.desc}}">
                <div class="markdown-html"></div>
              </marked-element>
            </li>
          </template>
          <li class="return" hidden$="{{!descriptor.return}}">Returns
            <span class="type">{{descriptor.return.type}}</span>
            <marked-element markdown="{{descriptor.return.desc}}">
              <div class="markdown-html"></div>
            </marked-element>
          </li>
        </ol>
        <marked-element id="desc" markdown="{{descriptor.desc}}" hidden$="{{!descriptor.desc}}">
          <div class="markdown-html"></div>
        </marked-element>
      </div>
    </div>
  </template>

  <script>!function(){Polymer({is:"iron-doc-property",properties:{descriptor:{type:Object,observer:"_descriptorChanged"},collapsed:{type:Boolean,value:!1,observer:"_collapsedChanged"},anchorId:{type:String,reflectToAttribute:!0},_paramText:String},listeners:{transitionEnd:"_onTransitionEnd",webkitTransitionEnd:"_onTransitionEnd"},ready:function(){this._isReady=!0},_onTransitionEnd:function(t){t.path[0]===this.$.transitionMask&&(this.$.transitionMask.style.height="")},_descriptorChanged:function(){this.toggleAttribute("private",this.descriptor["private"]),this.toggleAttribute("configuration",this.descriptor.configuration),this.toggleAttribute("function",this.descriptor["function"]),this._paramText=(this.descriptor.params||[]).map(function(t){return t.name}).join(", ")},_collapsedChanged:function(){if(!this._isReady)return void this.toggleAttribute("_collapsed",this.collapsed);var t=this.$.transitionMask,i=this.collapsed;t.style.height="auto";var e=t.offsetHeight;this.collapsed?t.style.height=e+"px":t.style.height="",requestAnimationFrame(function(){this.toggleAttribute("_collapsed",i),this.collapsed?t.style.height="":t.style.height=e+"px"}.bind(this))},_computeHideMeta:function(t){return void 0===t.type&&void 0===t["default"]},_computeHideParams:function(t,i){return!(t.params&&0!==t.params.length||i)},_computeHideDefault:function(t){return void 0===t},_computeDefaultDisplay:function(t){return""===t?"''":t},_getAnnotation:function(t){var i=[];return void 0!==t["default"]&&i.push("Default: "+t["default"]),t.readOnly&&i.push("readOnly"),t.notify&&i.push("notifies"),i.join(" – ")}})}();</script>
</dom-module>
</body></html>