@@ -126,6 +126,10 @@ export class PropertyShapeDocument extends PropertyDocumentMixin(LitElement) {
126
126
* Computed value from the shape. True if the property is an anyOf
127
127
*/
128
128
isAnyOf : { type : Boolean } ,
129
+ /**
130
+ * Determines if shape's range is deprecated
131
+ */
132
+ deprecated : { type : Boolean , reflect : true } ,
129
133
} ;
130
134
}
131
135
@@ -208,6 +212,7 @@ export class PropertyShapeDocument extends PropertyDocumentMixin(LitElement) {
208
212
this . hasPropertyDescription = false ;
209
213
this . narrow = false ;
210
214
this . renderReadOnly = false ;
215
+ this . deprecated = false ;
211
216
}
212
217
213
218
connectedCallback ( ) {
@@ -268,6 +273,12 @@ export class PropertyShapeDocument extends PropertyDocumentMixin(LitElement) {
268
273
this . propertyName
269
274
) ;
270
275
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 ) )
271
282
}
272
283
273
284
_computeObjectDataType ( range , shape ) {
@@ -633,6 +644,13 @@ export class PropertyShapeDocument extends PropertyDocumentMixin(LitElement) {
633
644
: '' } `;
634
645
}
635
646
647
+ _deprecatedWarningTemplate ( ) {
648
+ if ( ! this . deprecated ) {
649
+ return '' ;
650
+ }
651
+ return html `< div class ="deprecated-warning "> Warning: Deprecated</ div > `
652
+ }
653
+
636
654
/**
637
655
* @return {TemplateResult } Main render function.
638
656
*/
@@ -665,6 +683,7 @@ export class PropertyShapeDocument extends PropertyDocumentMixin(LitElement) {
665
683
> `
666
684
: '' }
667
685
</ div >
686
+ ${ this . _deprecatedWarningTemplate ( ) }
668
687
${ this . _descriptionTemplate ( ) }
669
688
< property-range-document
670
689
.amf ="${ this . amf } "
0 commit comments