@api-components/api-type-document
Advanced tools
Comparing version 4.2.11 to 4.2.12
{ | ||
"name": "@api-components/api-type-document", | ||
"description": "A documentation table for type (resource) properties. Works with AMF data model", | ||
"version": "4.2.11", | ||
"version": "4.2.12", | ||
"license": "Apache-2.0", | ||
@@ -6,0 +6,0 @@ "main": "index.js", |
@@ -136,2 +136,7 @@ import { LitElement, CSSResult, TemplateResult } from 'lit-element'; | ||
renderReadOnly: boolean; | ||
/** | ||
* Determines if shape's range is deprecated | ||
* @attribute | ||
*/ | ||
deprecated: boolean | ||
@@ -138,0 +143,0 @@ get complexToggleLabel(): string; |
@@ -129,2 +129,6 @@ import { LitElement, html } from 'lit-element'; | ||
isAnyOf: { type: Boolean }, | ||
/** | ||
* Determines if shape's range is deprecated | ||
*/ | ||
deprecated: { type: Boolean, reflect: true }, | ||
}; | ||
@@ -212,2 +216,3 @@ } | ||
this.renderReadOnly = false; | ||
this.deprecated = false; | ||
} | ||
@@ -273,4 +278,10 @@ | ||
this.propertyDataType = this._computeObjectDataType(range, shape); | ||
const isDeprecated = Boolean(this._computeIsDeprecated(range)); | ||
this.deprecated = isDeprecated; | ||
} | ||
_computeIsDeprecated(range) { | ||
return this._getValue(range, this._getAmfKey(this.ns.aml.vocabularies.shapes.deprecated)) | ||
} | ||
_computeObjectDataType(range, shape) { | ||
@@ -639,2 +650,9 @@ let type = range && this._computeRangeDataType(this._resolve(range)); | ||
_deprecatedWarningTemplate() { | ||
if (!this.deprecated) { | ||
return ''; | ||
} | ||
return html`<div class="deprecated-warning">Warning: Deprecated</div>` | ||
} | ||
/** | ||
@@ -672,2 +690,3 @@ * @return {TemplateResult} Main render function. | ||
</div> | ||
${this._deprecatedWarningTemplate()} | ||
${this._descriptionTemplate()} | ||
@@ -674,0 +693,0 @@ <property-range-document |
@@ -167,2 +167,20 @@ import { css } from 'lit-element'; | ||
} | ||
:host([deprecated]) .property-title { | ||
color: gray; | ||
text-decoration: line-through; | ||
} | ||
:host([deprecated]) .property-traits > span { | ||
background-color: var(--api-type-document-type-deprecated-background-color, gray); | ||
color: var(--api-type-document-type-deprecated-color, white); | ||
} | ||
.deprecated-warning { | ||
background-color: var(--api-type-document-type-deprecated-background-color, gray); | ||
color: var(--api-type-document-type-deprecated-color, white); | ||
padding: var(--api-type-document-deprecated-warning-padding, 3px 6px); | ||
border-radius: var(--api-type-document-deprecated-warning-border-radius, 3px); | ||
display: inline-flex; | ||
} | ||
`; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
138967
4149