UNPKG

@carbon/icons-angular

Version:

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

177 lines (172 loc) 13.6 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.WatsonHealthHangingProtocol = {}), global.tslib, global.ng.core, global.CarbonIconHelpers)); }(this, (function (exports, tslib, core, iconHelpers) { 'use strict'; var WatsonHealthHangingProtocolComponent = /** @class */ (function () { function WatsonHealthHangingProtocolComponent() { this.focusable = false; } tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], WatsonHealthHangingProtocolComponent.prototype, "ariaLabel", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], WatsonHealthHangingProtocolComponent.prototype, "ariaLabelledby", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", Boolean) ], WatsonHealthHangingProtocolComponent.prototype, "ariaHidden", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], WatsonHealthHangingProtocolComponent.prototype, "title", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", Boolean) ], WatsonHealthHangingProtocolComponent.prototype, "focusable", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], WatsonHealthHangingProtocolComponent.prototype, "innerClass", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], WatsonHealthHangingProtocolComponent.prototype, "size", void 0); WatsonHealthHangingProtocolComponent = tslib.__decorate([ core.Component({ selector: "ibm-icon-watson-health-hanging-protocol", template: "\n <svg\n ibmIconWatsonHealthHangingProtocol\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 " }) ], WatsonHealthHangingProtocolComponent); return WatsonHealthHangingProtocolComponent; }()); var WatsonHealthHangingProtocolDirective = /** @class */ (function () { function WatsonHealthHangingProtocolDirective(elementRef) { this.elementRef = elementRef; this.isFocusable = false; this.icons = { "32": { metadata: { "moduleName": "WatsonHealthHangingProtocol32", "filepath": "watson-health/hanging-protocol/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.37,20.52,17,15.41V13.86A4,4,0,1,0,12,10h2a2,2,0,1,1,4,.34A2.08,2.08,0,0,1,15.89,12h0a.89.89,0,0,0-.89.89v2.52L5.63,20.52A3.1,3.1,0,0,0,4.25,22a2.83,2.83,0,0,0,2.56,4H25.19a2.83,2.83,0,0,0,2.56-4A3.1,3.1,0,0,0,26.37,20.52ZM25.19,24H6.81A.81.81,0,0,1,6,23.19a1,1,0,0,1,.52-.88L16,17.14l9.48,5.17a1,1,0,0,1,.52.88A.81.81,0,0,1,25.19,24Z" } }], "name": "hanging-protocol", "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.37,20.52,17,15.41V13.86A4,4,0,1,0,12,10h2a2,2,0,1,1,4,.34A2.08,2.08,0,0,1,15.89,12h0a.89.89,0,0,0-.89.89v2.52L5.63,20.52A3.1,3.1,0,0,0,4.25,22a2.83,2.83,0,0,0,2.56,4H25.19a2.83,2.83,0,0,0,2.56-4A3.1,3.1,0,0,0,26.37,20.52ZM25.19,24H6.81A.81.81,0,0,1,6,23.19a1,1,0,0,1,.52-.88L16,17.14l9.48,5.17a1,1,0,0,1,.52.88A.81.81,0,0,1,25.19,24Z\"></path></svg>" }, "24": { metadata: { "moduleName": "WatsonHealthHangingProtocol24", "filepath": "watson-health/hanging-protocol/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.37,20.52,17,15.41V13.86A4,4,0,1,0,12,10h2a2,2,0,1,1,4,.34A2.08,2.08,0,0,1,15.89,12h0a.89.89,0,0,0-.89.89v2.52L5.63,20.52A3.1,3.1,0,0,0,4.25,22a2.83,2.83,0,0,0,2.56,4H25.19a2.83,2.83,0,0,0,2.56-4A3.1,3.1,0,0,0,26.37,20.52ZM25.19,24H6.81A.81.81,0,0,1,6,23.19a1,1,0,0,1,.52-.88L16,17.14l9.48,5.17a1,1,0,0,1,.52.88A.81.81,0,0,1,25.19,24Z" } }], "name": "hanging-protocol", "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.37,20.52,17,15.41V13.86A4,4,0,1,0,12,10h2a2,2,0,1,1,4,.34A2.08,2.08,0,0,1,15.89,12h0a.89.89,0,0,0-.89.89v2.52L5.63,20.52A3.1,3.1,0,0,0,4.25,22a2.83,2.83,0,0,0,2.56,4H25.19a2.83,2.83,0,0,0,2.56-4A3.1,3.1,0,0,0,26.37,20.52ZM25.19,24H6.81A.81.81,0,0,1,6,23.19a1,1,0,0,1,.52-.88L16,17.14l9.48,5.17a1,1,0,0,1,.52.88A.81.81,0,0,1,25.19,24Z\"></path></svg>" }, "20": { metadata: { "moduleName": "WatsonHealthHangingProtocol20", "filepath": "watson-health/hanging-protocol/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.37,20.52,17,15.41V13.86A4,4,0,1,0,12,10h2a2,2,0,1,1,4,.34A2.08,2.08,0,0,1,15.89,12h0a.89.89,0,0,0-.89.89v2.52L5.63,20.52A3.1,3.1,0,0,0,4.25,22a2.83,2.83,0,0,0,2.56,4H25.19a2.83,2.83,0,0,0,2.56-4A3.1,3.1,0,0,0,26.37,20.52ZM25.19,24H6.81A.81.81,0,0,1,6,23.19a1,1,0,0,1,.52-.88L16,17.14l9.48,5.17a1,1,0,0,1,.52.88A.81.81,0,0,1,25.19,24Z" } }], "name": "hanging-protocol", "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.37,20.52,17,15.41V13.86A4,4,0,1,0,12,10h2a2,2,0,1,1,4,.34A2.08,2.08,0,0,1,15.89,12h0a.89.89,0,0,0-.89.89v2.52L5.63,20.52A3.1,3.1,0,0,0,4.25,22a2.83,2.83,0,0,0,2.56,4H25.19a2.83,2.83,0,0,0,2.56-4A3.1,3.1,0,0,0,26.37,20.52ZM25.19,24H6.81A.81.81,0,0,1,6,23.19a1,1,0,0,1,.52-.88L16,17.14l9.48,5.17a1,1,0,0,1,.52.88A.81.81,0,0,1,25.19,24Z\"></path></svg>" }, "16": { metadata: { "moduleName": "WatsonHealthHangingProtocol16", "filepath": "watson-health/hanging-protocol/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.37,20.52,17,15.41V13.86A4,4,0,1,0,12,10h2a2,2,0,1,1,4,.34A2.08,2.08,0,0,1,15.89,12h0a.89.89,0,0,0-.89.89v2.52L5.63,20.52A3.1,3.1,0,0,0,4.25,22a2.83,2.83,0,0,0,2.56,4H25.19a2.83,2.83,0,0,0,2.56-4A3.1,3.1,0,0,0,26.37,20.52ZM25.19,24H6.81A.81.81,0,0,1,6,23.19a1,1,0,0,1,.52-.88L16,17.14l9.48,5.17a1,1,0,0,1,.52.88A.81.81,0,0,1,25.19,24Z" } }], "name": "hanging-protocol", "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.37,20.52,17,15.41V13.86A4,4,0,1,0,12,10h2a2,2,0,1,1,4,.34A2.08,2.08,0,0,1,15.89,12h0a.89.89,0,0,0-.89.89v2.52L5.63,20.52A3.1,3.1,0,0,0,4.25,22a2.83,2.83,0,0,0,2.56,4H25.19a2.83,2.83,0,0,0,2.56-4A3.1,3.1,0,0,0,26.37,20.52ZM25.19,24H6.81A.81.81,0,0,1,6,23.19a1,1,0,0,1,.52-.88L16,17.14l9.48,5.17a1,1,0,0,1,.52.88A.81.81,0,0,1,25.19,24Z\"></path></svg>" }, }; } WatsonHealthHangingProtocolDirective_1 = WatsonHealthHangingProtocolDirective; WatsonHealthHangingProtocolDirective.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; WatsonHealthHangingProtocolDirective_1.titleIdCounter++; title.setAttribute("id", "watson-health-hanging-protocol-" + WatsonHealthHangingProtocolDirective_1.titleIdCounter); svg.appendChild(title); svg.setAttribute("aria-labelledby", "watson-health-hanging-protocol-" + WatsonHealthHangingProtocolDirective_1.titleIdCounter); } }; var WatsonHealthHangingProtocolDirective_1; WatsonHealthHangingProtocolDirective.titleIdCounter = 0; WatsonHealthHangingProtocolDirective.ctorParameters = function () { return [ { type: core.ElementRef } ]; }; tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], WatsonHealthHangingProtocolDirective.prototype, "ariaLabel", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], WatsonHealthHangingProtocolDirective.prototype, "ariaLabelledby", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", Boolean) ], WatsonHealthHangingProtocolDirective.prototype, "ariaHidden", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], WatsonHealthHangingProtocolDirective.prototype, "title", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", Boolean) ], WatsonHealthHangingProtocolDirective.prototype, "isFocusable", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], WatsonHealthHangingProtocolDirective.prototype, "size", void 0); WatsonHealthHangingProtocolDirective = WatsonHealthHangingProtocolDirective_1 = tslib.__decorate([ core.Directive({ selector: "[ibmIconWatsonHealthHangingProtocol]" }), tslib.__metadata("design:paramtypes", [core.ElementRef]) ], WatsonHealthHangingProtocolDirective); return WatsonHealthHangingProtocolDirective; }()); var WatsonHealthHangingProtocolModule = /** @class */ (function () { function WatsonHealthHangingProtocolModule() { } WatsonHealthHangingProtocolModule = tslib.__decorate([ core.NgModule({ declarations: [ WatsonHealthHangingProtocolComponent, WatsonHealthHangingProtocolDirective, ], exports: [ WatsonHealthHangingProtocolComponent, WatsonHealthHangingProtocolDirective, ] }) ], WatsonHealthHangingProtocolModule); return WatsonHealthHangingProtocolModule; }()); exports.WatsonHealthHangingProtocolComponent = WatsonHealthHangingProtocolComponent; exports.WatsonHealthHangingProtocolDirective = WatsonHealthHangingProtocolDirective; exports.WatsonHealthHangingProtocolModule = WatsonHealthHangingProtocolModule; Object.defineProperty(exports, '__esModule', { value: true }); })));