UNPKG

@carbon/icons-angular

Version:

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

169 lines (166 loc) 12.5 kB
import { __decorate, __metadata } from 'tslib'; import { Input, Component, ElementRef, Directive, NgModule } from '@angular/core'; import { getAttributes } from '@carbon/icon-helpers'; var HumidityAltComponent = /** @class */ (function () { function HumidityAltComponent() { this.focusable = false; } __decorate([ Input(), __metadata("design:type", String) ], HumidityAltComponent.prototype, "ariaLabel", void 0); __decorate([ Input(), __metadata("design:type", String) ], HumidityAltComponent.prototype, "ariaLabelledby", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], HumidityAltComponent.prototype, "ariaHidden", void 0); __decorate([ Input(), __metadata("design:type", String) ], HumidityAltComponent.prototype, "title", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], HumidityAltComponent.prototype, "focusable", void 0); __decorate([ Input(), __metadata("design:type", String) ], HumidityAltComponent.prototype, "innerClass", void 0); __decorate([ Input(), __metadata("design:type", String) ], HumidityAltComponent.prototype, "size", void 0); HumidityAltComponent = __decorate([ Component({ selector: "ibm-icon-humidity-alt", template: "\n <svg\n ibmIconHumidityAlt\n [size]=\"size\"\n [ariaLabel]=\"ariaLabel\"\n [ariaLabelledby]=\"ariaLabelledby\"\n [ariaHidden]=\"ariaHidden\"\n [title]=\"title\"\n [isFocusable]=\"focusable\"\n [attr.class]=\"innerClass\">\n </svg>\n " }) ], HumidityAltComponent); return HumidityAltComponent; }()); var HumidityAltDirective = /** @class */ (function () { function HumidityAltDirective(elementRef) { this.elementRef = elementRef; this.isFocusable = false; this.icons = { "32": { metadata: { "moduleName": "HumidityAlt32", "filepath": "humidity--alt/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": "M26 12a3.8978 3.8978 0 01-4-3.777 3.9017 3.9017 0 01.6533-2.0639L25.17 2.4141a1.0381 1.0381 0 011.6592 0L29.3154 6.11A3.9693 3.9693 0 0130 8.223 3.8978 3.8978 0 0126 12zm0-7.2368L24.3438 7.2257A1.89 1.89 0 0024 8.223a2.0139 2.0139 0 004 0 1.98 1.98 0 00-.375-1.0466zM23.5 30H8.5A6.4962 6.4962 0 017.2 17.1381a8.9938 8.9938 0 0117.6006 0A6.4964 6.4964 0 0123.5 30zM16 12a7 7 0 00-6.9414 6.1452l-.0991.8122-.8155.064A4.4962 4.4962 0 008.5 28h15a4.4962 4.4962 0 00.3564-8.9786l-.8154-.064-.0986-.8122A7.0022 7.0022 0 0016 12z" } }], "name": "humidity--alt", "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=\"M26 12a3.8978 3.8978 0 01-4-3.777 3.9017 3.9017 0 01.6533-2.0639L25.17 2.4141a1.0381 1.0381 0 011.6592 0L29.3154 6.11A3.9693 3.9693 0 0130 8.223 3.8978 3.8978 0 0126 12zm0-7.2368L24.3438 7.2257A1.89 1.89 0 0024 8.223a2.0139 2.0139 0 004 0 1.98 1.98 0 00-.375-1.0466zM23.5 30H8.5A6.4962 6.4962 0 017.2 17.1381a8.9938 8.9938 0 0117.6006 0A6.4964 6.4964 0 0123.5 30zM16 12a7 7 0 00-6.9414 6.1452l-.0991.8122-.8155.064A4.4962 4.4962 0 008.5 28h15a4.4962 4.4962 0 00.3564-8.9786l-.8154-.064-.0986-.8122A7.0022 7.0022 0 0016 12z\"></path></svg>" }, "24": { metadata: { "moduleName": "HumidityAlt24", "filepath": "humidity--alt/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": "M26 12a3.8978 3.8978 0 01-4-3.777 3.9017 3.9017 0 01.6533-2.0639L25.17 2.4141a1.0381 1.0381 0 011.6592 0L29.3154 6.11A3.9693 3.9693 0 0130 8.223 3.8978 3.8978 0 0126 12zm0-7.2368L24.3438 7.2257A1.89 1.89 0 0024 8.223a2.0139 2.0139 0 004 0 1.98 1.98 0 00-.375-1.0466zM23.5 30H8.5A6.4962 6.4962 0 017.2 17.1381a8.9938 8.9938 0 0117.6006 0A6.4964 6.4964 0 0123.5 30zM16 12a7 7 0 00-6.9414 6.1452l-.0991.8122-.8155.064A4.4962 4.4962 0 008.5 28h15a4.4962 4.4962 0 00.3564-8.9786l-.8154-.064-.0986-.8122A7.0022 7.0022 0 0016 12z" } }], "name": "humidity--alt", "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=\"M26 12a3.8978 3.8978 0 01-4-3.777 3.9017 3.9017 0 01.6533-2.0639L25.17 2.4141a1.0381 1.0381 0 011.6592 0L29.3154 6.11A3.9693 3.9693 0 0130 8.223 3.8978 3.8978 0 0126 12zm0-7.2368L24.3438 7.2257A1.89 1.89 0 0024 8.223a2.0139 2.0139 0 004 0 1.98 1.98 0 00-.375-1.0466zM23.5 30H8.5A6.4962 6.4962 0 017.2 17.1381a8.9938 8.9938 0 0117.6006 0A6.4964 6.4964 0 0123.5 30zM16 12a7 7 0 00-6.9414 6.1452l-.0991.8122-.8155.064A4.4962 4.4962 0 008.5 28h15a4.4962 4.4962 0 00.3564-8.9786l-.8154-.064-.0986-.8122A7.0022 7.0022 0 0016 12z\"></path></svg>" }, "20": { metadata: { "moduleName": "HumidityAlt20", "filepath": "humidity--alt/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": "M26 12a3.8978 3.8978 0 01-4-3.777 3.9017 3.9017 0 01.6533-2.0639L25.17 2.4141a1.0381 1.0381 0 011.6592 0L29.3154 6.11A3.9693 3.9693 0 0130 8.223 3.8978 3.8978 0 0126 12zm0-7.2368L24.3438 7.2257A1.89 1.89 0 0024 8.223a2.0139 2.0139 0 004 0 1.98 1.98 0 00-.375-1.0466zM23.5 30H8.5A6.4962 6.4962 0 017.2 17.1381a8.9938 8.9938 0 0117.6006 0A6.4964 6.4964 0 0123.5 30zM16 12a7 7 0 00-6.9414 6.1452l-.0991.8122-.8155.064A4.4962 4.4962 0 008.5 28h15a4.4962 4.4962 0 00.3564-8.9786l-.8154-.064-.0986-.8122A7.0022 7.0022 0 0016 12z" } }], "name": "humidity--alt", "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=\"M26 12a3.8978 3.8978 0 01-4-3.777 3.9017 3.9017 0 01.6533-2.0639L25.17 2.4141a1.0381 1.0381 0 011.6592 0L29.3154 6.11A3.9693 3.9693 0 0130 8.223 3.8978 3.8978 0 0126 12zm0-7.2368L24.3438 7.2257A1.89 1.89 0 0024 8.223a2.0139 2.0139 0 004 0 1.98 1.98 0 00-.375-1.0466zM23.5 30H8.5A6.4962 6.4962 0 017.2 17.1381a8.9938 8.9938 0 0117.6006 0A6.4964 6.4964 0 0123.5 30zM16 12a7 7 0 00-6.9414 6.1452l-.0991.8122-.8155.064A4.4962 4.4962 0 008.5 28h15a4.4962 4.4962 0 00.3564-8.9786l-.8154-.064-.0986-.8122A7.0022 7.0022 0 0016 12z\"></path></svg>" }, "16": { metadata: { "moduleName": "HumidityAlt16", "filepath": "humidity--alt/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": "M26 12a3.8978 3.8978 0 01-4-3.777 3.9017 3.9017 0 01.6533-2.0639L25.17 2.4141a1.0381 1.0381 0 011.6592 0L29.3154 6.11A3.9693 3.9693 0 0130 8.223 3.8978 3.8978 0 0126 12zm0-7.2368L24.3438 7.2257A1.89 1.89 0 0024 8.223a2.0139 2.0139 0 004 0 1.98 1.98 0 00-.375-1.0466zM23.5 30H8.5A6.4962 6.4962 0 017.2 17.1381a8.9938 8.9938 0 0117.6006 0A6.4964 6.4964 0 0123.5 30zM16 12a7 7 0 00-6.9414 6.1452l-.0991.8122-.8155.064A4.4962 4.4962 0 008.5 28h15a4.4962 4.4962 0 00.3564-8.9786l-.8154-.064-.0986-.8122A7.0022 7.0022 0 0016 12z" } }], "name": "humidity--alt", "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=\"M26 12a3.8978 3.8978 0 01-4-3.777 3.9017 3.9017 0 01.6533-2.0639L25.17 2.4141a1.0381 1.0381 0 011.6592 0L29.3154 6.11A3.9693 3.9693 0 0130 8.223 3.8978 3.8978 0 0126 12zm0-7.2368L24.3438 7.2257A1.89 1.89 0 0024 8.223a2.0139 2.0139 0 004 0 1.98 1.98 0 00-.375-1.0466zM23.5 30H8.5A6.4962 6.4962 0 017.2 17.1381a8.9938 8.9938 0 0117.6006 0A6.4964 6.4964 0 0123.5 30zM16 12a7 7 0 00-6.9414 6.1452l-.0991.8122-.8155.064A4.4962 4.4962 0 008.5 28h15a4.4962 4.4962 0 00.3564-8.9786l-.8154-.064-.0986-.8122A7.0022 7.0022 0 0016 12z\"></path></svg>" }, }; } HumidityAltDirective_1 = HumidityAltDirective; HumidityAltDirective.prototype.ngAfterViewInit = function () { var svg = this.elementRef.nativeElement; svg.setAttribute("xmlns", "http://www.w3.org/2000/svg"); var icon = this.icons[this.size]; var domParser = new DOMParser(); var rawSVG = icon.svg; var svgElement = domParser.parseFromString(rawSVG, "image/svg+xml").documentElement; var 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; } var 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() }); var attrKeys = Object.keys(attributes); for (var i = 0; i < attrKeys.length; i++) { var key = attrKeys[i]; var value = attributes[key]; if (key === "title") { continue; } if (value) { svg.setAttribute(key, value); } } if (attributes.title) { var title = document.createElement("title"); title.textContent = attributes.title; HumidityAltDirective_1.titleIdCounter++; title.setAttribute("id", "humidity-alt-" + HumidityAltDirective_1.titleIdCounter); svg.appendChild(title); svg.setAttribute("aria-labelledby", "humidity-alt-" + HumidityAltDirective_1.titleIdCounter); } }; var HumidityAltDirective_1; HumidityAltDirective.titleIdCounter = 0; HumidityAltDirective.ctorParameters = function () { return [ { type: ElementRef } ]; }; __decorate([ Input(), __metadata("design:type", String) ], HumidityAltDirective.prototype, "ariaLabel", void 0); __decorate([ Input(), __metadata("design:type", String) ], HumidityAltDirective.prototype, "ariaLabelledby", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], HumidityAltDirective.prototype, "ariaHidden", void 0); __decorate([ Input(), __metadata("design:type", String) ], HumidityAltDirective.prototype, "title", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], HumidityAltDirective.prototype, "isFocusable", void 0); __decorate([ Input(), __metadata("design:type", String) ], HumidityAltDirective.prototype, "size", void 0); HumidityAltDirective = HumidityAltDirective_1 = __decorate([ Directive({ selector: "[ibmIconHumidityAlt]" }), __metadata("design:paramtypes", [ElementRef]) ], HumidityAltDirective); return HumidityAltDirective; }()); var HumidityAltModule = /** @class */ (function () { function HumidityAltModule() { } HumidityAltModule = __decorate([ NgModule({ declarations: [ HumidityAltComponent, HumidityAltDirective, ], exports: [ HumidityAltComponent, HumidityAltDirective, ] }) ], HumidityAltModule); return HumidityAltModule; }()); export { HumidityAltComponent, HumidityAltDirective, HumidityAltModule };