Repository URL to install this package:
|
Version:
4.0.59 ▾
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const MaterialIcon_1 = require("../../atoms/MaterialIcon");
const styled_1 = require("./styled");
function defaultRenderArrows(props, state) {
const {
isFirst,
isLast,
nextPage,
previousPage
} = state;
const {
isMobile
} = props;
return React.createElement(React.Fragment, null, React.createElement(styled_1.PreviousWrapper, null, React.createElement(MaterialIcon_1.MaterialIcon, {
type: "left",
isDisabled: isFirst,
onClick: previousPage
})), React.createElement(styled_1.NextWrapper, {
isMobile: isMobile
}, React.createElement(MaterialIcon_1.MaterialIcon, {
type: "right",
isDisabled: isLast,
onClick: nextPage
})));
}
exports.defaultRenderArrows = defaultRenderArrows;
function defaultRenderLimit(props, state, handleSize) {
const {
size,
sizes
} = state;
const {
isMobile,
renderOption
} = props;
const selectSize = React.createElement(styled_1.Select, {
onChange: handleSize,
value: size
}, sizes.map(renderOption));
return isMobile || sizes.length === 0 ? undefined : React.createElement(styled_1.SelectBox, null, React.createElement(styled_1.TextWrapper, null, React.createElement(styled_1.PreText, null, "Viewing"), selectSize));
}
exports.defaultRenderLimit = defaultRenderLimit;
function defaultRenderSelector(props, state, handlePage) {
const {
options,
maxValue,
value
} = state;
const {
renderOption
} = props;
const selectPage = React.createElement(styled_1.Select, {
onChange: handlePage,
value: value
}, options.map(renderOption));
return React.createElement(styled_1.TextWrapper, null, React.createElement(styled_1.PreText, null, "Page"), selectPage, React.createElement(styled_1.PostText, null, `of ${maxValue}`));
}
exports.defaultRenderSelector = defaultRenderSelector;
function defaultRenderOption(page, index) {
return React.createElement("option", {
key: page,
value: page
}, page);
}
exports.defaultRenderOption = defaultRenderOption; //# sourceMappingURL=renderProps.js.map