UNPKG

@carbon/icons-angular

Version:

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

174 lines (171 loc) 15.9 kB
import { __decorate, __metadata } from 'tslib'; import { Input, Component, ElementRef, Directive, NgModule } from '@angular/core'; import { getAttributes } from '@carbon/icon-helpers'; var SnowScatteredNightDirective_1; let SnowScatteredNightComponent = class SnowScatteredNightComponent { constructor() { this.focusable = false; } }; __decorate([ Input(), __metadata("design:type", String) ], SnowScatteredNightComponent.prototype, "ariaLabel", void 0); __decorate([ Input(), __metadata("design:type", String) ], SnowScatteredNightComponent.prototype, "ariaLabelledby", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], SnowScatteredNightComponent.prototype, "ariaHidden", void 0); __decorate([ Input(), __metadata("design:type", String) ], SnowScatteredNightComponent.prototype, "title", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], SnowScatteredNightComponent.prototype, "focusable", void 0); __decorate([ Input(), __metadata("design:type", String) ], SnowScatteredNightComponent.prototype, "innerClass", void 0); __decorate([ Input(), __metadata("design:type", String) ], SnowScatteredNightComponent.prototype, "size", void 0); SnowScatteredNightComponent = __decorate([ Component({ selector: "ibm-icon-snow-scattered-night", template: ` <svg ibmIconSnowScatteredNight [size]="size" [ariaLabel]="ariaLabel" [ariaLabelledby]="ariaLabelledby" [ariaHidden]="ariaHidden" [title]="title" [isFocusable]="focusable" [attr.class]="innerClass"> </svg> ` }) ], SnowScatteredNightComponent); let SnowScatteredNightDirective = SnowScatteredNightDirective_1 = class SnowScatteredNightDirective { constructor(elementRef) { this.elementRef = elementRef; this.isFocusable = false; this.icons = { "32": { metadata: { "moduleName": "SnowScatteredNight32", "filepath": "snow--scattered--night/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 30H13V32H11zM29.8439 13.0347a1.517 1.517 0 00-1.23-.8658 5.3552 5.3552 0 01-3.4095-1.7158 6.4655 6.4655 0 01-1.286-6.3926 1.6025 1.6025 0 00-.2989-1.5459 1.4543 1.4543 0 00-1.36-.4931l-.0191.0039a7.7685 7.7685 0 00-5.8847 5.5737A7.3706 7.3706 0 0013.5 7a7.5511 7.5511 0 00-7.1494 5.2441A5.9926 5.9926 0 008 24H19a6.0066 6.0066 0 006-6c0-.0571-.0123-.1113-.0139-.1685a7.5076 7.5076 0 004.7611-3.2768A1.5369 1.5369 0 0029.8439 13.0347zM19 22H8a3.9926 3.9926 0 01-.6733-7.9292l.663-.1128.1456-.6562a5.496 5.496 0 0110.7294 0l.1456.6562.6626.1128A3.9925 3.9925 0 0119 22zm5.5974-6.1289a5.9661 5.9661 0 00-3.948-3.627 7.49 7.49 0 00-2.489-3.58 5.9018 5.9018 0 013.6381-4.4473 8.4577 8.4577 0 001.94 7.5967A7.4007 7.4007 0 0027.64 14.041 5.4487 5.4487 0 0124.5974 15.8711z" } }], "name": "snow--scattered--night", "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 30H13V32H11zM29.8439 13.0347a1.517 1.517 0 00-1.23-.8658 5.3552 5.3552 0 01-3.4095-1.7158 6.4655 6.4655 0 01-1.286-6.3926 1.6025 1.6025 0 00-.2989-1.5459 1.4543 1.4543 0 00-1.36-.4931l-.0191.0039a7.7685 7.7685 0 00-5.8847 5.5737A7.3706 7.3706 0 0013.5 7a7.5511 7.5511 0 00-7.1494 5.2441A5.9926 5.9926 0 008 24H19a6.0066 6.0066 0 006-6c0-.0571-.0123-.1113-.0139-.1685a7.5076 7.5076 0 004.7611-3.2768A1.5369 1.5369 0 0029.8439 13.0347zM19 22H8a3.9926 3.9926 0 01-.6733-7.9292l.663-.1128.1456-.6562a5.496 5.496 0 0110.7294 0l.1456.6562.6626.1128A3.9925 3.9925 0 0119 22zm5.5974-6.1289a5.9661 5.9661 0 00-3.948-3.627 7.49 7.49 0 00-2.489-3.58 5.9018 5.9018 0 013.6381-4.4473 8.4577 8.4577 0 001.94 7.5967A7.4007 7.4007 0 0027.64 14.041 5.4487 5.4487 0 0124.5974 15.8711z"></path></svg>` }, "24": { metadata: { "moduleName": "SnowScatteredNight24", "filepath": "snow--scattered--night/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 30H13V32H11zM29.8439 13.0347a1.517 1.517 0 00-1.23-.8658 5.3552 5.3552 0 01-3.4095-1.7158 6.4655 6.4655 0 01-1.286-6.3926 1.6025 1.6025 0 00-.2989-1.5459 1.4543 1.4543 0 00-1.36-.4931l-.0191.0039a7.7685 7.7685 0 00-5.8847 5.5737A7.3706 7.3706 0 0013.5 7a7.5511 7.5511 0 00-7.1494 5.2441A5.9926 5.9926 0 008 24H19a6.0066 6.0066 0 006-6c0-.0571-.0123-.1113-.0139-.1685a7.5076 7.5076 0 004.7611-3.2768A1.5369 1.5369 0 0029.8439 13.0347zM19 22H8a3.9926 3.9926 0 01-.6733-7.9292l.663-.1128.1456-.6562a5.496 5.496 0 0110.7294 0l.1456.6562.6626.1128A3.9925 3.9925 0 0119 22zm5.5974-6.1289a5.9661 5.9661 0 00-3.948-3.627 7.49 7.49 0 00-2.489-3.58 5.9018 5.9018 0 013.6381-4.4473 8.4577 8.4577 0 001.94 7.5967A7.4007 7.4007 0 0027.64 14.041 5.4487 5.4487 0 0124.5974 15.8711z" } }], "name": "snow--scattered--night", "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 30H13V32H11zM29.8439 13.0347a1.517 1.517 0 00-1.23-.8658 5.3552 5.3552 0 01-3.4095-1.7158 6.4655 6.4655 0 01-1.286-6.3926 1.6025 1.6025 0 00-.2989-1.5459 1.4543 1.4543 0 00-1.36-.4931l-.0191.0039a7.7685 7.7685 0 00-5.8847 5.5737A7.3706 7.3706 0 0013.5 7a7.5511 7.5511 0 00-7.1494 5.2441A5.9926 5.9926 0 008 24H19a6.0066 6.0066 0 006-6c0-.0571-.0123-.1113-.0139-.1685a7.5076 7.5076 0 004.7611-3.2768A1.5369 1.5369 0 0029.8439 13.0347zM19 22H8a3.9926 3.9926 0 01-.6733-7.9292l.663-.1128.1456-.6562a5.496 5.496 0 0110.7294 0l.1456.6562.6626.1128A3.9925 3.9925 0 0119 22zm5.5974-6.1289a5.9661 5.9661 0 00-3.948-3.627 7.49 7.49 0 00-2.489-3.58 5.9018 5.9018 0 013.6381-4.4473 8.4577 8.4577 0 001.94 7.5967A7.4007 7.4007 0 0027.64 14.041 5.4487 5.4487 0 0124.5974 15.8711z"></path></svg>` }, "20": { metadata: { "moduleName": "SnowScatteredNight20", "filepath": "snow--scattered--night/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 30H13V32H11zM29.8439 13.0347a1.517 1.517 0 00-1.23-.8658 5.3552 5.3552 0 01-3.4095-1.7158 6.4655 6.4655 0 01-1.286-6.3926 1.6025 1.6025 0 00-.2989-1.5459 1.4543 1.4543 0 00-1.36-.4931l-.0191.0039a7.7685 7.7685 0 00-5.8847 5.5737A7.3706 7.3706 0 0013.5 7a7.5511 7.5511 0 00-7.1494 5.2441A5.9926 5.9926 0 008 24H19a6.0066 6.0066 0 006-6c0-.0571-.0123-.1113-.0139-.1685a7.5076 7.5076 0 004.7611-3.2768A1.5369 1.5369 0 0029.8439 13.0347zM19 22H8a3.9926 3.9926 0 01-.6733-7.9292l.663-.1128.1456-.6562a5.496 5.496 0 0110.7294 0l.1456.6562.6626.1128A3.9925 3.9925 0 0119 22zm5.5974-6.1289a5.9661 5.9661 0 00-3.948-3.627 7.49 7.49 0 00-2.489-3.58 5.9018 5.9018 0 013.6381-4.4473 8.4577 8.4577 0 001.94 7.5967A7.4007 7.4007 0 0027.64 14.041 5.4487 5.4487 0 0124.5974 15.8711z" } }], "name": "snow--scattered--night", "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 30H13V32H11zM29.8439 13.0347a1.517 1.517 0 00-1.23-.8658 5.3552 5.3552 0 01-3.4095-1.7158 6.4655 6.4655 0 01-1.286-6.3926 1.6025 1.6025 0 00-.2989-1.5459 1.4543 1.4543 0 00-1.36-.4931l-.0191.0039a7.7685 7.7685 0 00-5.8847 5.5737A7.3706 7.3706 0 0013.5 7a7.5511 7.5511 0 00-7.1494 5.2441A5.9926 5.9926 0 008 24H19a6.0066 6.0066 0 006-6c0-.0571-.0123-.1113-.0139-.1685a7.5076 7.5076 0 004.7611-3.2768A1.5369 1.5369 0 0029.8439 13.0347zM19 22H8a3.9926 3.9926 0 01-.6733-7.9292l.663-.1128.1456-.6562a5.496 5.496 0 0110.7294 0l.1456.6562.6626.1128A3.9925 3.9925 0 0119 22zm5.5974-6.1289a5.9661 5.9661 0 00-3.948-3.627 7.49 7.49 0 00-2.489-3.58 5.9018 5.9018 0 013.6381-4.4473 8.4577 8.4577 0 001.94 7.5967A7.4007 7.4007 0 0027.64 14.041 5.4487 5.4487 0 0124.5974 15.8711z"></path></svg>` }, "16": { metadata: { "moduleName": "SnowScatteredNight16", "filepath": "snow--scattered--night/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 30H13V32H11zM29.8439 13.0347a1.517 1.517 0 00-1.23-.8658 5.3552 5.3552 0 01-3.4095-1.7158 6.4655 6.4655 0 01-1.286-6.3926 1.6025 1.6025 0 00-.2989-1.5459 1.4543 1.4543 0 00-1.36-.4931l-.0191.0039a7.7685 7.7685 0 00-5.8847 5.5737A7.3706 7.3706 0 0013.5 7a7.5511 7.5511 0 00-7.1494 5.2441A5.9926 5.9926 0 008 24H19a6.0066 6.0066 0 006-6c0-.0571-.0123-.1113-.0139-.1685a7.5076 7.5076 0 004.7611-3.2768A1.5369 1.5369 0 0029.8439 13.0347zM19 22H8a3.9926 3.9926 0 01-.6733-7.9292l.663-.1128.1456-.6562a5.496 5.496 0 0110.7294 0l.1456.6562.6626.1128A3.9925 3.9925 0 0119 22zm5.5974-6.1289a5.9661 5.9661 0 00-3.948-3.627 7.49 7.49 0 00-2.489-3.58 5.9018 5.9018 0 013.6381-4.4473 8.4577 8.4577 0 001.94 7.5967A7.4007 7.4007 0 0027.64 14.041 5.4487 5.4487 0 0124.5974 15.8711z" } }], "name": "snow--scattered--night", "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 30H13V32H11zM29.8439 13.0347a1.517 1.517 0 00-1.23-.8658 5.3552 5.3552 0 01-3.4095-1.7158 6.4655 6.4655 0 01-1.286-6.3926 1.6025 1.6025 0 00-.2989-1.5459 1.4543 1.4543 0 00-1.36-.4931l-.0191.0039a7.7685 7.7685 0 00-5.8847 5.5737A7.3706 7.3706 0 0013.5 7a7.5511 7.5511 0 00-7.1494 5.2441A5.9926 5.9926 0 008 24H19a6.0066 6.0066 0 006-6c0-.0571-.0123-.1113-.0139-.1685a7.5076 7.5076 0 004.7611-3.2768A1.5369 1.5369 0 0029.8439 13.0347zM19 22H8a3.9926 3.9926 0 01-.6733-7.9292l.663-.1128.1456-.6562a5.496 5.496 0 0110.7294 0l.1456.6562.6626.1128A3.9925 3.9925 0 0119 22zm5.5974-6.1289a5.9661 5.9661 0 00-3.948-3.627 7.49 7.49 0 00-2.489-3.58 5.9018 5.9018 0 013.6381-4.4473 8.4577 8.4577 0 001.94 7.5967A7.4007 7.4007 0 0027.64 14.041 5.4487 5.4487 0 0124.5974 15.8711z"></path></svg>` }, }; } ngAfterViewInit() { const svg = this.elementRef.nativeElement; svg.setAttribute("xmlns", "http://www.w3.org/2000/svg"); const icon = this.icons[this.size]; const domParser = new DOMParser(); const rawSVG = icon.svg; const svgElement = domParser.parseFromString(rawSVG, "image/svg+xml").documentElement; let 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; } const attributes = 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() }); const attrKeys = Object.keys(attributes); for (let i = 0; i < attrKeys.length; i++) { const key = attrKeys[i]; const value = attributes[key]; if (key === "title") { continue; } if (value) { svg.setAttribute(key, value); } } if (attributes.title) { const title = document.createElement("title"); title.textContent = attributes.title; SnowScatteredNightDirective_1.titleIdCounter++; title.setAttribute("id", `snow-scattered-night-${SnowScatteredNightDirective_1.titleIdCounter}`); svg.appendChild(title); svg.setAttribute("aria-labelledby", `snow-scattered-night-${SnowScatteredNightDirective_1.titleIdCounter}`); } } }; SnowScatteredNightDirective.titleIdCounter = 0; SnowScatteredNightDirective.ctorParameters = () => [ { type: ElementRef } ]; __decorate([ Input(), __metadata("design:type", String) ], SnowScatteredNightDirective.prototype, "ariaLabel", void 0); __decorate([ Input(), __metadata("design:type", String) ], SnowScatteredNightDirective.prototype, "ariaLabelledby", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], SnowScatteredNightDirective.prototype, "ariaHidden", void 0); __decorate([ Input(), __metadata("design:type", String) ], SnowScatteredNightDirective.prototype, "title", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], SnowScatteredNightDirective.prototype, "isFocusable", void 0); __decorate([ Input(), __metadata("design:type", String) ], SnowScatteredNightDirective.prototype, "size", void 0); SnowScatteredNightDirective = SnowScatteredNightDirective_1 = __decorate([ Directive({ selector: "[ibmIconSnowScatteredNight]" }), __metadata("design:paramtypes", [ElementRef]) ], SnowScatteredNightDirective); let SnowScatteredNightModule = class SnowScatteredNightModule { }; SnowScatteredNightModule = __decorate([ NgModule({ declarations: [ SnowScatteredNightComponent, SnowScatteredNightDirective, ], exports: [ SnowScatteredNightComponent, SnowScatteredNightDirective, ] }) ], SnowScatteredNightModule); export { SnowScatteredNightComponent, SnowScatteredNightDirective, SnowScatteredNightModule };