@carbon/icons-angular
Version:
Angular components for icons in digital and software products using the Carbon Design System
169 lines (166 loc) • 13.2 kB
JavaScript
import { __decorate, __metadata } from 'tslib';
import { Input, Component, ElementRef, Directive, NgModule } from '@angular/core';
import { getAttributes } from '@carbon/icon-helpers';
var Rewind_10Component = /** @class */ (function () {
function Rewind_10Component() {
this.focusable = false;
}
__decorate([
Input(),
__metadata("design:type", String)
], Rewind_10Component.prototype, "ariaLabel", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], Rewind_10Component.prototype, "ariaLabelledby", void 0);
__decorate([
Input(),
__metadata("design:type", Boolean)
], Rewind_10Component.prototype, "ariaHidden", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], Rewind_10Component.prototype, "title", void 0);
__decorate([
Input(),
__metadata("design:type", Boolean)
], Rewind_10Component.prototype, "focusable", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], Rewind_10Component.prototype, "innerClass", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], Rewind_10Component.prototype, "size", void 0);
Rewind_10Component = __decorate([
Component({
selector: "ibm-icon-rewind-10",
template: "\n <svg\n ibmIconRewind_10\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 "
})
], Rewind_10Component);
return Rewind_10Component;
}());
var Rewind_10Directive = /** @class */ (function () {
function Rewind_10Directive(elementRef) {
this.elementRef = elementRef;
this.isFocusable = false;
this.icons = {
"32": {
metadata: { "moduleName": "Rewind_1032", "filepath": "rewind--10/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": "M4,18A12,12,0,1,0,16,6H12V1L6,7l6,6V8h4A10,10,0,1,1,6,18Z" } }, { "elem": "path", "attrs": { "d": "M19.63 22.13a2.84 2.84 0 01-1.28-.27 2.44 2.44 0 01-.89-.77 3.57 3.57 0 01-.52-1.25 7.69 7.69 0 01-.17-1.68 7.83 7.83 0 01.17-1.68 3.65 3.65 0 01.52-1.25 2.44 2.44 0 01.89-.77 2.84 2.84 0 011.28-.27 2.44 2.44 0 012.16 1 5.23 5.23 0 01.7 2.93 5.23 5.23 0 01-.7 2.93A2.44 2.44 0 0119.63 22.13zm0-1.22a1.07 1.07 0 001-.55A3.38 3.38 0 0021 18.85V17.47a3.31 3.31 0 00-.29-1.5 1.23 1.23 0 00-2.06 0 3.31 3.31 0 00-.29 1.5v1.38a3.38 3.38 0 00.29 1.51A1.06 1.06 0 0019.63 20.91zM10.63 22V20.82h2V15.63l-1.86 1-.55-1.06 2.32-1.3H14v6.5h1.78V22z" } }], "name": "rewind--10", "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=\"M4,18A12,12,0,1,0,16,6H12V1L6,7l6,6V8h4A10,10,0,1,1,6,18Z\"></path><path d=\"M19.63 22.13a2.84 2.84 0 01-1.28-.27 2.44 2.44 0 01-.89-.77 3.57 3.57 0 01-.52-1.25 7.69 7.69 0 01-.17-1.68 7.83 7.83 0 01.17-1.68 3.65 3.65 0 01.52-1.25 2.44 2.44 0 01.89-.77 2.84 2.84 0 011.28-.27 2.44 2.44 0 012.16 1 5.23 5.23 0 01.7 2.93 5.23 5.23 0 01-.7 2.93A2.44 2.44 0 0119.63 22.13zm0-1.22a1.07 1.07 0 001-.55A3.38 3.38 0 0021 18.85V17.47a3.31 3.31 0 00-.29-1.5 1.23 1.23 0 00-2.06 0 3.31 3.31 0 00-.29 1.5v1.38a3.38 3.38 0 00.29 1.51A1.06 1.06 0 0019.63 20.91zM10.63 22V20.82h2V15.63l-1.86 1-.55-1.06 2.32-1.3H14v6.5h1.78V22z\"></path></svg>"
},
"24": {
metadata: { "moduleName": "Rewind_1024", "filepath": "rewind--10/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": "M4,18A12,12,0,1,0,16,6H12V1L6,7l6,6V8h4A10,10,0,1,1,6,18Z" } }, { "elem": "path", "attrs": { "d": "M19.63 22.13a2.84 2.84 0 01-1.28-.27 2.44 2.44 0 01-.89-.77 3.57 3.57 0 01-.52-1.25 7.69 7.69 0 01-.17-1.68 7.83 7.83 0 01.17-1.68 3.65 3.65 0 01.52-1.25 2.44 2.44 0 01.89-.77 2.84 2.84 0 011.28-.27 2.44 2.44 0 012.16 1 5.23 5.23 0 01.7 2.93 5.23 5.23 0 01-.7 2.93A2.44 2.44 0 0119.63 22.13zm0-1.22a1.07 1.07 0 001-.55A3.38 3.38 0 0021 18.85V17.47a3.31 3.31 0 00-.29-1.5 1.23 1.23 0 00-2.06 0 3.31 3.31 0 00-.29 1.5v1.38a3.38 3.38 0 00.29 1.51A1.06 1.06 0 0019.63 20.91zM10.63 22V20.82h2V15.63l-1.86 1-.55-1.06 2.32-1.3H14v6.5h1.78V22z" } }], "name": "rewind--10", "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=\"M4,18A12,12,0,1,0,16,6H12V1L6,7l6,6V8h4A10,10,0,1,1,6,18Z\"></path><path d=\"M19.63 22.13a2.84 2.84 0 01-1.28-.27 2.44 2.44 0 01-.89-.77 3.57 3.57 0 01-.52-1.25 7.69 7.69 0 01-.17-1.68 7.83 7.83 0 01.17-1.68 3.65 3.65 0 01.52-1.25 2.44 2.44 0 01.89-.77 2.84 2.84 0 011.28-.27 2.44 2.44 0 012.16 1 5.23 5.23 0 01.7 2.93 5.23 5.23 0 01-.7 2.93A2.44 2.44 0 0119.63 22.13zm0-1.22a1.07 1.07 0 001-.55A3.38 3.38 0 0021 18.85V17.47a3.31 3.31 0 00-.29-1.5 1.23 1.23 0 00-2.06 0 3.31 3.31 0 00-.29 1.5v1.38a3.38 3.38 0 00.29 1.51A1.06 1.06 0 0019.63 20.91zM10.63 22V20.82h2V15.63l-1.86 1-.55-1.06 2.32-1.3H14v6.5h1.78V22z\"></path></svg>"
},
"20": {
metadata: { "moduleName": "Rewind_1020", "filepath": "rewind--10/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": "M4,18A12,12,0,1,0,16,6H12V1L6,7l6,6V8h4A10,10,0,1,1,6,18Z" } }, { "elem": "path", "attrs": { "d": "M19.63 22.13a2.84 2.84 0 01-1.28-.27 2.44 2.44 0 01-.89-.77 3.57 3.57 0 01-.52-1.25 7.69 7.69 0 01-.17-1.68 7.83 7.83 0 01.17-1.68 3.65 3.65 0 01.52-1.25 2.44 2.44 0 01.89-.77 2.84 2.84 0 011.28-.27 2.44 2.44 0 012.16 1 5.23 5.23 0 01.7 2.93 5.23 5.23 0 01-.7 2.93A2.44 2.44 0 0119.63 22.13zm0-1.22a1.07 1.07 0 001-.55A3.38 3.38 0 0021 18.85V17.47a3.31 3.31 0 00-.29-1.5 1.23 1.23 0 00-2.06 0 3.31 3.31 0 00-.29 1.5v1.38a3.38 3.38 0 00.29 1.51A1.06 1.06 0 0019.63 20.91zM10.63 22V20.82h2V15.63l-1.86 1-.55-1.06 2.32-1.3H14v6.5h1.78V22z" } }], "name": "rewind--10", "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=\"M4,18A12,12,0,1,0,16,6H12V1L6,7l6,6V8h4A10,10,0,1,1,6,18Z\"></path><path d=\"M19.63 22.13a2.84 2.84 0 01-1.28-.27 2.44 2.44 0 01-.89-.77 3.57 3.57 0 01-.52-1.25 7.69 7.69 0 01-.17-1.68 7.83 7.83 0 01.17-1.68 3.65 3.65 0 01.52-1.25 2.44 2.44 0 01.89-.77 2.84 2.84 0 011.28-.27 2.44 2.44 0 012.16 1 5.23 5.23 0 01.7 2.93 5.23 5.23 0 01-.7 2.93A2.44 2.44 0 0119.63 22.13zm0-1.22a1.07 1.07 0 001-.55A3.38 3.38 0 0021 18.85V17.47a3.31 3.31 0 00-.29-1.5 1.23 1.23 0 00-2.06 0 3.31 3.31 0 00-.29 1.5v1.38a3.38 3.38 0 00.29 1.51A1.06 1.06 0 0019.63 20.91zM10.63 22V20.82h2V15.63l-1.86 1-.55-1.06 2.32-1.3H14v6.5h1.78V22z\"></path></svg>"
},
"16": {
metadata: { "moduleName": "Rewind_1016", "filepath": "rewind--10/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": "M4,18A12,12,0,1,0,16,6H12V1L6,7l6,6V8h4A10,10,0,1,1,6,18Z" } }, { "elem": "path", "attrs": { "d": "M19.63 22.13a2.84 2.84 0 01-1.28-.27 2.44 2.44 0 01-.89-.77 3.57 3.57 0 01-.52-1.25 7.69 7.69 0 01-.17-1.68 7.83 7.83 0 01.17-1.68 3.65 3.65 0 01.52-1.25 2.44 2.44 0 01.89-.77 2.84 2.84 0 011.28-.27 2.44 2.44 0 012.16 1 5.23 5.23 0 01.7 2.93 5.23 5.23 0 01-.7 2.93A2.44 2.44 0 0119.63 22.13zm0-1.22a1.07 1.07 0 001-.55A3.38 3.38 0 0021 18.85V17.47a3.31 3.31 0 00-.29-1.5 1.23 1.23 0 00-2.06 0 3.31 3.31 0 00-.29 1.5v1.38a3.38 3.38 0 00.29 1.51A1.06 1.06 0 0019.63 20.91zM10.63 22V20.82h2V15.63l-1.86 1-.55-1.06 2.32-1.3H14v6.5h1.78V22z" } }], "name": "rewind--10", "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=\"M4,18A12,12,0,1,0,16,6H12V1L6,7l6,6V8h4A10,10,0,1,1,6,18Z\"></path><path d=\"M19.63 22.13a2.84 2.84 0 01-1.28-.27 2.44 2.44 0 01-.89-.77 3.57 3.57 0 01-.52-1.25 7.69 7.69 0 01-.17-1.68 7.83 7.83 0 01.17-1.68 3.65 3.65 0 01.52-1.25 2.44 2.44 0 01.89-.77 2.84 2.84 0 011.28-.27 2.44 2.44 0 012.16 1 5.23 5.23 0 01.7 2.93 5.23 5.23 0 01-.7 2.93A2.44 2.44 0 0119.63 22.13zm0-1.22a1.07 1.07 0 001-.55A3.38 3.38 0 0021 18.85V17.47a3.31 3.31 0 00-.29-1.5 1.23 1.23 0 00-2.06 0 3.31 3.31 0 00-.29 1.5v1.38a3.38 3.38 0 00.29 1.51A1.06 1.06 0 0019.63 20.91zM10.63 22V20.82h2V15.63l-1.86 1-.55-1.06 2.32-1.3H14v6.5h1.78V22z\"></path></svg>"
},
};
}
Rewind_10Directive_1 = Rewind_10Directive;
Rewind_10Directive.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;
Rewind_10Directive_1.titleIdCounter++;
title.setAttribute("id", "rewind-10-" + Rewind_10Directive_1.titleIdCounter);
svg.appendChild(title);
svg.setAttribute("aria-labelledby", "rewind-10-" + Rewind_10Directive_1.titleIdCounter);
}
};
var Rewind_10Directive_1;
Rewind_10Directive.titleIdCounter = 0;
Rewind_10Directive.ctorParameters = function () { return [
{ type: ElementRef }
]; };
__decorate([
Input(),
__metadata("design:type", String)
], Rewind_10Directive.prototype, "ariaLabel", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], Rewind_10Directive.prototype, "ariaLabelledby", void 0);
__decorate([
Input(),
__metadata("design:type", Boolean)
], Rewind_10Directive.prototype, "ariaHidden", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], Rewind_10Directive.prototype, "title", void 0);
__decorate([
Input(),
__metadata("design:type", Boolean)
], Rewind_10Directive.prototype, "isFocusable", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], Rewind_10Directive.prototype, "size", void 0);
Rewind_10Directive = Rewind_10Directive_1 = __decorate([
Directive({
selector: "[ibmIconRewind_10]"
}),
__metadata("design:paramtypes", [ElementRef])
], Rewind_10Directive);
return Rewind_10Directive;
}());
var Rewind_10Module = /** @class */ (function () {
function Rewind_10Module() {
}
Rewind_10Module = __decorate([
NgModule({
declarations: [
Rewind_10Component,
Rewind_10Directive,
],
exports: [
Rewind_10Component,
Rewind_10Directive,
]
})
], Rewind_10Module);
return Rewind_10Module;
}());
export { Rewind_10Component, Rewind_10Directive, Rewind_10Module };