UNPKG

@carbon/icons-angular

Version:

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

177 lines (172 loc) 15.2 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.MathCurve = {}), global.tslib, global.ng.core, global.CarbonIconHelpers)); }(this, (function (exports, tslib, core, iconHelpers) { 'use strict'; var MathCurveComponent = /** @class */ (function () { function MathCurveComponent() { this.focusable = false; } tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], MathCurveComponent.prototype, "ariaLabel", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], MathCurveComponent.prototype, "ariaLabelledby", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", Boolean) ], MathCurveComponent.prototype, "ariaHidden", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], MathCurveComponent.prototype, "title", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", Boolean) ], MathCurveComponent.prototype, "focusable", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], MathCurveComponent.prototype, "innerClass", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], MathCurveComponent.prototype, "size", void 0); MathCurveComponent = tslib.__decorate([ core.Component({ selector: "ibm-icon-math-curve", template: "\n <svg\n ibmIconMathCurve\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 " }) ], MathCurveComponent); return MathCurveComponent; }()); var MathCurveDirective = /** @class */ (function () { function MathCurveDirective(elementRef) { this.elementRef = elementRef; this.isFocusable = false; this.icons = { "32": { metadata: { "moduleName": "MathCurve32", "filepath": "math-curve/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": "M10.3555,23.0581C12.77,24.5918,15.6208,26,17.9514,26a3.8729,3.8729,0,0,0,2.856-1.084c2.2859-2.29.14-6.3979-1.938-10.3721L24.67,8.7427c1.07.686,2.1038,1.4253,3.0117,2.124L29,9.3486c-.7783-.6064-1.772-1.3383-2.8721-2.0634L30,3.4131,28.5859,2,24.3794,6.2061c-3.3164-1.91-7.1079-3.2461-9.2288-1.1216-2.0388,2.0425-.5512,5.5317,1.2683,9.082l-6.3071,6.3066c-1.0322-.7133-1.9985-1.4448-2.8-2.101L6,19.8848c.6145.5058,1.5513,1.2451,2.6653,2.0351L4,26.585V2H2V28a2,2,0,0,0,2,2H30V28H5.4133ZM16.5647,6.501c1.1357-1.1377,3.6931-.2862,6.3372,1.1831l-4.9947,4.9941C16.5942,10.0591,15.5562,7.5112,16.5647,6.501Zm.8215,9.5259c1.58,3.0317,3.1822,6.2959,2.0071,7.4726-1.3125,1.3145-4.5227-.0254-7.572-1.9077Z" } }], "name": "math-curve", "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=\"M10.3555,23.0581C12.77,24.5918,15.6208,26,17.9514,26a3.8729,3.8729,0,0,0,2.856-1.084c2.2859-2.29.14-6.3979-1.938-10.3721L24.67,8.7427c1.07.686,2.1038,1.4253,3.0117,2.124L29,9.3486c-.7783-.6064-1.772-1.3383-2.8721-2.0634L30,3.4131,28.5859,2,24.3794,6.2061c-3.3164-1.91-7.1079-3.2461-9.2288-1.1216-2.0388,2.0425-.5512,5.5317,1.2683,9.082l-6.3071,6.3066c-1.0322-.7133-1.9985-1.4448-2.8-2.101L6,19.8848c.6145.5058,1.5513,1.2451,2.6653,2.0351L4,26.585V2H2V28a2,2,0,0,0,2,2H30V28H5.4133ZM16.5647,6.501c1.1357-1.1377,3.6931-.2862,6.3372,1.1831l-4.9947,4.9941C16.5942,10.0591,15.5562,7.5112,16.5647,6.501Zm.8215,9.5259c1.58,3.0317,3.1822,6.2959,2.0071,7.4726-1.3125,1.3145-4.5227-.0254-7.572-1.9077Z\"></path></svg>" }, "24": { metadata: { "moduleName": "MathCurve24", "filepath": "math-curve/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": "M10.3555,23.0581C12.77,24.5918,15.6208,26,17.9514,26a3.8729,3.8729,0,0,0,2.856-1.084c2.2859-2.29.14-6.3979-1.938-10.3721L24.67,8.7427c1.07.686,2.1038,1.4253,3.0117,2.124L29,9.3486c-.7783-.6064-1.772-1.3383-2.8721-2.0634L30,3.4131,28.5859,2,24.3794,6.2061c-3.3164-1.91-7.1079-3.2461-9.2288-1.1216-2.0388,2.0425-.5512,5.5317,1.2683,9.082l-6.3071,6.3066c-1.0322-.7133-1.9985-1.4448-2.8-2.101L6,19.8848c.6145.5058,1.5513,1.2451,2.6653,2.0351L4,26.585V2H2V28a2,2,0,0,0,2,2H30V28H5.4133ZM16.5647,6.501c1.1357-1.1377,3.6931-.2862,6.3372,1.1831l-4.9947,4.9941C16.5942,10.0591,15.5562,7.5112,16.5647,6.501Zm.8215,9.5259c1.58,3.0317,3.1822,6.2959,2.0071,7.4726-1.3125,1.3145-4.5227-.0254-7.572-1.9077Z" } }], "name": "math-curve", "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=\"M10.3555,23.0581C12.77,24.5918,15.6208,26,17.9514,26a3.8729,3.8729,0,0,0,2.856-1.084c2.2859-2.29.14-6.3979-1.938-10.3721L24.67,8.7427c1.07.686,2.1038,1.4253,3.0117,2.124L29,9.3486c-.7783-.6064-1.772-1.3383-2.8721-2.0634L30,3.4131,28.5859,2,24.3794,6.2061c-3.3164-1.91-7.1079-3.2461-9.2288-1.1216-2.0388,2.0425-.5512,5.5317,1.2683,9.082l-6.3071,6.3066c-1.0322-.7133-1.9985-1.4448-2.8-2.101L6,19.8848c.6145.5058,1.5513,1.2451,2.6653,2.0351L4,26.585V2H2V28a2,2,0,0,0,2,2H30V28H5.4133ZM16.5647,6.501c1.1357-1.1377,3.6931-.2862,6.3372,1.1831l-4.9947,4.9941C16.5942,10.0591,15.5562,7.5112,16.5647,6.501Zm.8215,9.5259c1.58,3.0317,3.1822,6.2959,2.0071,7.4726-1.3125,1.3145-4.5227-.0254-7.572-1.9077Z\"></path></svg>" }, "20": { metadata: { "moduleName": "MathCurve20", "filepath": "math-curve/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": "M10.3555,23.0581C12.77,24.5918,15.6208,26,17.9514,26a3.8729,3.8729,0,0,0,2.856-1.084c2.2859-2.29.14-6.3979-1.938-10.3721L24.67,8.7427c1.07.686,2.1038,1.4253,3.0117,2.124L29,9.3486c-.7783-.6064-1.772-1.3383-2.8721-2.0634L30,3.4131,28.5859,2,24.3794,6.2061c-3.3164-1.91-7.1079-3.2461-9.2288-1.1216-2.0388,2.0425-.5512,5.5317,1.2683,9.082l-6.3071,6.3066c-1.0322-.7133-1.9985-1.4448-2.8-2.101L6,19.8848c.6145.5058,1.5513,1.2451,2.6653,2.0351L4,26.585V2H2V28a2,2,0,0,0,2,2H30V28H5.4133ZM16.5647,6.501c1.1357-1.1377,3.6931-.2862,6.3372,1.1831l-4.9947,4.9941C16.5942,10.0591,15.5562,7.5112,16.5647,6.501Zm.8215,9.5259c1.58,3.0317,3.1822,6.2959,2.0071,7.4726-1.3125,1.3145-4.5227-.0254-7.572-1.9077Z" } }], "name": "math-curve", "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=\"M10.3555,23.0581C12.77,24.5918,15.6208,26,17.9514,26a3.8729,3.8729,0,0,0,2.856-1.084c2.2859-2.29.14-6.3979-1.938-10.3721L24.67,8.7427c1.07.686,2.1038,1.4253,3.0117,2.124L29,9.3486c-.7783-.6064-1.772-1.3383-2.8721-2.0634L30,3.4131,28.5859,2,24.3794,6.2061c-3.3164-1.91-7.1079-3.2461-9.2288-1.1216-2.0388,2.0425-.5512,5.5317,1.2683,9.082l-6.3071,6.3066c-1.0322-.7133-1.9985-1.4448-2.8-2.101L6,19.8848c.6145.5058,1.5513,1.2451,2.6653,2.0351L4,26.585V2H2V28a2,2,0,0,0,2,2H30V28H5.4133ZM16.5647,6.501c1.1357-1.1377,3.6931-.2862,6.3372,1.1831l-4.9947,4.9941C16.5942,10.0591,15.5562,7.5112,16.5647,6.501Zm.8215,9.5259c1.58,3.0317,3.1822,6.2959,2.0071,7.4726-1.3125,1.3145-4.5227-.0254-7.572-1.9077Z\"></path></svg>" }, "16": { metadata: { "moduleName": "MathCurve16", "filepath": "math-curve/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": "M10.3555,23.0581C12.77,24.5918,15.6208,26,17.9514,26a3.8729,3.8729,0,0,0,2.856-1.084c2.2859-2.29.14-6.3979-1.938-10.3721L24.67,8.7427c1.07.686,2.1038,1.4253,3.0117,2.124L29,9.3486c-.7783-.6064-1.772-1.3383-2.8721-2.0634L30,3.4131,28.5859,2,24.3794,6.2061c-3.3164-1.91-7.1079-3.2461-9.2288-1.1216-2.0388,2.0425-.5512,5.5317,1.2683,9.082l-6.3071,6.3066c-1.0322-.7133-1.9985-1.4448-2.8-2.101L6,19.8848c.6145.5058,1.5513,1.2451,2.6653,2.0351L4,26.585V2H2V28a2,2,0,0,0,2,2H30V28H5.4133ZM16.5647,6.501c1.1357-1.1377,3.6931-.2862,6.3372,1.1831l-4.9947,4.9941C16.5942,10.0591,15.5562,7.5112,16.5647,6.501Zm.8215,9.5259c1.58,3.0317,3.1822,6.2959,2.0071,7.4726-1.3125,1.3145-4.5227-.0254-7.572-1.9077Z" } }], "name": "math-curve", "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=\"M10.3555,23.0581C12.77,24.5918,15.6208,26,17.9514,26a3.8729,3.8729,0,0,0,2.856-1.084c2.2859-2.29.14-6.3979-1.938-10.3721L24.67,8.7427c1.07.686,2.1038,1.4253,3.0117,2.124L29,9.3486c-.7783-.6064-1.772-1.3383-2.8721-2.0634L30,3.4131,28.5859,2,24.3794,6.2061c-3.3164-1.91-7.1079-3.2461-9.2288-1.1216-2.0388,2.0425-.5512,5.5317,1.2683,9.082l-6.3071,6.3066c-1.0322-.7133-1.9985-1.4448-2.8-2.101L6,19.8848c.6145.5058,1.5513,1.2451,2.6653,2.0351L4,26.585V2H2V28a2,2,0,0,0,2,2H30V28H5.4133ZM16.5647,6.501c1.1357-1.1377,3.6931-.2862,6.3372,1.1831l-4.9947,4.9941C16.5942,10.0591,15.5562,7.5112,16.5647,6.501Zm.8215,9.5259c1.58,3.0317,3.1822,6.2959,2.0071,7.4726-1.3125,1.3145-4.5227-.0254-7.572-1.9077Z\"></path></svg>" }, }; } MathCurveDirective_1 = MathCurveDirective; MathCurveDirective.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; MathCurveDirective_1.titleIdCounter++; title.setAttribute("id", "math-curve-" + MathCurveDirective_1.titleIdCounter); svg.appendChild(title); svg.setAttribute("aria-labelledby", "math-curve-" + MathCurveDirective_1.titleIdCounter); } }; var MathCurveDirective_1; MathCurveDirective.titleIdCounter = 0; MathCurveDirective.ctorParameters = function () { return [ { type: core.ElementRef } ]; }; tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], MathCurveDirective.prototype, "ariaLabel", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], MathCurveDirective.prototype, "ariaLabelledby", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", Boolean) ], MathCurveDirective.prototype, "ariaHidden", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], MathCurveDirective.prototype, "title", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", Boolean) ], MathCurveDirective.prototype, "isFocusable", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], MathCurveDirective.prototype, "size", void 0); MathCurveDirective = MathCurveDirective_1 = tslib.__decorate([ core.Directive({ selector: "[ibmIconMathCurve]" }), tslib.__metadata("design:paramtypes", [core.ElementRef]) ], MathCurveDirective); return MathCurveDirective; }()); var MathCurveModule = /** @class */ (function () { function MathCurveModule() { } MathCurveModule = tslib.__decorate([ core.NgModule({ declarations: [ MathCurveComponent, MathCurveDirective, ], exports: [ MathCurveComponent, MathCurveDirective, ] }) ], MathCurveModule); return MathCurveModule; }()); exports.MathCurveComponent = MathCurveComponent; exports.MathCurveDirective = MathCurveDirective; exports.MathCurveModule = MathCurveModule; Object.defineProperty(exports, '__esModule', { value: true }); })));