UNPKG

@carbon/icons-angular

Version:

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

169 lines (166 loc) 14.7 kB
import { __decorate, __metadata } from 'tslib'; import { Input, Component, ElementRef, Directive, NgModule } from '@angular/core'; import { getAttributes } from '@carbon/icon-helpers'; var WatsonHealthScalpelLassoComponent = /** @class */ (function () { function WatsonHealthScalpelLassoComponent() { this.focusable = false; } __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthScalpelLassoComponent.prototype, "ariaLabel", void 0); __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthScalpelLassoComponent.prototype, "ariaLabelledby", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], WatsonHealthScalpelLassoComponent.prototype, "ariaHidden", void 0); __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthScalpelLassoComponent.prototype, "title", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], WatsonHealthScalpelLassoComponent.prototype, "focusable", void 0); __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthScalpelLassoComponent.prototype, "innerClass", void 0); __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthScalpelLassoComponent.prototype, "size", void 0); WatsonHealthScalpelLassoComponent = __decorate([ Component({ selector: "ibm-icon-watson-health-scalpel-lasso", template: "\n <svg\n ibmIconWatsonHealthScalpelLasso\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 " }) ], WatsonHealthScalpelLassoComponent); return WatsonHealthScalpelLassoComponent; }()); var WatsonHealthScalpelLassoDirective = /** @class */ (function () { function WatsonHealthScalpelLassoDirective(elementRef) { this.elementRef = elementRef; this.isFocusable = false; this.icons = { "32": { metadata: { "moduleName": "WatsonHealthScalpelLasso32", "filepath": "watson-health/scalpel--lasso/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": "M28.8281 7.1338a4.0941 4.0941 0 00-5.6562 0L.3433 29.9619H9.5889a4.9682 4.9682 0 003.5356-1.4648L28.8281 12.79a3.9984 3.9984 0 000-5.6562zM12.2928 20.8406l2.086-2.0858 2.8293 2.8293L15.1224 23.67zM11.71 27.083a2.9824 2.9824 0 01-2.1215.8789H5.1714l5.7073-5.7072 2.83 2.83zM27.4141 11.376L18.6221 20.17l-2.8293-2.8292 8.7931-8.7928a2.0471 2.0471 0 012.8282 0 1.9993 1.9993 0 010 2.8281zM11 2H7a4.9843 4.9843 0 00-3.8633 8.1528A2.9586 2.9586 0 003 11a2.9945 2.9945 0 002 2.8154V14a2.0025 2.0025 0 01-2 2H2v2H3a4.0045 4.0045 0 004-4v-.1841A2.9959 2.9959 0 008.8157 12H11A5 5 0 0011 2zM6 12a1 1 0 111-1A1.0009 1.0009 0 016 12zm5-2H8.8157A2.974 2.974 0 004.394 8.4746 2.9908 2.9908 0 017 4h4a3 3 0 010 6z" } }], "name": "scalpel--lasso", "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=\"M28.8281 7.1338a4.0941 4.0941 0 00-5.6562 0L.3433 29.9619H9.5889a4.9682 4.9682 0 003.5356-1.4648L28.8281 12.79a3.9984 3.9984 0 000-5.6562zM12.2928 20.8406l2.086-2.0858 2.8293 2.8293L15.1224 23.67zM11.71 27.083a2.9824 2.9824 0 01-2.1215.8789H5.1714l5.7073-5.7072 2.83 2.83zM27.4141 11.376L18.6221 20.17l-2.8293-2.8292 8.7931-8.7928a2.0471 2.0471 0 012.8282 0 1.9993 1.9993 0 010 2.8281zM11 2H7a4.9843 4.9843 0 00-3.8633 8.1528A2.9586 2.9586 0 003 11a2.9945 2.9945 0 002 2.8154V14a2.0025 2.0025 0 01-2 2H2v2H3a4.0045 4.0045 0 004-4v-.1841A2.9959 2.9959 0 008.8157 12H11A5 5 0 0011 2zM6 12a1 1 0 111-1A1.0009 1.0009 0 016 12zm5-2H8.8157A2.974 2.974 0 004.394 8.4746 2.9908 2.9908 0 017 4h4a3 3 0 010 6z\"></path></svg>" }, "24": { metadata: { "moduleName": "WatsonHealthScalpelLasso24", "filepath": "watson-health/scalpel--lasso/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": "M28.8281 7.1338a4.0941 4.0941 0 00-5.6562 0L.3433 29.9619H9.5889a4.9682 4.9682 0 003.5356-1.4648L28.8281 12.79a3.9984 3.9984 0 000-5.6562zM12.2928 20.8406l2.086-2.0858 2.8293 2.8293L15.1224 23.67zM11.71 27.083a2.9824 2.9824 0 01-2.1215.8789H5.1714l5.7073-5.7072 2.83 2.83zM27.4141 11.376L18.6221 20.17l-2.8293-2.8292 8.7931-8.7928a2.0471 2.0471 0 012.8282 0 1.9993 1.9993 0 010 2.8281zM11 2H7a4.9843 4.9843 0 00-3.8633 8.1528A2.9586 2.9586 0 003 11a2.9945 2.9945 0 002 2.8154V14a2.0025 2.0025 0 01-2 2H2v2H3a4.0045 4.0045 0 004-4v-.1841A2.9959 2.9959 0 008.8157 12H11A5 5 0 0011 2zM6 12a1 1 0 111-1A1.0009 1.0009 0 016 12zm5-2H8.8157A2.974 2.974 0 004.394 8.4746 2.9908 2.9908 0 017 4h4a3 3 0 010 6z" } }], "name": "scalpel--lasso", "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=\"M28.8281 7.1338a4.0941 4.0941 0 00-5.6562 0L.3433 29.9619H9.5889a4.9682 4.9682 0 003.5356-1.4648L28.8281 12.79a3.9984 3.9984 0 000-5.6562zM12.2928 20.8406l2.086-2.0858 2.8293 2.8293L15.1224 23.67zM11.71 27.083a2.9824 2.9824 0 01-2.1215.8789H5.1714l5.7073-5.7072 2.83 2.83zM27.4141 11.376L18.6221 20.17l-2.8293-2.8292 8.7931-8.7928a2.0471 2.0471 0 012.8282 0 1.9993 1.9993 0 010 2.8281zM11 2H7a4.9843 4.9843 0 00-3.8633 8.1528A2.9586 2.9586 0 003 11a2.9945 2.9945 0 002 2.8154V14a2.0025 2.0025 0 01-2 2H2v2H3a4.0045 4.0045 0 004-4v-.1841A2.9959 2.9959 0 008.8157 12H11A5 5 0 0011 2zM6 12a1 1 0 111-1A1.0009 1.0009 0 016 12zm5-2H8.8157A2.974 2.974 0 004.394 8.4746 2.9908 2.9908 0 017 4h4a3 3 0 010 6z\"></path></svg>" }, "20": { metadata: { "moduleName": "WatsonHealthScalpelLasso20", "filepath": "watson-health/scalpel--lasso/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": "M28.8281 7.1338a4.0941 4.0941 0 00-5.6562 0L.3433 29.9619H9.5889a4.9682 4.9682 0 003.5356-1.4648L28.8281 12.79a3.9984 3.9984 0 000-5.6562zM12.2928 20.8406l2.086-2.0858 2.8293 2.8293L15.1224 23.67zM11.71 27.083a2.9824 2.9824 0 01-2.1215.8789H5.1714l5.7073-5.7072 2.83 2.83zM27.4141 11.376L18.6221 20.17l-2.8293-2.8292 8.7931-8.7928a2.0471 2.0471 0 012.8282 0 1.9993 1.9993 0 010 2.8281zM11 2H7a4.9843 4.9843 0 00-3.8633 8.1528A2.9586 2.9586 0 003 11a2.9945 2.9945 0 002 2.8154V14a2.0025 2.0025 0 01-2 2H2v2H3a4.0045 4.0045 0 004-4v-.1841A2.9959 2.9959 0 008.8157 12H11A5 5 0 0011 2zM6 12a1 1 0 111-1A1.0009 1.0009 0 016 12zm5-2H8.8157A2.974 2.974 0 004.394 8.4746 2.9908 2.9908 0 017 4h4a3 3 0 010 6z" } }], "name": "scalpel--lasso", "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=\"M28.8281 7.1338a4.0941 4.0941 0 00-5.6562 0L.3433 29.9619H9.5889a4.9682 4.9682 0 003.5356-1.4648L28.8281 12.79a3.9984 3.9984 0 000-5.6562zM12.2928 20.8406l2.086-2.0858 2.8293 2.8293L15.1224 23.67zM11.71 27.083a2.9824 2.9824 0 01-2.1215.8789H5.1714l5.7073-5.7072 2.83 2.83zM27.4141 11.376L18.6221 20.17l-2.8293-2.8292 8.7931-8.7928a2.0471 2.0471 0 012.8282 0 1.9993 1.9993 0 010 2.8281zM11 2H7a4.9843 4.9843 0 00-3.8633 8.1528A2.9586 2.9586 0 003 11a2.9945 2.9945 0 002 2.8154V14a2.0025 2.0025 0 01-2 2H2v2H3a4.0045 4.0045 0 004-4v-.1841A2.9959 2.9959 0 008.8157 12H11A5 5 0 0011 2zM6 12a1 1 0 111-1A1.0009 1.0009 0 016 12zm5-2H8.8157A2.974 2.974 0 004.394 8.4746 2.9908 2.9908 0 017 4h4a3 3 0 010 6z\"></path></svg>" }, "16": { metadata: { "moduleName": "WatsonHealthScalpelLasso16", "filepath": "watson-health/scalpel--lasso/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": "M28.8281 7.1338a4.0941 4.0941 0 00-5.6562 0L.3433 29.9619H9.5889a4.9682 4.9682 0 003.5356-1.4648L28.8281 12.79a3.9984 3.9984 0 000-5.6562zM12.2928 20.8406l2.086-2.0858 2.8293 2.8293L15.1224 23.67zM11.71 27.083a2.9824 2.9824 0 01-2.1215.8789H5.1714l5.7073-5.7072 2.83 2.83zM27.4141 11.376L18.6221 20.17l-2.8293-2.8292 8.7931-8.7928a2.0471 2.0471 0 012.8282 0 1.9993 1.9993 0 010 2.8281zM11 2H7a4.9843 4.9843 0 00-3.8633 8.1528A2.9586 2.9586 0 003 11a2.9945 2.9945 0 002 2.8154V14a2.0025 2.0025 0 01-2 2H2v2H3a4.0045 4.0045 0 004-4v-.1841A2.9959 2.9959 0 008.8157 12H11A5 5 0 0011 2zM6 12a1 1 0 111-1A1.0009 1.0009 0 016 12zm5-2H8.8157A2.974 2.974 0 004.394 8.4746 2.9908 2.9908 0 017 4h4a3 3 0 010 6z" } }], "name": "scalpel--lasso", "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=\"M28.8281 7.1338a4.0941 4.0941 0 00-5.6562 0L.3433 29.9619H9.5889a4.9682 4.9682 0 003.5356-1.4648L28.8281 12.79a3.9984 3.9984 0 000-5.6562zM12.2928 20.8406l2.086-2.0858 2.8293 2.8293L15.1224 23.67zM11.71 27.083a2.9824 2.9824 0 01-2.1215.8789H5.1714l5.7073-5.7072 2.83 2.83zM27.4141 11.376L18.6221 20.17l-2.8293-2.8292 8.7931-8.7928a2.0471 2.0471 0 012.8282 0 1.9993 1.9993 0 010 2.8281zM11 2H7a4.9843 4.9843 0 00-3.8633 8.1528A2.9586 2.9586 0 003 11a2.9945 2.9945 0 002 2.8154V14a2.0025 2.0025 0 01-2 2H2v2H3a4.0045 4.0045 0 004-4v-.1841A2.9959 2.9959 0 008.8157 12H11A5 5 0 0011 2zM6 12a1 1 0 111-1A1.0009 1.0009 0 016 12zm5-2H8.8157A2.974 2.974 0 004.394 8.4746 2.9908 2.9908 0 017 4h4a3 3 0 010 6z\"></path></svg>" }, }; } WatsonHealthScalpelLassoDirective_1 = WatsonHealthScalpelLassoDirective; WatsonHealthScalpelLassoDirective.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; WatsonHealthScalpelLassoDirective_1.titleIdCounter++; title.setAttribute("id", "watson-health-scalpel-lasso-" + WatsonHealthScalpelLassoDirective_1.titleIdCounter); svg.appendChild(title); svg.setAttribute("aria-labelledby", "watson-health-scalpel-lasso-" + WatsonHealthScalpelLassoDirective_1.titleIdCounter); } }; var WatsonHealthScalpelLassoDirective_1; WatsonHealthScalpelLassoDirective.titleIdCounter = 0; WatsonHealthScalpelLassoDirective.ctorParameters = function () { return [ { type: ElementRef } ]; }; __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthScalpelLassoDirective.prototype, "ariaLabel", void 0); __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthScalpelLassoDirective.prototype, "ariaLabelledby", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], WatsonHealthScalpelLassoDirective.prototype, "ariaHidden", void 0); __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthScalpelLassoDirective.prototype, "title", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], WatsonHealthScalpelLassoDirective.prototype, "isFocusable", void 0); __decorate([ Input(), __metadata("design:type", String) ], WatsonHealthScalpelLassoDirective.prototype, "size", void 0); WatsonHealthScalpelLassoDirective = WatsonHealthScalpelLassoDirective_1 = __decorate([ Directive({ selector: "[ibmIconWatsonHealthScalpelLasso]" }), __metadata("design:paramtypes", [ElementRef]) ], WatsonHealthScalpelLassoDirective); return WatsonHealthScalpelLassoDirective; }()); var WatsonHealthScalpelLassoModule = /** @class */ (function () { function WatsonHealthScalpelLassoModule() { } WatsonHealthScalpelLassoModule = __decorate([ NgModule({ declarations: [ WatsonHealthScalpelLassoComponent, WatsonHealthScalpelLassoDirective, ], exports: [ WatsonHealthScalpelLassoComponent, WatsonHealthScalpelLassoDirective, ] }) ], WatsonHealthScalpelLassoModule); return WatsonHealthScalpelLassoModule; }()); export { WatsonHealthScalpelLassoComponent, WatsonHealthScalpelLassoDirective, WatsonHealthScalpelLassoModule };