Repository URL to install this package:
Version:
0.9.6 ▾
|
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const react_1 = __importDefault(require("react"));
const styled_1 = require("./styled");
function defaultOnIncrement(props, state) {
return state.incrementCount(props);
}
function defaultOnDecrement(props, state) {
return state.decrementCount(props);
}
function defaultRenderBox(props, state) {
const increment = event => defaultOnIncrement(props, state);
const decrement = event => defaultOnDecrement(props, state);
const { onChange } = props;
return (react_1.default.createElement(styled_1.InnerWrapper, null,
react_1.default.createElement(styled_1.StyledButton, { onClick: decrement, isDisabled: !state.shouldDecrement },
react_1.default.createElement(styled_1.StyledMinusIcon, null)),
react_1.default.createElement(styled_1.InputBoxWrapper, null,
react_1.default.createElement(styled_1.StyledInput, { type: "text", value: state.count, onChange: onChange(state.count) })),
react_1.default.createElement(styled_1.StyledButton, { onClick: increment, isDisabled: !state.shouldIncrement },
react_1.default.createElement(styled_1.StyledPlusIcon, null))));
}
exports.defaultRenderBox = defaultRenderBox;
function defaultRenderWrapper(props) {
const { children, nowrap, className } = props;
if (nowrap) {
return react_1.default.createElement(react_1.default.Fragment, null, children);
}
else {
return (react_1.default.createElement(styled_1.IncrementerWrapper, { className: className }, children));
}
}
exports.defaultRenderWrapper = defaultRenderWrapper;
//# sourceMappingURL=renderProps.js.map