76 lines
3.6 KiB
JavaScript
76 lines
3.6 KiB
JavaScript
"use strict";
|
|
|
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
|
|
var React = _interopRequireWildcard(require("react"));
|
|
|
|
var _PanelContext = _interopRequireDefault(require("../PanelContext"));
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
|
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
|
|
var HIDDEN_STYLE = {
|
|
visibility: 'hidden'
|
|
};
|
|
|
|
function Header(_ref) {
|
|
var prefixCls = _ref.prefixCls,
|
|
_ref$prevIcon = _ref.prevIcon,
|
|
prevIcon = _ref$prevIcon === void 0 ? "\u2039" : _ref$prevIcon,
|
|
_ref$nextIcon = _ref.nextIcon,
|
|
nextIcon = _ref$nextIcon === void 0 ? "\u203A" : _ref$nextIcon,
|
|
_ref$superPrevIcon = _ref.superPrevIcon,
|
|
superPrevIcon = _ref$superPrevIcon === void 0 ? "\xAB" : _ref$superPrevIcon,
|
|
_ref$superNextIcon = _ref.superNextIcon,
|
|
superNextIcon = _ref$superNextIcon === void 0 ? "\xBB" : _ref$superNextIcon,
|
|
onSuperPrev = _ref.onSuperPrev,
|
|
onSuperNext = _ref.onSuperNext,
|
|
onPrev = _ref.onPrev,
|
|
onNext = _ref.onNext,
|
|
children = _ref.children;
|
|
|
|
var _React$useContext = React.useContext(_PanelContext.default),
|
|
hideNextBtn = _React$useContext.hideNextBtn,
|
|
hidePrevBtn = _React$useContext.hidePrevBtn;
|
|
|
|
return React.createElement("div", {
|
|
className: prefixCls
|
|
}, onSuperPrev && React.createElement("button", {
|
|
type: "button",
|
|
onClick: onSuperPrev,
|
|
tabIndex: -1,
|
|
className: "".concat(prefixCls, "-super-prev-btn"),
|
|
style: hidePrevBtn ? HIDDEN_STYLE : {}
|
|
}, superPrevIcon), onPrev && React.createElement("button", {
|
|
type: "button",
|
|
onClick: onPrev,
|
|
tabIndex: -1,
|
|
className: "".concat(prefixCls, "-prev-btn"),
|
|
style: hidePrevBtn ? HIDDEN_STYLE : {}
|
|
}, prevIcon), React.createElement("div", {
|
|
className: "".concat(prefixCls, "-view")
|
|
}, children), onNext && React.createElement("button", {
|
|
type: "button",
|
|
onClick: onNext,
|
|
tabIndex: -1,
|
|
className: "".concat(prefixCls, "-next-btn"),
|
|
style: hideNextBtn ? HIDDEN_STYLE : {}
|
|
}, nextIcon), onSuperNext && React.createElement("button", {
|
|
type: "button",
|
|
onClick: onSuperNext,
|
|
tabIndex: -1,
|
|
className: "".concat(prefixCls, "-super-next-btn"),
|
|
style: hideNextBtn ? HIDDEN_STYLE : {}
|
|
}, superNextIcon));
|
|
}
|
|
|
|
var _default = Header;
|
|
exports.default = _default; |