@popmenu/table 0.103.0 → 0.105.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.es.js +14 -1
- package/build/index.es.js.map +1 -1
- package/build/index.js +14 -1
- package/build/index.js.map +1 -1
- package/package.json +2 -2
package/build/index.es.js
CHANGED
|
@@ -2453,10 +2453,23 @@ var severityIcons$1 = {
|
|
|
2453
2453
|
warning: SvgWarning,
|
|
2454
2454
|
success: SvgCheckCircle,
|
|
2455
2455
|
};
|
|
2456
|
+
var getLinkProps = function (link) {
|
|
2457
|
+
if (!link)
|
|
2458
|
+
return null;
|
|
2459
|
+
var href = link.href, onClick = link.onClick, text = link.text;
|
|
2460
|
+
if (!text)
|
|
2461
|
+
return null;
|
|
2462
|
+
var props = { children: text };
|
|
2463
|
+
if (href)
|
|
2464
|
+
return __assign$1(__assign$1({}, props), { href: href });
|
|
2465
|
+
if (onClick)
|
|
2466
|
+
return __assign$1(__assign$1({}, props), { onClick: onClick });
|
|
2467
|
+
return null;
|
|
2468
|
+
};
|
|
2456
2469
|
var Alert = forwardRef(function (props, ref) {
|
|
2457
2470
|
var children = props.children, link = props.link, _a = props.severity, severity = _a === void 0 ? 'error' : _a, _b = props.variant, variant = _b === void 0 ? 'outlined' : _b, onClose = props.onClose, muiProps = __rest$1(props, ["children", "link", "severity", "variant", "onClose"]);
|
|
2458
2471
|
var classes = useAlertStyles(props);
|
|
2459
|
-
var validLink = link && link
|
|
2472
|
+
var validLink = link && getLinkProps(link);
|
|
2460
2473
|
var Action = (React__default.createElement(React__default.Fragment, null,
|
|
2461
2474
|
validLink && React__default.createElement(Link, __assign$1({}, validLink)),
|
|
2462
2475
|
onClose && (React__default.createElement(IconButton, { onClick: onClose },
|