@coveord/plasma-mantine
Version:
A Plasma flavoured Mantine theme
40 lines (39 loc) • 1.73 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "InlineConfirmTarget", {
enumerable: true,
get: function() {
return InlineConfirmTarget;
}
});
var _object_spread = require("@swc/helpers/_/_object_spread");
var _object_without_properties = require("@swc/helpers/_/_object_without_properties");
var _sliced_to_array = require("@swc/helpers/_/_sliced_to_array");
var _to_array = require("@swc/helpers/_/_to_array");
var _jsxruntime = require("react/jsx-runtime");
var _core = require("@mantine/core");
var _react = require("react");
var _Button = require("../Button/Button.js");
var _InlineConfirmContext = require("./InlineConfirmContext.js");
var InlineConfirmTarget = (0, _core.createPolymorphicComponent)(/*#__PURE__*/ (0, _react.forwardRef)(function(_0, _1) {
var _ref = [
_0,
_1
], _ref1 = _to_array._(_ref), _ref2 = _ref1[0], _rest = _ref1.slice(1), onClick = _ref2.onClick, inlineConfirmId = _ref2.inlineConfirmId, tmp = _ref2.component, Component = tmp === void 0 ? _Button.Button : tmp, others = _object_without_properties._(_ref2, [
"onClick",
"inlineConfirmId",
"component"
]), _rest1 = _sliced_to_array._(_rest, 1), ref = _rest1[0];
var setConfirmingId = (0, _InlineConfirmContext.useInlineConfirm)().setConfirmingId;
var handleOnClick = function handleOnClick(e) {
setConfirmingId(inlineConfirmId);
onClick === null || onClick === void 0 ? void 0 : onClick(e);
};
return /*#__PURE__*/ (0, _jsxruntime.jsx)(Component, _object_spread._({
ref: ref,
onClick: handleOnClick
}, others));
}));
//# sourceMappingURL=InlineConfirmTarget.js.map