@carbon/icons-angular
Version:
Angular components for icons in digital and software products using the Carbon Design System
177 lines (172 loc) • 13.2 kB
JavaScript
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('tslib'), require('/core'), require('@carbon/icon-helpers')) :
typeof define === 'function' && define.amd ? define(['exports', 'tslib', '/core', '@carbon/icon-helpers'], factory) :
(global = global || self, factory((global.CarbonIconsAngular = global.CarbonIconsAngular || {}, global.CarbonIconsAngular.NotificationOff = {}), global.tslib, global.ng.core, global.CarbonIconHelpers));
}(this, (function (exports, tslib, core, iconHelpers) { 'use strict';
var NotificationOffComponent = /** @class */ (function () {
function NotificationOffComponent() {
this.focusable = false;
}
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], NotificationOffComponent.prototype, "ariaLabel", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], NotificationOffComponent.prototype, "ariaLabelledby", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", Boolean)
], NotificationOffComponent.prototype, "ariaHidden", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], NotificationOffComponent.prototype, "title", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", Boolean)
], NotificationOffComponent.prototype, "focusable", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], NotificationOffComponent.prototype, "innerClass", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], NotificationOffComponent.prototype, "size", void 0);
NotificationOffComponent = tslib.__decorate([
core.Component({
selector: "ibm-icon-notification-off",
template: "\n <svg\n ibmIconNotificationOff\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 "
})
], NotificationOffComponent);
return NotificationOffComponent;
}());
var NotificationOffDirective = /** @class */ (function () {
function NotificationOffDirective(elementRef) {
this.elementRef = elementRef;
this.isFocusable = false;
this.icons = {
"32": {
metadata: { "moduleName": "NotificationOff32", "filepath": "notification--off/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": "M5 23V21.4l2.7-2.7A.91.91 0 008 18V13A8 8 0 0121 6.76l1.44-1.43A9.79 9.79 0 0017 3V1H15V3A10.15 10.15 0 006 13v4.6L3.3 20.3A.91.91 0 003 21v2zM26 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 28zm11-5H10.42l13-13A8.06 8.06 0 0124 13v5a.91.91 0 00.3.7L27 21.4z" } }], "name": "notification--off", "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=\"M5 23V21.4l2.7-2.7A.91.91 0 008 18V13A8 8 0 0121 6.76l1.44-1.43A9.79 9.79 0 0017 3V1H15V3A10.15 10.15 0 006 13v4.6L3.3 20.3A.91.91 0 003 21v2zM26 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 28zm11-5H10.42l13-13A8.06 8.06 0 0124 13v5a.91.91 0 00.3.7L27 21.4z\"></path></svg>"
},
"24": {
metadata: { "moduleName": "NotificationOff24", "filepath": "notification--off/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": "M5 23V21.4l2.7-2.7A.91.91 0 008 18V13A8 8 0 0121 6.76l1.44-1.43A9.79 9.79 0 0017 3V1H15V3A10.15 10.15 0 006 13v4.6L3.3 20.3A.91.91 0 003 21v2zM26 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 28zm11-5H10.42l13-13A8.06 8.06 0 0124 13v5a.91.91 0 00.3.7L27 21.4z" } }], "name": "notification--off", "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=\"M5 23V21.4l2.7-2.7A.91.91 0 008 18V13A8 8 0 0121 6.76l1.44-1.43A9.79 9.79 0 0017 3V1H15V3A10.15 10.15 0 006 13v4.6L3.3 20.3A.91.91 0 003 21v2zM26 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 28zm11-5H10.42l13-13A8.06 8.06 0 0124 13v5a.91.91 0 00.3.7L27 21.4z\"></path></svg>"
},
"20": {
metadata: { "moduleName": "NotificationOff20", "filepath": "notification--off/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": "M5 23V21.4l2.7-2.7A.91.91 0 008 18V13A8 8 0 0121 6.76l1.44-1.43A9.79 9.79 0 0017 3V1H15V3A10.15 10.15 0 006 13v4.6L3.3 20.3A.91.91 0 003 21v2zM26 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 28zm11-5H10.42l13-13A8.06 8.06 0 0124 13v5a.91.91 0 00.3.7L27 21.4z" } }], "name": "notification--off", "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=\"M5 23V21.4l2.7-2.7A.91.91 0 008 18V13A8 8 0 0121 6.76l1.44-1.43A9.79 9.79 0 0017 3V1H15V3A10.15 10.15 0 006 13v4.6L3.3 20.3A.91.91 0 003 21v2zM26 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 28zm11-5H10.42l13-13A8.06 8.06 0 0124 13v5a.91.91 0 00.3.7L27 21.4z\"></path></svg>"
},
"16": {
metadata: { "moduleName": "NotificationOff16", "filepath": "notification--off/16.js", "descriptor": { "elem": "svg", "attrs": { "xmlns": "http://www.w3.org/2000/svg", "viewBox": "0 0 16 16", "fill": "currentColor", "width": 16, "height": 16 }, "content": [{ "elem": "path", "attrs": { "d": "M2.5 11.5v-.8l1.3-1.4C3.9 9.3 4 9.1 4 9V6.5c0-2.2 1.8-4 4-4 .9 0 1.8.3 2.5.9l.7-.7C10.5 2 9.5 1.6 8.5 1.5v-1h-1v1C5 1.8 3 3.9 3 6.5v2.3l-1.4 1.3c-.1.1-.2.2-.1.4v1H2.5zM13 8.8V6.5c0-.8-.2-1.6-.5-2.2L15 1.7 14.3 1 1 14.3 1.7 15l2.5-2.5h1.3C5.5 13.9 6.6 15 8 15s2.5-1.1 2.5-2.5H14c.3 0 .5-.2.5-.4 0 0 0 0 0-.1v-1.5c0-.1-.1-.3-.1-.4L13 8.8zM8 14c-.8 0-1.5-.7-1.5-1.5h3C9.5 13.3 8.8 14 8 14zM13.5 11.5H5.2L11.7 5C11.9 5.5 12 6 12 6.5V9c0 .1.1.3.1.4l1.4 1.3V11.5z" } }], "name": "notification--off", "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 16 16\" aria-hidden=\"true\"><path d=\"M2.5 11.5v-.8l1.3-1.4C3.9 9.3 4 9.1 4 9V6.5c0-2.2 1.8-4 4-4 .9 0 1.8.3 2.5.9l.7-.7C10.5 2 9.5 1.6 8.5 1.5v-1h-1v1C5 1.8 3 3.9 3 6.5v2.3l-1.4 1.3c-.1.1-.2.2-.1.4v1H2.5zM13 8.8V6.5c0-.8-.2-1.6-.5-2.2L15 1.7 14.3 1 1 14.3 1.7 15l2.5-2.5h1.3C5.5 13.9 6.6 15 8 15s2.5-1.1 2.5-2.5H14c.3 0 .5-.2.5-.4 0 0 0 0 0-.1v-1.5c0-.1-.1-.3-.1-.4L13 8.8zM8 14c-.8 0-1.5-.7-1.5-1.5h3C9.5 13.3 8.8 14 8 14zM13.5 11.5H5.2L11.7 5C11.9 5.5 12 6 12 6.5V9c0 .1.1.3.1.4l1.4 1.3V11.5z\"></path></svg>"
},
};
}
NotificationOffDirective_1 = NotificationOffDirective;
NotificationOffDirective.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 = iconHelpers.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;
NotificationOffDirective_1.titleIdCounter++;
title.setAttribute("id", "notification-off-" + NotificationOffDirective_1.titleIdCounter);
svg.appendChild(title);
svg.setAttribute("aria-labelledby", "notification-off-" + NotificationOffDirective_1.titleIdCounter);
}
};
var NotificationOffDirective_1;
NotificationOffDirective.titleIdCounter = 0;
NotificationOffDirective.ctorParameters = function () { return [
{ type: core.ElementRef }
]; };
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], NotificationOffDirective.prototype, "ariaLabel", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], NotificationOffDirective.prototype, "ariaLabelledby", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", Boolean)
], NotificationOffDirective.prototype, "ariaHidden", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], NotificationOffDirective.prototype, "title", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", Boolean)
], NotificationOffDirective.prototype, "isFocusable", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], NotificationOffDirective.prototype, "size", void 0);
NotificationOffDirective = NotificationOffDirective_1 = tslib.__decorate([
core.Directive({
selector: "[ibmIconNotificationOff]"
}),
tslib.__metadata("design:paramtypes", [core.ElementRef])
], NotificationOffDirective);
return NotificationOffDirective;
}());
var NotificationOffModule = /** @class */ (function () {
function NotificationOffModule() {
}
NotificationOffModule = tslib.__decorate([
core.NgModule({
declarations: [
NotificationOffComponent,
NotificationOffDirective,
],
exports: [
NotificationOffComponent,
NotificationOffDirective,
]
})
], NotificationOffModule);
return NotificationOffModule;
}());
exports.NotificationOffComponent = NotificationOffComponent;
exports.NotificationOffDirective = NotificationOffDirective;
exports.NotificationOffModule = NotificationOffModule;
Object.defineProperty(exports, '__esModule', { value: true });
})));