Repository URL to install this package:
|
Version:
2.7.11 ▾
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const tslib_1 = require("tslib"); // libs
const react_1 = tslib_1.__importDefault(require("react"));
const mobx_react_1 = require("xmobx/mobx-react");
const exotic_1 = require("exotic");
const renderProps_1 = require("./renderProps"); // import styles from './styles'
// @styles
let LabelWithAction = class LabelWithAction extends react_1.default.Component {
render() {
const _a = this.props,
{
renderWrapper,
renderLinkButton,
renderLabel
} = _a,
remainingProps = tslib_1.__rest(_a, ["renderWrapper", "renderLinkButton", "renderLabel"]);
const {
onClick
} = remainingProps;
const children = exotic_1.isFunction(onClick) ? renderLinkButton(remainingProps) : renderLabel(remainingProps);
const view = renderWrapper(Object.assign({}, remainingProps, {
children
}));
return view;
}
};
LabelWithAction.defaultProps = {
className: '',
buttonLabel: '',
renderWrapper: renderProps_1.defaultRenderWrapper,
renderLinkButton: renderProps_1.defaultRenderLinkButton,
renderLabel: renderProps_1.defaultRenderLabel
};
LabelWithAction = tslib_1.__decorate([mobx_react_1.observer], LabelWithAction);
exports.LabelWithAction = LabelWithAction;
exports.default = LabelWithAction; //# sourceMappingURL=LabelWithAction.js.map