@carbon/icons-angular
Version:
Angular components for icons in digital and software products using the Carbon Design System
177 lines (172 loc) • 16.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.MostlyCloudy = {}), global.tslib, global.ng.core, global.CarbonIconHelpers));
}(this, (function (exports, tslib, core, iconHelpers) { 'use strict';
var MostlyCloudyComponent = /** @class */ (function () {
function MostlyCloudyComponent() {
this.focusable = false;
}
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], MostlyCloudyComponent.prototype, "ariaLabel", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], MostlyCloudyComponent.prototype, "ariaLabelledby", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", Boolean)
], MostlyCloudyComponent.prototype, "ariaHidden", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], MostlyCloudyComponent.prototype, "title", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", Boolean)
], MostlyCloudyComponent.prototype, "focusable", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], MostlyCloudyComponent.prototype, "innerClass", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], MostlyCloudyComponent.prototype, "size", void 0);
MostlyCloudyComponent = tslib.__decorate([
core.Component({
selector: "ibm-icon-mostly-cloudy",
template: "\n <svg\n ibmIconMostlyCloudy\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 "
})
], MostlyCloudyComponent);
return MostlyCloudyComponent;
}());
var MostlyCloudyDirective = /** @class */ (function () {
function MostlyCloudyDirective(elementRef) {
this.elementRef = elementRef;
this.isFocusable = false;
this.icons = {
"32": {
metadata: { "moduleName": "MostlyCloudy32", "filepath": "mostly-cloudy/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": "M21.743,18.6872A6.05,6.05,0,0,0,22.8,17.6006a5.9977,5.9977,0,1,0-10.7334-4.4444,7.5568,7.5568,0,0,0-5.7158,5.0879A5.9926,5.9926,0,0,0,8,30H19a5.9854,5.9854,0,0,0,2.743-11.3128ZM18,10a4.0042,4.0042,0,0,1,4,4,3.9613,3.9613,0,0,1-.8,2.3994,4.0122,4.0122,0,0,1-.94.8917,7.5416,7.5416,0,0,0-6.1339-4.2395A3.9985,3.9985,0,0,1,18,10Zm1,18H8a3.9928,3.9928,0,0,1-.6729-7.93L7.99,19.958l.1456-.6562a5.4958,5.4958,0,0,1,10.729,0l.1464.6562.6622.1123A3.9928,3.9928,0,0,1,19,28Z", "transform": "translate(0 .005)" } }, { "elem": "path", "attrs": { "d": "M26 13.005H30V15.005H26z" } }, { "elem": "path", "attrs": { "d": "M23.071 5.929H27.071V7.929H23.071z", "transform": "rotate(-45 25.077 6.931)" } }, { "elem": "path", "attrs": { "d": "M17 2.005H19V6.005H17z" } }, { "elem": "path", "attrs": { "d": "M9.929 4.929H11.929V8.929H9.929z", "transform": "rotate(-45 10.935 6.931)" } }], "name": "mostly-cloudy", "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=\"M21.743,18.6872A6.05,6.05,0,0,0,22.8,17.6006a5.9977,5.9977,0,1,0-10.7334-4.4444,7.5568,7.5568,0,0,0-5.7158,5.0879A5.9926,5.9926,0,0,0,8,30H19a5.9854,5.9854,0,0,0,2.743-11.3128ZM18,10a4.0042,4.0042,0,0,1,4,4,3.9613,3.9613,0,0,1-.8,2.3994,4.0122,4.0122,0,0,1-.94.8917,7.5416,7.5416,0,0,0-6.1339-4.2395A3.9985,3.9985,0,0,1,18,10Zm1,18H8a3.9928,3.9928,0,0,1-.6729-7.93L7.99,19.958l.1456-.6562a5.4958,5.4958,0,0,1,10.729,0l.1464.6562.6622.1123A3.9928,3.9928,0,0,1,19,28Z\" transform=\"translate(0 .005)\"></path><path d=\"M26 13.005H30V15.005H26z\"></path><path d=\"M23.071 5.929H27.071V7.929H23.071z\" transform=\"rotate(-45 25.077 6.931)\"></path><path d=\"M17 2.005H19V6.005H17z\"></path><path d=\"M9.929 4.929H11.929V8.929H9.929z\" transform=\"rotate(-45 10.935 6.931)\"></path></svg>"
},
"24": {
metadata: { "moduleName": "MostlyCloudy24", "filepath": "mostly-cloudy/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": "M21.743,18.6872A6.05,6.05,0,0,0,22.8,17.6006a5.9977,5.9977,0,1,0-10.7334-4.4444,7.5568,7.5568,0,0,0-5.7158,5.0879A5.9926,5.9926,0,0,0,8,30H19a5.9854,5.9854,0,0,0,2.743-11.3128ZM18,10a4.0042,4.0042,0,0,1,4,4,3.9613,3.9613,0,0,1-.8,2.3994,4.0122,4.0122,0,0,1-.94.8917,7.5416,7.5416,0,0,0-6.1339-4.2395A3.9985,3.9985,0,0,1,18,10Zm1,18H8a3.9928,3.9928,0,0,1-.6729-7.93L7.99,19.958l.1456-.6562a5.4958,5.4958,0,0,1,10.729,0l.1464.6562.6622.1123A3.9928,3.9928,0,0,1,19,28Z", "transform": "translate(0 .005)" } }, { "elem": "path", "attrs": { "d": "M26 13.005H30V15.005H26z" } }, { "elem": "path", "attrs": { "d": "M23.071 5.929H27.071V7.929H23.071z", "transform": "rotate(-45 25.077 6.931)" } }, { "elem": "path", "attrs": { "d": "M17 2.005H19V6.005H17z" } }, { "elem": "path", "attrs": { "d": "M9.929 4.929H11.929V8.929H9.929z", "transform": "rotate(-45 10.935 6.931)" } }], "name": "mostly-cloudy", "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=\"M21.743,18.6872A6.05,6.05,0,0,0,22.8,17.6006a5.9977,5.9977,0,1,0-10.7334-4.4444,7.5568,7.5568,0,0,0-5.7158,5.0879A5.9926,5.9926,0,0,0,8,30H19a5.9854,5.9854,0,0,0,2.743-11.3128ZM18,10a4.0042,4.0042,0,0,1,4,4,3.9613,3.9613,0,0,1-.8,2.3994,4.0122,4.0122,0,0,1-.94.8917,7.5416,7.5416,0,0,0-6.1339-4.2395A3.9985,3.9985,0,0,1,18,10Zm1,18H8a3.9928,3.9928,0,0,1-.6729-7.93L7.99,19.958l.1456-.6562a5.4958,5.4958,0,0,1,10.729,0l.1464.6562.6622.1123A3.9928,3.9928,0,0,1,19,28Z\" transform=\"translate(0 .005)\"></path><path d=\"M26 13.005H30V15.005H26z\"></path><path d=\"M23.071 5.929H27.071V7.929H23.071z\" transform=\"rotate(-45 25.077 6.931)\"></path><path d=\"M17 2.005H19V6.005H17z\"></path><path d=\"M9.929 4.929H11.929V8.929H9.929z\" transform=\"rotate(-45 10.935 6.931)\"></path></svg>"
},
"20": {
metadata: { "moduleName": "MostlyCloudy20", "filepath": "mostly-cloudy/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": "M21.743,18.6872A6.05,6.05,0,0,0,22.8,17.6006a5.9977,5.9977,0,1,0-10.7334-4.4444,7.5568,7.5568,0,0,0-5.7158,5.0879A5.9926,5.9926,0,0,0,8,30H19a5.9854,5.9854,0,0,0,2.743-11.3128ZM18,10a4.0042,4.0042,0,0,1,4,4,3.9613,3.9613,0,0,1-.8,2.3994,4.0122,4.0122,0,0,1-.94.8917,7.5416,7.5416,0,0,0-6.1339-4.2395A3.9985,3.9985,0,0,1,18,10Zm1,18H8a3.9928,3.9928,0,0,1-.6729-7.93L7.99,19.958l.1456-.6562a5.4958,5.4958,0,0,1,10.729,0l.1464.6562.6622.1123A3.9928,3.9928,0,0,1,19,28Z", "transform": "translate(0 .005)" } }, { "elem": "path", "attrs": { "d": "M26 13.005H30V15.005H26z" } }, { "elem": "path", "attrs": { "d": "M23.071 5.929H27.071V7.929H23.071z", "transform": "rotate(-45 25.077 6.931)" } }, { "elem": "path", "attrs": { "d": "M17 2.005H19V6.005H17z" } }, { "elem": "path", "attrs": { "d": "M9.929 4.929H11.929V8.929H9.929z", "transform": "rotate(-45 10.935 6.931)" } }], "name": "mostly-cloudy", "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=\"M21.743,18.6872A6.05,6.05,0,0,0,22.8,17.6006a5.9977,5.9977,0,1,0-10.7334-4.4444,7.5568,7.5568,0,0,0-5.7158,5.0879A5.9926,5.9926,0,0,0,8,30H19a5.9854,5.9854,0,0,0,2.743-11.3128ZM18,10a4.0042,4.0042,0,0,1,4,4,3.9613,3.9613,0,0,1-.8,2.3994,4.0122,4.0122,0,0,1-.94.8917,7.5416,7.5416,0,0,0-6.1339-4.2395A3.9985,3.9985,0,0,1,18,10Zm1,18H8a3.9928,3.9928,0,0,1-.6729-7.93L7.99,19.958l.1456-.6562a5.4958,5.4958,0,0,1,10.729,0l.1464.6562.6622.1123A3.9928,3.9928,0,0,1,19,28Z\" transform=\"translate(0 .005)\"></path><path d=\"M26 13.005H30V15.005H26z\"></path><path d=\"M23.071 5.929H27.071V7.929H23.071z\" transform=\"rotate(-45 25.077 6.931)\"></path><path d=\"M17 2.005H19V6.005H17z\"></path><path d=\"M9.929 4.929H11.929V8.929H9.929z\" transform=\"rotate(-45 10.935 6.931)\"></path></svg>"
},
"16": {
metadata: { "moduleName": "MostlyCloudy16", "filepath": "mostly-cloudy/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": "M21.743,18.6872A6.05,6.05,0,0,0,22.8,17.6006a5.9977,5.9977,0,1,0-10.7334-4.4444,7.5568,7.5568,0,0,0-5.7158,5.0879A5.9926,5.9926,0,0,0,8,30H19a5.9854,5.9854,0,0,0,2.743-11.3128ZM18,10a4.0042,4.0042,0,0,1,4,4,3.9613,3.9613,0,0,1-.8,2.3994,4.0122,4.0122,0,0,1-.94.8917,7.5416,7.5416,0,0,0-6.1339-4.2395A3.9985,3.9985,0,0,1,18,10Zm1,18H8a3.9928,3.9928,0,0,1-.6729-7.93L7.99,19.958l.1456-.6562a5.4958,5.4958,0,0,1,10.729,0l.1464.6562.6622.1123A3.9928,3.9928,0,0,1,19,28Z", "transform": "translate(0 .005)" } }, { "elem": "path", "attrs": { "d": "M26 13.005H30V15.005H26z" } }, { "elem": "path", "attrs": { "d": "M23.071 5.929H27.071V7.929H23.071z", "transform": "rotate(-45 25.077 6.931)" } }, { "elem": "path", "attrs": { "d": "M17 2.005H19V6.005H17z" } }, { "elem": "path", "attrs": { "d": "M9.929 4.929H11.929V8.929H9.929z", "transform": "rotate(-45 10.935 6.931)" } }], "name": "mostly-cloudy", "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=\"M21.743,18.6872A6.05,6.05,0,0,0,22.8,17.6006a5.9977,5.9977,0,1,0-10.7334-4.4444,7.5568,7.5568,0,0,0-5.7158,5.0879A5.9926,5.9926,0,0,0,8,30H19a5.9854,5.9854,0,0,0,2.743-11.3128ZM18,10a4.0042,4.0042,0,0,1,4,4,3.9613,3.9613,0,0,1-.8,2.3994,4.0122,4.0122,0,0,1-.94.8917,7.5416,7.5416,0,0,0-6.1339-4.2395A3.9985,3.9985,0,0,1,18,10Zm1,18H8a3.9928,3.9928,0,0,1-.6729-7.93L7.99,19.958l.1456-.6562a5.4958,5.4958,0,0,1,10.729,0l.1464.6562.6622.1123A3.9928,3.9928,0,0,1,19,28Z\" transform=\"translate(0 .005)\"></path><path d=\"M26 13.005H30V15.005H26z\"></path><path d=\"M23.071 5.929H27.071V7.929H23.071z\" transform=\"rotate(-45 25.077 6.931)\"></path><path d=\"M17 2.005H19V6.005H17z\"></path><path d=\"M9.929 4.929H11.929V8.929H9.929z\" transform=\"rotate(-45 10.935 6.931)\"></path></svg>"
},
};
}
MostlyCloudyDirective_1 = MostlyCloudyDirective;
MostlyCloudyDirective.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;
MostlyCloudyDirective_1.titleIdCounter++;
title.setAttribute("id", "mostly-cloudy-" + MostlyCloudyDirective_1.titleIdCounter);
svg.appendChild(title);
svg.setAttribute("aria-labelledby", "mostly-cloudy-" + MostlyCloudyDirective_1.titleIdCounter);
}
};
var MostlyCloudyDirective_1;
MostlyCloudyDirective.titleIdCounter = 0;
MostlyCloudyDirective.ctorParameters = function () { return [
{ type: core.ElementRef }
]; };
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], MostlyCloudyDirective.prototype, "ariaLabel", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], MostlyCloudyDirective.prototype, "ariaLabelledby", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", Boolean)
], MostlyCloudyDirective.prototype, "ariaHidden", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], MostlyCloudyDirective.prototype, "title", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", Boolean)
], MostlyCloudyDirective.prototype, "isFocusable", void 0);
tslib.__decorate([
core.Input(),
tslib.__metadata("design:type", String)
], MostlyCloudyDirective.prototype, "size", void 0);
MostlyCloudyDirective = MostlyCloudyDirective_1 = tslib.__decorate([
core.Directive({
selector: "[ibmIconMostlyCloudy]"
}),
tslib.__metadata("design:paramtypes", [core.ElementRef])
], MostlyCloudyDirective);
return MostlyCloudyDirective;
}());
var MostlyCloudyModule = /** @class */ (function () {
function MostlyCloudyModule() {
}
MostlyCloudyModule = tslib.__decorate([
core.NgModule({
declarations: [
MostlyCloudyComponent,
MostlyCloudyDirective,
],
exports: [
MostlyCloudyComponent,
MostlyCloudyDirective,
]
})
], MostlyCloudyModule);
return MostlyCloudyModule;
}());
exports.MostlyCloudyComponent = MostlyCloudyComponent;
exports.MostlyCloudyDirective = MostlyCloudyDirective;
exports.MostlyCloudyModule = MostlyCloudyModule;
Object.defineProperty(exports, '__esModule', { value: true });
})));