@api-components/api-type-document 4.2.17 → 4.2.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/ApiTypeDocument.js +29 -6
- package/src/TypeStyles.js +11 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@api-components/api-type-document",
|
|
3
3
|
"description": "A documentation table for type (resource) properties. Works with AMF data model",
|
|
4
|
-
"version": "4.2.
|
|
4
|
+
"version": "4.2.18",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"module": "index.js",
|
package/src/ApiTypeDocument.js
CHANGED
|
@@ -652,6 +652,25 @@ export class ApiTypeDocument extends PropertyDocumentMixin(LitElement) {
|
|
|
652
652
|
);
|
|
653
653
|
}
|
|
654
654
|
|
|
655
|
+
_arrayPropertyTemplate(label, value, title) {
|
|
656
|
+
return html`
|
|
657
|
+
<div class="property-attribute" part="property-attribute">
|
|
658
|
+
<span class="attribute-label" part="attribute-label">${label}</span>
|
|
659
|
+
<span class="attribute-value" part="attribute-value" title=${title}>${value}</span>
|
|
660
|
+
</div>
|
|
661
|
+
`
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
_arrayPropertiesTemplate() {
|
|
665
|
+
const minCount = this._getValue(this._resolvedType, this.ns.w3.shacl.minCount)
|
|
666
|
+
const maxCount = this._getValue(this._resolvedType, this.ns.w3.shacl.maxCount)
|
|
667
|
+
|
|
668
|
+
return html`
|
|
669
|
+
${minCount !== undefined ? this._arrayPropertyTemplate('Minimum array length:', minCount, 'Minimum amount of items in array') : ''}
|
|
670
|
+
${maxCount !== undefined ? this._arrayPropertyTemplate('Maximum array length:', maxCount, 'Maximum amount of items in array') : ''}
|
|
671
|
+
`
|
|
672
|
+
}
|
|
673
|
+
|
|
655
674
|
/**
|
|
656
675
|
* @return {TemplateResult} Templates for object properties
|
|
657
676
|
*/
|
|
@@ -688,15 +707,19 @@ export class ApiTypeDocument extends PropertyDocumentMixin(LitElement) {
|
|
|
688
707
|
: ''}
|
|
689
708
|
`
|
|
690
709
|
);
|
|
691
|
-
|
|
692
|
-
|
|
710
|
+
|
|
711
|
+
return html`
|
|
712
|
+
${!this.hasParentType ?
|
|
713
|
+
html`
|
|
693
714
|
<span>Array of:</span>
|
|
694
715
|
<div class="array-children">
|
|
695
716
|
${documents}
|
|
696
|
-
</div
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
717
|
+
</div>`
|
|
718
|
+
: html`${documents}`
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
${this._arrayPropertiesTemplate()}
|
|
722
|
+
`;
|
|
700
723
|
}
|
|
701
724
|
|
|
702
725
|
/**
|
package/src/TypeStyles.js
CHANGED
|
@@ -85,4 +85,15 @@ export default css`
|
|
|
85
85
|
.union-type-selector {
|
|
86
86
|
margin: 12px 0;
|
|
87
87
|
}
|
|
88
|
+
|
|
89
|
+
.property-attribute {
|
|
90
|
+
margin: 4px 0;
|
|
91
|
+
padding: 0;
|
|
92
|
+
color: var(--api-type-document-type-attribute-color, #616161);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.attribute-label {
|
|
96
|
+
font-weight: var(--api-type-document-property-range-attribute-label-font-weight, 500);
|
|
97
|
+
margin-right: 12px;
|
|
98
|
+
}
|
|
88
99
|
`;
|