1 | "use strict";
|
2 | "use client";
|
3 |
|
4 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
5 | exports.__esModule = true;
|
6 | exports.default = void 0;
|
7 | var _classnames = _interopRequireDefault(require("classnames"));
|
8 | var React = _interopRequireWildcard(require("react"));
|
9 | var _SelectableContext = _interopRequireDefault(require("@restart/ui/SelectableContext"));
|
10 | var _TabContext = _interopRequireDefault(require("@restart/ui/TabContext"));
|
11 | var _TabPanel = require("@restart/ui/TabPanel");
|
12 | var _ThemeProvider = require("./ThemeProvider");
|
13 | var _Fade = _interopRequireDefault(require("./Fade"));
|
14 | var _getTabTransitionComponent = _interopRequireDefault(require("./getTabTransitionComponent"));
|
15 | var _jsxRuntime = require("react/jsx-runtime");
|
16 | function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
17 | function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
|
18 | const TabPane = React.forwardRef(({
|
19 | bsPrefix,
|
20 | transition,
|
21 | ...props
|
22 | }, ref) => {
|
23 | const [{
|
24 | className,
|
25 |
|
26 | as: Component = 'div',
|
27 | ...rest
|
28 | }, {
|
29 | isActive,
|
30 | onEnter,
|
31 | onEntering,
|
32 | onEntered,
|
33 | onExit,
|
34 | onExiting,
|
35 | onExited,
|
36 | mountOnEnter,
|
37 | unmountOnExit,
|
38 | transition: Transition = _Fade.default
|
39 | }] = (0, _TabPanel.useTabPanel)({
|
40 | ...props,
|
41 | transition: (0, _getTabTransitionComponent.default)(transition)
|
42 | });
|
43 | const prefix = (0, _ThemeProvider.useBootstrapPrefix)(bsPrefix, 'tab-pane');
|
44 |
|
45 |
|
46 |
|
47 | return (0, _jsxRuntime.jsx)(_TabContext.default.Provider, {
|
48 | value: null,
|
49 | children: (0, _jsxRuntime.jsx)(_SelectableContext.default.Provider, {
|
50 | value: null,
|
51 | children: (0, _jsxRuntime.jsx)(Transition, {
|
52 | in: isActive,
|
53 | onEnter: onEnter,
|
54 | onEntering: onEntering,
|
55 | onEntered: onEntered,
|
56 | onExit: onExit,
|
57 | onExiting: onExiting,
|
58 | onExited: onExited,
|
59 | mountOnEnter: mountOnEnter,
|
60 | unmountOnExit: unmountOnExit,
|
61 | children: (0, _jsxRuntime.jsx)(Component, {
|
62 | ...rest,
|
63 | ref: ref,
|
64 | className: (0, _classnames.default)(className, prefix, isActive && 'active')
|
65 | })
|
66 | })
|
67 | })
|
68 | });
|
69 | });
|
70 | TabPane.displayName = 'TabPane';
|
71 | var _default = TabPane;
|
72 | exports.default = _default;
|
73 | module.exports = exports.default; |
\ | No newline at end of file |