UNPKG

@carbon/icons-angular

Version:

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

169 lines (166 loc) 14 kB
import { __decorate, __metadata } from 'tslib'; import { Input, Component, ElementRef, Directive, NgModule } from '@angular/core'; import { getAttributes } from '@carbon/icon-helpers'; var EarthSoutheastAsiaComponent = /** @class */ (function () { function EarthSoutheastAsiaComponent() { this.focusable = false; } __decorate([ Input(), __metadata("design:type", String) ], EarthSoutheastAsiaComponent.prototype, "ariaLabel", void 0); __decorate([ Input(), __metadata("design:type", String) ], EarthSoutheastAsiaComponent.prototype, "ariaLabelledby", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], EarthSoutheastAsiaComponent.prototype, "ariaHidden", void 0); __decorate([ Input(), __metadata("design:type", String) ], EarthSoutheastAsiaComponent.prototype, "title", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], EarthSoutheastAsiaComponent.prototype, "focusable", void 0); __decorate([ Input(), __metadata("design:type", String) ], EarthSoutheastAsiaComponent.prototype, "innerClass", void 0); __decorate([ Input(), __metadata("design:type", String) ], EarthSoutheastAsiaComponent.prototype, "size", void 0); EarthSoutheastAsiaComponent = __decorate([ Component({ selector: "ibm-icon-earth-southeast-asia", template: "\n <svg\n ibmIconEarthSoutheastAsia\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 " }) ], EarthSoutheastAsiaComponent); return EarthSoutheastAsiaComponent; }()); var EarthSoutheastAsiaDirective = /** @class */ (function () { function EarthSoutheastAsiaDirective(elementRef) { this.elementRef = elementRef; this.isFocusable = false; this.icons = { "32": { metadata: { "moduleName": "EarthSoutheastAsia32", "filepath": "earth--southeast-asia/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": "M14 24H17V26H14zM17 22H19V24H17zM17 18H19V20H17z" } }, { "elem": "path", "attrs": { "d": "M16,2A14,14,0,1,0,30,16,14.0158,14.0158,0,0,0,16,2Zm-.603,2.03,2.5073,5.0156L16.3228,13H10.271l-1.41,4.3872,2.8521,2.8521L10.7056,21.751,6.2856,19H4.395A11.9363,11.9363,0,0,1,15.397,4.03ZM5.1055,21h.6089l3.9345,2.4487A1.9912,1.9912,0,0,0,12.37,22.86l1.0078-1.5118a2.005,2.005,0,0,0-.25-2.5234l-1.9887-1.9888L11.729,15h4.5938A1.9906,1.9906,0,0,0,18.18,13.7427L19.7612,9.79a2.0019,2.0019,0,0,0-.0674-1.6382L17.6843,4.1323A11.9592,11.9592,0,0,1,26.8945,21H23a2.0023,2.0023,0,0,0-2,2v3.8945A11.9477,11.9477,0,0,1,5.1055,21ZM23,25.7266V23h2.7268A12.0762,12.0762,0,0,1,23,25.7266Z" } }], "name": "earth--southeast-asia", "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=\"M14 24H17V26H14zM17 22H19V24H17zM17 18H19V20H17z\"></path><path d=\"M16,2A14,14,0,1,0,30,16,14.0158,14.0158,0,0,0,16,2Zm-.603,2.03,2.5073,5.0156L16.3228,13H10.271l-1.41,4.3872,2.8521,2.8521L10.7056,21.751,6.2856,19H4.395A11.9363,11.9363,0,0,1,15.397,4.03ZM5.1055,21h.6089l3.9345,2.4487A1.9912,1.9912,0,0,0,12.37,22.86l1.0078-1.5118a2.005,2.005,0,0,0-.25-2.5234l-1.9887-1.9888L11.729,15h4.5938A1.9906,1.9906,0,0,0,18.18,13.7427L19.7612,9.79a2.0019,2.0019,0,0,0-.0674-1.6382L17.6843,4.1323A11.9592,11.9592,0,0,1,26.8945,21H23a2.0023,2.0023,0,0,0-2,2v3.8945A11.9477,11.9477,0,0,1,5.1055,21ZM23,25.7266V23h2.7268A12.0762,12.0762,0,0,1,23,25.7266Z\"></path></svg>" }, "24": { metadata: { "moduleName": "EarthSoutheastAsia24", "filepath": "earth--southeast-asia/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": "M14 24H17V26H14zM17 22H19V24H17zM17 18H19V20H17z" } }, { "elem": "path", "attrs": { "d": "M16,2A14,14,0,1,0,30,16,14.0158,14.0158,0,0,0,16,2Zm-.603,2.03,2.5073,5.0156L16.3228,13H10.271l-1.41,4.3872,2.8521,2.8521L10.7056,21.751,6.2856,19H4.395A11.9363,11.9363,0,0,1,15.397,4.03ZM5.1055,21h.6089l3.9345,2.4487A1.9912,1.9912,0,0,0,12.37,22.86l1.0078-1.5118a2.005,2.005,0,0,0-.25-2.5234l-1.9887-1.9888L11.729,15h4.5938A1.9906,1.9906,0,0,0,18.18,13.7427L19.7612,9.79a2.0019,2.0019,0,0,0-.0674-1.6382L17.6843,4.1323A11.9592,11.9592,0,0,1,26.8945,21H23a2.0023,2.0023,0,0,0-2,2v3.8945A11.9477,11.9477,0,0,1,5.1055,21ZM23,25.7266V23h2.7268A12.0762,12.0762,0,0,1,23,25.7266Z" } }], "name": "earth--southeast-asia", "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=\"M14 24H17V26H14zM17 22H19V24H17zM17 18H19V20H17z\"></path><path d=\"M16,2A14,14,0,1,0,30,16,14.0158,14.0158,0,0,0,16,2Zm-.603,2.03,2.5073,5.0156L16.3228,13H10.271l-1.41,4.3872,2.8521,2.8521L10.7056,21.751,6.2856,19H4.395A11.9363,11.9363,0,0,1,15.397,4.03ZM5.1055,21h.6089l3.9345,2.4487A1.9912,1.9912,0,0,0,12.37,22.86l1.0078-1.5118a2.005,2.005,0,0,0-.25-2.5234l-1.9887-1.9888L11.729,15h4.5938A1.9906,1.9906,0,0,0,18.18,13.7427L19.7612,9.79a2.0019,2.0019,0,0,0-.0674-1.6382L17.6843,4.1323A11.9592,11.9592,0,0,1,26.8945,21H23a2.0023,2.0023,0,0,0-2,2v3.8945A11.9477,11.9477,0,0,1,5.1055,21ZM23,25.7266V23h2.7268A12.0762,12.0762,0,0,1,23,25.7266Z\"></path></svg>" }, "20": { metadata: { "moduleName": "EarthSoutheastAsia20", "filepath": "earth--southeast-asia/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": "M14 24H17V26H14zM17 22H19V24H17zM17 18H19V20H17z" } }, { "elem": "path", "attrs": { "d": "M16,2A14,14,0,1,0,30,16,14.0158,14.0158,0,0,0,16,2Zm-.603,2.03,2.5073,5.0156L16.3228,13H10.271l-1.41,4.3872,2.8521,2.8521L10.7056,21.751,6.2856,19H4.395A11.9363,11.9363,0,0,1,15.397,4.03ZM5.1055,21h.6089l3.9345,2.4487A1.9912,1.9912,0,0,0,12.37,22.86l1.0078-1.5118a2.005,2.005,0,0,0-.25-2.5234l-1.9887-1.9888L11.729,15h4.5938A1.9906,1.9906,0,0,0,18.18,13.7427L19.7612,9.79a2.0019,2.0019,0,0,0-.0674-1.6382L17.6843,4.1323A11.9592,11.9592,0,0,1,26.8945,21H23a2.0023,2.0023,0,0,0-2,2v3.8945A11.9477,11.9477,0,0,1,5.1055,21ZM23,25.7266V23h2.7268A12.0762,12.0762,0,0,1,23,25.7266Z" } }], "name": "earth--southeast-asia", "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=\"M14 24H17V26H14zM17 22H19V24H17zM17 18H19V20H17z\"></path><path d=\"M16,2A14,14,0,1,0,30,16,14.0158,14.0158,0,0,0,16,2Zm-.603,2.03,2.5073,5.0156L16.3228,13H10.271l-1.41,4.3872,2.8521,2.8521L10.7056,21.751,6.2856,19H4.395A11.9363,11.9363,0,0,1,15.397,4.03ZM5.1055,21h.6089l3.9345,2.4487A1.9912,1.9912,0,0,0,12.37,22.86l1.0078-1.5118a2.005,2.005,0,0,0-.25-2.5234l-1.9887-1.9888L11.729,15h4.5938A1.9906,1.9906,0,0,0,18.18,13.7427L19.7612,9.79a2.0019,2.0019,0,0,0-.0674-1.6382L17.6843,4.1323A11.9592,11.9592,0,0,1,26.8945,21H23a2.0023,2.0023,0,0,0-2,2v3.8945A11.9477,11.9477,0,0,1,5.1055,21ZM23,25.7266V23h2.7268A12.0762,12.0762,0,0,1,23,25.7266Z\"></path></svg>" }, "16": { metadata: { "moduleName": "EarthSoutheastAsia16", "filepath": "earth--southeast-asia/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": "M14 24H17V26H14zM17 22H19V24H17zM17 18H19V20H17z" } }, { "elem": "path", "attrs": { "d": "M16,2A14,14,0,1,0,30,16,14.0158,14.0158,0,0,0,16,2Zm-.603,2.03,2.5073,5.0156L16.3228,13H10.271l-1.41,4.3872,2.8521,2.8521L10.7056,21.751,6.2856,19H4.395A11.9363,11.9363,0,0,1,15.397,4.03ZM5.1055,21h.6089l3.9345,2.4487A1.9912,1.9912,0,0,0,12.37,22.86l1.0078-1.5118a2.005,2.005,0,0,0-.25-2.5234l-1.9887-1.9888L11.729,15h4.5938A1.9906,1.9906,0,0,0,18.18,13.7427L19.7612,9.79a2.0019,2.0019,0,0,0-.0674-1.6382L17.6843,4.1323A11.9592,11.9592,0,0,1,26.8945,21H23a2.0023,2.0023,0,0,0-2,2v3.8945A11.9477,11.9477,0,0,1,5.1055,21ZM23,25.7266V23h2.7268A12.0762,12.0762,0,0,1,23,25.7266Z" } }], "name": "earth--southeast-asia", "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=\"M14 24H17V26H14zM17 22H19V24H17zM17 18H19V20H17z\"></path><path d=\"M16,2A14,14,0,1,0,30,16,14.0158,14.0158,0,0,0,16,2Zm-.603,2.03,2.5073,5.0156L16.3228,13H10.271l-1.41,4.3872,2.8521,2.8521L10.7056,21.751,6.2856,19H4.395A11.9363,11.9363,0,0,1,15.397,4.03ZM5.1055,21h.6089l3.9345,2.4487A1.9912,1.9912,0,0,0,12.37,22.86l1.0078-1.5118a2.005,2.005,0,0,0-.25-2.5234l-1.9887-1.9888L11.729,15h4.5938A1.9906,1.9906,0,0,0,18.18,13.7427L19.7612,9.79a2.0019,2.0019,0,0,0-.0674-1.6382L17.6843,4.1323A11.9592,11.9592,0,0,1,26.8945,21H23a2.0023,2.0023,0,0,0-2,2v3.8945A11.9477,11.9477,0,0,1,5.1055,21ZM23,25.7266V23h2.7268A12.0762,12.0762,0,0,1,23,25.7266Z\"></path></svg>" }, }; } EarthSoutheastAsiaDirective_1 = EarthSoutheastAsiaDirective; EarthSoutheastAsiaDirective.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 = 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; EarthSoutheastAsiaDirective_1.titleIdCounter++; title.setAttribute("id", "earth-southeast-asia-" + EarthSoutheastAsiaDirective_1.titleIdCounter); svg.appendChild(title); svg.setAttribute("aria-labelledby", "earth-southeast-asia-" + EarthSoutheastAsiaDirective_1.titleIdCounter); } }; var EarthSoutheastAsiaDirective_1; EarthSoutheastAsiaDirective.titleIdCounter = 0; EarthSoutheastAsiaDirective.ctorParameters = function () { return [ { type: ElementRef } ]; }; __decorate([ Input(), __metadata("design:type", String) ], EarthSoutheastAsiaDirective.prototype, "ariaLabel", void 0); __decorate([ Input(), __metadata("design:type", String) ], EarthSoutheastAsiaDirective.prototype, "ariaLabelledby", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], EarthSoutheastAsiaDirective.prototype, "ariaHidden", void 0); __decorate([ Input(), __metadata("design:type", String) ], EarthSoutheastAsiaDirective.prototype, "title", void 0); __decorate([ Input(), __metadata("design:type", Boolean) ], EarthSoutheastAsiaDirective.prototype, "isFocusable", void 0); __decorate([ Input(), __metadata("design:type", String) ], EarthSoutheastAsiaDirective.prototype, "size", void 0); EarthSoutheastAsiaDirective = EarthSoutheastAsiaDirective_1 = __decorate([ Directive({ selector: "[ibmIconEarthSoutheastAsia]" }), __metadata("design:paramtypes", [ElementRef]) ], EarthSoutheastAsiaDirective); return EarthSoutheastAsiaDirective; }()); var EarthSoutheastAsiaModule = /** @class */ (function () { function EarthSoutheastAsiaModule() { } EarthSoutheastAsiaModule = __decorate([ NgModule({ declarations: [ EarthSoutheastAsiaComponent, EarthSoutheastAsiaDirective, ], exports: [ EarthSoutheastAsiaComponent, EarthSoutheastAsiaDirective, ] }) ], EarthSoutheastAsiaModule); return EarthSoutheastAsiaModule; }()); export { EarthSoutheastAsiaComponent, EarthSoutheastAsiaDirective, EarthSoutheastAsiaModule };