UNPKG

@carbon/icons-angular

Version:

Angular components for icons in digital and software products using the Carbon Design System

174 lines (171 loc) 12.6 kB
import { __decorate, __metadata } from 'tslib'; import { Input, Component, ElementRef, Directive, NgModule } from '@angular/core'; import { getAttributes } from '@carbon/icon-helpers'; var WatsonHealthRegionAnalysisVolumeDirective_1; let WatsonHealthRegionAnalysisVolumeComponent = class WatsonHealthRegionAnalysisVolumeComponent { constructor() { this.focusable = false; } }; __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthRegionAnalysisVolumeComponent.prototype, "ariaLabel", void 0); __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthRegionAnalysisVolumeComponent.prototype, "ariaLabelledby", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], WatsonHealthRegionAnalysisVolumeComponent.prototype, "ariaHidden", void 0); __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthRegionAnalysisVolumeComponent.prototype, "title", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], WatsonHealthRegionAnalysisVolumeComponent.prototype, "focusable", void 0); __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthRegionAnalysisVolumeComponent.prototype, "innerClass", void 0); __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthRegionAnalysisVolumeComponent.prototype, "size", void 0); WatsonHealthRegionAnalysisVolumeComponent = __decorate([ Component({ selector: "ibm-icon-watson-health-region-analysis-volume", template: ` <svg ibmIconWatsonHealthRegionAnalysisVolume [size]="size" [ariaLabel]="ariaLabel" [ariaLabelledby]="ariaLabelledby" [ariaHidden]="ariaHidden" [title]="title" [isFocusable]="focusable" [attr.class]="innerClass"> </svg> ` }) ], WatsonHealthRegionAnalysisVolumeComponent); let WatsonHealthRegionAnalysisVolumeDirective = WatsonHealthRegionAnalysisVolumeDirective_1 = class WatsonHealthRegionAnalysisVolumeDirective { constructor(elementRef) { this.elementRef = elementRef; this.isFocusable = false; this.icons = { "32": { metadata: { "moduleName": "WatsonHealthRegionAnalysisVolume32", "filepath": "watson-health/region-analysis--volume/32.js", "descriptor": { "elem": "svg", "attrs": { "xmlns": "http://www.w3.org/2000/svg", "viewBox": "0 0 32 32", "fill": "currentColor", "width": 32, "height": 32 }, "content": [{ "elem": "path", "attrs": { "d": "M30,23V21H28V19H26v2H23V19H21v2H19v2h2v3H19v2h2v2h2V28h3v2h2V28h2V26H28V23Zm-4,3H23V23h3Z" } }, { "elem": "path", "attrs": { "d": "M4.8305,20.3555A24.9534,24.9534,0,0,0,15,22.9644v-2A22.9014,22.9014,0,0,1,4.1335,17.6919,11.979,11.979,0,0,1,4,16a11.9847,11.9847,0,0,1,.1332-1.69,22.9282,22.9282,0,0,1,23.7336,0A11.9847,11.9847,0,0,1,28,16h2A14,14,0,1,0,16,30V28A12.01,12.01,0,0,1,4.8305,20.3555ZM16,4a12.01,12.01,0,0,1,11.17,7.6465,24.8982,24.8982,0,0,0-22.3406,0A12.01,12.01,0,0,1,16,4Z" } }], "name": "region-analysis--volume", "size": 32 }, "size": 32 }, svg: `<svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="currentColor" width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><path d="M30,23V21H28V19H26v2H23V19H21v2H19v2h2v3H19v2h2v2h2V28h3v2h2V28h2V26H28V23Zm-4,3H23V23h3Z"></path><path d="M4.8305,20.3555A24.9534,24.9534,0,0,0,15,22.9644v-2A22.9014,22.9014,0,0,1,4.1335,17.6919,11.979,11.979,0,0,1,4,16a11.9847,11.9847,0,0,1,.1332-1.69,22.9282,22.9282,0,0,1,23.7336,0A11.9847,11.9847,0,0,1,28,16h2A14,14,0,1,0,16,30V28A12.01,12.01,0,0,1,4.8305,20.3555ZM16,4a12.01,12.01,0,0,1,11.17,7.6465,24.8982,24.8982,0,0,0-22.3406,0A12.01,12.01,0,0,1,16,4Z"></path></svg>` }, "24": { metadata: { "moduleName": "WatsonHealthRegionAnalysisVolume24", "filepath": "watson-health/region-analysis--volume/24.js", "descriptor": { "elem": "svg", "attrs": { "xmlns": "http://www.w3.org/2000/svg", "viewBox": "0 0 32 32", "fill": "currentColor", "width": 24, "height": 24 }, "content": [{ "elem": "path", "attrs": { "d": "M30,23V21H28V19H26v2H23V19H21v2H19v2h2v3H19v2h2v2h2V28h3v2h2V28h2V26H28V23Zm-4,3H23V23h3Z" } }, { "elem": "path", "attrs": { "d": "M4.8305,20.3555A24.9534,24.9534,0,0,0,15,22.9644v-2A22.9014,22.9014,0,0,1,4.1335,17.6919,11.979,11.979,0,0,1,4,16a11.9847,11.9847,0,0,1,.1332-1.69,22.9282,22.9282,0,0,1,23.7336,0A11.9847,11.9847,0,0,1,28,16h2A14,14,0,1,0,16,30V28A12.01,12.01,0,0,1,4.8305,20.3555ZM16,4a12.01,12.01,0,0,1,11.17,7.6465,24.8982,24.8982,0,0,0-22.3406,0A12.01,12.01,0,0,1,16,4Z" } }], "name": "region-analysis--volume", "size": 24 }, "size": 24 }, svg: `<svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="currentColor" width="24" height="24" viewBox="0 0 32 32" aria-hidden="true"><path d="M30,23V21H28V19H26v2H23V19H21v2H19v2h2v3H19v2h2v2h2V28h3v2h2V28h2V26H28V23Zm-4,3H23V23h3Z"></path><path d="M4.8305,20.3555A24.9534,24.9534,0,0,0,15,22.9644v-2A22.9014,22.9014,0,0,1,4.1335,17.6919,11.979,11.979,0,0,1,4,16a11.9847,11.9847,0,0,1,.1332-1.69,22.9282,22.9282,0,0,1,23.7336,0A11.9847,11.9847,0,0,1,28,16h2A14,14,0,1,0,16,30V28A12.01,12.01,0,0,1,4.8305,20.3555ZM16,4a12.01,12.01,0,0,1,11.17,7.6465,24.8982,24.8982,0,0,0-22.3406,0A12.01,12.01,0,0,1,16,4Z"></path></svg>` }, "20": { metadata: { "moduleName": "WatsonHealthRegionAnalysisVolume20", "filepath": "watson-health/region-analysis--volume/20.js", "descriptor": { "elem": "svg", "attrs": { "xmlns": "http://www.w3.org/2000/svg", "viewBox": "0 0 32 32", "fill": "currentColor", "width": 20, "height": 20 }, "content": [{ "elem": "path", "attrs": { "d": "M30,23V21H28V19H26v2H23V19H21v2H19v2h2v3H19v2h2v2h2V28h3v2h2V28h2V26H28V23Zm-4,3H23V23h3Z" } }, { "elem": "path", "attrs": { "d": "M4.8305,20.3555A24.9534,24.9534,0,0,0,15,22.9644v-2A22.9014,22.9014,0,0,1,4.1335,17.6919,11.979,11.979,0,0,1,4,16a11.9847,11.9847,0,0,1,.1332-1.69,22.9282,22.9282,0,0,1,23.7336,0A11.9847,11.9847,0,0,1,28,16h2A14,14,0,1,0,16,30V28A12.01,12.01,0,0,1,4.8305,20.3555ZM16,4a12.01,12.01,0,0,1,11.17,7.6465,24.8982,24.8982,0,0,0-22.3406,0A12.01,12.01,0,0,1,16,4Z" } }], "name": "region-analysis--volume", "size": 20 }, "size": 20 }, svg: `<svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="currentColor" width="20" height="20" viewBox="0 0 32 32" aria-hidden="true"><path d="M30,23V21H28V19H26v2H23V19H21v2H19v2h2v3H19v2h2v2h2V28h3v2h2V28h2V26H28V23Zm-4,3H23V23h3Z"></path><path d="M4.8305,20.3555A24.9534,24.9534,0,0,0,15,22.9644v-2A22.9014,22.9014,0,0,1,4.1335,17.6919,11.979,11.979,0,0,1,4,16a11.9847,11.9847,0,0,1,.1332-1.69,22.9282,22.9282,0,0,1,23.7336,0A11.9847,11.9847,0,0,1,28,16h2A14,14,0,1,0,16,30V28A12.01,12.01,0,0,1,4.8305,20.3555ZM16,4a12.01,12.01,0,0,1,11.17,7.6465,24.8982,24.8982,0,0,0-22.3406,0A12.01,12.01,0,0,1,16,4Z"></path></svg>` }, "16": { metadata: { "moduleName": "WatsonHealthRegionAnalysisVolume16", "filepath": "watson-health/region-analysis--volume/16.js", "descriptor": { "elem": "svg", "attrs": { "xmlns": "http://www.w3.org/2000/svg", "viewBox": "0 0 32 32", "fill": "currentColor", "width": 16, "height": 16 }, "content": [{ "elem": "path", "attrs": { "d": "M30,23V21H28V19H26v2H23V19H21v2H19v2h2v3H19v2h2v2h2V28h3v2h2V28h2V26H28V23Zm-4,3H23V23h3Z" } }, { "elem": "path", "attrs": { "d": "M4.8305,20.3555A24.9534,24.9534,0,0,0,15,22.9644v-2A22.9014,22.9014,0,0,1,4.1335,17.6919,11.979,11.979,0,0,1,4,16a11.9847,11.9847,0,0,1,.1332-1.69,22.9282,22.9282,0,0,1,23.7336,0A11.9847,11.9847,0,0,1,28,16h2A14,14,0,1,0,16,30V28A12.01,12.01,0,0,1,4.8305,20.3555ZM16,4a12.01,12.01,0,0,1,11.17,7.6465,24.8982,24.8982,0,0,0-22.3406,0A12.01,12.01,0,0,1,16,4Z" } }], "name": "region-analysis--volume", "size": 16 }, "size": 16 }, svg: `<svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="currentColor" width="16" height="16" viewBox="0 0 32 32" aria-hidden="true"><path d="M30,23V21H28V19H26v2H23V19H21v2H19v2h2v3H19v2h2v2h2V28h3v2h2V28h2V26H28V23Zm-4,3H23V23h3Z"></path><path d="M4.8305,20.3555A24.9534,24.9534,0,0,0,15,22.9644v-2A22.9014,22.9014,0,0,1,4.1335,17.6919,11.979,11.979,0,0,1,4,16a11.9847,11.9847,0,0,1,.1332-1.69,22.9282,22.9282,0,0,1,23.7336,0A11.9847,11.9847,0,0,1,28,16h2A14,14,0,1,0,16,30V28A12.01,12.01,0,0,1,4.8305,20.3555ZM16,4a12.01,12.01,0,0,1,11.17,7.6465,24.8982,24.8982,0,0,0-22.3406,0A12.01,12.01,0,0,1,16,4Z"></path></svg>` }, }; } ngAfterViewInit() { const svg = this.elementRef.nativeElement; svg.setAttribute("xmlns", "http://www.w3.org/2000/svg"); const icon = this.icons[this.size]; const domParser = new DOMParser(); const rawSVG = icon.svg; const svgElement = domParser.parseFromString(rawSVG, "image/svg+xml").documentElement; let node = svgElement.firstChild; while (node) { // importNode makes a clone of the node // this ensures we keep looping over the nodes in the parsed document svg.appendChild(svg.ownerDocument.importNode(node, true)); node = node.nextSibling; } const attributes = getAttributes({ width: icon.metadata.descriptor.attrs.height, height: icon.metadata.descriptor.attrs.height, viewBox: icon.metadata.descriptor.attrs.viewBox, title: this.title, "aria-label": this.ariaLabel, "aria-labelledby": this.ariaLabelledby, "aria-hidden": this.ariaHidden, focusable: this.isFocusable.toString() }); const attrKeys = Object.keys(attributes); for (let i = 0; i < attrKeys.length; i++) { const key = attrKeys[i]; const value = attributes[key]; if (key === "title") { continue; } if (value) { svg.setAttribute(key, value); } } if (attributes.title) { const title = document.createElement("title"); title.textContent = attributes.title; WatsonHealthRegionAnalysisVolumeDirective_1.titleIdCounter++; title.setAttribute("id", `watson-health-region-analysis-volume-${WatsonHealthRegionAnalysisVolumeDirective_1.titleIdCounter}`); svg.appendChild(title); svg.setAttribute("aria-labelledby", `watson-health-region-analysis-volume-${WatsonHealthRegionAnalysisVolumeDirective_1.titleIdCounter}`); } } }; WatsonHealthRegionAnalysisVolumeDirective.titleIdCounter = 0; WatsonHealthRegionAnalysisVolumeDirective.ctorParameters = () => [ { type: ElementRef } ]; __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthRegionAnalysisVolumeDirective.prototype, "ariaLabel", void 0); __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthRegionAnalysisVolumeDirective.prototype, "ariaLabelledby", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], WatsonHealthRegionAnalysisVolumeDirective.prototype, "ariaHidden", void 0); __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthRegionAnalysisVolumeDirective.prototype, "title", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], WatsonHealthRegionAnalysisVolumeDirective.prototype, "isFocusable", void 0); __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthRegionAnalysisVolumeDirective.prototype, "size", void 0); WatsonHealthRegionAnalysisVolumeDirective = WatsonHealthRegionAnalysisVolumeDirective_1 = __decorate([ Directive({ selector: "[ibmIconWatsonHealthRegionAnalysisVolume]" }), __metadata("design:paramtypes", [ElementRef]) ], WatsonHealthRegionAnalysisVolumeDirective); let WatsonHealthRegionAnalysisVolumeModule = class WatsonHealthRegionAnalysisVolumeModule { }; WatsonHealthRegionAnalysisVolumeModule = __decorate([ NgModule({ declarations: [ WatsonHealthRegionAnalysisVolumeComponent, WatsonHealthRegionAnalysisVolumeDirective, ], exports: [ WatsonHealthRegionAnalysisVolumeComponent, WatsonHealthRegionAnalysisVolumeDirective, ] }) ], WatsonHealthRegionAnalysisVolumeModule); export { WatsonHealthRegionAnalysisVolumeComponent, WatsonHealthRegionAnalysisVolumeDirective, WatsonHealthRegionAnalysisVolumeModule };