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.LogoYelp = {}), global.tslib, global.ng.core, global.CarbonIconHelpers)); }(this, (function (exports, tslib, core, iconHelpers) { 'use strict'; var LogoYelpComponent = /** @class */ (function () { function LogoYelpComponent() { this.focusable = false; } tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], LogoYelpComponent.prototype, "ariaLabel", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], LogoYelpComponent.prototype, "ariaLabelledby", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", Boolean) ], LogoYelpComponent.prototype, "ariaHidden", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], LogoYelpComponent.prototype, "title", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", Boolean) ], LogoYelpComponent.prototype, "focusable", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], LogoYelpComponent.prototype, "innerClass", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], LogoYelpComponent.prototype, "size", void 0); LogoYelpComponent = tslib.__decorate([ core.Component({ selector: "ibm-icon-logo-yelp", template: "\n <svg\n ibmIconLogoYelp\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 " }) ], LogoYelpComponent); return LogoYelpComponent; }()); var LogoYelpDirective = /** @class */ (function () { function LogoYelpDirective(elementRef) { this.elementRef = elementRef; this.isFocusable = false; this.icons = { "32": { metadata: { "moduleName": "LogoYelp32", "filepath": "logo--yelp/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": { "fill-rule": "evenodd", "d": "M9.09 15.2458l4.6706 2.2777a1.0706 1.0706 0 01-.21 2.0011L8.5087 20.7818a1.0729 1.0729 0 01-1.3241-.921 9.2173 9.2173 0 01.4213-3.9965A1.0706 1.0706 0 019.09 15.2458zM10.96 24.8605l3.4763-3.8613a1.0707 1.0707 0 011.8657.7537l-.1814 5.1945a1.072 1.072 0 01-1.2491 1.0192A9.3014 9.3014 0 0111.1488 26.46 1.0713 1.0713 0 0110.96 24.8605zM19.2025 19.7222l4.9412 1.6058a1.0713 1.0713 0 01.6363 1.4794 9.3022 9.3022 0 01-2.4707 3.1663 1.072 1.072 0 01-1.5914-.2581l-2.7543-4.4078A1.0707 1.0707 0 0119.2025 19.7222zM24.2273 16.57l-4.9948 1.4321A1.0706 1.0706 0 0118.05 16.3742l2.906-4.3078A1.0706 1.0706 0 0122.55 11.86 9.2168 9.2168 0 0124.9135 15.11 1.0729 1.0729 0 0124.2273 16.57zM12.5561 4.45a14.9542 14.9542 0 00-2.5676.9459 1.07 1.07 0 00-.4636 1.5013l4.8819 8.4557a1.0707 1.0707 0 001.9979-.5353V5.0534A1.07 1.07 0 0015.2526 3.985 14.9577 14.9577 0 0012.5561 4.45z" } }], "name": "logo--yelp", "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 fill-rule=\"evenodd\" d=\"M9.09 15.2458l4.6706 2.2777a1.0706 1.0706 0 01-.21 2.0011L8.5087 20.7818a1.0729 1.0729 0 01-1.3241-.921 9.2173 9.2173 0 01.4213-3.9965A1.0706 1.0706 0 019.09 15.2458zM10.96 24.8605l3.4763-3.8613a1.0707 1.0707 0 011.8657.7537l-.1814 5.1945a1.072 1.072 0 01-1.2491 1.0192A9.3014 9.3014 0 0111.1488 26.46 1.0713 1.0713 0 0110.96 24.8605zM19.2025 19.7222l4.9412 1.6058a1.0713 1.0713 0 01.6363 1.4794 9.3022 9.3022 0 01-2.4707 3.1663 1.072 1.072 0 01-1.5914-.2581l-2.7543-4.4078A1.0707 1.0707 0 0119.2025 19.7222zM24.2273 16.57l-4.9948 1.4321A1.0706 1.0706 0 0118.05 16.3742l2.906-4.3078A1.0706 1.0706 0 0122.55 11.86 9.2168 9.2168 0 0124.9135 15.11 1.0729 1.0729 0 0124.2273 16.57zM12.5561 4.45a14.9542 14.9542 0 00-2.5676.9459 1.07 1.07 0 00-.4636 1.5013l4.8819 8.4557a1.0707 1.0707 0 001.9979-.5353V5.0534A1.07 1.07 0 0015.2526 3.985 14.9577 14.9577 0 0012.5561 4.45z\"></path></svg>" }, "24": { metadata: { "moduleName": "LogoYelp24", "filepath": "logo--yelp/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": { "fill-rule": "evenodd", "d": "M9.09 15.2458l4.6706 2.2777a1.0706 1.0706 0 01-.21 2.0011L8.5087 20.7818a1.0729 1.0729 0 01-1.3241-.921 9.2173 9.2173 0 01.4213-3.9965A1.0706 1.0706 0 019.09 15.2458zM10.96 24.8605l3.4763-3.8613a1.0707 1.0707 0 011.8657.7537l-.1814 5.1945a1.072 1.072 0 01-1.2491 1.0192A9.3014 9.3014 0 0111.1488 26.46 1.0713 1.0713 0 0110.96 24.8605zM19.2025 19.7222l4.9412 1.6058a1.0713 1.0713 0 01.6363 1.4794 9.3022 9.3022 0 01-2.4707 3.1663 1.072 1.072 0 01-1.5914-.2581l-2.7543-4.4078A1.0707 1.0707 0 0119.2025 19.7222zM24.2273 16.57l-4.9948 1.4321A1.0706 1.0706 0 0118.05 16.3742l2.906-4.3078A1.0706 1.0706 0 0122.55 11.86 9.2168 9.2168 0 0124.9135 15.11 1.0729 1.0729 0 0124.2273 16.57zM12.5561 4.45a14.9542 14.9542 0 00-2.5676.9459 1.07 1.07 0 00-.4636 1.5013l4.8819 8.4557a1.0707 1.0707 0 001.9979-.5353V5.0534A1.07 1.07 0 0015.2526 3.985 14.9577 14.9577 0 0012.5561 4.45z" } }], "name": "logo--yelp", "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 fill-rule=\"evenodd\" d=\"M9.09 15.2458l4.6706 2.2777a1.0706 1.0706 0 01-.21 2.0011L8.5087 20.7818a1.0729 1.0729 0 01-1.3241-.921 9.2173 9.2173 0 01.4213-3.9965A1.0706 1.0706 0 019.09 15.2458zM10.96 24.8605l3.4763-3.8613a1.0707 1.0707 0 011.8657.7537l-.1814 5.1945a1.072 1.072 0 01-1.2491 1.0192A9.3014 9.3014 0 0111.1488 26.46 1.0713 1.0713 0 0110.96 24.8605zM19.2025 19.7222l4.9412 1.6058a1.0713 1.0713 0 01.6363 1.4794 9.3022 9.3022 0 01-2.4707 3.1663 1.072 1.072 0 01-1.5914-.2581l-2.7543-4.4078A1.0707 1.0707 0 0119.2025 19.7222zM24.2273 16.57l-4.9948 1.4321A1.0706 1.0706 0 0118.05 16.3742l2.906-4.3078A1.0706 1.0706 0 0122.55 11.86 9.2168 9.2168 0 0124.9135 15.11 1.0729 1.0729 0 0124.2273 16.57zM12.5561 4.45a14.9542 14.9542 0 00-2.5676.9459 1.07 1.07 0 00-.4636 1.5013l4.8819 8.4557a1.0707 1.0707 0 001.9979-.5353V5.0534A1.07 1.07 0 0015.2526 3.985 14.9577 14.9577 0 0012.5561 4.45z\"></path></svg>" }, "20": { metadata: { "moduleName": "LogoYelp20", "filepath": "logo--yelp/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": { "fill-rule": "evenodd", "d": "M9.09 15.2458l4.6706 2.2777a1.0706 1.0706 0 01-.21 2.0011L8.5087 20.7818a1.0729 1.0729 0 01-1.3241-.921 9.2173 9.2173 0 01.4213-3.9965A1.0706 1.0706 0 019.09 15.2458zM10.96 24.8605l3.4763-3.8613a1.0707 1.0707 0 011.8657.7537l-.1814 5.1945a1.072 1.072 0 01-1.2491 1.0192A9.3014 9.3014 0 0111.1488 26.46 1.0713 1.0713 0 0110.96 24.8605zM19.2025 19.7222l4.9412 1.6058a1.0713 1.0713 0 01.6363 1.4794 9.3022 9.3022 0 01-2.4707 3.1663 1.072 1.072 0 01-1.5914-.2581l-2.7543-4.4078A1.0707 1.0707 0 0119.2025 19.7222zM24.2273 16.57l-4.9948 1.4321A1.0706 1.0706 0 0118.05 16.3742l2.906-4.3078A1.0706 1.0706 0 0122.55 11.86 9.2168 9.2168 0 0124.9135 15.11 1.0729 1.0729 0 0124.2273 16.57zM12.5561 4.45a14.9542 14.9542 0 00-2.5676.9459 1.07 1.07 0 00-.4636 1.5013l4.8819 8.4557a1.0707 1.0707 0 001.9979-.5353V5.0534A1.07 1.07 0 0015.2526 3.985 14.9577 14.9577 0 0012.5561 4.45z" } }], "name": "logo--yelp", "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 fill-rule=\"evenodd\" d=\"M9.09 15.2458l4.6706 2.2777a1.0706 1.0706 0 01-.21 2.0011L8.5087 20.7818a1.0729 1.0729 0 01-1.3241-.921 9.2173 9.2173 0 01.4213-3.9965A1.0706 1.0706 0 019.09 15.2458zM10.96 24.8605l3.4763-3.8613a1.0707 1.0707 0 011.8657.7537l-.1814 5.1945a1.072 1.072 0 01-1.2491 1.0192A9.3014 9.3014 0 0111.1488 26.46 1.0713 1.0713 0 0110.96 24.8605zM19.2025 19.7222l4.9412 1.6058a1.0713 1.0713 0 01.6363 1.4794 9.3022 9.3022 0 01-2.4707 3.1663 1.072 1.072 0 01-1.5914-.2581l-2.7543-4.4078A1.0707 1.0707 0 0119.2025 19.7222zM24.2273 16.57l-4.9948 1.4321A1.0706 1.0706 0 0118.05 16.3742l2.906-4.3078A1.0706 1.0706 0 0122.55 11.86 9.2168 9.2168 0 0124.9135 15.11 1.0729 1.0729 0 0124.2273 16.57zM12.5561 4.45a14.9542 14.9542 0 00-2.5676.9459 1.07 1.07 0 00-.4636 1.5013l4.8819 8.4557a1.0707 1.0707 0 001.9979-.5353V5.0534A1.07 1.07 0 0015.2526 3.985 14.9577 14.9577 0 0012.5561 4.45z\"></path></svg>" }, "16": { metadata: { "moduleName": "LogoYelp16", "filepath": "logo--yelp/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": { "fill-rule": "evenodd", "d": "M9.09 15.2458l4.6706 2.2777a1.0706 1.0706 0 01-.21 2.0011L8.5087 20.7818a1.0729 1.0729 0 01-1.3241-.921 9.2173 9.2173 0 01.4213-3.9965A1.0706 1.0706 0 019.09 15.2458zM10.96 24.8605l3.4763-3.8613a1.0707 1.0707 0 011.8657.7537l-.1814 5.1945a1.072 1.072 0 01-1.2491 1.0192A9.3014 9.3014 0 0111.1488 26.46 1.0713 1.0713 0 0110.96 24.8605zM19.2025 19.7222l4.9412 1.6058a1.0713 1.0713 0 01.6363 1.4794 9.3022 9.3022 0 01-2.4707 3.1663 1.072 1.072 0 01-1.5914-.2581l-2.7543-4.4078A1.0707 1.0707 0 0119.2025 19.7222zM24.2273 16.57l-4.9948 1.4321A1.0706 1.0706 0 0118.05 16.3742l2.906-4.3078A1.0706 1.0706 0 0122.55 11.86 9.2168 9.2168 0 0124.9135 15.11 1.0729 1.0729 0 0124.2273 16.57zM12.5561 4.45a14.9542 14.9542 0 00-2.5676.9459 1.07 1.07 0 00-.4636 1.5013l4.8819 8.4557a1.0707 1.0707 0 001.9979-.5353V5.0534A1.07 1.07 0 0015.2526 3.985 14.9577 14.9577 0 0012.5561 4.45z" } }], "name": "logo--yelp", "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 fill-rule=\"evenodd\" d=\"M9.09 15.2458l4.6706 2.2777a1.0706 1.0706 0 01-.21 2.0011L8.5087 20.7818a1.0729 1.0729 0 01-1.3241-.921 9.2173 9.2173 0 01.4213-3.9965A1.0706 1.0706 0 019.09 15.2458zM10.96 24.8605l3.4763-3.8613a1.0707 1.0707 0 011.8657.7537l-.1814 5.1945a1.072 1.072 0 01-1.2491 1.0192A9.3014 9.3014 0 0111.1488 26.46 1.0713 1.0713 0 0110.96 24.8605zM19.2025 19.7222l4.9412 1.6058a1.0713 1.0713 0 01.6363 1.4794 9.3022 9.3022 0 01-2.4707 3.1663 1.072 1.072 0 01-1.5914-.2581l-2.7543-4.4078A1.0707 1.0707 0 0119.2025 19.7222zM24.2273 16.57l-4.9948 1.4321A1.0706 1.0706 0 0118.05 16.3742l2.906-4.3078A1.0706 1.0706 0 0122.55 11.86 9.2168 9.2168 0 0124.9135 15.11 1.0729 1.0729 0 0124.2273 16.57zM12.5561 4.45a14.9542 14.9542 0 00-2.5676.9459 1.07 1.07 0 00-.4636 1.5013l4.8819 8.4557a1.0707 1.0707 0 001.9979-.5353V5.0534A1.07 1.07 0 0015.2526 3.985 14.9577 14.9577 0 0012.5561 4.45z\"></path></svg>" }, }; } LogoYelpDirective_1 = LogoYelpDirective; LogoYelpDirective.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; LogoYelpDirective_1.titleIdCounter++; title.setAttribute("id", "logo-yelp-" + LogoYelpDirective_1.titleIdCounter); svg.appendChild(title); svg.setAttribute("aria-labelledby", "logo-yelp-" + LogoYelpDirective_1.titleIdCounter); } }; var LogoYelpDirective_1; LogoYelpDirective.titleIdCounter = 0; LogoYelpDirective.ctorParameters = function () { return [ { type: core.ElementRef } ]; }; tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], LogoYelpDirective.prototype, "ariaLabel", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], LogoYelpDirective.prototype, "ariaLabelledby", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", Boolean) ], LogoYelpDirective.prototype, "ariaHidden", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], LogoYelpDirective.prototype, "title", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", Boolean) ], LogoYelpDirective.prototype, "isFocusable", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], LogoYelpDirective.prototype, "size", void 0); LogoYelpDirective = LogoYelpDirective_1 = tslib.__decorate([ core.Directive({ selector: "[ibmIconLogoYelp]" }), tslib.__metadata("design:paramtypes", [core.ElementRef]) ], LogoYelpDirective); return LogoYelpDirective; }()); var LogoYelpModule = /** @class */ (function () { function LogoYelpModule() { } LogoYelpModule = tslib.__decorate([ core.NgModule({ declarations: [ LogoYelpComponent, LogoYelpDirective, ], exports: [ LogoYelpComponent, LogoYelpDirective, ] }) ], LogoYelpModule); return LogoYelpModule; }()); exports.LogoYelpComponent = LogoYelpComponent; exports.LogoYelpDirective = LogoYelpDirective; exports.LogoYelpModule = LogoYelpModule; Object.defineProperty(exports, '__esModule', { value: true }); })));