UNPKG

@carbon/icons-angular

Version:

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

174 lines (171 loc) 15 kB
import { __decorate, __metadata } from 'tslib'; import { Input, Component, ElementRef, Directive, NgModule } from '@angular/core'; import { getAttributes } from '@carbon/icon-helpers'; var HeatMap_02Directive_1; let HeatMap_02Component = class HeatMap_02Component { constructor() { this.focusable = false; } }; __decorate([ Input(), __metadata("design:type", String) ], HeatMap_02Component.prototype, "ariaLabel", void 0); __decorate([ Input(), __metadata("design:type", String) ], HeatMap_02Component.prototype, "ariaLabelledby", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], HeatMap_02Component.prototype, "ariaHidden", void 0); __decorate([ Input(), __metadata("design:type", String) ], HeatMap_02Component.prototype, "title", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], HeatMap_02Component.prototype, "focusable", void 0); __decorate([ Input(), __metadata("design:type", String) ], HeatMap_02Component.prototype, "innerClass", void 0); __decorate([ Input(), __metadata("design:type", String) ], HeatMap_02Component.prototype, "size", void 0); HeatMap_02Component = __decorate([ Component({ selector: "ibm-icon-heat-map-02", template: ` <svg ibmIconHeatMap_02 [size]="size" [ariaLabel]="ariaLabel" [ariaLabelledby]="ariaLabelledby" [ariaHidden]="ariaHidden" [title]="title" [isFocusable]="focusable" [attr.class]="innerClass"> </svg> ` }) ], HeatMap_02Component); let HeatMap_02Directive = HeatMap_02Directive_1 = class HeatMap_02Directive { constructor(elementRef) { this.elementRef = elementRef; this.isFocusable = false; this.icons = { "32": { metadata: { "moduleName": "HeatMap_0232", "filepath": "heat-map--02/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": "circle", "attrs": { "cx": "21", "cy": "20", "r": "2" } }, { "elem": "circle", "attrs": { "cx": "14", "cy": "12", "r": "2" } }, { "elem": "circle", "attrs": { "cx": "29", "cy": "19", "r": "1" } }, { "elem": "path", "attrs": { "d": "M26.5 30A3.5 3.5 0 1130 26.5 3.5041 3.5041 0 0126.5 30zm0-5A1.5 1.5 0 1028 26.5 1.5017 1.5017 0 0026.5 25zM14 30a3.958 3.958 0 01-2.126-.6211 6.9977 6.9977 0 114.1109-6.8384A3.9916 3.9916 0 0114 30zm-1.8843-3.0278l.5391.4946a1.9915 1.9915 0 102.0039-3.343l-.6909-.2432.03-.8467a5.0085 5.0085 0 10-2.5166 4.3023zM24 16a6.0067 6.0067 0 01-6-6 5.3246 5.3246 0 01.0269-.5327A3.9564 3.9564 0 0116 6a4.0045 4.0045 0 014-4 3.9564 3.9564 0 013.4673 2.0271C23.6484 4.009 23.8252 4 24 4a6 6 0 010 12zM20 4a2.0021 2.0021 0 00-2 2 1.9805 1.9805 0 001.43 1.9023l.9018.2706-.2153.9162A3.9938 3.9938 0 1024 6a4.0064 4.0064 0 00-.9121.1162l-.9155.2141-.27-.9006A1.9807 1.9807 0 0020 4zM6.5 11A4.5 4.5 0 1111 6.5 4.5051 4.5051 0 016.5 11zm0-7A2.5 2.5 0 109 6.5 2.503 2.503 0 006.5 4z" } }], "name": "heat-map--02", "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"><circle cx="21" cy="20" r="2"></circle><circle cx="14" cy="12" r="2"></circle><circle cx="29" cy="19" r="1"></circle><path d="M26.5 30A3.5 3.5 0 1130 26.5 3.5041 3.5041 0 0126.5 30zm0-5A1.5 1.5 0 1028 26.5 1.5017 1.5017 0 0026.5 25zM14 30a3.958 3.958 0 01-2.126-.6211 6.9977 6.9977 0 114.1109-6.8384A3.9916 3.9916 0 0114 30zm-1.8843-3.0278l.5391.4946a1.9915 1.9915 0 102.0039-3.343l-.6909-.2432.03-.8467a5.0085 5.0085 0 10-2.5166 4.3023zM24 16a6.0067 6.0067 0 01-6-6 5.3246 5.3246 0 01.0269-.5327A3.9564 3.9564 0 0116 6a4.0045 4.0045 0 014-4 3.9564 3.9564 0 013.4673 2.0271C23.6484 4.009 23.8252 4 24 4a6 6 0 010 12zM20 4a2.0021 2.0021 0 00-2 2 1.9805 1.9805 0 001.43 1.9023l.9018.2706-.2153.9162A3.9938 3.9938 0 1024 6a4.0064 4.0064 0 00-.9121.1162l-.9155.2141-.27-.9006A1.9807 1.9807 0 0020 4zM6.5 11A4.5 4.5 0 1111 6.5 4.5051 4.5051 0 016.5 11zm0-7A2.5 2.5 0 109 6.5 2.503 2.503 0 006.5 4z"></path></svg>` }, "24": { metadata: { "moduleName": "HeatMap_0224", "filepath": "heat-map--02/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": "circle", "attrs": { "cx": "21", "cy": "20", "r": "2" } }, { "elem": "circle", "attrs": { "cx": "14", "cy": "12", "r": "2" } }, { "elem": "circle", "attrs": { "cx": "29", "cy": "19", "r": "1" } }, { "elem": "path", "attrs": { "d": "M26.5 30A3.5 3.5 0 1130 26.5 3.5041 3.5041 0 0126.5 30zm0-5A1.5 1.5 0 1028 26.5 1.5017 1.5017 0 0026.5 25zM14 30a3.958 3.958 0 01-2.126-.6211 6.9977 6.9977 0 114.1109-6.8384A3.9916 3.9916 0 0114 30zm-1.8843-3.0278l.5391.4946a1.9915 1.9915 0 102.0039-3.343l-.6909-.2432.03-.8467a5.0085 5.0085 0 10-2.5166 4.3023zM24 16a6.0067 6.0067 0 01-6-6 5.3246 5.3246 0 01.0269-.5327A3.9564 3.9564 0 0116 6a4.0045 4.0045 0 014-4 3.9564 3.9564 0 013.4673 2.0271C23.6484 4.009 23.8252 4 24 4a6 6 0 010 12zM20 4a2.0021 2.0021 0 00-2 2 1.9805 1.9805 0 001.43 1.9023l.9018.2706-.2153.9162A3.9938 3.9938 0 1024 6a4.0064 4.0064 0 00-.9121.1162l-.9155.2141-.27-.9006A1.9807 1.9807 0 0020 4zM6.5 11A4.5 4.5 0 1111 6.5 4.5051 4.5051 0 016.5 11zm0-7A2.5 2.5 0 109 6.5 2.503 2.503 0 006.5 4z" } }], "name": "heat-map--02", "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"><circle cx="21" cy="20" r="2"></circle><circle cx="14" cy="12" r="2"></circle><circle cx="29" cy="19" r="1"></circle><path d="M26.5 30A3.5 3.5 0 1130 26.5 3.5041 3.5041 0 0126.5 30zm0-5A1.5 1.5 0 1028 26.5 1.5017 1.5017 0 0026.5 25zM14 30a3.958 3.958 0 01-2.126-.6211 6.9977 6.9977 0 114.1109-6.8384A3.9916 3.9916 0 0114 30zm-1.8843-3.0278l.5391.4946a1.9915 1.9915 0 102.0039-3.343l-.6909-.2432.03-.8467a5.0085 5.0085 0 10-2.5166 4.3023zM24 16a6.0067 6.0067 0 01-6-6 5.3246 5.3246 0 01.0269-.5327A3.9564 3.9564 0 0116 6a4.0045 4.0045 0 014-4 3.9564 3.9564 0 013.4673 2.0271C23.6484 4.009 23.8252 4 24 4a6 6 0 010 12zM20 4a2.0021 2.0021 0 00-2 2 1.9805 1.9805 0 001.43 1.9023l.9018.2706-.2153.9162A3.9938 3.9938 0 1024 6a4.0064 4.0064 0 00-.9121.1162l-.9155.2141-.27-.9006A1.9807 1.9807 0 0020 4zM6.5 11A4.5 4.5 0 1111 6.5 4.5051 4.5051 0 016.5 11zm0-7A2.5 2.5 0 109 6.5 2.503 2.503 0 006.5 4z"></path></svg>` }, "20": { metadata: { "moduleName": "HeatMap_0220", "filepath": "heat-map--02/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": "circle", "attrs": { "cx": "21", "cy": "20", "r": "2" } }, { "elem": "circle", "attrs": { "cx": "14", "cy": "12", "r": "2" } }, { "elem": "circle", "attrs": { "cx": "29", "cy": "19", "r": "1" } }, { "elem": "path", "attrs": { "d": "M26.5 30A3.5 3.5 0 1130 26.5 3.5041 3.5041 0 0126.5 30zm0-5A1.5 1.5 0 1028 26.5 1.5017 1.5017 0 0026.5 25zM14 30a3.958 3.958 0 01-2.126-.6211 6.9977 6.9977 0 114.1109-6.8384A3.9916 3.9916 0 0114 30zm-1.8843-3.0278l.5391.4946a1.9915 1.9915 0 102.0039-3.343l-.6909-.2432.03-.8467a5.0085 5.0085 0 10-2.5166 4.3023zM24 16a6.0067 6.0067 0 01-6-6 5.3246 5.3246 0 01.0269-.5327A3.9564 3.9564 0 0116 6a4.0045 4.0045 0 014-4 3.9564 3.9564 0 013.4673 2.0271C23.6484 4.009 23.8252 4 24 4a6 6 0 010 12zM20 4a2.0021 2.0021 0 00-2 2 1.9805 1.9805 0 001.43 1.9023l.9018.2706-.2153.9162A3.9938 3.9938 0 1024 6a4.0064 4.0064 0 00-.9121.1162l-.9155.2141-.27-.9006A1.9807 1.9807 0 0020 4zM6.5 11A4.5 4.5 0 1111 6.5 4.5051 4.5051 0 016.5 11zm0-7A2.5 2.5 0 109 6.5 2.503 2.503 0 006.5 4z" } }], "name": "heat-map--02", "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"><circle cx="21" cy="20" r="2"></circle><circle cx="14" cy="12" r="2"></circle><circle cx="29" cy="19" r="1"></circle><path d="M26.5 30A3.5 3.5 0 1130 26.5 3.5041 3.5041 0 0126.5 30zm0-5A1.5 1.5 0 1028 26.5 1.5017 1.5017 0 0026.5 25zM14 30a3.958 3.958 0 01-2.126-.6211 6.9977 6.9977 0 114.1109-6.8384A3.9916 3.9916 0 0114 30zm-1.8843-3.0278l.5391.4946a1.9915 1.9915 0 102.0039-3.343l-.6909-.2432.03-.8467a5.0085 5.0085 0 10-2.5166 4.3023zM24 16a6.0067 6.0067 0 01-6-6 5.3246 5.3246 0 01.0269-.5327A3.9564 3.9564 0 0116 6a4.0045 4.0045 0 014-4 3.9564 3.9564 0 013.4673 2.0271C23.6484 4.009 23.8252 4 24 4a6 6 0 010 12zM20 4a2.0021 2.0021 0 00-2 2 1.9805 1.9805 0 001.43 1.9023l.9018.2706-.2153.9162A3.9938 3.9938 0 1024 6a4.0064 4.0064 0 00-.9121.1162l-.9155.2141-.27-.9006A1.9807 1.9807 0 0020 4zM6.5 11A4.5 4.5 0 1111 6.5 4.5051 4.5051 0 016.5 11zm0-7A2.5 2.5 0 109 6.5 2.503 2.503 0 006.5 4z"></path></svg>` }, "16": { metadata: { "moduleName": "HeatMap_0216", "filepath": "heat-map--02/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": "circle", "attrs": { "cx": "21", "cy": "20", "r": "2" } }, { "elem": "circle", "attrs": { "cx": "14", "cy": "12", "r": "2" } }, { "elem": "circle", "attrs": { "cx": "29", "cy": "19", "r": "1" } }, { "elem": "path", "attrs": { "d": "M26.5 30A3.5 3.5 0 1130 26.5 3.5041 3.5041 0 0126.5 30zm0-5A1.5 1.5 0 1028 26.5 1.5017 1.5017 0 0026.5 25zM14 30a3.958 3.958 0 01-2.126-.6211 6.9977 6.9977 0 114.1109-6.8384A3.9916 3.9916 0 0114 30zm-1.8843-3.0278l.5391.4946a1.9915 1.9915 0 102.0039-3.343l-.6909-.2432.03-.8467a5.0085 5.0085 0 10-2.5166 4.3023zM24 16a6.0067 6.0067 0 01-6-6 5.3246 5.3246 0 01.0269-.5327A3.9564 3.9564 0 0116 6a4.0045 4.0045 0 014-4 3.9564 3.9564 0 013.4673 2.0271C23.6484 4.009 23.8252 4 24 4a6 6 0 010 12zM20 4a2.0021 2.0021 0 00-2 2 1.9805 1.9805 0 001.43 1.9023l.9018.2706-.2153.9162A3.9938 3.9938 0 1024 6a4.0064 4.0064 0 00-.9121.1162l-.9155.2141-.27-.9006A1.9807 1.9807 0 0020 4zM6.5 11A4.5 4.5 0 1111 6.5 4.5051 4.5051 0 016.5 11zm0-7A2.5 2.5 0 109 6.5 2.503 2.503 0 006.5 4z" } }], "name": "heat-map--02", "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"><circle cx="21" cy="20" r="2"></circle><circle cx="14" cy="12" r="2"></circle><circle cx="29" cy="19" r="1"></circle><path d="M26.5 30A3.5 3.5 0 1130 26.5 3.5041 3.5041 0 0126.5 30zm0-5A1.5 1.5 0 1028 26.5 1.5017 1.5017 0 0026.5 25zM14 30a3.958 3.958 0 01-2.126-.6211 6.9977 6.9977 0 114.1109-6.8384A3.9916 3.9916 0 0114 30zm-1.8843-3.0278l.5391.4946a1.9915 1.9915 0 102.0039-3.343l-.6909-.2432.03-.8467a5.0085 5.0085 0 10-2.5166 4.3023zM24 16a6.0067 6.0067 0 01-6-6 5.3246 5.3246 0 01.0269-.5327A3.9564 3.9564 0 0116 6a4.0045 4.0045 0 014-4 3.9564 3.9564 0 013.4673 2.0271C23.6484 4.009 23.8252 4 24 4a6 6 0 010 12zM20 4a2.0021 2.0021 0 00-2 2 1.9805 1.9805 0 001.43 1.9023l.9018.2706-.2153.9162A3.9938 3.9938 0 1024 6a4.0064 4.0064 0 00-.9121.1162l-.9155.2141-.27-.9006A1.9807 1.9807 0 0020 4zM6.5 11A4.5 4.5 0 1111 6.5 4.5051 4.5051 0 016.5 11zm0-7A2.5 2.5 0 109 6.5 2.503 2.503 0 006.5 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; HeatMap_02Directive_1.titleIdCounter++; title.setAttribute("id", `heat-map-02-${HeatMap_02Directive_1.titleIdCounter}`); svg.appendChild(title); svg.setAttribute("aria-labelledby", `heat-map-02-${HeatMap_02Directive_1.titleIdCounter}`); } } }; HeatMap_02Directive.titleIdCounter = 0; HeatMap_02Directive.ctorParameters = () => [ { type: ElementRef } ]; __decorate([ Input(), __metadata("design:type", String) ], HeatMap_02Directive.prototype, "ariaLabel", void 0); __decorate([ Input(), __metadata("design:type", String) ], HeatMap_02Directive.prototype, "ariaLabelledby", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], HeatMap_02Directive.prototype, "ariaHidden", void 0); __decorate([ Input(), __metadata("design:type", String) ], HeatMap_02Directive.prototype, "title", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], HeatMap_02Directive.prototype, "isFocusable", void 0); __decorate([ Input(), __metadata("design:type", String) ], HeatMap_02Directive.prototype, "size", void 0); HeatMap_02Directive = HeatMap_02Directive_1 = __decorate([ Directive({ selector: "[ibmIconHeatMap_02]" }), __metadata("design:paramtypes", [ElementRef]) ], HeatMap_02Directive); let HeatMap_02Module = class HeatMap_02Module { }; HeatMap_02Module = __decorate([ NgModule({ declarations: [ HeatMap_02Component, HeatMap_02Directive, ], exports: [ HeatMap_02Component, HeatMap_02Directive, ] }) ], HeatMap_02Module); export { HeatMap_02Component, HeatMap_02Directive, HeatMap_02Module };