@@ -126,6 +126,10 @@ export class PropertyShapeDocument extends PropertyDocumentMixin(LitElement) {
126126 * Computed value from the shape. True if the property is an anyOf
127127 */
128128 isAnyOf : { type : Boolean } ,
129+ /**
130+ * Determines if shape's range is deprecated
131+ */
132+ deprecated : { type : Boolean , reflect : true } ,
129133 } ;
130134 }
131135
@@ -208,6 +212,7 @@ export class PropertyShapeDocument extends PropertyDocumentMixin(LitElement) {
208212 this . hasPropertyDescription = false ;
209213 this . narrow = false ;
210214 this . renderReadOnly = false ;
215+ this . deprecated = false ;
211216 }
212217
213218 connectedCallback ( ) {
@@ -268,6 +273,12 @@ export class PropertyShapeDocument extends PropertyDocumentMixin(LitElement) {
268273 this . propertyName
269274 ) ;
270275 this . propertyDataType = this . _computeObjectDataType ( range , shape ) ;
276+ const isDeprecated = Boolean ( this . _computeIsDeprecated ( range ) ) ;
277+ this . deprecated = isDeprecated ;
278+ }
279+
280+ _computeIsDeprecated ( range ) {
281+ return this . _getValue ( range , this . _getAmfKey ( this . ns . aml . vocabularies . shapes . deprecated ) )
271282 }
272283
273284 _computeObjectDataType ( range , shape ) {
@@ -633,6 +644,13 @@ export class PropertyShapeDocument extends PropertyDocumentMixin(LitElement) {
633644 : '' } `;
634645 }
635646
647+ _deprecatedWarningTemplate ( ) {
648+ if ( ! this . deprecated ) {
649+ return '' ;
650+ }
651+ return html `< div class ="deprecated-warning "> Warning: Deprecated</ div > `
652+ }
653+
636654 /**
637655 * @return {TemplateResult } Main render function.
638656 */
@@ -665,6 +683,7 @@ export class PropertyShapeDocument extends PropertyDocumentMixin(LitElement) {
665683 > `
666684 : '' }
667685 </ div >
686+ ${ this . _deprecatedWarningTemplate ( ) }
668687 ${ this . _descriptionTemplate ( ) }
669688 < property-range-document
670689 .amf ="${ this . amf } "
0 commit comments