UNPKG

@carbon/icons-angular

Version:

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

177 lines (172 loc) 16.7 kB
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('tslib'), require('@angular/core'), require('@carbon/icon-helpers')) : typeof define === 'function' && define.amd ? define(['exports', 'tslib', '@angular/core', '@carbon/icon-helpers'], factory) : (global = global || self, factory((global.CarbonIconsAngular = global.CarbonIconsAngular || {}, global.CarbonIconsAngular.WatsonHealthSmoothing = {}), global.tslib, global.ng.core, global.CarbonIconHelpers)); }(this, (function (exports, tslib, core, iconHelpers) { 'use strict'; var WatsonHealthSmoothingComponent = /** @class */ (function () { function WatsonHealthSmoothingComponent() { this.focusable = false; } tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], WatsonHealthSmoothingComponent.prototype, "ariaLabel", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], WatsonHealthSmoothingComponent.prototype, "ariaLabelledby", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", Boolean) ], WatsonHealthSmoothingComponent.prototype, "ariaHidden", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], WatsonHealthSmoothingComponent.prototype, "title", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", Boolean) ], WatsonHealthSmoothingComponent.prototype, "focusable", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], WatsonHealthSmoothingComponent.prototype, "innerClass", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], WatsonHealthSmoothingComponent.prototype, "size", void 0); WatsonHealthSmoothingComponent = tslib.__decorate([ core.Component({ selector: "ibm-icon-watson-health-smoothing", template: "\n <svg\n ibmIconWatsonHealthSmoothing\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 " }) ], WatsonHealthSmoothingComponent); return WatsonHealthSmoothingComponent; }()); var WatsonHealthSmoothingDirective = /** @class */ (function () { function WatsonHealthSmoothingDirective(elementRef) { this.elementRef = elementRef; this.isFocusable = false; this.icons = { "32": { metadata: { "moduleName": "WatsonHealthSmoothing32", "filepath": "watson-health/smoothing/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": "16", "cy": "16", "r": "5" } }, { "elem": "path", "attrs": { "d": "M7.7 4.7a14.7029 14.7029 0 00-3 3.1L6.3 9A13.2634 13.2634 0 018.9 6.3zM4.6 12.3l-1.9-.6A12.5111 12.5111 0 002 16H4A11.4756 11.4756 0 014.6 12.3zM2.7 20.4a14.4029 14.4029 0 002 3.9l1.6-1.2a12.8867 12.8867 0 01-1.7-3.3zM7.8 27.3a14.4029 14.4029 0 003.9 2l.6-1.9A12.8867 12.8867 0 019 25.7zM11.7 2.7l.6 1.9A11.4756 11.4756 0 0116 4V2A12.5111 12.5111 0 0011.7 2.7zM24.2 27.3a15.18 15.18 0 003.1-3.1L25.7 23A11.526 11.526 0 0123 25.7zM27.4 19.7l1.9.6A15.4747 15.4747 0 0030 16H28A11.4756 11.4756 0 0127.4 19.7zM29.2 11.6a14.4029 14.4029 0 00-2-3.9L25.6 8.9a12.8867 12.8867 0 011.7 3.3zM24.1 4.6a14.4029 14.4029 0 00-3.9-2l-.6 1.9a12.8867 12.8867 0 013.3 1.7zM20.3 29.3l-.6-1.9A11.4756 11.4756 0 0116 28v2A21.4206 21.4206 0 0020.3 29.3z" } }], "name": "smoothing", "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=\"16\" cy=\"16\" r=\"5\"></circle><path d=\"M7.7 4.7a14.7029 14.7029 0 00-3 3.1L6.3 9A13.2634 13.2634 0 018.9 6.3zM4.6 12.3l-1.9-.6A12.5111 12.5111 0 002 16H4A11.4756 11.4756 0 014.6 12.3zM2.7 20.4a14.4029 14.4029 0 002 3.9l1.6-1.2a12.8867 12.8867 0 01-1.7-3.3zM7.8 27.3a14.4029 14.4029 0 003.9 2l.6-1.9A12.8867 12.8867 0 019 25.7zM11.7 2.7l.6 1.9A11.4756 11.4756 0 0116 4V2A12.5111 12.5111 0 0011.7 2.7zM24.2 27.3a15.18 15.18 0 003.1-3.1L25.7 23A11.526 11.526 0 0123 25.7zM27.4 19.7l1.9.6A15.4747 15.4747 0 0030 16H28A11.4756 11.4756 0 0127.4 19.7zM29.2 11.6a14.4029 14.4029 0 00-2-3.9L25.6 8.9a12.8867 12.8867 0 011.7 3.3zM24.1 4.6a14.4029 14.4029 0 00-3.9-2l-.6 1.9a12.8867 12.8867 0 013.3 1.7zM20.3 29.3l-.6-1.9A11.4756 11.4756 0 0116 28v2A21.4206 21.4206 0 0020.3 29.3z\"></path></svg>" }, "24": { metadata: { "moduleName": "WatsonHealthSmoothing24", "filepath": "watson-health/smoothing/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": "16", "cy": "16", "r": "5" } }, { "elem": "path", "attrs": { "d": "M7.7 4.7a14.7029 14.7029 0 00-3 3.1L6.3 9A13.2634 13.2634 0 018.9 6.3zM4.6 12.3l-1.9-.6A12.5111 12.5111 0 002 16H4A11.4756 11.4756 0 014.6 12.3zM2.7 20.4a14.4029 14.4029 0 002 3.9l1.6-1.2a12.8867 12.8867 0 01-1.7-3.3zM7.8 27.3a14.4029 14.4029 0 003.9 2l.6-1.9A12.8867 12.8867 0 019 25.7zM11.7 2.7l.6 1.9A11.4756 11.4756 0 0116 4V2A12.5111 12.5111 0 0011.7 2.7zM24.2 27.3a15.18 15.18 0 003.1-3.1L25.7 23A11.526 11.526 0 0123 25.7zM27.4 19.7l1.9.6A15.4747 15.4747 0 0030 16H28A11.4756 11.4756 0 0127.4 19.7zM29.2 11.6a14.4029 14.4029 0 00-2-3.9L25.6 8.9a12.8867 12.8867 0 011.7 3.3zM24.1 4.6a14.4029 14.4029 0 00-3.9-2l-.6 1.9a12.8867 12.8867 0 013.3 1.7zM20.3 29.3l-.6-1.9A11.4756 11.4756 0 0116 28v2A21.4206 21.4206 0 0020.3 29.3z" } }], "name": "smoothing", "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=\"16\" cy=\"16\" r=\"5\"></circle><path d=\"M7.7 4.7a14.7029 14.7029 0 00-3 3.1L6.3 9A13.2634 13.2634 0 018.9 6.3zM4.6 12.3l-1.9-.6A12.5111 12.5111 0 002 16H4A11.4756 11.4756 0 014.6 12.3zM2.7 20.4a14.4029 14.4029 0 002 3.9l1.6-1.2a12.8867 12.8867 0 01-1.7-3.3zM7.8 27.3a14.4029 14.4029 0 003.9 2l.6-1.9A12.8867 12.8867 0 019 25.7zM11.7 2.7l.6 1.9A11.4756 11.4756 0 0116 4V2A12.5111 12.5111 0 0011.7 2.7zM24.2 27.3a15.18 15.18 0 003.1-3.1L25.7 23A11.526 11.526 0 0123 25.7zM27.4 19.7l1.9.6A15.4747 15.4747 0 0030 16H28A11.4756 11.4756 0 0127.4 19.7zM29.2 11.6a14.4029 14.4029 0 00-2-3.9L25.6 8.9a12.8867 12.8867 0 011.7 3.3zM24.1 4.6a14.4029 14.4029 0 00-3.9-2l-.6 1.9a12.8867 12.8867 0 013.3 1.7zM20.3 29.3l-.6-1.9A11.4756 11.4756 0 0116 28v2A21.4206 21.4206 0 0020.3 29.3z\"></path></svg>" }, "20": { metadata: { "moduleName": "WatsonHealthSmoothing20", "filepath": "watson-health/smoothing/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": "16", "cy": "16", "r": "5" } }, { "elem": "path", "attrs": { "d": "M7.7 4.7a14.7029 14.7029 0 00-3 3.1L6.3 9A13.2634 13.2634 0 018.9 6.3zM4.6 12.3l-1.9-.6A12.5111 12.5111 0 002 16H4A11.4756 11.4756 0 014.6 12.3zM2.7 20.4a14.4029 14.4029 0 002 3.9l1.6-1.2a12.8867 12.8867 0 01-1.7-3.3zM7.8 27.3a14.4029 14.4029 0 003.9 2l.6-1.9A12.8867 12.8867 0 019 25.7zM11.7 2.7l.6 1.9A11.4756 11.4756 0 0116 4V2A12.5111 12.5111 0 0011.7 2.7zM24.2 27.3a15.18 15.18 0 003.1-3.1L25.7 23A11.526 11.526 0 0123 25.7zM27.4 19.7l1.9.6A15.4747 15.4747 0 0030 16H28A11.4756 11.4756 0 0127.4 19.7zM29.2 11.6a14.4029 14.4029 0 00-2-3.9L25.6 8.9a12.8867 12.8867 0 011.7 3.3zM24.1 4.6a14.4029 14.4029 0 00-3.9-2l-.6 1.9a12.8867 12.8867 0 013.3 1.7zM20.3 29.3l-.6-1.9A11.4756 11.4756 0 0116 28v2A21.4206 21.4206 0 0020.3 29.3z" } }], "name": "smoothing", "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=\"16\" cy=\"16\" r=\"5\"></circle><path d=\"M7.7 4.7a14.7029 14.7029 0 00-3 3.1L6.3 9A13.2634 13.2634 0 018.9 6.3zM4.6 12.3l-1.9-.6A12.5111 12.5111 0 002 16H4A11.4756 11.4756 0 014.6 12.3zM2.7 20.4a14.4029 14.4029 0 002 3.9l1.6-1.2a12.8867 12.8867 0 01-1.7-3.3zM7.8 27.3a14.4029 14.4029 0 003.9 2l.6-1.9A12.8867 12.8867 0 019 25.7zM11.7 2.7l.6 1.9A11.4756 11.4756 0 0116 4V2A12.5111 12.5111 0 0011.7 2.7zM24.2 27.3a15.18 15.18 0 003.1-3.1L25.7 23A11.526 11.526 0 0123 25.7zM27.4 19.7l1.9.6A15.4747 15.4747 0 0030 16H28A11.4756 11.4756 0 0127.4 19.7zM29.2 11.6a14.4029 14.4029 0 00-2-3.9L25.6 8.9a12.8867 12.8867 0 011.7 3.3zM24.1 4.6a14.4029 14.4029 0 00-3.9-2l-.6 1.9a12.8867 12.8867 0 013.3 1.7zM20.3 29.3l-.6-1.9A11.4756 11.4756 0 0116 28v2A21.4206 21.4206 0 0020.3 29.3z\"></path></svg>" }, "16": { metadata: { "moduleName": "WatsonHealthSmoothing16", "filepath": "watson-health/smoothing/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": "16", "cy": "16", "r": "5" } }, { "elem": "path", "attrs": { "d": "M7.7 4.7a14.7029 14.7029 0 00-3 3.1L6.3 9A13.2634 13.2634 0 018.9 6.3zM4.6 12.3l-1.9-.6A12.5111 12.5111 0 002 16H4A11.4756 11.4756 0 014.6 12.3zM2.7 20.4a14.4029 14.4029 0 002 3.9l1.6-1.2a12.8867 12.8867 0 01-1.7-3.3zM7.8 27.3a14.4029 14.4029 0 003.9 2l.6-1.9A12.8867 12.8867 0 019 25.7zM11.7 2.7l.6 1.9A11.4756 11.4756 0 0116 4V2A12.5111 12.5111 0 0011.7 2.7zM24.2 27.3a15.18 15.18 0 003.1-3.1L25.7 23A11.526 11.526 0 0123 25.7zM27.4 19.7l1.9.6A15.4747 15.4747 0 0030 16H28A11.4756 11.4756 0 0127.4 19.7zM29.2 11.6a14.4029 14.4029 0 00-2-3.9L25.6 8.9a12.8867 12.8867 0 011.7 3.3zM24.1 4.6a14.4029 14.4029 0 00-3.9-2l-.6 1.9a12.8867 12.8867 0 013.3 1.7zM20.3 29.3l-.6-1.9A11.4756 11.4756 0 0116 28v2A21.4206 21.4206 0 0020.3 29.3z" } }], "name": "smoothing", "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=\"16\" cy=\"16\" r=\"5\"></circle><path d=\"M7.7 4.7a14.7029 14.7029 0 00-3 3.1L6.3 9A13.2634 13.2634 0 018.9 6.3zM4.6 12.3l-1.9-.6A12.5111 12.5111 0 002 16H4A11.4756 11.4756 0 014.6 12.3zM2.7 20.4a14.4029 14.4029 0 002 3.9l1.6-1.2a12.8867 12.8867 0 01-1.7-3.3zM7.8 27.3a14.4029 14.4029 0 003.9 2l.6-1.9A12.8867 12.8867 0 019 25.7zM11.7 2.7l.6 1.9A11.4756 11.4756 0 0116 4V2A12.5111 12.5111 0 0011.7 2.7zM24.2 27.3a15.18 15.18 0 003.1-3.1L25.7 23A11.526 11.526 0 0123 25.7zM27.4 19.7l1.9.6A15.4747 15.4747 0 0030 16H28A11.4756 11.4756 0 0127.4 19.7zM29.2 11.6a14.4029 14.4029 0 00-2-3.9L25.6 8.9a12.8867 12.8867 0 011.7 3.3zM24.1 4.6a14.4029 14.4029 0 00-3.9-2l-.6 1.9a12.8867 12.8867 0 013.3 1.7zM20.3 29.3l-.6-1.9A11.4756 11.4756 0 0116 28v2A21.4206 21.4206 0 0020.3 29.3z\"></path></svg>" }, }; } WatsonHealthSmoothingDirective_1 = WatsonHealthSmoothingDirective; WatsonHealthSmoothingDirective.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 = iconHelpers.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; WatsonHealthSmoothingDirective_1.titleIdCounter++; title.setAttribute("id", "watson-health-smoothing-" + WatsonHealthSmoothingDirective_1.titleIdCounter); svg.appendChild(title); svg.setAttribute("aria-labelledby", "watson-health-smoothing-" + WatsonHealthSmoothingDirective_1.titleIdCounter); } }; var WatsonHealthSmoothingDirective_1; WatsonHealthSmoothingDirective.titleIdCounter = 0; WatsonHealthSmoothingDirective.ctorParameters = function () { return [ { type: core.ElementRef } ]; }; tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], WatsonHealthSmoothingDirective.prototype, "ariaLabel", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], WatsonHealthSmoothingDirective.prototype, "ariaLabelledby", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", Boolean) ], WatsonHealthSmoothingDirective.prototype, "ariaHidden", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], WatsonHealthSmoothingDirective.prototype, "title", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", Boolean) ], WatsonHealthSmoothingDirective.prototype, "isFocusable", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], WatsonHealthSmoothingDirective.prototype, "size", void 0); WatsonHealthSmoothingDirective = WatsonHealthSmoothingDirective_1 = tslib.__decorate([ core.Directive({ selector: "[ibmIconWatsonHealthSmoothing]" }), tslib.__metadata("design:paramtypes", [core.ElementRef]) ], WatsonHealthSmoothingDirective); return WatsonHealthSmoothingDirective; }()); var WatsonHealthSmoothingModule = /** @class */ (function () { function WatsonHealthSmoothingModule() { } WatsonHealthSmoothingModule = tslib.__decorate([ core.NgModule({ declarations: [ WatsonHealthSmoothingComponent, WatsonHealthSmoothingDirective, ], exports: [ WatsonHealthSmoothingComponent, WatsonHealthSmoothingDirective, ] }) ], WatsonHealthSmoothingModule); return WatsonHealthSmoothingModule; }()); exports.WatsonHealthSmoothingComponent = WatsonHealthSmoothingComponent; exports.WatsonHealthSmoothingDirective = WatsonHealthSmoothingDirective; exports.WatsonHealthSmoothingModule = WatsonHealthSmoothingModule; Object.defineProperty(exports, '__esModule', { value: true }); })));