@carbon/icons-angular
Version:
Angular components for icons in digital and software products using the Carbon Design System
177 lines (172 loc) • 15.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.MixedRainHail = {}), global.tslib, global.ng.core, global.CarbonIconHelpers));
}(this, (function (exports, tslib, core, iconHelpers) { 'use strict';
var MixedRainHailComponent = /** @class */ (function () {
function MixedRainHailComponent() {
this.focusable = false;
}
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], MixedRainHailComponent.prototype, "ariaLabel", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], MixedRainHailComponent.prototype, "ariaLabelledby", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", Boolean)
], MixedRainHailComponent.prototype, "ariaHidden", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], MixedRainHailComponent.prototype, "title", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", Boolean)
], MixedRainHailComponent.prototype, "focusable", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], MixedRainHailComponent.prototype, "innerClass", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], MixedRainHailComponent.prototype, "size", void 0);
MixedRainHailComponent = tslib.__decorate([
core.Component({
selector: "ibm-icon-mixed-rain-hail",
template: "\n <svg\n ibmIconMixedRainHail\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 "
})
], MixedRainHailComponent);
return MixedRainHailComponent;
}());
var MixedRainHailDirective = /** @class */ (function () {
function MixedRainHailDirective(elementRef) {
this.elementRef = elementRef;
this.isFocusable = false;
this.icons = {
"32": {
metadata: { "moduleName": "MixedRainHail32", "filepath": "mixed-rain-hail/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": "circle", "attrs": { "cx": "24.5", "cy": "25.5", "r": "1.5" } }, { "elem": "circle", "attrs": { "cx": "21.5", "cy": "29.5", "r": "1.5" } }, { "elem": "path", "attrs": { "d": "M15.868 30.496L14.132 29.504 17.276 24 11.277 24 16.132 15.504 17.868 16.496 14.723 22 20.724 22 15.868 30.496z" } }, { "elem": "path", "attrs": { "d": "M9 32a1 1 0 01-.8944-1.4474l2-4.0005a1 1 0 111.7888.8947l-2 4A.9981.9981 0 019 32zM24.8008 9.1362a8.9943 8.9943 0 00-17.6006 0 6.4929 6.4929 0 00.23 12.7681L6.106 24.5527a1 1 0 101.7885.8946l2-4a1 1 0 00-.447-1.3418A.9786.9786 0 009 20.01V20H8.5a4.4975 4.4975 0 01-.356-8.981l.8155-.0639.0991-.812a6.9938 6.9938 0 0113.8838 0l.0986.812.8154.0639A4.4975 4.4975 0 0123.5 20H23v2h.5A6.4974 6.4974 0 0024.8008 9.1362z" } }], "name": "mixed-rain-hail", "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\"><circle cx=\"24.5\" cy=\"25.5\" r=\"1.5\"></circle><circle cx=\"21.5\" cy=\"29.5\" r=\"1.5\"></circle><path d=\"M15.868 30.496L14.132 29.504 17.276 24 11.277 24 16.132 15.504 17.868 16.496 14.723 22 20.724 22 15.868 30.496z\"></path><path d=\"M9 32a1 1 0 01-.8944-1.4474l2-4.0005a1 1 0 111.7888.8947l-2 4A.9981.9981 0 019 32zM24.8008 9.1362a8.9943 8.9943 0 00-17.6006 0 6.4929 6.4929 0 00.23 12.7681L6.106 24.5527a1 1 0 101.7885.8946l2-4a1 1 0 00-.447-1.3418A.9786.9786 0 009 20.01V20H8.5a4.4975 4.4975 0 01-.356-8.981l.8155-.0639.0991-.812a6.9938 6.9938 0 0113.8838 0l.0986.812.8154.0639A4.4975 4.4975 0 0123.5 20H23v2h.5A6.4974 6.4974 0 0024.8008 9.1362z\"></path></svg>"
},
"24": {
metadata: { "moduleName": "MixedRainHail24", "filepath": "mixed-rain-hail/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": "circle", "attrs": { "cx": "24.5", "cy": "25.5", "r": "1.5" } }, { "elem": "circle", "attrs": { "cx": "21.5", "cy": "29.5", "r": "1.5" } }, { "elem": "path", "attrs": { "d": "M15.868 30.496L14.132 29.504 17.276 24 11.277 24 16.132 15.504 17.868 16.496 14.723 22 20.724 22 15.868 30.496z" } }, { "elem": "path", "attrs": { "d": "M9 32a1 1 0 01-.8944-1.4474l2-4.0005a1 1 0 111.7888.8947l-2 4A.9981.9981 0 019 32zM24.8008 9.1362a8.9943 8.9943 0 00-17.6006 0 6.4929 6.4929 0 00.23 12.7681L6.106 24.5527a1 1 0 101.7885.8946l2-4a1 1 0 00-.447-1.3418A.9786.9786 0 009 20.01V20H8.5a4.4975 4.4975 0 01-.356-8.981l.8155-.0639.0991-.812a6.9938 6.9938 0 0113.8838 0l.0986.812.8154.0639A4.4975 4.4975 0 0123.5 20H23v2h.5A6.4974 6.4974 0 0024.8008 9.1362z" } }], "name": "mixed-rain-hail", "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\"><circle cx=\"24.5\" cy=\"25.5\" r=\"1.5\"></circle><circle cx=\"21.5\" cy=\"29.5\" r=\"1.5\"></circle><path d=\"M15.868 30.496L14.132 29.504 17.276 24 11.277 24 16.132 15.504 17.868 16.496 14.723 22 20.724 22 15.868 30.496z\"></path><path d=\"M9 32a1 1 0 01-.8944-1.4474l2-4.0005a1 1 0 111.7888.8947l-2 4A.9981.9981 0 019 32zM24.8008 9.1362a8.9943 8.9943 0 00-17.6006 0 6.4929 6.4929 0 00.23 12.7681L6.106 24.5527a1 1 0 101.7885.8946l2-4a1 1 0 00-.447-1.3418A.9786.9786 0 009 20.01V20H8.5a4.4975 4.4975 0 01-.356-8.981l.8155-.0639.0991-.812a6.9938 6.9938 0 0113.8838 0l.0986.812.8154.0639A4.4975 4.4975 0 0123.5 20H23v2h.5A6.4974 6.4974 0 0024.8008 9.1362z\"></path></svg>"
},
"20": {
metadata: { "moduleName": "MixedRainHail20", "filepath": "mixed-rain-hail/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": "circle", "attrs": { "cx": "24.5", "cy": "25.5", "r": "1.5" } }, { "elem": "circle", "attrs": { "cx": "21.5", "cy": "29.5", "r": "1.5" } }, { "elem": "path", "attrs": { "d": "M15.868 30.496L14.132 29.504 17.276 24 11.277 24 16.132 15.504 17.868 16.496 14.723 22 20.724 22 15.868 30.496z" } }, { "elem": "path", "attrs": { "d": "M9 32a1 1 0 01-.8944-1.4474l2-4.0005a1 1 0 111.7888.8947l-2 4A.9981.9981 0 019 32zM24.8008 9.1362a8.9943 8.9943 0 00-17.6006 0 6.4929 6.4929 0 00.23 12.7681L6.106 24.5527a1 1 0 101.7885.8946l2-4a1 1 0 00-.447-1.3418A.9786.9786 0 009 20.01V20H8.5a4.4975 4.4975 0 01-.356-8.981l.8155-.0639.0991-.812a6.9938 6.9938 0 0113.8838 0l.0986.812.8154.0639A4.4975 4.4975 0 0123.5 20H23v2h.5A6.4974 6.4974 0 0024.8008 9.1362z" } }], "name": "mixed-rain-hail", "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\"><circle cx=\"24.5\" cy=\"25.5\" r=\"1.5\"></circle><circle cx=\"21.5\" cy=\"29.5\" r=\"1.5\"></circle><path d=\"M15.868 30.496L14.132 29.504 17.276 24 11.277 24 16.132 15.504 17.868 16.496 14.723 22 20.724 22 15.868 30.496z\"></path><path d=\"M9 32a1 1 0 01-.8944-1.4474l2-4.0005a1 1 0 111.7888.8947l-2 4A.9981.9981 0 019 32zM24.8008 9.1362a8.9943 8.9943 0 00-17.6006 0 6.4929 6.4929 0 00.23 12.7681L6.106 24.5527a1 1 0 101.7885.8946l2-4a1 1 0 00-.447-1.3418A.9786.9786 0 009 20.01V20H8.5a4.4975 4.4975 0 01-.356-8.981l.8155-.0639.0991-.812a6.9938 6.9938 0 0113.8838 0l.0986.812.8154.0639A4.4975 4.4975 0 0123.5 20H23v2h.5A6.4974 6.4974 0 0024.8008 9.1362z\"></path></svg>"
},
"16": {
metadata: { "moduleName": "MixedRainHail16", "filepath": "mixed-rain-hail/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": "circle", "attrs": { "cx": "24.5", "cy": "25.5", "r": "1.5" } }, { "elem": "circle", "attrs": { "cx": "21.5", "cy": "29.5", "r": "1.5" } }, { "elem": "path", "attrs": { "d": "M15.868 30.496L14.132 29.504 17.276 24 11.277 24 16.132 15.504 17.868 16.496 14.723 22 20.724 22 15.868 30.496z" } }, { "elem": "path", "attrs": { "d": "M9 32a1 1 0 01-.8944-1.4474l2-4.0005a1 1 0 111.7888.8947l-2 4A.9981.9981 0 019 32zM24.8008 9.1362a8.9943 8.9943 0 00-17.6006 0 6.4929 6.4929 0 00.23 12.7681L6.106 24.5527a1 1 0 101.7885.8946l2-4a1 1 0 00-.447-1.3418A.9786.9786 0 009 20.01V20H8.5a4.4975 4.4975 0 01-.356-8.981l.8155-.0639.0991-.812a6.9938 6.9938 0 0113.8838 0l.0986.812.8154.0639A4.4975 4.4975 0 0123.5 20H23v2h.5A6.4974 6.4974 0 0024.8008 9.1362z" } }], "name": "mixed-rain-hail", "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\"><circle cx=\"24.5\" cy=\"25.5\" r=\"1.5\"></circle><circle cx=\"21.5\" cy=\"29.5\" r=\"1.5\"></circle><path d=\"M15.868 30.496L14.132 29.504 17.276 24 11.277 24 16.132 15.504 17.868 16.496 14.723 22 20.724 22 15.868 30.496z\"></path><path d=\"M9 32a1 1 0 01-.8944-1.4474l2-4.0005a1 1 0 111.7888.8947l-2 4A.9981.9981 0 019 32zM24.8008 9.1362a8.9943 8.9943 0 00-17.6006 0 6.4929 6.4929 0 00.23 12.7681L6.106 24.5527a1 1 0 101.7885.8946l2-4a1 1 0 00-.447-1.3418A.9786.9786 0 009 20.01V20H8.5a4.4975 4.4975 0 01-.356-8.981l.8155-.0639.0991-.812a6.9938 6.9938 0 0113.8838 0l.0986.812.8154.0639A4.4975 4.4975 0 0123.5 20H23v2h.5A6.4974 6.4974 0 0024.8008 9.1362z\"></path></svg>"
},
};
}
MixedRainHailDirective_1 = MixedRainHailDirective;
MixedRainHailDirective.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;
MixedRainHailDirective_1.titleIdCounter++;
title.setAttribute("id", "mixed-rain-hail-" + MixedRainHailDirective_1.titleIdCounter);
svg.appendChild(title);
svg.setAttribute("aria-labelledby", "mixed-rain-hail-" + MixedRainHailDirective_1.titleIdCounter);
}
};
var MixedRainHailDirective_1;
MixedRainHailDirective.titleIdCounter = 0;
MixedRainHailDirective.ctorParameters = function () { return [
{ type: core.ElementRef }
]; };
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], MixedRainHailDirective.prototype, "ariaLabel", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], MixedRainHailDirective.prototype, "ariaLabelledby", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", Boolean)
], MixedRainHailDirective.prototype, "ariaHidden", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], MixedRainHailDirective.prototype, "title", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", Boolean)
], MixedRainHailDirective.prototype, "isFocusable", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], MixedRainHailDirective.prototype, "size", void 0);
MixedRainHailDirective = MixedRainHailDirective_1 = tslib.__decorate([
core.Directive({
selector: "[ibmIconMixedRainHail]"
}),
tslib.__metadata("design:paramtypes", [core.ElementRef])
], MixedRainHailDirective);
return MixedRainHailDirective;
}());
var MixedRainHailModule = /** @class */ (function () {
function MixedRainHailModule() {
}
MixedRainHailModule = tslib.__decorate([
core.NgModule({
declarations: [
MixedRainHailComponent,
MixedRainHailDirective,
],
exports: [
MixedRainHailComponent,
MixedRainHailDirective,
]
})
], MixedRainHailModule);
return MixedRainHailModule;
}());
exports.MixedRainHailComponent = MixedRainHailComponent;
exports.MixedRainHailDirective = MixedRainHailDirective;
exports.MixedRainHailModule = MixedRainHailModule;
Object.defineProperty(exports, '__esModule', { value: true });
})));