diff --git a/README.md b/README.md index 2cd30d5..73032f5 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,35 @@ npm install --save @api-components/api-summary ``` +### Styling using CSS Shadow Parts + +```html + + + + + + + + + + +``` +For a complete list of parts, check out this [doc](./Styling.md). + ### In a LitElement template ```js diff --git a/Styling.md b/Styling.md new file mode 100644 index 0000000..c74c51f --- /dev/null +++ b/Styling.md @@ -0,0 +1,13 @@ +# Styling + +## List of CSS Shadow Parts + +- `api-title` +- `api-title-label` +- `api-version` +- `marked-description` +- `info-section` +- `info-inline-desc` +- `license-section` +- `separator` +- `toc` \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 413dcb6..f094d47 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@api-components/api-summary", - "version": "4.5.0", + "version": "4.6.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 26fbe24..1a997fa 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@api-components/api-summary", "description": "A summary view for an API base on AMF data model", - "version": "4.5.0", + "version": "4.6.0", "license": "Apache-2.0", "main": "index.js", "module": "index.js", diff --git a/src/ApiSummary.d.ts b/src/ApiSummary.d.ts index 55b4a14..480ec51 100644 --- a/src/ApiSummary.d.ts +++ b/src/ApiSummary.d.ts @@ -24,6 +24,10 @@ export declare class ApiSummary extends AmfHelperMixin(LitElement) { * @attribute */ titleLevel: string; + /** + * A property to hide the table of contents list of endpoints. + */ + hideToc: boolean; _providerName: string; _providerEmail: string; diff --git a/src/ApiSummary.js b/src/ApiSummary.js index fb14b33..ce1c574 100644 --- a/src/ApiSummary.js +++ b/src/ApiSummary.js @@ -43,6 +43,10 @@ export class ApiSummary extends AmfHelperMixin(LitElement) { * @default 2 */ titleLevel: { type: String }, + /** + * A property to hide the table of contents list of endpoints. + */ + hideToc: { type: Boolean }, _providerName: { type: String }, _providerEmail: { type: String }, @@ -99,6 +103,7 @@ export class ApiSummary extends AmfHelperMixin(LitElement) { * @type {string[]} */ this.protocols = undefined; + this.hideToc = false; } __amfChanged() { @@ -321,7 +326,7 @@ export class ApiSummary extends AmfHelperMixin(LitElement) { ${this._termsOfServiceTemplate()} - ${this._endpointsTemplate()} + ${this.hideToc ? '' : this._endpointsTemplate()} `; } @@ -331,8 +336,8 @@ export class ApiSummary extends AmfHelperMixin(LitElement) { return ''; } return html` -
- +
+ ${_apiTitle}
`; } @@ -343,7 +348,7 @@ export class ApiSummary extends AmfHelperMixin(LitElement) { return ''; } return html` -

+

${_version}

`; @@ -355,7 +360,7 @@ export class ApiSummary extends AmfHelperMixin(LitElement) { return ''; } return html` -
+
@@ -427,16 +432,16 @@ export class ApiSummary extends AmfHelperMixin(LitElement) { `${_providerUrl}`, ): undefined; return html` -