UNPKG

api-console-assets

Version:

This repo only exists to publish api console components to npm

92 lines (87 loc) 3.58 kB
<!-- @license Copyright 2016 The Advanced REST client authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <link rel="import" href="../polymer/polymer.html"> <link rel="import" href="../marked-element/marked-element.html"> <link rel="import" href="../prism-element/prism-theme-default.html"> <link rel="import" href="../markdown-styles/markdown-styles.html"> <link rel="import" href="../raml-annotations-display/raml-annotations-display.html"> <link rel="import" href="docs-parameters-table-shared-styles.html"> <link rel="import" href="docs-parameters-behavior.html"> <!-- A RAML's type's property item description. It renders documentation for a single RAML type's property. @element markdown-body --> <dom-module id="raml-type-property-description"> <template> <style include="markdown-styles"></style> <style include="docs-parameters-table-shared-styles"></style> <style> .markdown-body p { margin: 0; } </style> <template is="dom-if" if="[[_hasDisplayName(item)]]"> <p class="property-display-name">[[item.displayName]]</p> </template> <template is="dom-if" if="[[item.description]]"> <marked-element markdown="[[item.description]]"> <div class="markdown-html markdown-body"></div> </marked-element> </template> <template is="dom-if" if="[[displayType]]"> <div class="meta-property type">Type: <span>[[item.type]]</span></div> </template> <template is="dom-if" if="[[hasValue(item.default)]]"> <div class="meta-property default">Default value: <span>[[getValue(item.default)]]</span></div> </template> <template is="dom-if" if="[[_hasExamples(item)]]"> <div class="meta-property example">Example value: <span>[[_getExamples(item)]]</span></div> </template> <template is="dom-if" if="[[item.pattern]]"> <div class="meta-property pattern">Validation pattern: <span>[[item.pattern]]</span></div> </template> <template is="dom-if" if="[[_hasMinimum(item)]]"> <div class="meta-property min">Minimum value: <span>[[_getMinimum(item)]]</span></div> </template> <template is="dom-if" if="[[_hasMaximum(item)]]"> <div class="meta-property max">Maximum value: <span>[[_getMaximum(item)]]</span></div> </template> <template is="dom-if" if="[[hasValue(item.enum)]]"> <div class="meta-property enum">Possible values: <span>[[_computeEnumValue(item.enum)]]</span></div> </template> <template is="dom-if" if="[[hasValue(item.annotations)]]"> <raml-annotations-display class="meta-property annotations" annotations="[[item.annotations]]"></raml-annotations-display> </template> </template> <script> Polymer({ is: 'raml-type-property-description', behaviors: [RamlBehaviors.DocsParametersBehavior], properties: { /** * A property to display information about. */ item: Object, /** * If set then the element will render type property label. */ displayType: { type: Boolean, value: false } } }); </script> </dom-module>