@carbon/icons-angular
Version:
Angular components for icons in digital and software products using the Carbon Design System
169 lines (166 loc) • 11 kB
JavaScript
import { __decorate, __metadata } from 'tslib';
import { Input, Component, ElementRef, Directive, NgModule } from '@angular/core';
import { getAttributes } from '@carbon/icon-helpers';
var NotificationOffFilledComponent = /** @class */ (function () {
function NotificationOffFilledComponent() {
this.focusable = false;
}
__decorate([
Input(),
__metadata("design:type", String)
], NotificationOffFilledComponent.prototype, "ariaLabel", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], NotificationOffFilledComponent.prototype, "ariaLabelledby", void 0);
__decorate([
Input(),
__metadata("design:type", Boolean)
], NotificationOffFilledComponent.prototype, "ariaHidden", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], NotificationOffFilledComponent.prototype, "title", void 0);
__decorate([
Input(),
__metadata("design:type", Boolean)
], NotificationOffFilledComponent.prototype, "focusable", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], NotificationOffFilledComponent.prototype, "innerClass", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], NotificationOffFilledComponent.prototype, "size", void 0);
NotificationOffFilledComponent = __decorate([
Component({
selector: "ibm-icon-notification-off-filled",
template: "\n <svg\n ibmIconNotificationOffFilled\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 "
})
], NotificationOffFilledComponent);
return NotificationOffFilledComponent;
}());
var NotificationOffFilledDirective = /** @class */ (function () {
function NotificationOffFilledDirective(elementRef) {
this.elementRef = elementRef;
this.isFocusable = false;
this.icons = {
"32": {
metadata: { "moduleName": "NotificationOffFilled32", "filepath": "notification--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 17.6V13a10 10 0 00-1.09-4.5L30 3.41 28.59 2 2 28.59 3.41 30l5-5H11a5 5 0 0010 0h7a.94.94 0 001-1V21a.91.91 0 00-.3-.7zM16 28a3 3 0 01-3-3h6A3 3 0 0116 28zM21.63 4.72A9.78 9.78 0 0017 3V1H15V3A10.15 10.15 0 006 13v4.6L3.3 20.3A.91.91 0 003 21v2.34z" } }], "name": "notification--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 17.6V13a10 10 0 00-1.09-4.5L30 3.41 28.59 2 2 28.59 3.41 30l5-5H11a5 5 0 0010 0h7a.94.94 0 001-1V21a.91.91 0 00-.3-.7zM16 28a3 3 0 01-3-3h6A3 3 0 0116 28zM21.63 4.72A9.78 9.78 0 0017 3V1H15V3A10.15 10.15 0 006 13v4.6L3.3 20.3A.91.91 0 003 21v2.34z\"></path></svg>"
},
"24": {
metadata: { "moduleName": "NotificationOffFilled24", "filepath": "notification--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 17.6V13a10 10 0 00-1.09-4.5L30 3.41 28.59 2 2 28.59 3.41 30l5-5H11a5 5 0 0010 0h7a.94.94 0 001-1V21a.91.91 0 00-.3-.7zM16 28a3 3 0 01-3-3h6A3 3 0 0116 28zM21.63 4.72A9.78 9.78 0 0017 3V1H15V3A10.15 10.15 0 006 13v4.6L3.3 20.3A.91.91 0 003 21v2.34z" } }], "name": "notification--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 17.6V13a10 10 0 00-1.09-4.5L30 3.41 28.59 2 2 28.59 3.41 30l5-5H11a5 5 0 0010 0h7a.94.94 0 001-1V21a.91.91 0 00-.3-.7zM16 28a3 3 0 01-3-3h6A3 3 0 0116 28zM21.63 4.72A9.78 9.78 0 0017 3V1H15V3A10.15 10.15 0 006 13v4.6L3.3 20.3A.91.91 0 003 21v2.34z\"></path></svg>"
},
"20": {
metadata: { "moduleName": "NotificationOffFilled20", "filepath": "notification--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 17.6V13a10 10 0 00-1.09-4.5L30 3.41 28.59 2 2 28.59 3.41 30l5-5H11a5 5 0 0010 0h7a.94.94 0 001-1V21a.91.91 0 00-.3-.7zM16 28a3 3 0 01-3-3h6A3 3 0 0116 28zM21.63 4.72A9.78 9.78 0 0017 3V1H15V3A10.15 10.15 0 006 13v4.6L3.3 20.3A.91.91 0 003 21v2.34z" } }], "name": "notification--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 17.6V13a10 10 0 00-1.09-4.5L30 3.41 28.59 2 2 28.59 3.41 30l5-5H11a5 5 0 0010 0h7a.94.94 0 001-1V21a.91.91 0 00-.3-.7zM16 28a3 3 0 01-3-3h6A3 3 0 0116 28zM21.63 4.72A9.78 9.78 0 0017 3V1H15V3A10.15 10.15 0 006 13v4.6L3.3 20.3A.91.91 0 003 21v2.34z\"></path></svg>"
},
"16": {
metadata: { "moduleName": "NotificationOffFilled16", "filepath": "notification--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 17.6V13a10 10 0 00-1.09-4.5L30 3.41 28.59 2 2 28.59 3.41 30l5-5H11a5 5 0 0010 0h7a.94.94 0 001-1V21a.91.91 0 00-.3-.7zM16 28a3 3 0 01-3-3h6A3 3 0 0116 28zM21.63 4.72A9.78 9.78 0 0017 3V1H15V3A10.15 10.15 0 006 13v4.6L3.3 20.3A.91.91 0 003 21v2.34z" } }], "name": "notification--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 17.6V13a10 10 0 00-1.09-4.5L30 3.41 28.59 2 2 28.59 3.41 30l5-5H11a5 5 0 0010 0h7a.94.94 0 001-1V21a.91.91 0 00-.3-.7zM16 28a3 3 0 01-3-3h6A3 3 0 0116 28zM21.63 4.72A9.78 9.78 0 0017 3V1H15V3A10.15 10.15 0 006 13v4.6L3.3 20.3A.91.91 0 003 21v2.34z\"></path></svg>"
},
};
}
NotificationOffFilledDirective_1 = NotificationOffFilledDirective;
NotificationOffFilledDirective.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;
NotificationOffFilledDirective_1.titleIdCounter++;
title.setAttribute("id", "notification-off-filled-" + NotificationOffFilledDirective_1.titleIdCounter);
svg.appendChild(title);
svg.setAttribute("aria-labelledby", "notification-off-filled-" + NotificationOffFilledDirective_1.titleIdCounter);
}
};
var NotificationOffFilledDirective_1;
NotificationOffFilledDirective.titleIdCounter = 0;
NotificationOffFilledDirective.ctorParameters = function () { return [
{ type: ElementRef }
]; };
__decorate([
Input(),
__metadata("design:type", String)
], NotificationOffFilledDirective.prototype, "ariaLabel", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], NotificationOffFilledDirective.prototype, "ariaLabelledby", void 0);
__decorate([
Input(),
__metadata("design:type", Boolean)
], NotificationOffFilledDirective.prototype, "ariaHidden", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], NotificationOffFilledDirective.prototype, "title", void 0);
__decorate([
Input(),
__metadata("design:type", Boolean)
], NotificationOffFilledDirective.prototype, "isFocusable", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], NotificationOffFilledDirective.prototype, "size", void 0);
NotificationOffFilledDirective = NotificationOffFilledDirective_1 = __decorate([
Directive({
selector: "[ibmIconNotificationOffFilled]"
}),
__metadata("design:paramtypes", [ElementRef])
], NotificationOffFilledDirective);
return NotificationOffFilledDirective;
}());
var NotificationOffFilledModule = /** @class */ (function () {
function NotificationOffFilledModule() {
}
NotificationOffFilledModule = __decorate([
NgModule({
declarations: [
NotificationOffFilledComponent,
NotificationOffFilledDirective,
],
exports: [
NotificationOffFilledComponent,
NotificationOffFilledDirective,
]
})
], NotificationOffFilledModule);
return NotificationOffFilledModule;
}());
export { NotificationOffFilledComponent, NotificationOffFilledDirective, NotificationOffFilledModule };