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.WatsonHealth_3DMprToggle = {}), global.tslib, global.ng.core, global.CarbonIconHelpers)); }(this, (function (exports, tslib, core, iconHelpers) { 'use strict'; var WatsonHealth_3DMprToggleComponent = /** @class */ (function () { function WatsonHealth_3DMprToggleComponent() { this.focusable = false; } tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], WatsonHealth_3DMprToggleComponent.prototype, "ariaLabel", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], WatsonHealth_3DMprToggleComponent.prototype, "ariaLabelledby", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", Boolean) ], WatsonHealth_3DMprToggleComponent.prototype, "ariaHidden", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], WatsonHealth_3DMprToggleComponent.prototype, "title", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", Boolean) ], WatsonHealth_3DMprToggleComponent.prototype, "focusable", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], WatsonHealth_3DMprToggleComponent.prototype, "innerClass", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], WatsonHealth_3DMprToggleComponent.prototype, "size", void 0); WatsonHealth_3DMprToggleComponent = tslib.__decorate([ core.Component({ selector: "ibm-icon-watson-health-3-d-mpr-toggle", template: "\n <svg\n ibmIconWatsonHealth_3DMprToggle\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 " }) ], WatsonHealth_3DMprToggleComponent); return WatsonHealth_3DMprToggleComponent; }()); var WatsonHealth_3DMprToggleDirective = /** @class */ (function () { function WatsonHealth_3DMprToggleDirective(elementRef) { this.elementRef = elementRef; this.isFocusable = false; this.icons = { "32": { metadata: { "moduleName": "WatsonHealth3DMprToggle32", "filepath": "watson-health/3D-MPR-Toggle/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": "M11 2L2 2 2 11 4 11 4 4 11 4 11 2zM2 21L2 30 11 30 11 28 4 28 4 21 2 21zM30 11L30 2 21 2 21 4 28 4 28 11 30 11zM21 30L30 30 30 21 28 21 28 28 21 28 21 30zM25.49 10.13l-9-5a1 1 0 00-1 0l-9 5A1 1 0 006 11V21a1 1 0 00.51.87l9 5a1 1 0 001 0l9-5A1 1 0 0026 21V11A1 1 0 0025.49 10.13zM16 7.14L22.94 11 16 14.86 9.06 11zM8 12.7l7 3.89V24.3L8 20.41zm9 11.6V16.59l7-3.89v7.71z" } }], "name": "3D-MPR-Toggle", "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=\"M11 2L2 2 2 11 4 11 4 4 11 4 11 2zM2 21L2 30 11 30 11 28 4 28 4 21 2 21zM30 11L30 2 21 2 21 4 28 4 28 11 30 11zM21 30L30 30 30 21 28 21 28 28 21 28 21 30zM25.49 10.13l-9-5a1 1 0 00-1 0l-9 5A1 1 0 006 11V21a1 1 0 00.51.87l9 5a1 1 0 001 0l9-5A1 1 0 0026 21V11A1 1 0 0025.49 10.13zM16 7.14L22.94 11 16 14.86 9.06 11zM8 12.7l7 3.89V24.3L8 20.41zm9 11.6V16.59l7-3.89v7.71z\"></path></svg>" }, "24": { metadata: { "moduleName": "WatsonHealth3DMprToggle24", "filepath": "watson-health/3D-MPR-Toggle/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": "M11 2L2 2 2 11 4 11 4 4 11 4 11 2zM2 21L2 30 11 30 11 28 4 28 4 21 2 21zM30 11L30 2 21 2 21 4 28 4 28 11 30 11zM21 30L30 30 30 21 28 21 28 28 21 28 21 30zM25.49 10.13l-9-5a1 1 0 00-1 0l-9 5A1 1 0 006 11V21a1 1 0 00.51.87l9 5a1 1 0 001 0l9-5A1 1 0 0026 21V11A1 1 0 0025.49 10.13zM16 7.14L22.94 11 16 14.86 9.06 11zM8 12.7l7 3.89V24.3L8 20.41zm9 11.6V16.59l7-3.89v7.71z" } }], "name": "3D-MPR-Toggle", "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=\"M11 2L2 2 2 11 4 11 4 4 11 4 11 2zM2 21L2 30 11 30 11 28 4 28 4 21 2 21zM30 11L30 2 21 2 21 4 28 4 28 11 30 11zM21 30L30 30 30 21 28 21 28 28 21 28 21 30zM25.49 10.13l-9-5a1 1 0 00-1 0l-9 5A1 1 0 006 11V21a1 1 0 00.51.87l9 5a1 1 0 001 0l9-5A1 1 0 0026 21V11A1 1 0 0025.49 10.13zM16 7.14L22.94 11 16 14.86 9.06 11zM8 12.7l7 3.89V24.3L8 20.41zm9 11.6V16.59l7-3.89v7.71z\"></path></svg>" }, "20": { metadata: { "moduleName": "WatsonHealth3DMprToggle20", "filepath": "watson-health/3D-MPR-Toggle/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": "M11 2L2 2 2 11 4 11 4 4 11 4 11 2zM2 21L2 30 11 30 11 28 4 28 4 21 2 21zM30 11L30 2 21 2 21 4 28 4 28 11 30 11zM21 30L30 30 30 21 28 21 28 28 21 28 21 30zM25.49 10.13l-9-5a1 1 0 00-1 0l-9 5A1 1 0 006 11V21a1 1 0 00.51.87l9 5a1 1 0 001 0l9-5A1 1 0 0026 21V11A1 1 0 0025.49 10.13zM16 7.14L22.94 11 16 14.86 9.06 11zM8 12.7l7 3.89V24.3L8 20.41zm9 11.6V16.59l7-3.89v7.71z" } }], "name": "3D-MPR-Toggle", "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=\"M11 2L2 2 2 11 4 11 4 4 11 4 11 2zM2 21L2 30 11 30 11 28 4 28 4 21 2 21zM30 11L30 2 21 2 21 4 28 4 28 11 30 11zM21 30L30 30 30 21 28 21 28 28 21 28 21 30zM25.49 10.13l-9-5a1 1 0 00-1 0l-9 5A1 1 0 006 11V21a1 1 0 00.51.87l9 5a1 1 0 001 0l9-5A1 1 0 0026 21V11A1 1 0 0025.49 10.13zM16 7.14L22.94 11 16 14.86 9.06 11zM8 12.7l7 3.89V24.3L8 20.41zm9 11.6V16.59l7-3.89v7.71z\"></path></svg>" }, "16": { metadata: { "moduleName": "WatsonHealth3DMprToggle16", "filepath": "watson-health/3D-MPR-Toggle/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": "M11 2L2 2 2 11 4 11 4 4 11 4 11 2zM2 21L2 30 11 30 11 28 4 28 4 21 2 21zM30 11L30 2 21 2 21 4 28 4 28 11 30 11zM21 30L30 30 30 21 28 21 28 28 21 28 21 30zM25.49 10.13l-9-5a1 1 0 00-1 0l-9 5A1 1 0 006 11V21a1 1 0 00.51.87l9 5a1 1 0 001 0l9-5A1 1 0 0026 21V11A1 1 0 0025.49 10.13zM16 7.14L22.94 11 16 14.86 9.06 11zM8 12.7l7 3.89V24.3L8 20.41zm9 11.6V16.59l7-3.89v7.71z" } }], "name": "3D-MPR-Toggle", "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=\"M11 2L2 2 2 11 4 11 4 4 11 4 11 2zM2 21L2 30 11 30 11 28 4 28 4 21 2 21zM30 11L30 2 21 2 21 4 28 4 28 11 30 11zM21 30L30 30 30 21 28 21 28 28 21 28 21 30zM25.49 10.13l-9-5a1 1 0 00-1 0l-9 5A1 1 0 006 11V21a1 1 0 00.51.87l9 5a1 1 0 001 0l9-5A1 1 0 0026 21V11A1 1 0 0025.49 10.13zM16 7.14L22.94 11 16 14.86 9.06 11zM8 12.7l7 3.89V24.3L8 20.41zm9 11.6V16.59l7-3.89v7.71z\"></path></svg>" }, }; } WatsonHealth_3DMprToggleDirective_1 = WatsonHealth_3DMprToggleDirective; WatsonHealth_3DMprToggleDirective.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; WatsonHealth_3DMprToggleDirective_1.titleIdCounter++; title.setAttribute("id", "watson-health-3-d-mpr-toggle-" + WatsonHealth_3DMprToggleDirective_1.titleIdCounter); svg.appendChild(title); svg.setAttribute("aria-labelledby", "watson-health-3-d-mpr-toggle-" + WatsonHealth_3DMprToggleDirective_1.titleIdCounter); } }; var WatsonHealth_3DMprToggleDirective_1; WatsonHealth_3DMprToggleDirective.titleIdCounter = 0; WatsonHealth_3DMprToggleDirective.ctorParameters = function () { return [ { type: core.ElementRef } ]; }; tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], WatsonHealth_3DMprToggleDirective.prototype, "ariaLabel", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], WatsonHealth_3DMprToggleDirective.prototype, "ariaLabelledby", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", Boolean) ], WatsonHealth_3DMprToggleDirective.prototype, "ariaHidden", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], WatsonHealth_3DMprToggleDirective.prototype, "title", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", Boolean) ], WatsonHealth_3DMprToggleDirective.prototype, "isFocusable", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], WatsonHealth_3DMprToggleDirective.prototype, "size", void 0); WatsonHealth_3DMprToggleDirective = WatsonHealth_3DMprToggleDirective_1 = tslib.__decorate([ core.Directive({ selector: "[ibmIconWatsonHealth_3DMprToggle]" }), tslib.__metadata("design:paramtypes", [core.ElementRef]) ], WatsonHealth_3DMprToggleDirective); return WatsonHealth_3DMprToggleDirective; }()); var WatsonHealth_3DMprToggleModule = /** @class */ (function () { function WatsonHealth_3DMprToggleModule() { } WatsonHealth_3DMprToggleModule = tslib.__decorate([ core.NgModule({ declarations: [ WatsonHealth_3DMprToggleComponent, WatsonHealth_3DMprToggleDirective, ], exports: [ WatsonHealth_3DMprToggleComponent, WatsonHealth_3DMprToggleDirective, ] }) ], WatsonHealth_3DMprToggleModule); return WatsonHealth_3DMprToggleModule; }()); exports.WatsonHealth_3DMprToggleComponent = WatsonHealth_3DMprToggleComponent; exports.WatsonHealth_3DMprToggleDirective = WatsonHealth_3DMprToggleDirective; exports.WatsonHealth_3DMprToggleModule = WatsonHealth_3DMprToggleModule; Object.defineProperty(exports, '__esModule', { value: true }); })));