@api-components/api-type-document
Advanced tools
Comparing version 4.2.17 to 4.2.18
{ | ||
"name": "@api-components/api-type-document", | ||
"description": "A documentation table for type (resource) properties. Works with AMF data model", | ||
"version": "4.2.17", | ||
"version": "4.2.18", | ||
"license": "Apache-2.0", | ||
@@ -6,0 +6,0 @@ "main": "index.js", |
@@ -655,2 +655,21 @@ import { LitElement, html } from 'lit-element'; | ||
_arrayPropertyTemplate(label, value, title) { | ||
return html` | ||
<div class="property-attribute" part="property-attribute"> | ||
<span class="attribute-label" part="attribute-label">${label}</span> | ||
<span class="attribute-value" part="attribute-value" title=${title}>${value}</span> | ||
</div> | ||
` | ||
} | ||
_arrayPropertiesTemplate() { | ||
const minCount = this._getValue(this._resolvedType, this.ns.w3.shacl.minCount) | ||
const maxCount = this._getValue(this._resolvedType, this.ns.w3.shacl.maxCount) | ||
return html` | ||
${minCount !== undefined ? this._arrayPropertyTemplate('Minimum array length:', minCount, 'Minimum amount of items in array') : ''} | ||
${maxCount !== undefined ? this._arrayPropertyTemplate('Maximum array length:', maxCount, 'Maximum amount of items in array') : ''} | ||
` | ||
} | ||
/** | ||
@@ -692,11 +711,15 @@ * @return {TemplateResult} Templates for object properties | ||
); | ||
if (!this.hasParentType) { | ||
return html` | ||
return html` | ||
${!this.hasParentType ? | ||
html` | ||
<span>Array of:</span> | ||
<div class="array-children"> | ||
${documents} | ||
</div> | ||
`; | ||
} | ||
return html`${documents}`; | ||
</div>` | ||
: html`${documents}` | ||
} | ||
${this._arrayPropertiesTemplate()} | ||
`; | ||
} | ||
@@ -703,0 +726,0 @@ |
@@ -88,2 +88,13 @@ import { css } from 'lit-element'; | ||
} | ||
.property-attribute { | ||
margin: 4px 0; | ||
padding: 0; | ||
color: var(--api-type-document-type-attribute-color, #616161); | ||
} | ||
.attribute-label { | ||
font-weight: var(--api-type-document-property-range-attribute-label-font-weight, 500); | ||
margin-right: 12px; | ||
} | ||
`; |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
141767
4242
0