@carbon/icons-angular
Version:
Angular components for icons in digital and software products using the Carbon Design System
177 lines (172 loc) • 14.4 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.LogoLivestream = {}), global.tslib, global.ng.core, global.CarbonIconHelpers));
}(this, (function (exports, tslib, core, iconHelpers) { 'use strict';
var LogoLivestreamComponent = /** @class */ (function () {
function LogoLivestreamComponent() {
this.focusable = false;
}
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], LogoLivestreamComponent.prototype, "ariaLabel", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], LogoLivestreamComponent.prototype, "ariaLabelledby", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", Boolean)
], LogoLivestreamComponent.prototype, "ariaHidden", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], LogoLivestreamComponent.prototype, "title", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", Boolean)
], LogoLivestreamComponent.prototype, "focusable", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], LogoLivestreamComponent.prototype, "innerClass", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], LogoLivestreamComponent.prototype, "size", void 0);
LogoLivestreamComponent = tslib.__decorate([
core.Component({
selector: "ibm-icon-logo-livestream",
template: "\n <svg\n ibmIconLogoLivestream\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 "
})
], LogoLivestreamComponent);
return LogoLivestreamComponent;
}());
var LogoLivestreamDirective = /** @class */ (function () {
function LogoLivestreamDirective(elementRef) {
this.elementRef = elementRef;
this.isFocusable = false;
this.icons = {
"32": {
metadata: { "moduleName": "LogoLivestream32", "filepath": "logo--livestream/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": "M22.49 23.71h-.76c-2.26 0-4.52 0-6.78 0a3.12 3.12 0 01-2.41-1A14.91 14.91 0 0110 18.88c-1.3-2.6-2.54-5.22-3.82-7.82-.39-.8-.82-1.56-1.28-2.32A7.84 7.84 0 002 5.6c1.24 0 2.41 0 3.57 0a45.63 45.63 0 017 .61 8.09 8.09 0 016.34 5.09 48.51 48.51 0 012.17 7.36A26 26 0 0022.49 23.71zM28.1 26.38a2.93 2.93 0 01-2.74-2.64 42.08 42.08 0 01-.14-4.9 48 48 0 00-.61-7.58 3.75 3.75 0 00-.83-2h2.65c.54 0 .73.37.89.78A12.1 12.1 0 0128 13.28c.29 2.72.31 5.45.33 8.18a10.94 10.94 0 000 1.15c.09.78.4 1.1 1.17 1.08.5 0 .5-.06.5-.06v2.69A8.62 8.62 0 0128.1 26.38z" } }], "name": "logo--livestream", "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=\"M22.49 23.71h-.76c-2.26 0-4.52 0-6.78 0a3.12 3.12 0 01-2.41-1A14.91 14.91 0 0110 18.88c-1.3-2.6-2.54-5.22-3.82-7.82-.39-.8-.82-1.56-1.28-2.32A7.84 7.84 0 002 5.6c1.24 0 2.41 0 3.57 0a45.63 45.63 0 017 .61 8.09 8.09 0 016.34 5.09 48.51 48.51 0 012.17 7.36A26 26 0 0022.49 23.71zM28.1 26.38a2.93 2.93 0 01-2.74-2.64 42.08 42.08 0 01-.14-4.9 48 48 0 00-.61-7.58 3.75 3.75 0 00-.83-2h2.65c.54 0 .73.37.89.78A12.1 12.1 0 0128 13.28c.29 2.72.31 5.45.33 8.18a10.94 10.94 0 000 1.15c.09.78.4 1.1 1.17 1.08.5 0 .5-.06.5-.06v2.69A8.62 8.62 0 0128.1 26.38z\"></path></svg>"
},
"24": {
metadata: { "moduleName": "LogoLivestream24", "filepath": "logo--livestream/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": "M22.49 23.71h-.76c-2.26 0-4.52 0-6.78 0a3.12 3.12 0 01-2.41-1A14.91 14.91 0 0110 18.88c-1.3-2.6-2.54-5.22-3.82-7.82-.39-.8-.82-1.56-1.28-2.32A7.84 7.84 0 002 5.6c1.24 0 2.41 0 3.57 0a45.63 45.63 0 017 .61 8.09 8.09 0 016.34 5.09 48.51 48.51 0 012.17 7.36A26 26 0 0022.49 23.71zM28.1 26.38a2.93 2.93 0 01-2.74-2.64 42.08 42.08 0 01-.14-4.9 48 48 0 00-.61-7.58 3.75 3.75 0 00-.83-2h2.65c.54 0 .73.37.89.78A12.1 12.1 0 0128 13.28c.29 2.72.31 5.45.33 8.18a10.94 10.94 0 000 1.15c.09.78.4 1.1 1.17 1.08.5 0 .5-.06.5-.06v2.69A8.62 8.62 0 0128.1 26.38z" } }], "name": "logo--livestream", "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=\"M22.49 23.71h-.76c-2.26 0-4.52 0-6.78 0a3.12 3.12 0 01-2.41-1A14.91 14.91 0 0110 18.88c-1.3-2.6-2.54-5.22-3.82-7.82-.39-.8-.82-1.56-1.28-2.32A7.84 7.84 0 002 5.6c1.24 0 2.41 0 3.57 0a45.63 45.63 0 017 .61 8.09 8.09 0 016.34 5.09 48.51 48.51 0 012.17 7.36A26 26 0 0022.49 23.71zM28.1 26.38a2.93 2.93 0 01-2.74-2.64 42.08 42.08 0 01-.14-4.9 48 48 0 00-.61-7.58 3.75 3.75 0 00-.83-2h2.65c.54 0 .73.37.89.78A12.1 12.1 0 0128 13.28c.29 2.72.31 5.45.33 8.18a10.94 10.94 0 000 1.15c.09.78.4 1.1 1.17 1.08.5 0 .5-.06.5-.06v2.69A8.62 8.62 0 0128.1 26.38z\"></path></svg>"
},
"20": {
metadata: { "moduleName": "LogoLivestream20", "filepath": "logo--livestream/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": "M22.49 23.71h-.76c-2.26 0-4.52 0-6.78 0a3.12 3.12 0 01-2.41-1A14.91 14.91 0 0110 18.88c-1.3-2.6-2.54-5.22-3.82-7.82-.39-.8-.82-1.56-1.28-2.32A7.84 7.84 0 002 5.6c1.24 0 2.41 0 3.57 0a45.63 45.63 0 017 .61 8.09 8.09 0 016.34 5.09 48.51 48.51 0 012.17 7.36A26 26 0 0022.49 23.71zM28.1 26.38a2.93 2.93 0 01-2.74-2.64 42.08 42.08 0 01-.14-4.9 48 48 0 00-.61-7.58 3.75 3.75 0 00-.83-2h2.65c.54 0 .73.37.89.78A12.1 12.1 0 0128 13.28c.29 2.72.31 5.45.33 8.18a10.94 10.94 0 000 1.15c.09.78.4 1.1 1.17 1.08.5 0 .5-.06.5-.06v2.69A8.62 8.62 0 0128.1 26.38z" } }], "name": "logo--livestream", "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=\"M22.49 23.71h-.76c-2.26 0-4.52 0-6.78 0a3.12 3.12 0 01-2.41-1A14.91 14.91 0 0110 18.88c-1.3-2.6-2.54-5.22-3.82-7.82-.39-.8-.82-1.56-1.28-2.32A7.84 7.84 0 002 5.6c1.24 0 2.41 0 3.57 0a45.63 45.63 0 017 .61 8.09 8.09 0 016.34 5.09 48.51 48.51 0 012.17 7.36A26 26 0 0022.49 23.71zM28.1 26.38a2.93 2.93 0 01-2.74-2.64 42.08 42.08 0 01-.14-4.9 48 48 0 00-.61-7.58 3.75 3.75 0 00-.83-2h2.65c.54 0 .73.37.89.78A12.1 12.1 0 0128 13.28c.29 2.72.31 5.45.33 8.18a10.94 10.94 0 000 1.15c.09.78.4 1.1 1.17 1.08.5 0 .5-.06.5-.06v2.69A8.62 8.62 0 0128.1 26.38z\"></path></svg>"
},
"16": {
metadata: { "moduleName": "LogoLivestream16", "filepath": "logo--livestream/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": "M22.49 23.71h-.76c-2.26 0-4.52 0-6.78 0a3.12 3.12 0 01-2.41-1A14.91 14.91 0 0110 18.88c-1.3-2.6-2.54-5.22-3.82-7.82-.39-.8-.82-1.56-1.28-2.32A7.84 7.84 0 002 5.6c1.24 0 2.41 0 3.57 0a45.63 45.63 0 017 .61 8.09 8.09 0 016.34 5.09 48.51 48.51 0 012.17 7.36A26 26 0 0022.49 23.71zM28.1 26.38a2.93 2.93 0 01-2.74-2.64 42.08 42.08 0 01-.14-4.9 48 48 0 00-.61-7.58 3.75 3.75 0 00-.83-2h2.65c.54 0 .73.37.89.78A12.1 12.1 0 0128 13.28c.29 2.72.31 5.45.33 8.18a10.94 10.94 0 000 1.15c.09.78.4 1.1 1.17 1.08.5 0 .5-.06.5-.06v2.69A8.62 8.62 0 0128.1 26.38z" } }], "name": "logo--livestream", "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=\"M22.49 23.71h-.76c-2.26 0-4.52 0-6.78 0a3.12 3.12 0 01-2.41-1A14.91 14.91 0 0110 18.88c-1.3-2.6-2.54-5.22-3.82-7.82-.39-.8-.82-1.56-1.28-2.32A7.84 7.84 0 002 5.6c1.24 0 2.41 0 3.57 0a45.63 45.63 0 017 .61 8.09 8.09 0 016.34 5.09 48.51 48.51 0 012.17 7.36A26 26 0 0022.49 23.71zM28.1 26.38a2.93 2.93 0 01-2.74-2.64 42.08 42.08 0 01-.14-4.9 48 48 0 00-.61-7.58 3.75 3.75 0 00-.83-2h2.65c.54 0 .73.37.89.78A12.1 12.1 0 0128 13.28c.29 2.72.31 5.45.33 8.18a10.94 10.94 0 000 1.15c.09.78.4 1.1 1.17 1.08.5 0 .5-.06.5-.06v2.69A8.62 8.62 0 0128.1 26.38z\"></path></svg>"
},
};
}
LogoLivestreamDirective_1 = LogoLivestreamDirective;
LogoLivestreamDirective.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;
LogoLivestreamDirective_1.titleIdCounter++;
title.setAttribute("id", "logo-livestream-" + LogoLivestreamDirective_1.titleIdCounter);
svg.appendChild(title);
svg.setAttribute("aria-labelledby", "logo-livestream-" + LogoLivestreamDirective_1.titleIdCounter);
}
};
var LogoLivestreamDirective_1;
LogoLivestreamDirective.titleIdCounter = 0;
LogoLivestreamDirective.ctorParameters = function () { return [
{ type: core.ElementRef }
]; };
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], LogoLivestreamDirective.prototype, "ariaLabel", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], LogoLivestreamDirective.prototype, "ariaLabelledby", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", Boolean)
], LogoLivestreamDirective.prototype, "ariaHidden", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], LogoLivestreamDirective.prototype, "title", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", Boolean)
], LogoLivestreamDirective.prototype, "isFocusable", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], LogoLivestreamDirective.prototype, "size", void 0);
LogoLivestreamDirective = LogoLivestreamDirective_1 = tslib.__decorate([
core.Directive({
selector: "[ibmIconLogoLivestream]"
}),
tslib.__metadata("design:paramtypes", [core.ElementRef])
], LogoLivestreamDirective);
return LogoLivestreamDirective;
}());
var LogoLivestreamModule = /** @class */ (function () {
function LogoLivestreamModule() {
}
LogoLivestreamModule = tslib.__decorate([
core.NgModule({
declarations: [
LogoLivestreamComponent,
LogoLivestreamDirective,
],
exports: [
LogoLivestreamComponent,
LogoLivestreamDirective,
]
})
], LogoLivestreamModule);
return LogoLivestreamModule;
}());
exports.LogoLivestreamComponent = LogoLivestreamComponent;
exports.LogoLivestreamDirective = LogoLivestreamDirective;
exports.LogoLivestreamModule = LogoLivestreamModule;
Object.defineProperty(exports, '__esModule', { value: true });
})));