UNPKG

@carbon/icons-angular

Version:

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

177 lines (172 loc) 18.4 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.SnowScattered = {}), global.tslib, global.ng.core, global.CarbonIconHelpers)); }(this, (function (exports, tslib, core, iconHelpers) { 'use strict'; var SnowScatteredComponent = /** @class */ (function () { function SnowScatteredComponent() { this.focusable = false; } tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], SnowScatteredComponent.prototype, "ariaLabel", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], SnowScatteredComponent.prototype, "ariaLabelledby", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", Boolean) ], SnowScatteredComponent.prototype, "ariaHidden", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], SnowScatteredComponent.prototype, "title", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", Boolean) ], SnowScatteredComponent.prototype, "focusable", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], SnowScatteredComponent.prototype, "innerClass", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], SnowScatteredComponent.prototype, "size", void 0); SnowScatteredComponent = tslib.__decorate([ core.Component({ selector: "ibm-icon-snow-scattered", template: "\n <svg\n ibmIconSnowScattered\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 " }) ], SnowScatteredComponent); return SnowScatteredComponent; }()); var SnowScatteredDirective = /** @class */ (function () { function SnowScatteredDirective(elementRef) { this.elementRef = elementRef; this.isFocusable = false; this.icons = { "32": { metadata: { "moduleName": "SnowScattered32", "filepath": "snow--scattered/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": "M2 26H4V28H2zM4 28H6V30H4zM6 30H8V32H6zM6 26H8V28H6zM2 30H4V32H2zM20 26H22V28H20zM22 28H24V30H22zM24 30H26V32H24zM24 26H26V28H24zM20 30H22V32H20zM11 26H13V28H11zM13 28H15V30H13zM15 30H17V32H15zM15 26H17V28H15zM11 30H13V32H11zM20 0H22V3H20zM29 10.001H32V12.001H29z" } }, { "elem": "path", "attrs": { "d": "M26.732 3.768H29.732V5.768H26.732z", "transform": "rotate(-45 28.232 4.768)" } }, { "elem": "path", "attrs": { "d": "M26.732 16.233H29.732V18.233H26.732z", "transform": "rotate(-135 28.232 17.233)" } }, { "elem": "path", "attrs": { "d": "M12.268 3.768H15.268V5.768H12.268z", "transform": "rotate(-135 13.768 4.768)" } }, { "elem": "path", "attrs": { "d": "M27,11A5.9852,5.9852,0,0,0,16.1431,7.5083,7.3737,7.3737,0,0,0,13.5,7a7.5511,7.5511,0,0,0-7.1494,5.2441A5.9926,5.9926,0,0,0,8,24H19a5.9672,5.9672,0,0,0,5.5667-8.2A5.9722,5.9722,0,0,0,27,11ZM19,22H8a3.9926,3.9926,0,0,1-.6733-7.9292l.663-.1128.1456-.6562a5.496,5.496,0,0,1,10.7294,0l.1456.6562.6626.1128A3.9925,3.9925,0,0,1,19,22Zm4.5222-7.9131a5.9592,5.9592,0,0,0-2.8728-1.8428,7.5212,7.5212,0,0,0-2.7224-3.78,3.9869,3.9869,0,1,1,5.5952,5.6225Z" } }], "name": "snow--scattered", "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=\"M2 26H4V28H2zM4 28H6V30H4zM6 30H8V32H6zM6 26H8V28H6zM2 30H4V32H2zM20 26H22V28H20zM22 28H24V30H22zM24 30H26V32H24zM24 26H26V28H24zM20 30H22V32H20zM11 26H13V28H11zM13 28H15V30H13zM15 30H17V32H15zM15 26H17V28H15zM11 30H13V32H11zM20 0H22V3H20zM29 10.001H32V12.001H29z\"></path><path d=\"M26.732 3.768H29.732V5.768H26.732z\" transform=\"rotate(-45 28.232 4.768)\"></path><path d=\"M26.732 16.233H29.732V18.233H26.732z\" transform=\"rotate(-135 28.232 17.233)\"></path><path d=\"M12.268 3.768H15.268V5.768H12.268z\" transform=\"rotate(-135 13.768 4.768)\"></path><path d=\"M27,11A5.9852,5.9852,0,0,0,16.1431,7.5083,7.3737,7.3737,0,0,0,13.5,7a7.5511,7.5511,0,0,0-7.1494,5.2441A5.9926,5.9926,0,0,0,8,24H19a5.9672,5.9672,0,0,0,5.5667-8.2A5.9722,5.9722,0,0,0,27,11ZM19,22H8a3.9926,3.9926,0,0,1-.6733-7.9292l.663-.1128.1456-.6562a5.496,5.496,0,0,1,10.7294,0l.1456.6562.6626.1128A3.9925,3.9925,0,0,1,19,22Zm4.5222-7.9131a5.9592,5.9592,0,0,0-2.8728-1.8428,7.5212,7.5212,0,0,0-2.7224-3.78,3.9869,3.9869,0,1,1,5.5952,5.6225Z\"></path></svg>" }, "24": { metadata: { "moduleName": "SnowScattered24", "filepath": "snow--scattered/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": "M2 26H4V28H2zM4 28H6V30H4zM6 30H8V32H6zM6 26H8V28H6zM2 30H4V32H2zM20 26H22V28H20zM22 28H24V30H22zM24 30H26V32H24zM24 26H26V28H24zM20 30H22V32H20zM11 26H13V28H11zM13 28H15V30H13zM15 30H17V32H15zM15 26H17V28H15zM11 30H13V32H11zM20 0H22V3H20zM29 10.001H32V12.001H29z" } }, { "elem": "path", "attrs": { "d": "M26.732 3.768H29.732V5.768H26.732z", "transform": "rotate(-45 28.232 4.768)" } }, { "elem": "path", "attrs": { "d": "M26.732 16.233H29.732V18.233H26.732z", "transform": "rotate(-135 28.232 17.233)" } }, { "elem": "path", "attrs": { "d": "M12.268 3.768H15.268V5.768H12.268z", "transform": "rotate(-135 13.768 4.768)" } }, { "elem": "path", "attrs": { "d": "M27,11A5.9852,5.9852,0,0,0,16.1431,7.5083,7.3737,7.3737,0,0,0,13.5,7a7.5511,7.5511,0,0,0-7.1494,5.2441A5.9926,5.9926,0,0,0,8,24H19a5.9672,5.9672,0,0,0,5.5667-8.2A5.9722,5.9722,0,0,0,27,11ZM19,22H8a3.9926,3.9926,0,0,1-.6733-7.9292l.663-.1128.1456-.6562a5.496,5.496,0,0,1,10.7294,0l.1456.6562.6626.1128A3.9925,3.9925,0,0,1,19,22Zm4.5222-7.9131a5.9592,5.9592,0,0,0-2.8728-1.8428,7.5212,7.5212,0,0,0-2.7224-3.78,3.9869,3.9869,0,1,1,5.5952,5.6225Z" } }], "name": "snow--scattered", "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=\"M2 26H4V28H2zM4 28H6V30H4zM6 30H8V32H6zM6 26H8V28H6zM2 30H4V32H2zM20 26H22V28H20zM22 28H24V30H22zM24 30H26V32H24zM24 26H26V28H24zM20 30H22V32H20zM11 26H13V28H11zM13 28H15V30H13zM15 30H17V32H15zM15 26H17V28H15zM11 30H13V32H11zM20 0H22V3H20zM29 10.001H32V12.001H29z\"></path><path d=\"M26.732 3.768H29.732V5.768H26.732z\" transform=\"rotate(-45 28.232 4.768)\"></path><path d=\"M26.732 16.233H29.732V18.233H26.732z\" transform=\"rotate(-135 28.232 17.233)\"></path><path d=\"M12.268 3.768H15.268V5.768H12.268z\" transform=\"rotate(-135 13.768 4.768)\"></path><path d=\"M27,11A5.9852,5.9852,0,0,0,16.1431,7.5083,7.3737,7.3737,0,0,0,13.5,7a7.5511,7.5511,0,0,0-7.1494,5.2441A5.9926,5.9926,0,0,0,8,24H19a5.9672,5.9672,0,0,0,5.5667-8.2A5.9722,5.9722,0,0,0,27,11ZM19,22H8a3.9926,3.9926,0,0,1-.6733-7.9292l.663-.1128.1456-.6562a5.496,5.496,0,0,1,10.7294,0l.1456.6562.6626.1128A3.9925,3.9925,0,0,1,19,22Zm4.5222-7.9131a5.9592,5.9592,0,0,0-2.8728-1.8428,7.5212,7.5212,0,0,0-2.7224-3.78,3.9869,3.9869,0,1,1,5.5952,5.6225Z\"></path></svg>" }, "20": { metadata: { "moduleName": "SnowScattered20", "filepath": "snow--scattered/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": "M2 26H4V28H2zM4 28H6V30H4zM6 30H8V32H6zM6 26H8V28H6zM2 30H4V32H2zM20 26H22V28H20zM22 28H24V30H22zM24 30H26V32H24zM24 26H26V28H24zM20 30H22V32H20zM11 26H13V28H11zM13 28H15V30H13zM15 30H17V32H15zM15 26H17V28H15zM11 30H13V32H11zM20 0H22V3H20zM29 10.001H32V12.001H29z" } }, { "elem": "path", "attrs": { "d": "M26.732 3.768H29.732V5.768H26.732z", "transform": "rotate(-45 28.232 4.768)" } }, { "elem": "path", "attrs": { "d": "M26.732 16.233H29.732V18.233H26.732z", "transform": "rotate(-135 28.232 17.233)" } }, { "elem": "path", "attrs": { "d": "M12.268 3.768H15.268V5.768H12.268z", "transform": "rotate(-135 13.768 4.768)" } }, { "elem": "path", "attrs": { "d": "M27,11A5.9852,5.9852,0,0,0,16.1431,7.5083,7.3737,7.3737,0,0,0,13.5,7a7.5511,7.5511,0,0,0-7.1494,5.2441A5.9926,5.9926,0,0,0,8,24H19a5.9672,5.9672,0,0,0,5.5667-8.2A5.9722,5.9722,0,0,0,27,11ZM19,22H8a3.9926,3.9926,0,0,1-.6733-7.9292l.663-.1128.1456-.6562a5.496,5.496,0,0,1,10.7294,0l.1456.6562.6626.1128A3.9925,3.9925,0,0,1,19,22Zm4.5222-7.9131a5.9592,5.9592,0,0,0-2.8728-1.8428,7.5212,7.5212,0,0,0-2.7224-3.78,3.9869,3.9869,0,1,1,5.5952,5.6225Z" } }], "name": "snow--scattered", "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=\"M2 26H4V28H2zM4 28H6V30H4zM6 30H8V32H6zM6 26H8V28H6zM2 30H4V32H2zM20 26H22V28H20zM22 28H24V30H22zM24 30H26V32H24zM24 26H26V28H24zM20 30H22V32H20zM11 26H13V28H11zM13 28H15V30H13zM15 30H17V32H15zM15 26H17V28H15zM11 30H13V32H11zM20 0H22V3H20zM29 10.001H32V12.001H29z\"></path><path d=\"M26.732 3.768H29.732V5.768H26.732z\" transform=\"rotate(-45 28.232 4.768)\"></path><path d=\"M26.732 16.233H29.732V18.233H26.732z\" transform=\"rotate(-135 28.232 17.233)\"></path><path d=\"M12.268 3.768H15.268V5.768H12.268z\" transform=\"rotate(-135 13.768 4.768)\"></path><path d=\"M27,11A5.9852,5.9852,0,0,0,16.1431,7.5083,7.3737,7.3737,0,0,0,13.5,7a7.5511,7.5511,0,0,0-7.1494,5.2441A5.9926,5.9926,0,0,0,8,24H19a5.9672,5.9672,0,0,0,5.5667-8.2A5.9722,5.9722,0,0,0,27,11ZM19,22H8a3.9926,3.9926,0,0,1-.6733-7.9292l.663-.1128.1456-.6562a5.496,5.496,0,0,1,10.7294,0l.1456.6562.6626.1128A3.9925,3.9925,0,0,1,19,22Zm4.5222-7.9131a5.9592,5.9592,0,0,0-2.8728-1.8428,7.5212,7.5212,0,0,0-2.7224-3.78,3.9869,3.9869,0,1,1,5.5952,5.6225Z\"></path></svg>" }, "16": { metadata: { "moduleName": "SnowScattered16", "filepath": "snow--scattered/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": "M2 26H4V28H2zM4 28H6V30H4zM6 30H8V32H6zM6 26H8V28H6zM2 30H4V32H2zM20 26H22V28H20zM22 28H24V30H22zM24 30H26V32H24zM24 26H26V28H24zM20 30H22V32H20zM11 26H13V28H11zM13 28H15V30H13zM15 30H17V32H15zM15 26H17V28H15zM11 30H13V32H11zM20 0H22V3H20zM29 10.001H32V12.001H29z" } }, { "elem": "path", "attrs": { "d": "M26.732 3.768H29.732V5.768H26.732z", "transform": "rotate(-45 28.232 4.768)" } }, { "elem": "path", "attrs": { "d": "M26.732 16.233H29.732V18.233H26.732z", "transform": "rotate(-135 28.232 17.233)" } }, { "elem": "path", "attrs": { "d": "M12.268 3.768H15.268V5.768H12.268z", "transform": "rotate(-135 13.768 4.768)" } }, { "elem": "path", "attrs": { "d": "M27,11A5.9852,5.9852,0,0,0,16.1431,7.5083,7.3737,7.3737,0,0,0,13.5,7a7.5511,7.5511,0,0,0-7.1494,5.2441A5.9926,5.9926,0,0,0,8,24H19a5.9672,5.9672,0,0,0,5.5667-8.2A5.9722,5.9722,0,0,0,27,11ZM19,22H8a3.9926,3.9926,0,0,1-.6733-7.9292l.663-.1128.1456-.6562a5.496,5.496,0,0,1,10.7294,0l.1456.6562.6626.1128A3.9925,3.9925,0,0,1,19,22Zm4.5222-7.9131a5.9592,5.9592,0,0,0-2.8728-1.8428,7.5212,7.5212,0,0,0-2.7224-3.78,3.9869,3.9869,0,1,1,5.5952,5.6225Z" } }], "name": "snow--scattered", "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=\"M2 26H4V28H2zM4 28H6V30H4zM6 30H8V32H6zM6 26H8V28H6zM2 30H4V32H2zM20 26H22V28H20zM22 28H24V30H22zM24 30H26V32H24zM24 26H26V28H24zM20 30H22V32H20zM11 26H13V28H11zM13 28H15V30H13zM15 30H17V32H15zM15 26H17V28H15zM11 30H13V32H11zM20 0H22V3H20zM29 10.001H32V12.001H29z\"></path><path d=\"M26.732 3.768H29.732V5.768H26.732z\" transform=\"rotate(-45 28.232 4.768)\"></path><path d=\"M26.732 16.233H29.732V18.233H26.732z\" transform=\"rotate(-135 28.232 17.233)\"></path><path d=\"M12.268 3.768H15.268V5.768H12.268z\" transform=\"rotate(-135 13.768 4.768)\"></path><path d=\"M27,11A5.9852,5.9852,0,0,0,16.1431,7.5083,7.3737,7.3737,0,0,0,13.5,7a7.5511,7.5511,0,0,0-7.1494,5.2441A5.9926,5.9926,0,0,0,8,24H19a5.9672,5.9672,0,0,0,5.5667-8.2A5.9722,5.9722,0,0,0,27,11ZM19,22H8a3.9926,3.9926,0,0,1-.6733-7.9292l.663-.1128.1456-.6562a5.496,5.496,0,0,1,10.7294,0l.1456.6562.6626.1128A3.9925,3.9925,0,0,1,19,22Zm4.5222-7.9131a5.9592,5.9592,0,0,0-2.8728-1.8428,7.5212,7.5212,0,0,0-2.7224-3.78,3.9869,3.9869,0,1,1,5.5952,5.6225Z\"></path></svg>" }, }; } SnowScatteredDirective_1 = SnowScatteredDirective; SnowScatteredDirective.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; SnowScatteredDirective_1.titleIdCounter++; title.setAttribute("id", "snow-scattered-" + SnowScatteredDirective_1.titleIdCounter); svg.appendChild(title); svg.setAttribute("aria-labelledby", "snow-scattered-" + SnowScatteredDirective_1.titleIdCounter); } }; var SnowScatteredDirective_1; SnowScatteredDirective.titleIdCounter = 0; SnowScatteredDirective.ctorParameters = function () { return [ { type: core.ElementRef } ]; }; tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], SnowScatteredDirective.prototype, "ariaLabel", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], SnowScatteredDirective.prototype, "ariaLabelledby", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", Boolean) ], SnowScatteredDirective.prototype, "ariaHidden", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], SnowScatteredDirective.prototype, "title", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", Boolean) ], SnowScatteredDirective.prototype, "isFocusable", void 0); tslib.__decorate([ core.Input(), tslib.__metadata("design:type", String) ], SnowScatteredDirective.prototype, "size", void 0); SnowScatteredDirective = SnowScatteredDirective_1 = tslib.__decorate([ core.Directive({ selector: "[ibmIconSnowScattered]" }), tslib.__metadata("design:paramtypes", [core.ElementRef]) ], SnowScatteredDirective); return SnowScatteredDirective; }()); var SnowScatteredModule = /** @class */ (function () { function SnowScatteredModule() { } SnowScatteredModule = tslib.__decorate([ core.NgModule({ declarations: [ SnowScatteredComponent, SnowScatteredDirective, ], exports: [ SnowScatteredComponent, SnowScatteredDirective, ] }) ], SnowScatteredModule); return SnowScatteredModule; }()); exports.SnowScatteredComponent = SnowScatteredComponent; exports.SnowScatteredDirective = SnowScatteredDirective; exports.SnowScatteredModule = SnowScatteredModule; Object.defineProperty(exports, '__esModule', { value: true }); })));