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.LogoJupyter = {}), global.tslib, global.ng.core, global.CarbonIconHelpers)); }(this, (function (exports, tslib, core, iconHelpers) { 'use strict'; var LogoJupyterComponent = /** @class */ (function () { function LogoJupyterComponent() { this.focusable = false; } tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], LogoJupyterComponent.prototype, "ariaLabel", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], LogoJupyterComponent.prototype, "ariaLabelledby", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", Boolean) ], LogoJupyterComponent.prototype, "ariaHidden", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], LogoJupyterComponent.prototype, "title", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", Boolean) ], LogoJupyterComponent.prototype, "focusable", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], LogoJupyterComponent.prototype, "innerClass", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], LogoJupyterComponent.prototype, "size", void 0); LogoJupyterComponent = tslib.__decorate([ core.Component({ selector: "ibm-icon-logo-jupyter", template: "\n <svg\n ibmIconLogoJupyter\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 " }) ], LogoJupyterComponent); return LogoJupyterComponent; }()); var LogoJupyterDirective = /** @class */ (function () { function LogoJupyterDirective(elementRef) { this.elementRef = elementRef; this.isFocusable = false; this.icons = { "32": { metadata: { "moduleName": "LogoJupyter32", "filepath": "logo--jupyter/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.0766 3.5878a1.69 1.69 0 11-1.76-1.5853 1.67 1.67 0 011.76 1.5853zM16.2191 23.1113c-4.4866 0-8.43-1.61-10.4688-3.9882a11.1618 11.1618 0 0020.9377 0C24.6541 21.5011 20.7257 23.1113 16.2191 23.1113zM16.2191 7.6483c4.4867 0 8.43 1.61 10.4689 3.9881a11.1618 11.1618 0 00-20.9377 0C7.7892 9.2535 11.7126 7.6483 16.2191 7.6483zM10.0427 27.7388a2.1085 2.1085 0 11-.2031-.7976 2.1278 2.1278 0 01.2031.7976zM6.26 7.1064A1.2263 1.2263 0 117.4517 5.83 1.2415 1.2415 0 016.26 7.1064z" } }], "name": "logo--jupyter", "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.0766 3.5878a1.69 1.69 0 11-1.76-1.5853 1.67 1.67 0 011.76 1.5853zM16.2191 23.1113c-4.4866 0-8.43-1.61-10.4688-3.9882a11.1618 11.1618 0 0020.9377 0C24.6541 21.5011 20.7257 23.1113 16.2191 23.1113zM16.2191 7.6483c4.4867 0 8.43 1.61 10.4689 3.9881a11.1618 11.1618 0 00-20.9377 0C7.7892 9.2535 11.7126 7.6483 16.2191 7.6483zM10.0427 27.7388a2.1085 2.1085 0 11-.2031-.7976 2.1278 2.1278 0 01.2031.7976zM6.26 7.1064A1.2263 1.2263 0 117.4517 5.83 1.2415 1.2415 0 016.26 7.1064z\"></path></svg>" }, "24": { metadata: { "moduleName": "LogoJupyter24", "filepath": "logo--jupyter/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.0766 3.5878a1.69 1.69 0 11-1.76-1.5853 1.67 1.67 0 011.76 1.5853zM16.2191 23.1113c-4.4866 0-8.43-1.61-10.4688-3.9882a11.1618 11.1618 0 0020.9377 0C24.6541 21.5011 20.7257 23.1113 16.2191 23.1113zM16.2191 7.6483c4.4867 0 8.43 1.61 10.4689 3.9881a11.1618 11.1618 0 00-20.9377 0C7.7892 9.2535 11.7126 7.6483 16.2191 7.6483zM10.0427 27.7388a2.1085 2.1085 0 11-.2031-.7976 2.1278 2.1278 0 01.2031.7976zM6.26 7.1064A1.2263 1.2263 0 117.4517 5.83 1.2415 1.2415 0 016.26 7.1064z" } }], "name": "logo--jupyter", "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.0766 3.5878a1.69 1.69 0 11-1.76-1.5853 1.67 1.67 0 011.76 1.5853zM16.2191 23.1113c-4.4866 0-8.43-1.61-10.4688-3.9882a11.1618 11.1618 0 0020.9377 0C24.6541 21.5011 20.7257 23.1113 16.2191 23.1113zM16.2191 7.6483c4.4867 0 8.43 1.61 10.4689 3.9881a11.1618 11.1618 0 00-20.9377 0C7.7892 9.2535 11.7126 7.6483 16.2191 7.6483zM10.0427 27.7388a2.1085 2.1085 0 11-.2031-.7976 2.1278 2.1278 0 01.2031.7976zM6.26 7.1064A1.2263 1.2263 0 117.4517 5.83 1.2415 1.2415 0 016.26 7.1064z\"></path></svg>" }, "20": { metadata: { "moduleName": "LogoJupyter20", "filepath": "logo--jupyter/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.0766 3.5878a1.69 1.69 0 11-1.76-1.5853 1.67 1.67 0 011.76 1.5853zM16.2191 23.1113c-4.4866 0-8.43-1.61-10.4688-3.9882a11.1618 11.1618 0 0020.9377 0C24.6541 21.5011 20.7257 23.1113 16.2191 23.1113zM16.2191 7.6483c4.4867 0 8.43 1.61 10.4689 3.9881a11.1618 11.1618 0 00-20.9377 0C7.7892 9.2535 11.7126 7.6483 16.2191 7.6483zM10.0427 27.7388a2.1085 2.1085 0 11-.2031-.7976 2.1278 2.1278 0 01.2031.7976zM6.26 7.1064A1.2263 1.2263 0 117.4517 5.83 1.2415 1.2415 0 016.26 7.1064z" } }], "name": "logo--jupyter", "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.0766 3.5878a1.69 1.69 0 11-1.76-1.5853 1.67 1.67 0 011.76 1.5853zM16.2191 23.1113c-4.4866 0-8.43-1.61-10.4688-3.9882a11.1618 11.1618 0 0020.9377 0C24.6541 21.5011 20.7257 23.1113 16.2191 23.1113zM16.2191 7.6483c4.4867 0 8.43 1.61 10.4689 3.9881a11.1618 11.1618 0 00-20.9377 0C7.7892 9.2535 11.7126 7.6483 16.2191 7.6483zM10.0427 27.7388a2.1085 2.1085 0 11-.2031-.7976 2.1278 2.1278 0 01.2031.7976zM6.26 7.1064A1.2263 1.2263 0 117.4517 5.83 1.2415 1.2415 0 016.26 7.1064z\"></path></svg>" }, "16": { metadata: { "moduleName": "LogoJupyter16", "filepath": "logo--jupyter/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.0766 3.5878a1.69 1.69 0 11-1.76-1.5853 1.67 1.67 0 011.76 1.5853zM16.2191 23.1113c-4.4866 0-8.43-1.61-10.4688-3.9882a11.1618 11.1618 0 0020.9377 0C24.6541 21.5011 20.7257 23.1113 16.2191 23.1113zM16.2191 7.6483c4.4867 0 8.43 1.61 10.4689 3.9881a11.1618 11.1618 0 00-20.9377 0C7.7892 9.2535 11.7126 7.6483 16.2191 7.6483zM10.0427 27.7388a2.1085 2.1085 0 11-.2031-.7976 2.1278 2.1278 0 01.2031.7976zM6.26 7.1064A1.2263 1.2263 0 117.4517 5.83 1.2415 1.2415 0 016.26 7.1064z" } }], "name": "logo--jupyter", "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.0766 3.5878a1.69 1.69 0 11-1.76-1.5853 1.67 1.67 0 011.76 1.5853zM16.2191 23.1113c-4.4866 0-8.43-1.61-10.4688-3.9882a11.1618 11.1618 0 0020.9377 0C24.6541 21.5011 20.7257 23.1113 16.2191 23.1113zM16.2191 7.6483c4.4867 0 8.43 1.61 10.4689 3.9881a11.1618 11.1618 0 00-20.9377 0C7.7892 9.2535 11.7126 7.6483 16.2191 7.6483zM10.0427 27.7388a2.1085 2.1085 0 11-.2031-.7976 2.1278 2.1278 0 01.2031.7976zM6.26 7.1064A1.2263 1.2263 0 117.4517 5.83 1.2415 1.2415 0 016.26 7.1064z\"></path></svg>" }, }; } LogoJupyterDirective_1 = LogoJupyterDirective; LogoJupyterDirective.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; LogoJupyterDirective_1.titleIdCounter++; title.setAttribute("id", "logo-jupyter-" + LogoJupyterDirective_1.titleIdCounter); svg.appendChild(title); svg.setAttribute("aria-labelledby", "logo-jupyter-" + LogoJupyterDirective_1.titleIdCounter); } }; var LogoJupyterDirective_1; LogoJupyterDirective.titleIdCounter = 0; LogoJupyterDirective.ctorParameters = function () { return [ { type: core.ElementRef } ]; }; tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], LogoJupyterDirective.prototype, "ariaLabel", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], LogoJupyterDirective.prototype, "ariaLabelledby", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", Boolean) ], LogoJupyterDirective.prototype, "ariaHidden", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], LogoJupyterDirective.prototype, "title", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", Boolean) ], LogoJupyterDirective.prototype, "isFocusable", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], LogoJupyterDirective.prototype, "size", void 0); LogoJupyterDirective = LogoJupyterDirective_1 = tslib.__decorate([ core.Directive({ selector: "[ibmIconLogoJupyter]" }), tslib.__metadata("design:paramtypes", [core.ElementRef]) ], LogoJupyterDirective); return LogoJupyterDirective; }()); var LogoJupyterModule = /** @class */ (function () { function LogoJupyterModule() { } LogoJupyterModule = tslib.__decorate([ core.NgModule({ declarations: [ LogoJupyterComponent, LogoJupyterDirective, ], exports: [ LogoJupyterComponent, LogoJupyterDirective, ] }) ], LogoJupyterModule); return LogoJupyterModule; }()); exports.LogoJupyterComponent = LogoJupyterComponent; exports.LogoJupyterDirective = LogoJupyterDirective; exports.LogoJupyterModule = LogoJupyterModule; Object.defineProperty(exports, '__esModule', { value: true }); })));