UNPKG

@carbon/icons-angular

Version:

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

174 lines (171 loc) 10.4 kB
import { __decorate, __metadata } from 'tslib'; import { Input, Component, ElementRef, Directive, NgModule } from '@angular/core'; import { getAttributes } from '@carbon/icon-helpers'; var PhoneOffFilledDirective_1; let PhoneOffFilledComponent = class PhoneOffFilledComponent { constructor() { this.focusable = false; } }; __decorate([ Input(), __metadata("design:type", String) ], PhoneOffFilledComponent.prototype, "ariaLabel", void 0); __decorate([ Input(), __metadata("design:type", String) ], PhoneOffFilledComponent.prototype, "ariaLabelledby", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], PhoneOffFilledComponent.prototype, "ariaHidden", void 0); __decorate([ Input(), __metadata("design:type", String) ], PhoneOffFilledComponent.prototype, "title", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], PhoneOffFilledComponent.prototype, "focusable", void 0); __decorate([ Input(), __metadata("design:type", String) ], PhoneOffFilledComponent.prototype, "innerClass", void 0); __decorate([ Input(), __metadata("design:type", String) ], PhoneOffFilledComponent.prototype, "size", void 0); PhoneOffFilledComponent = __decorate([ Component({ selector: "ibm-icon-phone-off-filled", template: ` <svg ibmIconPhoneOffFilled [size]="size" [ariaLabel]="ariaLabel" [ariaLabelledby]="ariaLabelledby" [ariaHidden]="ariaHidden" [title]="title" [isFocusable]="focusable" [attr.class]="innerClass"> </svg> ` }) ], PhoneOffFilledComponent); let PhoneOffFilledDirective = PhoneOffFilledDirective_1 = class PhoneOffFilledDirective { constructor(elementRef) { this.elementRef = elementRef; this.isFocusable = false; this.icons = { "32": { metadata: { "moduleName": "PhoneOffFilled32", "filepath": "phone--off--filled/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.74 19.56l-2.52-1a2 2 0 00-2.15.44L20 21.06a9.93 9.93 0 01-5.35-2.29L30 3.41 28.59 2 2 28.59 3.41 30l7.93-7.92c3.24 3.12 7.89 5.5 14.55 5.92A2 2 0 0028 26V21.41A2 2 0 0026.74 19.56zM8.15 18.19l3.52-3.52A11.68 11.68 0 0110.85 12l2.07-2.07a2 2 0 00.44-2.15l-1-2.52A2 2 0 0010.5 4H6A2 2 0 004 6.22 29 29 0 008.15 18.19z" } }], "name": "phone--off--filled", "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.74 19.56l-2.52-1a2 2 0 00-2.15.44L20 21.06a9.93 9.93 0 01-5.35-2.29L30 3.41 28.59 2 2 28.59 3.41 30l7.93-7.92c3.24 3.12 7.89 5.5 14.55 5.92A2 2 0 0028 26V21.41A2 2 0 0026.74 19.56zM8.15 18.19l3.52-3.52A11.68 11.68 0 0110.85 12l2.07-2.07a2 2 0 00.44-2.15l-1-2.52A2 2 0 0010.5 4H6A2 2 0 004 6.22 29 29 0 008.15 18.19z"></path></svg>` }, "24": { metadata: { "moduleName": "PhoneOffFilled24", "filepath": "phone--off--filled/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.74 19.56l-2.52-1a2 2 0 00-2.15.44L20 21.06a9.93 9.93 0 01-5.35-2.29L30 3.41 28.59 2 2 28.59 3.41 30l7.93-7.92c3.24 3.12 7.89 5.5 14.55 5.92A2 2 0 0028 26V21.41A2 2 0 0026.74 19.56zM8.15 18.19l3.52-3.52A11.68 11.68 0 0110.85 12l2.07-2.07a2 2 0 00.44-2.15l-1-2.52A2 2 0 0010.5 4H6A2 2 0 004 6.22 29 29 0 008.15 18.19z" } }], "name": "phone--off--filled", "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.74 19.56l-2.52-1a2 2 0 00-2.15.44L20 21.06a9.93 9.93 0 01-5.35-2.29L30 3.41 28.59 2 2 28.59 3.41 30l7.93-7.92c3.24 3.12 7.89 5.5 14.55 5.92A2 2 0 0028 26V21.41A2 2 0 0026.74 19.56zM8.15 18.19l3.52-3.52A11.68 11.68 0 0110.85 12l2.07-2.07a2 2 0 00.44-2.15l-1-2.52A2 2 0 0010.5 4H6A2 2 0 004 6.22 29 29 0 008.15 18.19z"></path></svg>` }, "20": { metadata: { "moduleName": "PhoneOffFilled20", "filepath": "phone--off--filled/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.74 19.56l-2.52-1a2 2 0 00-2.15.44L20 21.06a9.93 9.93 0 01-5.35-2.29L30 3.41 28.59 2 2 28.59 3.41 30l7.93-7.92c3.24 3.12 7.89 5.5 14.55 5.92A2 2 0 0028 26V21.41A2 2 0 0026.74 19.56zM8.15 18.19l3.52-3.52A11.68 11.68 0 0110.85 12l2.07-2.07a2 2 0 00.44-2.15l-1-2.52A2 2 0 0010.5 4H6A2 2 0 004 6.22 29 29 0 008.15 18.19z" } }], "name": "phone--off--filled", "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.74 19.56l-2.52-1a2 2 0 00-2.15.44L20 21.06a9.93 9.93 0 01-5.35-2.29L30 3.41 28.59 2 2 28.59 3.41 30l7.93-7.92c3.24 3.12 7.89 5.5 14.55 5.92A2 2 0 0028 26V21.41A2 2 0 0026.74 19.56zM8.15 18.19l3.52-3.52A11.68 11.68 0 0110.85 12l2.07-2.07a2 2 0 00.44-2.15l-1-2.52A2 2 0 0010.5 4H6A2 2 0 004 6.22 29 29 0 008.15 18.19z"></path></svg>` }, "16": { metadata: { "moduleName": "PhoneOffFilled16", "filepath": "phone--off--filled/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.74 19.56l-2.52-1a2 2 0 00-2.15.44L20 21.06a9.93 9.93 0 01-5.35-2.29L30 3.41 28.59 2 2 28.59 3.41 30l7.93-7.92c3.24 3.12 7.89 5.5 14.55 5.92A2 2 0 0028 26V21.41A2 2 0 0026.74 19.56zM8.15 18.19l3.52-3.52A11.68 11.68 0 0110.85 12l2.07-2.07a2 2 0 00.44-2.15l-1-2.52A2 2 0 0010.5 4H6A2 2 0 004 6.22 29 29 0 008.15 18.19z" } }], "name": "phone--off--filled", "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.74 19.56l-2.52-1a2 2 0 00-2.15.44L20 21.06a9.93 9.93 0 01-5.35-2.29L30 3.41 28.59 2 2 28.59 3.41 30l7.93-7.92c3.24 3.12 7.89 5.5 14.55 5.92A2 2 0 0028 26V21.41A2 2 0 0026.74 19.56zM8.15 18.19l3.52-3.52A11.68 11.68 0 0110.85 12l2.07-2.07a2 2 0 00.44-2.15l-1-2.52A2 2 0 0010.5 4H6A2 2 0 004 6.22 29 29 0 008.15 18.19z"></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; PhoneOffFilledDirective_1.titleIdCounter++; title.setAttribute("id", `phone-off-filled-${PhoneOffFilledDirective_1.titleIdCounter}`); svg.appendChild(title); svg.setAttribute("aria-labelledby", `phone-off-filled-${PhoneOffFilledDirective_1.titleIdCounter}`); } } }; PhoneOffFilledDirective.titleIdCounter = 0; PhoneOffFilledDirective.ctorParameters = () => [ { type: ElementRef } ]; __decorate([ Input(), __metadata("design:type", String) ], PhoneOffFilledDirective.prototype, "ariaLabel", void 0); __decorate([ Input(), __metadata("design:type", String) ], PhoneOffFilledDirective.prototype, "ariaLabelledby", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], PhoneOffFilledDirective.prototype, "ariaHidden", void 0); __decorate([ Input(), __metadata("design:type", String) ], PhoneOffFilledDirective.prototype, "title", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], PhoneOffFilledDirective.prototype, "isFocusable", void 0); __decorate([ Input(), __metadata("design:type", String) ], PhoneOffFilledDirective.prototype, "size", void 0); PhoneOffFilledDirective = PhoneOffFilledDirective_1 = __decorate([ Directive({ selector: "[ibmIconPhoneOffFilled]" }), __metadata("design:paramtypes", [ElementRef]) ], PhoneOffFilledDirective); let PhoneOffFilledModule = class PhoneOffFilledModule { }; PhoneOffFilledModule = __decorate([ NgModule({ declarations: [ PhoneOffFilledComponent, PhoneOffFilledDirective, ], exports: [ PhoneOffFilledComponent, PhoneOffFilledDirective, ] }) ], PhoneOffFilledModule); export { PhoneOffFilledComponent, PhoneOffFilledDirective, PhoneOffFilledModule };