@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.js
CHANGED
|
@@ -2502,10 +2502,23 @@ var severityIcons$1 = {
|
|
|
2502
2502
|
warning: SvgWarning,
|
|
2503
2503
|
success: SvgCheckCircle,
|
|
2504
2504
|
};
|
|
2505
|
+
var getLinkProps = function (link) {
|
|
2506
|
+
if (!link)
|
|
2507
|
+
return null;
|
|
2508
|
+
var href = link.href, onClick = link.onClick, text = link.text;
|
|
2509
|
+
if (!text)
|
|
2510
|
+
return null;
|
|
2511
|
+
var props = { children: text };
|
|
2512
|
+
if (href)
|
|
2513
|
+
return __assign$1(__assign$1({}, props), { href: href });
|
|
2514
|
+
if (onClick)
|
|
2515
|
+
return __assign$1(__assign$1({}, props), { onClick: onClick });
|
|
2516
|
+
return null;
|
|
2517
|
+
};
|
|
2505
2518
|
var Alert = React.forwardRef(function (props, ref) {
|
|
2506
2519
|
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"]);
|
|
2507
2520
|
var classes = useAlertStyles(props);
|
|
2508
|
-
var validLink = link && link
|
|
2521
|
+
var validLink = link && getLinkProps(link);
|
|
2509
2522
|
var Action = (React__default['default'].createElement(React__default['default'].Fragment, null,
|
|
2510
2523
|
validLink && React__default['default'].createElement(Link, __assign$1({}, validLink)),
|
|
2511
2524
|
onClose && (React__default['default'].createElement(IconButton, { onClick: onClose },
|