MCPcopy
hub / github.com/microsoft/SandDance / getIcon

Function getIcon

docs/app/js/sanddance-app.js:28092–28116  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

28090 _iconSettings.__remapped[normalizeIconName(iconName)] = normalizeIconName(mappedToName);
28091}
28092function getIcon(name) {
28093 var icon = undefined;
28094 var options = _iconSettings.__options;
28095 name = name ? normalizeIconName(name) : "";
28096 name = _iconSettings.__remapped[name] || name;
28097 if (name) {
28098 icon = _iconSettings[name];
28099 if (icon) {
28100 var subset = icon.subset;
28101 if (subset && subset.fontFace) {
28102 if (!subset.isRegistered) {
28103 (0, _mergeStyles.fontFace)(subset.fontFace);
28104 subset.isRegistered = true;
28105 }
28106 if (!subset.className) subset.className = (0, _mergeStyles.mergeStyles)(subset.style, {
28107 fontFamily: subset.fontFace.fontFamily,
28108 fontWeight: subset.fontFace.fontWeight || "normal",
28109 fontStyle: subset.fontFace.fontStyle || "normal"
28110 });
28111 }
28112 } else // eslint-disable-next-line deprecation/deprecation
28113 if (!options.disableWarnings && options.warnOnMissingIcons) (0, _utilities.warn)('The icon "' + name + '" was used but not registered. See https://github.com/microsoft/fluentui/wiki/Using-icons for more information.');
28114 }
28115 return icon;
28116}
28117function setIconOptions(options) {
28118 _iconSettings.__options = (0, _tslib.__assign)((0, _tslib.__assign)({}, _iconSettings.__options), options);
28119}

Callers 5

getDiffIconsFunction · 0.85
getIconsFunction · 0.85
sanddance.jsFile · 0.85
getDiffIconsFunction · 0.85

Calls 1

normalizeIconNameFunction · 0.85

Tested by

no test coverage detected