This repository has been archived by the owner on Feb 7, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
raml-type-property-description.html
91 lines (87 loc) · 3.49 KB
/
raml-type-property-description.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!--
@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>