@carbon/icons-angular
Version:
Angular components for icons in digital and software products using the Carbon Design System
169 lines (166 loc) • 13.4 kB
JavaScript
import { __decorate, __metadata } from 'tslib';
import { Input, Component, ElementRef, Directive, NgModule } from '@angular/core';
import { getAttributes } from '@carbon/icon-helpers';
var WatsonHealthRegionAnalysisVolumeComponent = /** @class */ (function () {
function WatsonHealthRegionAnalysisVolumeComponent() {
this.focusable = false;
}
__decorate([
Input(),
__metadata("design:type", String)
], WatsonHealthRegionAnalysisVolumeComponent.prototype, "ariaLabel", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], WatsonHealthRegionAnalysisVolumeComponent.prototype, "ariaLabelledby", void 0);
__decorate([
Input(),
__metadata("design:type", Boolean)
], WatsonHealthRegionAnalysisVolumeComponent.prototype, "ariaHidden", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], WatsonHealthRegionAnalysisVolumeComponent.prototype, "title", void 0);
__decorate([
Input(),
__metadata("design:type", Boolean)
], WatsonHealthRegionAnalysisVolumeComponent.prototype, "focusable", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], WatsonHealthRegionAnalysisVolumeComponent.prototype, "innerClass", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], WatsonHealthRegionAnalysisVolumeComponent.prototype, "size", void 0);
WatsonHealthRegionAnalysisVolumeComponent = __decorate([
Component({
selector: "ibm-icon-watson-health-region-analysis-volume",
template: "\n <svg\n ibmIconWatsonHealthRegionAnalysisVolume\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 "
})
], WatsonHealthRegionAnalysisVolumeComponent);
return WatsonHealthRegionAnalysisVolumeComponent;
}());
var WatsonHealthRegionAnalysisVolumeDirective = /** @class */ (function () {
function WatsonHealthRegionAnalysisVolumeDirective(elementRef) {
this.elementRef = elementRef;
this.isFocusable = false;
this.icons = {
"32": {
metadata: { "moduleName": "WatsonHealthRegionAnalysisVolume32", "filepath": "watson-health/region-analysis--volume/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": "M30,23V21H28V19H26v2H23V19H21v2H19v2h2v3H19v2h2v2h2V28h3v2h2V28h2V26H28V23Zm-4,3H23V23h3Z" } }, { "elem": "path", "attrs": { "d": "M4.8305,20.3555A24.9534,24.9534,0,0,0,15,22.9644v-2A22.9014,22.9014,0,0,1,4.1335,17.6919,11.979,11.979,0,0,1,4,16a11.9847,11.9847,0,0,1,.1332-1.69,22.9282,22.9282,0,0,1,23.7336,0A11.9847,11.9847,0,0,1,28,16h2A14,14,0,1,0,16,30V28A12.01,12.01,0,0,1,4.8305,20.3555ZM16,4a12.01,12.01,0,0,1,11.17,7.6465,24.8982,24.8982,0,0,0-22.3406,0A12.01,12.01,0,0,1,16,4Z" } }], "name": "region-analysis--volume", "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=\"M30,23V21H28V19H26v2H23V19H21v2H19v2h2v3H19v2h2v2h2V28h3v2h2V28h2V26H28V23Zm-4,3H23V23h3Z\"></path><path d=\"M4.8305,20.3555A24.9534,24.9534,0,0,0,15,22.9644v-2A22.9014,22.9014,0,0,1,4.1335,17.6919,11.979,11.979,0,0,1,4,16a11.9847,11.9847,0,0,1,.1332-1.69,22.9282,22.9282,0,0,1,23.7336,0A11.9847,11.9847,0,0,1,28,16h2A14,14,0,1,0,16,30V28A12.01,12.01,0,0,1,4.8305,20.3555ZM16,4a12.01,12.01,0,0,1,11.17,7.6465,24.8982,24.8982,0,0,0-22.3406,0A12.01,12.01,0,0,1,16,4Z\"></path></svg>"
},
"24": {
metadata: { "moduleName": "WatsonHealthRegionAnalysisVolume24", "filepath": "watson-health/region-analysis--volume/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": "M30,23V21H28V19H26v2H23V19H21v2H19v2h2v3H19v2h2v2h2V28h3v2h2V28h2V26H28V23Zm-4,3H23V23h3Z" } }, { "elem": "path", "attrs": { "d": "M4.8305,20.3555A24.9534,24.9534,0,0,0,15,22.9644v-2A22.9014,22.9014,0,0,1,4.1335,17.6919,11.979,11.979,0,0,1,4,16a11.9847,11.9847,0,0,1,.1332-1.69,22.9282,22.9282,0,0,1,23.7336,0A11.9847,11.9847,0,0,1,28,16h2A14,14,0,1,0,16,30V28A12.01,12.01,0,0,1,4.8305,20.3555ZM16,4a12.01,12.01,0,0,1,11.17,7.6465,24.8982,24.8982,0,0,0-22.3406,0A12.01,12.01,0,0,1,16,4Z" } }], "name": "region-analysis--volume", "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=\"M30,23V21H28V19H26v2H23V19H21v2H19v2h2v3H19v2h2v2h2V28h3v2h2V28h2V26H28V23Zm-4,3H23V23h3Z\"></path><path d=\"M4.8305,20.3555A24.9534,24.9534,0,0,0,15,22.9644v-2A22.9014,22.9014,0,0,1,4.1335,17.6919,11.979,11.979,0,0,1,4,16a11.9847,11.9847,0,0,1,.1332-1.69,22.9282,22.9282,0,0,1,23.7336,0A11.9847,11.9847,0,0,1,28,16h2A14,14,0,1,0,16,30V28A12.01,12.01,0,0,1,4.8305,20.3555ZM16,4a12.01,12.01,0,0,1,11.17,7.6465,24.8982,24.8982,0,0,0-22.3406,0A12.01,12.01,0,0,1,16,4Z\"></path></svg>"
},
"20": {
metadata: { "moduleName": "WatsonHealthRegionAnalysisVolume20", "filepath": "watson-health/region-analysis--volume/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": "M30,23V21H28V19H26v2H23V19H21v2H19v2h2v3H19v2h2v2h2V28h3v2h2V28h2V26H28V23Zm-4,3H23V23h3Z" } }, { "elem": "path", "attrs": { "d": "M4.8305,20.3555A24.9534,24.9534,0,0,0,15,22.9644v-2A22.9014,22.9014,0,0,1,4.1335,17.6919,11.979,11.979,0,0,1,4,16a11.9847,11.9847,0,0,1,.1332-1.69,22.9282,22.9282,0,0,1,23.7336,0A11.9847,11.9847,0,0,1,28,16h2A14,14,0,1,0,16,30V28A12.01,12.01,0,0,1,4.8305,20.3555ZM16,4a12.01,12.01,0,0,1,11.17,7.6465,24.8982,24.8982,0,0,0-22.3406,0A12.01,12.01,0,0,1,16,4Z" } }], "name": "region-analysis--volume", "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=\"M30,23V21H28V19H26v2H23V19H21v2H19v2h2v3H19v2h2v2h2V28h3v2h2V28h2V26H28V23Zm-4,3H23V23h3Z\"></path><path d=\"M4.8305,20.3555A24.9534,24.9534,0,0,0,15,22.9644v-2A22.9014,22.9014,0,0,1,4.1335,17.6919,11.979,11.979,0,0,1,4,16a11.9847,11.9847,0,0,1,.1332-1.69,22.9282,22.9282,0,0,1,23.7336,0A11.9847,11.9847,0,0,1,28,16h2A14,14,0,1,0,16,30V28A12.01,12.01,0,0,1,4.8305,20.3555ZM16,4a12.01,12.01,0,0,1,11.17,7.6465,24.8982,24.8982,0,0,0-22.3406,0A12.01,12.01,0,0,1,16,4Z\"></path></svg>"
},
"16": {
metadata: { "moduleName": "WatsonHealthRegionAnalysisVolume16", "filepath": "watson-health/region-analysis--volume/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": "M30,23V21H28V19H26v2H23V19H21v2H19v2h2v3H19v2h2v2h2V28h3v2h2V28h2V26H28V23Zm-4,3H23V23h3Z" } }, { "elem": "path", "attrs": { "d": "M4.8305,20.3555A24.9534,24.9534,0,0,0,15,22.9644v-2A22.9014,22.9014,0,0,1,4.1335,17.6919,11.979,11.979,0,0,1,4,16a11.9847,11.9847,0,0,1,.1332-1.69,22.9282,22.9282,0,0,1,23.7336,0A11.9847,11.9847,0,0,1,28,16h2A14,14,0,1,0,16,30V28A12.01,12.01,0,0,1,4.8305,20.3555ZM16,4a12.01,12.01,0,0,1,11.17,7.6465,24.8982,24.8982,0,0,0-22.3406,0A12.01,12.01,0,0,1,16,4Z" } }], "name": "region-analysis--volume", "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=\"M30,23V21H28V19H26v2H23V19H21v2H19v2h2v3H19v2h2v2h2V28h3v2h2V28h2V26H28V23Zm-4,3H23V23h3Z\"></path><path d=\"M4.8305,20.3555A24.9534,24.9534,0,0,0,15,22.9644v-2A22.9014,22.9014,0,0,1,4.1335,17.6919,11.979,11.979,0,0,1,4,16a11.9847,11.9847,0,0,1,.1332-1.69,22.9282,22.9282,0,0,1,23.7336,0A11.9847,11.9847,0,0,1,28,16h2A14,14,0,1,0,16,30V28A12.01,12.01,0,0,1,4.8305,20.3555ZM16,4a12.01,12.01,0,0,1,11.17,7.6465,24.8982,24.8982,0,0,0-22.3406,0A12.01,12.01,0,0,1,16,4Z\"></path></svg>"
},
};
}
WatsonHealthRegionAnalysisVolumeDirective_1 = WatsonHealthRegionAnalysisVolumeDirective;
WatsonHealthRegionAnalysisVolumeDirective.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;
WatsonHealthRegionAnalysisVolumeDirective_1.titleIdCounter++;
title.setAttribute("id", "watson-health-region-analysis-volume-" + WatsonHealthRegionAnalysisVolumeDirective_1.titleIdCounter);
svg.appendChild(title);
svg.setAttribute("aria-labelledby", "watson-health-region-analysis-volume-" + WatsonHealthRegionAnalysisVolumeDirective_1.titleIdCounter);
}
};
var WatsonHealthRegionAnalysisVolumeDirective_1;
WatsonHealthRegionAnalysisVolumeDirective.titleIdCounter = 0;
WatsonHealthRegionAnalysisVolumeDirective.ctorParameters = function () { return [
{ type: ElementRef }
]; };
__decorate([
Input(),
__metadata("design:type", String)
], WatsonHealthRegionAnalysisVolumeDirective.prototype, "ariaLabel", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], WatsonHealthRegionAnalysisVolumeDirective.prototype, "ariaLabelledby", void 0);
__decorate([
Input(),
__metadata("design:type", Boolean)
], WatsonHealthRegionAnalysisVolumeDirective.prototype, "ariaHidden", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], WatsonHealthRegionAnalysisVolumeDirective.prototype, "title", void 0);
__decorate([
Input(),
__metadata("design:type", Boolean)
], WatsonHealthRegionAnalysisVolumeDirective.prototype, "isFocusable", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], WatsonHealthRegionAnalysisVolumeDirective.prototype, "size", void 0);
WatsonHealthRegionAnalysisVolumeDirective = WatsonHealthRegionAnalysisVolumeDirective_1 = __decorate([
Directive({
selector: "[ibmIconWatsonHealthRegionAnalysisVolume]"
}),
__metadata("design:paramtypes", [ElementRef])
], WatsonHealthRegionAnalysisVolumeDirective);
return WatsonHealthRegionAnalysisVolumeDirective;
}());
var WatsonHealthRegionAnalysisVolumeModule = /** @class */ (function () {
function WatsonHealthRegionAnalysisVolumeModule() {
}
WatsonHealthRegionAnalysisVolumeModule = __decorate([
NgModule({
declarations: [
WatsonHealthRegionAnalysisVolumeComponent,
WatsonHealthRegionAnalysisVolumeDirective,
],
exports: [
WatsonHealthRegionAnalysisVolumeComponent,
WatsonHealthRegionAnalysisVolumeDirective,
]
})
], WatsonHealthRegionAnalysisVolumeModule);
return WatsonHealthRegionAnalysisVolumeModule;
}());
export { WatsonHealthRegionAnalysisVolumeComponent, WatsonHealthRegionAnalysisVolumeDirective, WatsonHealthRegionAnalysisVolumeModule };