UNPKG

@carbon/icons-angular

Version:

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

169 lines (166 loc) 14.2 kB
import { __decorate, __metadata } from 'tslib'; import { Input, Component, ElementRef, Directive, NgModule } from '@angular/core'; import { getAttributes } from '@carbon/icon-helpers'; var WatsonHealthEdgeEnhancement_01Component = /** @class */ (function () { function WatsonHealthEdgeEnhancement_01Component() { this.focusable = false; } __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthEdgeEnhancement_01Component.prototype, "ariaLabel", void 0); __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthEdgeEnhancement_01Component.prototype, "ariaLabelledby", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], WatsonHealthEdgeEnhancement_01Component.prototype, "ariaHidden", void 0); __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthEdgeEnhancement_01Component.prototype, "title", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], WatsonHealthEdgeEnhancement_01Component.prototype, "focusable", void 0); __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthEdgeEnhancement_01Component.prototype, "innerClass", void 0); __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthEdgeEnhancement_01Component.prototype, "size", void 0); WatsonHealthEdgeEnhancement_01Component = __decorate([ Component({ selector: "ibm-icon-watson-health-edge-enhancement-01", template: "\n <svg\n ibmIconWatsonHealthEdgeEnhancement_01\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 " }) ], WatsonHealthEdgeEnhancement_01Component); return WatsonHealthEdgeEnhancement_01Component; }()); var WatsonHealthEdgeEnhancement_01Directive = /** @class */ (function () { function WatsonHealthEdgeEnhancement_01Directive(elementRef) { this.elementRef = elementRef; this.isFocusable = false; this.icons = { "32": { metadata: { "moduleName": "WatsonHealthEdgeEnhancement_0132", "filepath": "watson-health/edge-enhancement--01/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 28L26 20 24 20 24 21 22 21 22 23 24 23 24 28 22 28 22 30 28 30 28 28 26 28zM28 16h2A14 14 0 0016 2V4A12 12 0 0128 16z" } }, { "elem": "path", "attrs": { "d": "M26 16A10 10 0 0016 6V16zM16 28A11.96 11.96 0 015.416 21.6548c-.0664-.127-.133-.2534-.1953-.3843-.0547-.1123-.106-.227-.1572-.3413A13.1207 13.1207 0 014.19 18l-1.9677.4131A13.9173 13.9173 0 002.7 20.2993l-.0251.0083A13.9615 13.9615 0 0016 30zM5.5913 10L3.86 9a14.14 14.14 0 00-1.6382 4.5872l1.9677.3469A12.1519 12.1519 0 015.5913 10zM11.8164 4.7646L11.1328 2.887A13.976 13.976 0 006.9507 5.3278L8.2358 6.8593A11.9729 11.9729 0 0111.8164 4.7646z" } }], "name": "edge-enhancement--01", "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 28L26 20 24 20 24 21 22 21 22 23 24 23 24 28 22 28 22 30 28 30 28 28 26 28zM28 16h2A14 14 0 0016 2V4A12 12 0 0128 16z\"></path><path d=\"M26 16A10 10 0 0016 6V16zM16 28A11.96 11.96 0 015.416 21.6548c-.0664-.127-.133-.2534-.1953-.3843-.0547-.1123-.106-.227-.1572-.3413A13.1207 13.1207 0 014.19 18l-1.9677.4131A13.9173 13.9173 0 002.7 20.2993l-.0251.0083A13.9615 13.9615 0 0016 30zM5.5913 10L3.86 9a14.14 14.14 0 00-1.6382 4.5872l1.9677.3469A12.1519 12.1519 0 015.5913 10zM11.8164 4.7646L11.1328 2.887A13.976 13.976 0 006.9507 5.3278L8.2358 6.8593A11.9729 11.9729 0 0111.8164 4.7646z\"></path></svg>" }, "24": { metadata: { "moduleName": "WatsonHealthEdgeEnhancement_0124", "filepath": "watson-health/edge-enhancement--01/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 28L26 20 24 20 24 21 22 21 22 23 24 23 24 28 22 28 22 30 28 30 28 28 26 28zM28 16h2A14 14 0 0016 2V4A12 12 0 0128 16z" } }, { "elem": "path", "attrs": { "d": "M26 16A10 10 0 0016 6V16zM16 28A11.96 11.96 0 015.416 21.6548c-.0664-.127-.133-.2534-.1953-.3843-.0547-.1123-.106-.227-.1572-.3413A13.1207 13.1207 0 014.19 18l-1.9677.4131A13.9173 13.9173 0 002.7 20.2993l-.0251.0083A13.9615 13.9615 0 0016 30zM5.5913 10L3.86 9a14.14 14.14 0 00-1.6382 4.5872l1.9677.3469A12.1519 12.1519 0 015.5913 10zM11.8164 4.7646L11.1328 2.887A13.976 13.976 0 006.9507 5.3278L8.2358 6.8593A11.9729 11.9729 0 0111.8164 4.7646z" } }], "name": "edge-enhancement--01", "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 28L26 20 24 20 24 21 22 21 22 23 24 23 24 28 22 28 22 30 28 30 28 28 26 28zM28 16h2A14 14 0 0016 2V4A12 12 0 0128 16z\"></path><path d=\"M26 16A10 10 0 0016 6V16zM16 28A11.96 11.96 0 015.416 21.6548c-.0664-.127-.133-.2534-.1953-.3843-.0547-.1123-.106-.227-.1572-.3413A13.1207 13.1207 0 014.19 18l-1.9677.4131A13.9173 13.9173 0 002.7 20.2993l-.0251.0083A13.9615 13.9615 0 0016 30zM5.5913 10L3.86 9a14.14 14.14 0 00-1.6382 4.5872l1.9677.3469A12.1519 12.1519 0 015.5913 10zM11.8164 4.7646L11.1328 2.887A13.976 13.976 0 006.9507 5.3278L8.2358 6.8593A11.9729 11.9729 0 0111.8164 4.7646z\"></path></svg>" }, "20": { metadata: { "moduleName": "WatsonHealthEdgeEnhancement_0120", "filepath": "watson-health/edge-enhancement--01/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 28L26 20 24 20 24 21 22 21 22 23 24 23 24 28 22 28 22 30 28 30 28 28 26 28zM28 16h2A14 14 0 0016 2V4A12 12 0 0128 16z" } }, { "elem": "path", "attrs": { "d": "M26 16A10 10 0 0016 6V16zM16 28A11.96 11.96 0 015.416 21.6548c-.0664-.127-.133-.2534-.1953-.3843-.0547-.1123-.106-.227-.1572-.3413A13.1207 13.1207 0 014.19 18l-1.9677.4131A13.9173 13.9173 0 002.7 20.2993l-.0251.0083A13.9615 13.9615 0 0016 30zM5.5913 10L3.86 9a14.14 14.14 0 00-1.6382 4.5872l1.9677.3469A12.1519 12.1519 0 015.5913 10zM11.8164 4.7646L11.1328 2.887A13.976 13.976 0 006.9507 5.3278L8.2358 6.8593A11.9729 11.9729 0 0111.8164 4.7646z" } }], "name": "edge-enhancement--01", "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 28L26 20 24 20 24 21 22 21 22 23 24 23 24 28 22 28 22 30 28 30 28 28 26 28zM28 16h2A14 14 0 0016 2V4A12 12 0 0128 16z\"></path><path d=\"M26 16A10 10 0 0016 6V16zM16 28A11.96 11.96 0 015.416 21.6548c-.0664-.127-.133-.2534-.1953-.3843-.0547-.1123-.106-.227-.1572-.3413A13.1207 13.1207 0 014.19 18l-1.9677.4131A13.9173 13.9173 0 002.7 20.2993l-.0251.0083A13.9615 13.9615 0 0016 30zM5.5913 10L3.86 9a14.14 14.14 0 00-1.6382 4.5872l1.9677.3469A12.1519 12.1519 0 015.5913 10zM11.8164 4.7646L11.1328 2.887A13.976 13.976 0 006.9507 5.3278L8.2358 6.8593A11.9729 11.9729 0 0111.8164 4.7646z\"></path></svg>" }, "16": { metadata: { "moduleName": "WatsonHealthEdgeEnhancement_0116", "filepath": "watson-health/edge-enhancement--01/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 28L26 20 24 20 24 21 22 21 22 23 24 23 24 28 22 28 22 30 28 30 28 28 26 28zM28 16h2A14 14 0 0016 2V4A12 12 0 0128 16z" } }, { "elem": "path", "attrs": { "d": "M26 16A10 10 0 0016 6V16zM16 28A11.96 11.96 0 015.416 21.6548c-.0664-.127-.133-.2534-.1953-.3843-.0547-.1123-.106-.227-.1572-.3413A13.1207 13.1207 0 014.19 18l-1.9677.4131A13.9173 13.9173 0 002.7 20.2993l-.0251.0083A13.9615 13.9615 0 0016 30zM5.5913 10L3.86 9a14.14 14.14 0 00-1.6382 4.5872l1.9677.3469A12.1519 12.1519 0 015.5913 10zM11.8164 4.7646L11.1328 2.887A13.976 13.976 0 006.9507 5.3278L8.2358 6.8593A11.9729 11.9729 0 0111.8164 4.7646z" } }], "name": "edge-enhancement--01", "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 28L26 20 24 20 24 21 22 21 22 23 24 23 24 28 22 28 22 30 28 30 28 28 26 28zM28 16h2A14 14 0 0016 2V4A12 12 0 0128 16z\"></path><path d=\"M26 16A10 10 0 0016 6V16zM16 28A11.96 11.96 0 015.416 21.6548c-.0664-.127-.133-.2534-.1953-.3843-.0547-.1123-.106-.227-.1572-.3413A13.1207 13.1207 0 014.19 18l-1.9677.4131A13.9173 13.9173 0 002.7 20.2993l-.0251.0083A13.9615 13.9615 0 0016 30zM5.5913 10L3.86 9a14.14 14.14 0 00-1.6382 4.5872l1.9677.3469A12.1519 12.1519 0 015.5913 10zM11.8164 4.7646L11.1328 2.887A13.976 13.976 0 006.9507 5.3278L8.2358 6.8593A11.9729 11.9729 0 0111.8164 4.7646z\"></path></svg>" }, }; } WatsonHealthEdgeEnhancement_01Directive_1 = WatsonHealthEdgeEnhancement_01Directive; WatsonHealthEdgeEnhancement_01Directive.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; WatsonHealthEdgeEnhancement_01Directive_1.titleIdCounter++; title.setAttribute("id", "watson-health-edge-enhancement-01-" + WatsonHealthEdgeEnhancement_01Directive_1.titleIdCounter); svg.appendChild(title); svg.setAttribute("aria-labelledby", "watson-health-edge-enhancement-01-" + WatsonHealthEdgeEnhancement_01Directive_1.titleIdCounter); } }; var WatsonHealthEdgeEnhancement_01Directive_1; WatsonHealthEdgeEnhancement_01Directive.titleIdCounter = 0; WatsonHealthEdgeEnhancement_01Directive.ctorParameters = function () { return [ { type: ElementRef } ]; }; __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthEdgeEnhancement_01Directive.prototype, "ariaLabel", void 0); __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthEdgeEnhancement_01Directive.prototype, "ariaLabelledby", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], WatsonHealthEdgeEnhancement_01Directive.prototype, "ariaHidden", void 0); __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthEdgeEnhancement_01Directive.prototype, "title", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], WatsonHealthEdgeEnhancement_01Directive.prototype, "isFocusable", void 0); __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthEdgeEnhancement_01Directive.prototype, "size", void 0); WatsonHealthEdgeEnhancement_01Directive = WatsonHealthEdgeEnhancement_01Directive_1 = __decorate([ Directive({ selector: "[ibmIconWatsonHealthEdgeEnhancement_01]" }), __metadata("design:paramtypes", [ElementRef]) ], WatsonHealthEdgeEnhancement_01Directive); return WatsonHealthEdgeEnhancement_01Directive; }()); var WatsonHealthEdgeEnhancement_01Module = /** @class */ (function () { function WatsonHealthEdgeEnhancement_01Module() { } WatsonHealthEdgeEnhancement_01Module = __decorate([ NgModule({ declarations: [ WatsonHealthEdgeEnhancement_01Component, WatsonHealthEdgeEnhancement_01Directive, ], exports: [ WatsonHealthEdgeEnhancement_01Component, WatsonHealthEdgeEnhancement_01Directive, ] }) ], WatsonHealthEdgeEnhancement_01Module); return WatsonHealthEdgeEnhancement_01Module; }()); export { WatsonHealthEdgeEnhancement_01Component, WatsonHealthEdgeEnhancement_01Directive, WatsonHealthEdgeEnhancement_01Module };