@carbon/icons-angular
Version:
Angular components for icons in digital and software products using the Carbon Design System
169 lines (166 loc) • 12.3 kB
JavaScript
import { __decorate, __metadata } from 'tslib';
import { Input, Component, ElementRef, Directive, NgModule } from '@angular/core';
import { getAttributes } from '@carbon/icon-helpers';
var PhoneOffComponent = /** @class */ (function () {
function PhoneOffComponent() {
this.focusable = false;
}
__decorate([
Input(),
__metadata("design:type", String)
], PhoneOffComponent.prototype, "ariaLabel", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], PhoneOffComponent.prototype, "ariaLabelledby", void 0);
__decorate([
Input(),
__metadata("design:type", Boolean)
], PhoneOffComponent.prototype, "ariaHidden", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], PhoneOffComponent.prototype, "title", void 0);
__decorate([
Input(),
__metadata("design:type", Boolean)
], PhoneOffComponent.prototype, "focusable", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], PhoneOffComponent.prototype, "innerClass", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], PhoneOffComponent.prototype, "size", void 0);
PhoneOffComponent = __decorate([
Component({
selector: "ibm-icon-phone-off",
template: "\n <svg\n ibmIconPhoneOff\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 "
})
], PhoneOffComponent);
return PhoneOffComponent;
}());
var PhoneOffDirective = /** @class */ (function () {
function PhoneOffDirective(elementRef) {
this.elementRef = elementRef;
this.isFocusable = false;
this.icons = {
"32": {
metadata: { "moduleName": "PhoneOff32", "filepath": "phone--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": "M9.19 18.56A25.66 25.66 0 015 6.08V6A1 1 0 016 5h5.28l1.5 3.77L9.94 11.64l.06.48a13 13 0 001.46 4.17l1.46-1.46a9.34 9.34 0 01-.84-2.52l2.13-2.15A2 2 0 0014.65 8L13.13 4.26A2 2 0 0011.27 3H5.76A3 3 0 003 6.23 28 28 0 007.79 20zM27.77 18.86L24 17.35a2 2 0 00-2.17.41l-2.17 2.15A9.17 9.17 0 0115.45 18L30 3.41 28.59 2 2 28.59 3.41 30l7-7c3.38 3.18 8.28 5.62 15.39 6H26a3 3 0 003-3V20.72A2 2 0 0027.77 18.86zM27 26v.06a1 1 0 01-1.06.94c-6.51-.37-11-2.54-14.11-5.42L14 19.44A10.77 10.77 0 0019.88 22l.48.06 2.87-2.85L27 20.72z" } }], "name": "phone--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=\"M9.19 18.56A25.66 25.66 0 015 6.08V6A1 1 0 016 5h5.28l1.5 3.77L9.94 11.64l.06.48a13 13 0 001.46 4.17l1.46-1.46a9.34 9.34 0 01-.84-2.52l2.13-2.15A2 2 0 0014.65 8L13.13 4.26A2 2 0 0011.27 3H5.76A3 3 0 003 6.23 28 28 0 007.79 20zM27.77 18.86L24 17.35a2 2 0 00-2.17.41l-2.17 2.15A9.17 9.17 0 0115.45 18L30 3.41 28.59 2 2 28.59 3.41 30l7-7c3.38 3.18 8.28 5.62 15.39 6H26a3 3 0 003-3V20.72A2 2 0 0027.77 18.86zM27 26v.06a1 1 0 01-1.06.94c-6.51-.37-11-2.54-14.11-5.42L14 19.44A10.77 10.77 0 0019.88 22l.48.06 2.87-2.85L27 20.72z\"></path></svg>"
},
"24": {
metadata: { "moduleName": "PhoneOff24", "filepath": "phone--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": "M9.19 18.56A25.66 25.66 0 015 6.08V6A1 1 0 016 5h5.28l1.5 3.77L9.94 11.64l.06.48a13 13 0 001.46 4.17l1.46-1.46a9.34 9.34 0 01-.84-2.52l2.13-2.15A2 2 0 0014.65 8L13.13 4.26A2 2 0 0011.27 3H5.76A3 3 0 003 6.23 28 28 0 007.79 20zM27.77 18.86L24 17.35a2 2 0 00-2.17.41l-2.17 2.15A9.17 9.17 0 0115.45 18L30 3.41 28.59 2 2 28.59 3.41 30l7-7c3.38 3.18 8.28 5.62 15.39 6H26a3 3 0 003-3V20.72A2 2 0 0027.77 18.86zM27 26v.06a1 1 0 01-1.06.94c-6.51-.37-11-2.54-14.11-5.42L14 19.44A10.77 10.77 0 0019.88 22l.48.06 2.87-2.85L27 20.72z" } }], "name": "phone--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=\"M9.19 18.56A25.66 25.66 0 015 6.08V6A1 1 0 016 5h5.28l1.5 3.77L9.94 11.64l.06.48a13 13 0 001.46 4.17l1.46-1.46a9.34 9.34 0 01-.84-2.52l2.13-2.15A2 2 0 0014.65 8L13.13 4.26A2 2 0 0011.27 3H5.76A3 3 0 003 6.23 28 28 0 007.79 20zM27.77 18.86L24 17.35a2 2 0 00-2.17.41l-2.17 2.15A9.17 9.17 0 0115.45 18L30 3.41 28.59 2 2 28.59 3.41 30l7-7c3.38 3.18 8.28 5.62 15.39 6H26a3 3 0 003-3V20.72A2 2 0 0027.77 18.86zM27 26v.06a1 1 0 01-1.06.94c-6.51-.37-11-2.54-14.11-5.42L14 19.44A10.77 10.77 0 0019.88 22l.48.06 2.87-2.85L27 20.72z\"></path></svg>"
},
"20": {
metadata: { "moduleName": "PhoneOff20", "filepath": "phone--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": "M9.19 18.56A25.66 25.66 0 015 6.08V6A1 1 0 016 5h5.28l1.5 3.77L9.94 11.64l.06.48a13 13 0 001.46 4.17l1.46-1.46a9.34 9.34 0 01-.84-2.52l2.13-2.15A2 2 0 0014.65 8L13.13 4.26A2 2 0 0011.27 3H5.76A3 3 0 003 6.23 28 28 0 007.79 20zM27.77 18.86L24 17.35a2 2 0 00-2.17.41l-2.17 2.15A9.17 9.17 0 0115.45 18L30 3.41 28.59 2 2 28.59 3.41 30l7-7c3.38 3.18 8.28 5.62 15.39 6H26a3 3 0 003-3V20.72A2 2 0 0027.77 18.86zM27 26v.06a1 1 0 01-1.06.94c-6.51-.37-11-2.54-14.11-5.42L14 19.44A10.77 10.77 0 0019.88 22l.48.06 2.87-2.85L27 20.72z" } }], "name": "phone--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=\"M9.19 18.56A25.66 25.66 0 015 6.08V6A1 1 0 016 5h5.28l1.5 3.77L9.94 11.64l.06.48a13 13 0 001.46 4.17l1.46-1.46a9.34 9.34 0 01-.84-2.52l2.13-2.15A2 2 0 0014.65 8L13.13 4.26A2 2 0 0011.27 3H5.76A3 3 0 003 6.23 28 28 0 007.79 20zM27.77 18.86L24 17.35a2 2 0 00-2.17.41l-2.17 2.15A9.17 9.17 0 0115.45 18L30 3.41 28.59 2 2 28.59 3.41 30l7-7c3.38 3.18 8.28 5.62 15.39 6H26a3 3 0 003-3V20.72A2 2 0 0027.77 18.86zM27 26v.06a1 1 0 01-1.06.94c-6.51-.37-11-2.54-14.11-5.42L14 19.44A10.77 10.77 0 0019.88 22l.48.06 2.87-2.85L27 20.72z\"></path></svg>"
},
"16": {
metadata: { "moduleName": "PhoneOff16", "filepath": "phone--off/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": "M9.19 18.56A25.66 25.66 0 015 6.08V6A1 1 0 016 5h5.28l1.5 3.77L9.94 11.64l.06.48a13 13 0 001.46 4.17l1.46-1.46a9.34 9.34 0 01-.84-2.52l2.13-2.15A2 2 0 0014.65 8L13.13 4.26A2 2 0 0011.27 3H5.76A3 3 0 003 6.23 28 28 0 007.79 20zM27.77 18.86L24 17.35a2 2 0 00-2.17.41l-2.17 2.15A9.17 9.17 0 0115.45 18L30 3.41 28.59 2 2 28.59 3.41 30l7-7c3.38 3.18 8.28 5.62 15.39 6H26a3 3 0 003-3V20.72A2 2 0 0027.77 18.86zM27 26v.06a1 1 0 01-1.06.94c-6.51-.37-11-2.54-14.11-5.42L14 19.44A10.77 10.77 0 0019.88 22l.48.06 2.87-2.85L27 20.72z" } }], "name": "phone--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 32 32\" aria-hidden=\"true\"><path d=\"M9.19 18.56A25.66 25.66 0 015 6.08V6A1 1 0 016 5h5.28l1.5 3.77L9.94 11.64l.06.48a13 13 0 001.46 4.17l1.46-1.46a9.34 9.34 0 01-.84-2.52l2.13-2.15A2 2 0 0014.65 8L13.13 4.26A2 2 0 0011.27 3H5.76A3 3 0 003 6.23 28 28 0 007.79 20zM27.77 18.86L24 17.35a2 2 0 00-2.17.41l-2.17 2.15A9.17 9.17 0 0115.45 18L30 3.41 28.59 2 2 28.59 3.41 30l7-7c3.38 3.18 8.28 5.62 15.39 6H26a3 3 0 003-3V20.72A2 2 0 0027.77 18.86zM27 26v.06a1 1 0 01-1.06.94c-6.51-.37-11-2.54-14.11-5.42L14 19.44A10.77 10.77 0 0019.88 22l.48.06 2.87-2.85L27 20.72z\"></path></svg>"
},
};
}
PhoneOffDirective_1 = PhoneOffDirective;
PhoneOffDirective.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;
PhoneOffDirective_1.titleIdCounter++;
title.setAttribute("id", "phone-off-" + PhoneOffDirective_1.titleIdCounter);
svg.appendChild(title);
svg.setAttribute("aria-labelledby", "phone-off-" + PhoneOffDirective_1.titleIdCounter);
}
};
var PhoneOffDirective_1;
PhoneOffDirective.titleIdCounter = 0;
PhoneOffDirective.ctorParameters = function () { return [
{ type: ElementRef }
]; };
__decorate([
Input(),
__metadata("design:type", String)
], PhoneOffDirective.prototype, "ariaLabel", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], PhoneOffDirective.prototype, "ariaLabelledby", void 0);
__decorate([
Input(),
__metadata("design:type", Boolean)
], PhoneOffDirective.prototype, "ariaHidden", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], PhoneOffDirective.prototype, "title", void 0);
__decorate([
Input(),
__metadata("design:type", Boolean)
], PhoneOffDirective.prototype, "isFocusable", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], PhoneOffDirective.prototype, "size", void 0);
PhoneOffDirective = PhoneOffDirective_1 = __decorate([
Directive({
selector: "[ibmIconPhoneOff]"
}),
__metadata("design:paramtypes", [ElementRef])
], PhoneOffDirective);
return PhoneOffDirective;
}());
var PhoneOffModule = /** @class */ (function () {
function PhoneOffModule() {
}
PhoneOffModule = __decorate([
NgModule({
declarations: [
PhoneOffComponent,
PhoneOffDirective,
],
exports: [
PhoneOffComponent,
PhoneOffDirective,
]
})
], PhoneOffModule);
return PhoneOffModule;
}());
export { PhoneOffComponent, PhoneOffDirective, PhoneOffModule };