UNPKG

@carbon/icons-angular

Version:

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

174 lines (171 loc) 11.5 kB
import { __decorate, __metadata } from 'tslib'; import { Input, Component, ElementRef, Directive, NgModule } from '@angular/core'; import { getAttributes } from '@carbon/icon-helpers'; var EarthSoutheastAsiaFilledDirective_1; let EarthSoutheastAsiaFilledComponent = class EarthSoutheastAsiaFilledComponent { constructor() { this.focusable = false; } }; __decorate([ Input(), __metadata("design:type", String) ], EarthSoutheastAsiaFilledComponent.prototype, "ariaLabel", void 0); __decorate([ Input(), __metadata("design:type", String) ], EarthSoutheastAsiaFilledComponent.prototype, "ariaLabelledby", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], EarthSoutheastAsiaFilledComponent.prototype, "ariaHidden", void 0); __decorate([ Input(), __metadata("design:type", String) ], EarthSoutheastAsiaFilledComponent.prototype, "title", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], EarthSoutheastAsiaFilledComponent.prototype, "focusable", void 0); __decorate([ Input(), __metadata("design:type", String) ], EarthSoutheastAsiaFilledComponent.prototype, "innerClass", void 0); __decorate([ Input(), __metadata("design:type", String) ], EarthSoutheastAsiaFilledComponent.prototype, "size", void 0); EarthSoutheastAsiaFilledComponent = __decorate([ Component({ selector: "ibm-icon-earth-southeast-asia-filled", template: ` <svg ibmIconEarthSoutheastAsiaFilled [size]="size" [ariaLabel]="ariaLabel" [ariaLabelledby]="ariaLabelledby" [ariaHidden]="ariaHidden" [title]="title" [isFocusable]="focusable" [attr.class]="innerClass"> </svg> ` }) ], EarthSoutheastAsiaFilledComponent); let EarthSoutheastAsiaFilledDirective = EarthSoutheastAsiaFilledDirective_1 = class EarthSoutheastAsiaFilledDirective { constructor(elementRef) { this.elementRef = elementRef; this.isFocusable = false; this.icons = { "32": { metadata: { "moduleName": "EarthSoutheastAsiaFilled32", "filepath": "earth--southeast-asia--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": "M17 22H19V24H17zM17 18H19V20H17zM14 24H17V26H14z" } }, { "elem": "path", "attrs": { "d": "M16,2A14,14,0,1,0,30,16,14.0158,14.0158,0,0,0,16,2ZM4.7,20H6l4.1772,2.6a1,1,0,0,0,1.36-.2939l1.0078-1.5118a1,1,0,0,0-.125-1.2617L10,17.1118,11,14h5.323a1,1,0,0,0,.9285-.6284L18.8333,9.417a1,1,0,0,0-.034-.8189L16.5129,4.0259A11.9652,11.9652,0,0,1,26.3762,22H23a1,1,0,0,0-1,1v3.3765A11.9578,11.9578,0,0,1,4.7,20Z" } }], "name": "earth--southeast-asia--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="M17 22H19V24H17zM17 18H19V20H17zM14 24H17V26H14z"></path><path d="M16,2A14,14,0,1,0,30,16,14.0158,14.0158,0,0,0,16,2ZM4.7,20H6l4.1772,2.6a1,1,0,0,0,1.36-.2939l1.0078-1.5118a1,1,0,0,0-.125-1.2617L10,17.1118,11,14h5.323a1,1,0,0,0,.9285-.6284L18.8333,9.417a1,1,0,0,0-.034-.8189L16.5129,4.0259A11.9652,11.9652,0,0,1,26.3762,22H23a1,1,0,0,0-1,1v3.3765A11.9578,11.9578,0,0,1,4.7,20Z"></path></svg>` }, "24": { metadata: { "moduleName": "EarthSoutheastAsiaFilled24", "filepath": "earth--southeast-asia--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": "M17 22H19V24H17zM17 18H19V20H17zM14 24H17V26H14z" } }, { "elem": "path", "attrs": { "d": "M16,2A14,14,0,1,0,30,16,14.0158,14.0158,0,0,0,16,2ZM4.7,20H6l4.1772,2.6a1,1,0,0,0,1.36-.2939l1.0078-1.5118a1,1,0,0,0-.125-1.2617L10,17.1118,11,14h5.323a1,1,0,0,0,.9285-.6284L18.8333,9.417a1,1,0,0,0-.034-.8189L16.5129,4.0259A11.9652,11.9652,0,0,1,26.3762,22H23a1,1,0,0,0-1,1v3.3765A11.9578,11.9578,0,0,1,4.7,20Z" } }], "name": "earth--southeast-asia--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="M17 22H19V24H17zM17 18H19V20H17zM14 24H17V26H14z"></path><path d="M16,2A14,14,0,1,0,30,16,14.0158,14.0158,0,0,0,16,2ZM4.7,20H6l4.1772,2.6a1,1,0,0,0,1.36-.2939l1.0078-1.5118a1,1,0,0,0-.125-1.2617L10,17.1118,11,14h5.323a1,1,0,0,0,.9285-.6284L18.8333,9.417a1,1,0,0,0-.034-.8189L16.5129,4.0259A11.9652,11.9652,0,0,1,26.3762,22H23a1,1,0,0,0-1,1v3.3765A11.9578,11.9578,0,0,1,4.7,20Z"></path></svg>` }, "20": { metadata: { "moduleName": "EarthSoutheastAsiaFilled20", "filepath": "earth--southeast-asia--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": "M17 22H19V24H17zM17 18H19V20H17zM14 24H17V26H14z" } }, { "elem": "path", "attrs": { "d": "M16,2A14,14,0,1,0,30,16,14.0158,14.0158,0,0,0,16,2ZM4.7,20H6l4.1772,2.6a1,1,0,0,0,1.36-.2939l1.0078-1.5118a1,1,0,0,0-.125-1.2617L10,17.1118,11,14h5.323a1,1,0,0,0,.9285-.6284L18.8333,9.417a1,1,0,0,0-.034-.8189L16.5129,4.0259A11.9652,11.9652,0,0,1,26.3762,22H23a1,1,0,0,0-1,1v3.3765A11.9578,11.9578,0,0,1,4.7,20Z" } }], "name": "earth--southeast-asia--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="M17 22H19V24H17zM17 18H19V20H17zM14 24H17V26H14z"></path><path d="M16,2A14,14,0,1,0,30,16,14.0158,14.0158,0,0,0,16,2ZM4.7,20H6l4.1772,2.6a1,1,0,0,0,1.36-.2939l1.0078-1.5118a1,1,0,0,0-.125-1.2617L10,17.1118,11,14h5.323a1,1,0,0,0,.9285-.6284L18.8333,9.417a1,1,0,0,0-.034-.8189L16.5129,4.0259A11.9652,11.9652,0,0,1,26.3762,22H23a1,1,0,0,0-1,1v3.3765A11.9578,11.9578,0,0,1,4.7,20Z"></path></svg>` }, "16": { metadata: { "moduleName": "EarthSoutheastAsiaFilled16", "filepath": "earth--southeast-asia--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": "M17 22H19V24H17zM17 18H19V20H17zM14 24H17V26H14z" } }, { "elem": "path", "attrs": { "d": "M16,2A14,14,0,1,0,30,16,14.0158,14.0158,0,0,0,16,2ZM4.7,20H6l4.1772,2.6a1,1,0,0,0,1.36-.2939l1.0078-1.5118a1,1,0,0,0-.125-1.2617L10,17.1118,11,14h5.323a1,1,0,0,0,.9285-.6284L18.8333,9.417a1,1,0,0,0-.034-.8189L16.5129,4.0259A11.9652,11.9652,0,0,1,26.3762,22H23a1,1,0,0,0-1,1v3.3765A11.9578,11.9578,0,0,1,4.7,20Z" } }], "name": "earth--southeast-asia--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="M17 22H19V24H17zM17 18H19V20H17zM14 24H17V26H14z"></path><path d="M16,2A14,14,0,1,0,30,16,14.0158,14.0158,0,0,0,16,2ZM4.7,20H6l4.1772,2.6a1,1,0,0,0,1.36-.2939l1.0078-1.5118a1,1,0,0,0-.125-1.2617L10,17.1118,11,14h5.323a1,1,0,0,0,.9285-.6284L18.8333,9.417a1,1,0,0,0-.034-.8189L16.5129,4.0259A11.9652,11.9652,0,0,1,26.3762,22H23a1,1,0,0,0-1,1v3.3765A11.9578,11.9578,0,0,1,4.7,20Z"></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; EarthSoutheastAsiaFilledDirective_1.titleIdCounter++; title.setAttribute("id", `earth-southeast-asia-filled-${EarthSoutheastAsiaFilledDirective_1.titleIdCounter}`); svg.appendChild(title); svg.setAttribute("aria-labelledby", `earth-southeast-asia-filled-${EarthSoutheastAsiaFilledDirective_1.titleIdCounter}`); } } }; EarthSoutheastAsiaFilledDirective.titleIdCounter = 0; EarthSoutheastAsiaFilledDirective.ctorParameters = () => [ { type: ElementRef } ]; __decorate([ Input(), __metadata("design:type", String) ], EarthSoutheastAsiaFilledDirective.prototype, "ariaLabel", void 0); __decorate([ Input(), __metadata("design:type", String) ], EarthSoutheastAsiaFilledDirective.prototype, "ariaLabelledby", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], EarthSoutheastAsiaFilledDirective.prototype, "ariaHidden", void 0); __decorate([ Input(), __metadata("design:type", String) ], EarthSoutheastAsiaFilledDirective.prototype, "title", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], EarthSoutheastAsiaFilledDirective.prototype, "isFocusable", void 0); __decorate([ Input(), __metadata("design:type", String) ], EarthSoutheastAsiaFilledDirective.prototype, "size", void 0); EarthSoutheastAsiaFilledDirective = EarthSoutheastAsiaFilledDirective_1 = __decorate([ Directive({ selector: "[ibmIconEarthSoutheastAsiaFilled]" }), __metadata("design:paramtypes", [ElementRef]) ], EarthSoutheastAsiaFilledDirective); let EarthSoutheastAsiaFilledModule = class EarthSoutheastAsiaFilledModule { }; EarthSoutheastAsiaFilledModule = __decorate([ NgModule({ declarations: [ EarthSoutheastAsiaFilledComponent, EarthSoutheastAsiaFilledDirective, ], exports: [ EarthSoutheastAsiaFilledComponent, EarthSoutheastAsiaFilledDirective, ] }) ], EarthSoutheastAsiaFilledModule); export { EarthSoutheastAsiaFilledComponent, EarthSoutheastAsiaFilledDirective, EarthSoutheastAsiaFilledModule };