UNPKG

@carbon/icons-angular

Version:

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

169 lines (166 loc) 16.9 kB
import { __decorate, __metadata } from 'tslib'; import { Input, Component, ElementRef, Directive, NgModule } from '@angular/core'; import { getAttributes } from '@carbon/icon-helpers'; var WatsonHealthSmoothingCursorComponent = /** @class */ (function () { function WatsonHealthSmoothingCursorComponent() { this.focusable = false; } __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthSmoothingCursorComponent.prototype, "ariaLabel", void 0); __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthSmoothingCursorComponent.prototype, "ariaLabelledby", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], WatsonHealthSmoothingCursorComponent.prototype, "ariaHidden", void 0); __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthSmoothingCursorComponent.prototype, "title", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], WatsonHealthSmoothingCursorComponent.prototype, "focusable", void 0); __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthSmoothingCursorComponent.prototype, "innerClass", void 0); __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthSmoothingCursorComponent.prototype, "size", void 0); WatsonHealthSmoothingCursorComponent = __decorate([ Component({ selector: "ibm-icon-watson-health-smoothing-cursor", template: "\n <svg\n ibmIconWatsonHealthSmoothingCursor\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 " }) ], WatsonHealthSmoothingCursorComponent); return WatsonHealthSmoothingCursorComponent; }()); var WatsonHealthSmoothingCursorDirective = /** @class */ (function () { function WatsonHealthSmoothingCursorDirective(elementRef) { this.elementRef = elementRef; this.isFocusable = false; this.icons = { "32": { metadata: { "moduleName": "WatsonHealthSmoothingCursor32", "filepath": "watson-health/smoothing--cursor/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": "18", "cy": "18", "r": "4" } }, { "elem": "path", "attrs": { "d": "M18 30a11.8932 11.8932 0 01-4.1035-.72L14.58 27.4A9.9725 9.9725 0 0018 28zM22.1484 29.2637l-.6914-1.877a9.9556 9.9556 0 002.9973-1.748l1.2916 1.5268A11.9525 11.9525 0 0122.1484 29.2637zM10.2893 27.1951A12.0141 12.0141 0 017.61 24.0078l1.73-1.0029a10.0236 10.0236 0 002.2347 2.6584zM28.4133 23.967l-1.7343-.9956a9.9159 9.9159 0 001.176-3.2641l1.9712.3388A11.8956 11.8956 0 0128.4133 23.967zM6.1821 20.0925A12.1282 12.1282 0 016.1777 15.93l1.9707.3423a10.1214 10.1214 0 00.0035 3.4738zM27.8447 16.2339a9.9019 9.9019 0 00-1.1953-3.2564l1.7285-1.0063a11.9029 11.9029 0 011.4361 3.9121zM9.3313 13.0107l-1.7324-.999a12.01 12.01 0 012.6738-3.1931l1.2886 1.53A10.01 10.01 0 009.3313 13.0107zM24.4094 10.3237a9.96 9.96 0 00-3.0088-1.7309l.68-1.8809a11.9491 11.9491 0 013.6118 2.0772zM14.562 8.6064l-.6875-1.8779A12.1031 12.1031 0 0118 6V8A10.0875 10.0875 0 0014.562 8.6064zM11 2L2 2 2 11 4 11 4 4 11 4 11 2z" } }], "name": "smoothing--cursor", "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=\"18\" cy=\"18\" r=\"4\"></circle><path d=\"M18 30a11.8932 11.8932 0 01-4.1035-.72L14.58 27.4A9.9725 9.9725 0 0018 28zM22.1484 29.2637l-.6914-1.877a9.9556 9.9556 0 002.9973-1.748l1.2916 1.5268A11.9525 11.9525 0 0122.1484 29.2637zM10.2893 27.1951A12.0141 12.0141 0 017.61 24.0078l1.73-1.0029a10.0236 10.0236 0 002.2347 2.6584zM28.4133 23.967l-1.7343-.9956a9.9159 9.9159 0 001.176-3.2641l1.9712.3388A11.8956 11.8956 0 0128.4133 23.967zM6.1821 20.0925A12.1282 12.1282 0 016.1777 15.93l1.9707.3423a10.1214 10.1214 0 00.0035 3.4738zM27.8447 16.2339a9.9019 9.9019 0 00-1.1953-3.2564l1.7285-1.0063a11.9029 11.9029 0 011.4361 3.9121zM9.3313 13.0107l-1.7324-.999a12.01 12.01 0 012.6738-3.1931l1.2886 1.53A10.01 10.01 0 009.3313 13.0107zM24.4094 10.3237a9.96 9.96 0 00-3.0088-1.7309l.68-1.8809a11.9491 11.9491 0 013.6118 2.0772zM14.562 8.6064l-.6875-1.8779A12.1031 12.1031 0 0118 6V8A10.0875 10.0875 0 0014.562 8.6064zM11 2L2 2 2 11 4 11 4 4 11 4 11 2z\"></path></svg>" }, "24": { metadata: { "moduleName": "WatsonHealthSmoothingCursor24", "filepath": "watson-health/smoothing--cursor/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": "18", "cy": "18", "r": "4" } }, { "elem": "path", "attrs": { "d": "M18 30a11.8932 11.8932 0 01-4.1035-.72L14.58 27.4A9.9725 9.9725 0 0018 28zM22.1484 29.2637l-.6914-1.877a9.9556 9.9556 0 002.9973-1.748l1.2916 1.5268A11.9525 11.9525 0 0122.1484 29.2637zM10.2893 27.1951A12.0141 12.0141 0 017.61 24.0078l1.73-1.0029a10.0236 10.0236 0 002.2347 2.6584zM28.4133 23.967l-1.7343-.9956a9.9159 9.9159 0 001.176-3.2641l1.9712.3388A11.8956 11.8956 0 0128.4133 23.967zM6.1821 20.0925A12.1282 12.1282 0 016.1777 15.93l1.9707.3423a10.1214 10.1214 0 00.0035 3.4738zM27.8447 16.2339a9.9019 9.9019 0 00-1.1953-3.2564l1.7285-1.0063a11.9029 11.9029 0 011.4361 3.9121zM9.3313 13.0107l-1.7324-.999a12.01 12.01 0 012.6738-3.1931l1.2886 1.53A10.01 10.01 0 009.3313 13.0107zM24.4094 10.3237a9.96 9.96 0 00-3.0088-1.7309l.68-1.8809a11.9491 11.9491 0 013.6118 2.0772zM14.562 8.6064l-.6875-1.8779A12.1031 12.1031 0 0118 6V8A10.0875 10.0875 0 0014.562 8.6064zM11 2L2 2 2 11 4 11 4 4 11 4 11 2z" } }], "name": "smoothing--cursor", "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=\"18\" cy=\"18\" r=\"4\"></circle><path d=\"M18 30a11.8932 11.8932 0 01-4.1035-.72L14.58 27.4A9.9725 9.9725 0 0018 28zM22.1484 29.2637l-.6914-1.877a9.9556 9.9556 0 002.9973-1.748l1.2916 1.5268A11.9525 11.9525 0 0122.1484 29.2637zM10.2893 27.1951A12.0141 12.0141 0 017.61 24.0078l1.73-1.0029a10.0236 10.0236 0 002.2347 2.6584zM28.4133 23.967l-1.7343-.9956a9.9159 9.9159 0 001.176-3.2641l1.9712.3388A11.8956 11.8956 0 0128.4133 23.967zM6.1821 20.0925A12.1282 12.1282 0 016.1777 15.93l1.9707.3423a10.1214 10.1214 0 00.0035 3.4738zM27.8447 16.2339a9.9019 9.9019 0 00-1.1953-3.2564l1.7285-1.0063a11.9029 11.9029 0 011.4361 3.9121zM9.3313 13.0107l-1.7324-.999a12.01 12.01 0 012.6738-3.1931l1.2886 1.53A10.01 10.01 0 009.3313 13.0107zM24.4094 10.3237a9.96 9.96 0 00-3.0088-1.7309l.68-1.8809a11.9491 11.9491 0 013.6118 2.0772zM14.562 8.6064l-.6875-1.8779A12.1031 12.1031 0 0118 6V8A10.0875 10.0875 0 0014.562 8.6064zM11 2L2 2 2 11 4 11 4 4 11 4 11 2z\"></path></svg>" }, "20": { metadata: { "moduleName": "WatsonHealthSmoothingCursor20", "filepath": "watson-health/smoothing--cursor/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": "18", "cy": "18", "r": "4" } }, { "elem": "path", "attrs": { "d": "M18 30a11.8932 11.8932 0 01-4.1035-.72L14.58 27.4A9.9725 9.9725 0 0018 28zM22.1484 29.2637l-.6914-1.877a9.9556 9.9556 0 002.9973-1.748l1.2916 1.5268A11.9525 11.9525 0 0122.1484 29.2637zM10.2893 27.1951A12.0141 12.0141 0 017.61 24.0078l1.73-1.0029a10.0236 10.0236 0 002.2347 2.6584zM28.4133 23.967l-1.7343-.9956a9.9159 9.9159 0 001.176-3.2641l1.9712.3388A11.8956 11.8956 0 0128.4133 23.967zM6.1821 20.0925A12.1282 12.1282 0 016.1777 15.93l1.9707.3423a10.1214 10.1214 0 00.0035 3.4738zM27.8447 16.2339a9.9019 9.9019 0 00-1.1953-3.2564l1.7285-1.0063a11.9029 11.9029 0 011.4361 3.9121zM9.3313 13.0107l-1.7324-.999a12.01 12.01 0 012.6738-3.1931l1.2886 1.53A10.01 10.01 0 009.3313 13.0107zM24.4094 10.3237a9.96 9.96 0 00-3.0088-1.7309l.68-1.8809a11.9491 11.9491 0 013.6118 2.0772zM14.562 8.6064l-.6875-1.8779A12.1031 12.1031 0 0118 6V8A10.0875 10.0875 0 0014.562 8.6064zM11 2L2 2 2 11 4 11 4 4 11 4 11 2z" } }], "name": "smoothing--cursor", "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=\"18\" cy=\"18\" r=\"4\"></circle><path d=\"M18 30a11.8932 11.8932 0 01-4.1035-.72L14.58 27.4A9.9725 9.9725 0 0018 28zM22.1484 29.2637l-.6914-1.877a9.9556 9.9556 0 002.9973-1.748l1.2916 1.5268A11.9525 11.9525 0 0122.1484 29.2637zM10.2893 27.1951A12.0141 12.0141 0 017.61 24.0078l1.73-1.0029a10.0236 10.0236 0 002.2347 2.6584zM28.4133 23.967l-1.7343-.9956a9.9159 9.9159 0 001.176-3.2641l1.9712.3388A11.8956 11.8956 0 0128.4133 23.967zM6.1821 20.0925A12.1282 12.1282 0 016.1777 15.93l1.9707.3423a10.1214 10.1214 0 00.0035 3.4738zM27.8447 16.2339a9.9019 9.9019 0 00-1.1953-3.2564l1.7285-1.0063a11.9029 11.9029 0 011.4361 3.9121zM9.3313 13.0107l-1.7324-.999a12.01 12.01 0 012.6738-3.1931l1.2886 1.53A10.01 10.01 0 009.3313 13.0107zM24.4094 10.3237a9.96 9.96 0 00-3.0088-1.7309l.68-1.8809a11.9491 11.9491 0 013.6118 2.0772zM14.562 8.6064l-.6875-1.8779A12.1031 12.1031 0 0118 6V8A10.0875 10.0875 0 0014.562 8.6064zM11 2L2 2 2 11 4 11 4 4 11 4 11 2z\"></path></svg>" }, "16": { metadata: { "moduleName": "WatsonHealthSmoothingCursor16", "filepath": "watson-health/smoothing--cursor/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": "18", "cy": "18", "r": "4" } }, { "elem": "path", "attrs": { "d": "M18 30a11.8932 11.8932 0 01-4.1035-.72L14.58 27.4A9.9725 9.9725 0 0018 28zM22.1484 29.2637l-.6914-1.877a9.9556 9.9556 0 002.9973-1.748l1.2916 1.5268A11.9525 11.9525 0 0122.1484 29.2637zM10.2893 27.1951A12.0141 12.0141 0 017.61 24.0078l1.73-1.0029a10.0236 10.0236 0 002.2347 2.6584zM28.4133 23.967l-1.7343-.9956a9.9159 9.9159 0 001.176-3.2641l1.9712.3388A11.8956 11.8956 0 0128.4133 23.967zM6.1821 20.0925A12.1282 12.1282 0 016.1777 15.93l1.9707.3423a10.1214 10.1214 0 00.0035 3.4738zM27.8447 16.2339a9.9019 9.9019 0 00-1.1953-3.2564l1.7285-1.0063a11.9029 11.9029 0 011.4361 3.9121zM9.3313 13.0107l-1.7324-.999a12.01 12.01 0 012.6738-3.1931l1.2886 1.53A10.01 10.01 0 009.3313 13.0107zM24.4094 10.3237a9.96 9.96 0 00-3.0088-1.7309l.68-1.8809a11.9491 11.9491 0 013.6118 2.0772zM14.562 8.6064l-.6875-1.8779A12.1031 12.1031 0 0118 6V8A10.0875 10.0875 0 0014.562 8.6064zM11 2L2 2 2 11 4 11 4 4 11 4 11 2z" } }], "name": "smoothing--cursor", "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=\"18\" cy=\"18\" r=\"4\"></circle><path d=\"M18 30a11.8932 11.8932 0 01-4.1035-.72L14.58 27.4A9.9725 9.9725 0 0018 28zM22.1484 29.2637l-.6914-1.877a9.9556 9.9556 0 002.9973-1.748l1.2916 1.5268A11.9525 11.9525 0 0122.1484 29.2637zM10.2893 27.1951A12.0141 12.0141 0 017.61 24.0078l1.73-1.0029a10.0236 10.0236 0 002.2347 2.6584zM28.4133 23.967l-1.7343-.9956a9.9159 9.9159 0 001.176-3.2641l1.9712.3388A11.8956 11.8956 0 0128.4133 23.967zM6.1821 20.0925A12.1282 12.1282 0 016.1777 15.93l1.9707.3423a10.1214 10.1214 0 00.0035 3.4738zM27.8447 16.2339a9.9019 9.9019 0 00-1.1953-3.2564l1.7285-1.0063a11.9029 11.9029 0 011.4361 3.9121zM9.3313 13.0107l-1.7324-.999a12.01 12.01 0 012.6738-3.1931l1.2886 1.53A10.01 10.01 0 009.3313 13.0107zM24.4094 10.3237a9.96 9.96 0 00-3.0088-1.7309l.68-1.8809a11.9491 11.9491 0 013.6118 2.0772zM14.562 8.6064l-.6875-1.8779A12.1031 12.1031 0 0118 6V8A10.0875 10.0875 0 0014.562 8.6064zM11 2L2 2 2 11 4 11 4 4 11 4 11 2z\"></path></svg>" }, }; } WatsonHealthSmoothingCursorDirective_1 = WatsonHealthSmoothingCursorDirective; WatsonHealthSmoothingCursorDirective.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; WatsonHealthSmoothingCursorDirective_1.titleIdCounter++; title.setAttribute("id", "watson-health-smoothing-cursor-" + WatsonHealthSmoothingCursorDirective_1.titleIdCounter); svg.appendChild(title); svg.setAttribute("aria-labelledby", "watson-health-smoothing-cursor-" + WatsonHealthSmoothingCursorDirective_1.titleIdCounter); } }; var WatsonHealthSmoothingCursorDirective_1; WatsonHealthSmoothingCursorDirective.titleIdCounter = 0; WatsonHealthSmoothingCursorDirective.ctorParameters = function () { return [ { type: ElementRef } ]; }; __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthSmoothingCursorDirective.prototype, "ariaLabel", void 0); __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthSmoothingCursorDirective.prototype, "ariaLabelledby", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], WatsonHealthSmoothingCursorDirective.prototype, "ariaHidden", void 0); __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthSmoothingCursorDirective.prototype, "title", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], WatsonHealthSmoothingCursorDirective.prototype, "isFocusable", void 0); __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthSmoothingCursorDirective.prototype, "size", void 0); WatsonHealthSmoothingCursorDirective = WatsonHealthSmoothingCursorDirective_1 = __decorate([ Directive({ selector: "[ibmIconWatsonHealthSmoothingCursor]" }), __metadata("design:paramtypes", [ElementRef]) ], WatsonHealthSmoothingCursorDirective); return WatsonHealthSmoothingCursorDirective; }()); var WatsonHealthSmoothingCursorModule = /** @class */ (function () { function WatsonHealthSmoothingCursorModule() { } WatsonHealthSmoothingCursorModule = __decorate([ NgModule({ declarations: [ WatsonHealthSmoothingCursorComponent, WatsonHealthSmoothingCursorDirective, ], exports: [ WatsonHealthSmoothingCursorComponent, WatsonHealthSmoothingCursorDirective, ] }) ], WatsonHealthSmoothingCursorModule); return WatsonHealthSmoothingCursorModule; }()); export { WatsonHealthSmoothingCursorComponent, WatsonHealthSmoothingCursorDirective, WatsonHealthSmoothingCursorModule };