@rmwc/icon
Advanced tools
Comparing version 14.0.0-alpha.0 to 14.0.1-alpha.0
@@ -44,3 +44,3 @@ "use strict"; | ||
var content = _a.content, rest = tslib_1.__rest(_a, ["content"]); | ||
return (react_1.default.createElement(IconRoot, tslib_1.__assign({}, rest, { style: tslib_1.__assign(tslib_1.__assign({}, rest.style), { backgroundImage: "url(" + content + ")" }) }))); | ||
return (react_1.default.createElement(IconRoot, tslib_1.__assign({}, rest, { style: tslib_1.__assign(tslib_1.__assign({}, rest.style), { backgroundImage: "url(".concat(content, ")") }) }))); | ||
}; | ||
@@ -74,6 +74,6 @@ var renderComponent = function (_a) { | ||
/** An Icon component. Most of these options can be set once globally, read the documentation on Provider for more info. */ | ||
exports.Icon = base_1.createComponent(function (_a, ref) { | ||
exports.Icon = (0, base_1.createComponent)(function (_a, ref) { | ||
var _b; | ||
var icon = _a.icon, rest = tslib_1.__rest(_a, ["icon"]); | ||
var providerContext = provider_1.useProviderContext(); | ||
var providerContext = (0, provider_1.useProviderContext)(); | ||
// Build icon options object | ||
@@ -84,7 +84,7 @@ var _c = tslib_1.__assign({}, buildIconOptions(icon)), content = _c.icon, strategy = _c.strategy, prefix = _c.prefix, basename = _c.basename, render = _c.render, size = _c.size, optionsRest = tslib_1.__rest(_c, ["icon", "strategy", "prefix", "basename", "render", "size"]); | ||
var contentToUse = content; | ||
var strategyToUse = exports.getIconStrategy(contentToUse, strategy || null, providerStrategy || null); | ||
var strategyToUse = (0, exports.getIconStrategy)(contentToUse, strategy || null, providerStrategy || null); | ||
var prefixToUse = prefix || providerPrefix; | ||
var basenameToUse = basename === undefined ? providerBasename : basename; | ||
var iconClassName = strategyToUse === 'className' && typeof content === 'string' | ||
? "" + String(prefixToUse) + content | ||
? "".concat(String(prefixToUse)).concat(content) | ||
: null; | ||
@@ -97,7 +97,7 @@ var rendererFromMap = !!strategyToUse && iconRenderMap[strategyToUse]; | ||
if (!renderToUse) { | ||
console.error("Icon: rendering not implemented for " + String(strategyToUse) + "."); | ||
console.error("Icon: rendering not implemented for ".concat(String(strategyToUse), ".")); | ||
return null; | ||
} | ||
var rendered = renderToUse(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, rest), optionsRest), { ref: ref, content: contentToUse, className: base_1.classNames('rmwc-icon', "rmwc-icon--" + strategyToUse, basenameToUse, rest.className, optionsRest.className, iconClassName, (_b = {}, | ||
_b["rmwc-icon--size-" + (size || '')] = !!size, | ||
var rendered = renderToUse(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, rest), optionsRest), { ref: ref, content: contentToUse, className: (0, base_1.classNames)('rmwc-icon', "rmwc-icon--".concat(strategyToUse), basenameToUse, rest.className, optionsRest.className, iconClassName, (_b = {}, | ||
_b["rmwc-icon--size-".concat(size || '')] = !!size, | ||
_b)) })); | ||
@@ -107,3 +107,3 @@ if (!react_1.default.isValidElement(rendered)) { | ||
} | ||
var childDisplayName = base_1.getDisplayName(rendered.props.children); | ||
var childDisplayName = (0, base_1.getDisplayName)(rendered.props.children); | ||
if (childDisplayName.includes('Avatar') || | ||
@@ -113,3 +113,3 @@ childDisplayName.includes('Icon')) { | ||
// prevents an infinite loop | ||
children: rendered.props.children.props.children, className: base_1.classNames(rendered.props.className, rendered.props.children.props.className) })); | ||
children: rendered.props.children.props.children, className: (0, base_1.classNames)(rendered.props.className, rendered.props.children.props.className) })); | ||
} | ||
@@ -116,0 +116,0 @@ return rendered; |
@@ -40,3 +40,3 @@ import { __assign, __rest } from "tslib"; | ||
var content = _a.content, rest = __rest(_a, ["content"]); | ||
return (React.createElement(IconRoot, __assign({}, rest, { style: __assign(__assign({}, rest.style), { backgroundImage: "url(" + content + ")" }) }))); | ||
return (React.createElement(IconRoot, __assign({}, rest, { style: __assign(__assign({}, rest.style), { backgroundImage: "url(".concat(content, ")") }) }))); | ||
}; | ||
@@ -83,3 +83,3 @@ var renderComponent = function (_a) { | ||
var iconClassName = strategyToUse === 'className' && typeof content === 'string' | ||
? "" + String(prefixToUse) + content | ||
? "".concat(String(prefixToUse)).concat(content) | ||
: null; | ||
@@ -92,7 +92,7 @@ var rendererFromMap = !!strategyToUse && iconRenderMap[strategyToUse]; | ||
if (!renderToUse) { | ||
console.error("Icon: rendering not implemented for " + String(strategyToUse) + "."); | ||
console.error("Icon: rendering not implemented for ".concat(String(strategyToUse), ".")); | ||
return null; | ||
} | ||
var rendered = renderToUse(__assign(__assign(__assign({}, rest), optionsRest), { ref: ref, content: contentToUse, className: classNames('rmwc-icon', "rmwc-icon--" + strategyToUse, basenameToUse, rest.className, optionsRest.className, iconClassName, (_b = {}, | ||
_b["rmwc-icon--size-" + (size || '')] = !!size, | ||
var rendered = renderToUse(__assign(__assign(__assign({}, rest), optionsRest), { ref: ref, content: contentToUse, className: classNames('rmwc-icon', "rmwc-icon--".concat(strategyToUse), basenameToUse, rest.className, optionsRest.className, iconClassName, (_b = {}, | ||
_b["rmwc-icon--size-".concat(size || '')] = !!size, | ||
_b)) })); | ||
@@ -99,0 +99,0 @@ if (!React.isValidElement(rendered)) { |
{ | ||
"name": "@rmwc/icon", | ||
"version": "14.0.0-alpha.0", | ||
"version": "14.0.1-alpha.0", | ||
"description": "RMWC Icon component", | ||
@@ -39,7 +39,7 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@rmwc/base": "^14.0.0-alpha.0", | ||
"@rmwc/provider": "^14.0.0-alpha.0", | ||
"@rmwc/types": "^14.0.0-alpha.0" | ||
"@rmwc/base": "^14.0.1-alpha.0", | ||
"@rmwc/provider": "^14.0.1-alpha.0", | ||
"@rmwc/types": "^14.0.1-alpha.0" | ||
}, | ||
"gitHead": "bf098adc2571ee1641ef20d79f38fb64e9ff186e" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58596
Updated@rmwc/base@^14.0.1-alpha.0
Updated@rmwc/types@^14.0.1-alpha.0