@carbon/icons-angular
Version:
Angular components for icons in digital and software products using the Carbon Design System
169 lines (166 loc) • 14.4 kB
JavaScript
import { __decorate, __metadata } from 'tslib';
import { Input, Component, ElementRef, Directive, NgModule } from '@angular/core';
import { getAttributes } from '@carbon/icon-helpers';
var WatsonHealthScalpelSelectComponent = /** @class */ (function () {
function WatsonHealthScalpelSelectComponent() {
this.focusable = false;
}
__decorate([
Input(),
__metadata("design:type", String)
], WatsonHealthScalpelSelectComponent.prototype, "ariaLabel", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], WatsonHealthScalpelSelectComponent.prototype, "ariaLabelledby", void 0);
__decorate([
Input(),
__metadata("design:type", Boolean)
], WatsonHealthScalpelSelectComponent.prototype, "ariaHidden", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], WatsonHealthScalpelSelectComponent.prototype, "title", void 0);
__decorate([
Input(),
__metadata("design:type", Boolean)
], WatsonHealthScalpelSelectComponent.prototype, "focusable", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], WatsonHealthScalpelSelectComponent.prototype, "innerClass", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], WatsonHealthScalpelSelectComponent.prototype, "size", void 0);
WatsonHealthScalpelSelectComponent = __decorate([
Component({
selector: "ibm-icon-watson-health-scalpel-select",
template: "\n <svg\n ibmIconWatsonHealthScalpelSelect\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 "
})
], WatsonHealthScalpelSelectComponent);
return WatsonHealthScalpelSelectComponent;
}());
var WatsonHealthScalpelSelectDirective = /** @class */ (function () {
function WatsonHealthScalpelSelectDirective(elementRef) {
this.elementRef = elementRef;
this.isFocusable = false;
this.icons = {
"32": {
metadata: { "moduleName": "WatsonHealthScalpelSelect32", "filepath": "watson-health/scalpel--select/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": "M28.8281 7.1719a4.0941 4.0941 0 00-5.6562 0L.3433 30H9.5889a4.9682 4.9682 0 003.5356-1.4648L28.8281 12.8281a3.9984 3.9984 0 000-5.6562zM12.2928 20.8787l2.086-2.0859 2.8293 2.8294-2.0857 2.0862zM11.71 27.1211A2.9824 2.9824 0 019.5889 28H5.1714l5.7073-5.7072 2.83 2.83zm15.7037-15.707l-8.792 8.7939-2.8293-2.8292 8.7931-8.7929a2.0473 2.0473 0 012.8282 0 1.9995 1.9995 0 010 2.8282zM15 2a2.9948 2.9948 0 00-2.8157 2H7.8156A2.9925 2.9925 0 104 7.8154v4.3687a3 3 0 102 0V7.8159A2.9959 2.9959 0 007.8156 6h4.3686A2.9947 2.9947 0 1015 2zM5 16a1 1 0 111-1A1.0008 1.0008 0 015 16zM5 6A1 1 0 116 5 1.0008 1.0008 0 015 6zM15 6a1 1 0 111-1A1.0008 1.0008 0 0115 6z" } }], "name": "scalpel--select", "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=\"M28.8281 7.1719a4.0941 4.0941 0 00-5.6562 0L.3433 30H9.5889a4.9682 4.9682 0 003.5356-1.4648L28.8281 12.8281a3.9984 3.9984 0 000-5.6562zM12.2928 20.8787l2.086-2.0859 2.8293 2.8294-2.0857 2.0862zM11.71 27.1211A2.9824 2.9824 0 019.5889 28H5.1714l5.7073-5.7072 2.83 2.83zm15.7037-15.707l-8.792 8.7939-2.8293-2.8292 8.7931-8.7929a2.0473 2.0473 0 012.8282 0 1.9995 1.9995 0 010 2.8282zM15 2a2.9948 2.9948 0 00-2.8157 2H7.8156A2.9925 2.9925 0 104 7.8154v4.3687a3 3 0 102 0V7.8159A2.9959 2.9959 0 007.8156 6h4.3686A2.9947 2.9947 0 1015 2zM5 16a1 1 0 111-1A1.0008 1.0008 0 015 16zM5 6A1 1 0 116 5 1.0008 1.0008 0 015 6zM15 6a1 1 0 111-1A1.0008 1.0008 0 0115 6z\"></path></svg>"
},
"24": {
metadata: { "moduleName": "WatsonHealthScalpelSelect24", "filepath": "watson-health/scalpel--select/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": "M28.8281 7.1719a4.0941 4.0941 0 00-5.6562 0L.3433 30H9.5889a4.9682 4.9682 0 003.5356-1.4648L28.8281 12.8281a3.9984 3.9984 0 000-5.6562zM12.2928 20.8787l2.086-2.0859 2.8293 2.8294-2.0857 2.0862zM11.71 27.1211A2.9824 2.9824 0 019.5889 28H5.1714l5.7073-5.7072 2.83 2.83zm15.7037-15.707l-8.792 8.7939-2.8293-2.8292 8.7931-8.7929a2.0473 2.0473 0 012.8282 0 1.9995 1.9995 0 010 2.8282zM15 2a2.9948 2.9948 0 00-2.8157 2H7.8156A2.9925 2.9925 0 104 7.8154v4.3687a3 3 0 102 0V7.8159A2.9959 2.9959 0 007.8156 6h4.3686A2.9947 2.9947 0 1015 2zM5 16a1 1 0 111-1A1.0008 1.0008 0 015 16zM5 6A1 1 0 116 5 1.0008 1.0008 0 015 6zM15 6a1 1 0 111-1A1.0008 1.0008 0 0115 6z" } }], "name": "scalpel--select", "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=\"M28.8281 7.1719a4.0941 4.0941 0 00-5.6562 0L.3433 30H9.5889a4.9682 4.9682 0 003.5356-1.4648L28.8281 12.8281a3.9984 3.9984 0 000-5.6562zM12.2928 20.8787l2.086-2.0859 2.8293 2.8294-2.0857 2.0862zM11.71 27.1211A2.9824 2.9824 0 019.5889 28H5.1714l5.7073-5.7072 2.83 2.83zm15.7037-15.707l-8.792 8.7939-2.8293-2.8292 8.7931-8.7929a2.0473 2.0473 0 012.8282 0 1.9995 1.9995 0 010 2.8282zM15 2a2.9948 2.9948 0 00-2.8157 2H7.8156A2.9925 2.9925 0 104 7.8154v4.3687a3 3 0 102 0V7.8159A2.9959 2.9959 0 007.8156 6h4.3686A2.9947 2.9947 0 1015 2zM5 16a1 1 0 111-1A1.0008 1.0008 0 015 16zM5 6A1 1 0 116 5 1.0008 1.0008 0 015 6zM15 6a1 1 0 111-1A1.0008 1.0008 0 0115 6z\"></path></svg>"
},
"20": {
metadata: { "moduleName": "WatsonHealthScalpelSelect20", "filepath": "watson-health/scalpel--select/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": "M28.8281 7.1719a4.0941 4.0941 0 00-5.6562 0L.3433 30H9.5889a4.9682 4.9682 0 003.5356-1.4648L28.8281 12.8281a3.9984 3.9984 0 000-5.6562zM12.2928 20.8787l2.086-2.0859 2.8293 2.8294-2.0857 2.0862zM11.71 27.1211A2.9824 2.9824 0 019.5889 28H5.1714l5.7073-5.7072 2.83 2.83zm15.7037-15.707l-8.792 8.7939-2.8293-2.8292 8.7931-8.7929a2.0473 2.0473 0 012.8282 0 1.9995 1.9995 0 010 2.8282zM15 2a2.9948 2.9948 0 00-2.8157 2H7.8156A2.9925 2.9925 0 104 7.8154v4.3687a3 3 0 102 0V7.8159A2.9959 2.9959 0 007.8156 6h4.3686A2.9947 2.9947 0 1015 2zM5 16a1 1 0 111-1A1.0008 1.0008 0 015 16zM5 6A1 1 0 116 5 1.0008 1.0008 0 015 6zM15 6a1 1 0 111-1A1.0008 1.0008 0 0115 6z" } }], "name": "scalpel--select", "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=\"M28.8281 7.1719a4.0941 4.0941 0 00-5.6562 0L.3433 30H9.5889a4.9682 4.9682 0 003.5356-1.4648L28.8281 12.8281a3.9984 3.9984 0 000-5.6562zM12.2928 20.8787l2.086-2.0859 2.8293 2.8294-2.0857 2.0862zM11.71 27.1211A2.9824 2.9824 0 019.5889 28H5.1714l5.7073-5.7072 2.83 2.83zm15.7037-15.707l-8.792 8.7939-2.8293-2.8292 8.7931-8.7929a2.0473 2.0473 0 012.8282 0 1.9995 1.9995 0 010 2.8282zM15 2a2.9948 2.9948 0 00-2.8157 2H7.8156A2.9925 2.9925 0 104 7.8154v4.3687a3 3 0 102 0V7.8159A2.9959 2.9959 0 007.8156 6h4.3686A2.9947 2.9947 0 1015 2zM5 16a1 1 0 111-1A1.0008 1.0008 0 015 16zM5 6A1 1 0 116 5 1.0008 1.0008 0 015 6zM15 6a1 1 0 111-1A1.0008 1.0008 0 0115 6z\"></path></svg>"
},
"16": {
metadata: { "moduleName": "WatsonHealthScalpelSelect16", "filepath": "watson-health/scalpel--select/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": "M28.8281 7.1719a4.0941 4.0941 0 00-5.6562 0L.3433 30H9.5889a4.9682 4.9682 0 003.5356-1.4648L28.8281 12.8281a3.9984 3.9984 0 000-5.6562zM12.2928 20.8787l2.086-2.0859 2.8293 2.8294-2.0857 2.0862zM11.71 27.1211A2.9824 2.9824 0 019.5889 28H5.1714l5.7073-5.7072 2.83 2.83zm15.7037-15.707l-8.792 8.7939-2.8293-2.8292 8.7931-8.7929a2.0473 2.0473 0 012.8282 0 1.9995 1.9995 0 010 2.8282zM15 2a2.9948 2.9948 0 00-2.8157 2H7.8156A2.9925 2.9925 0 104 7.8154v4.3687a3 3 0 102 0V7.8159A2.9959 2.9959 0 007.8156 6h4.3686A2.9947 2.9947 0 1015 2zM5 16a1 1 0 111-1A1.0008 1.0008 0 015 16zM5 6A1 1 0 116 5 1.0008 1.0008 0 015 6zM15 6a1 1 0 111-1A1.0008 1.0008 0 0115 6z" } }], "name": "scalpel--select", "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=\"M28.8281 7.1719a4.0941 4.0941 0 00-5.6562 0L.3433 30H9.5889a4.9682 4.9682 0 003.5356-1.4648L28.8281 12.8281a3.9984 3.9984 0 000-5.6562zM12.2928 20.8787l2.086-2.0859 2.8293 2.8294-2.0857 2.0862zM11.71 27.1211A2.9824 2.9824 0 019.5889 28H5.1714l5.7073-5.7072 2.83 2.83zm15.7037-15.707l-8.792 8.7939-2.8293-2.8292 8.7931-8.7929a2.0473 2.0473 0 012.8282 0 1.9995 1.9995 0 010 2.8282zM15 2a2.9948 2.9948 0 00-2.8157 2H7.8156A2.9925 2.9925 0 104 7.8154v4.3687a3 3 0 102 0V7.8159A2.9959 2.9959 0 007.8156 6h4.3686A2.9947 2.9947 0 1015 2zM5 16a1 1 0 111-1A1.0008 1.0008 0 015 16zM5 6A1 1 0 116 5 1.0008 1.0008 0 015 6zM15 6a1 1 0 111-1A1.0008 1.0008 0 0115 6z\"></path></svg>"
},
};
}
WatsonHealthScalpelSelectDirective_1 = WatsonHealthScalpelSelectDirective;
WatsonHealthScalpelSelectDirective.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;
WatsonHealthScalpelSelectDirective_1.titleIdCounter++;
title.setAttribute("id", "watson-health-scalpel-select-" + WatsonHealthScalpelSelectDirective_1.titleIdCounter);
svg.appendChild(title);
svg.setAttribute("aria-labelledby", "watson-health-scalpel-select-" + WatsonHealthScalpelSelectDirective_1.titleIdCounter);
}
};
var WatsonHealthScalpelSelectDirective_1;
WatsonHealthScalpelSelectDirective.titleIdCounter = 0;
WatsonHealthScalpelSelectDirective.ctorParameters = function () { return [
{ type: ElementRef }
]; };
__decorate([
Input(),
__metadata("design:type", String)
], WatsonHealthScalpelSelectDirective.prototype, "ariaLabel", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], WatsonHealthScalpelSelectDirective.prototype, "ariaLabelledby", void 0);
__decorate([
Input(),
__metadata("design:type", Boolean)
], WatsonHealthScalpelSelectDirective.prototype, "ariaHidden", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], WatsonHealthScalpelSelectDirective.prototype, "title", void 0);
__decorate([
Input(),
__metadata("design:type", Boolean)
], WatsonHealthScalpelSelectDirective.prototype, "isFocusable", void 0);
__decorate([
Input(),
__metadata("design:type", String)
], WatsonHealthScalpelSelectDirective.prototype, "size", void 0);
WatsonHealthScalpelSelectDirective = WatsonHealthScalpelSelectDirective_1 = __decorate([
Directive({
selector: "[ibmIconWatsonHealthScalpelSelect]"
}),
__metadata("design:paramtypes", [ElementRef])
], WatsonHealthScalpelSelectDirective);
return WatsonHealthScalpelSelectDirective;
}());
var WatsonHealthScalpelSelectModule = /** @class */ (function () {
function WatsonHealthScalpelSelectModule() {
}
WatsonHealthScalpelSelectModule = __decorate([
NgModule({
declarations: [
WatsonHealthScalpelSelectComponent,
WatsonHealthScalpelSelectDirective,
],
exports: [
WatsonHealthScalpelSelectComponent,
WatsonHealthScalpelSelectDirective,
]
})
], WatsonHealthScalpelSelectModule);
return WatsonHealthScalpelSelectModule;
}());
export { WatsonHealthScalpelSelectComponent, WatsonHealthScalpelSelectDirective, WatsonHealthScalpelSelectModule };