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 _ThemeProvider = require("./ThemeProvider");
|
10 | var _jsxRuntime = require("react/jsx-runtime");
|
11 | 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); }
|
12 | 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; }
|
13 | const positionClasses = {
|
14 | 'top-start': 'top-0 start-0',
|
15 | 'top-center': 'top-0 start-50 translate-middle-x',
|
16 | 'top-end': 'top-0 end-0',
|
17 | 'middle-start': 'top-50 start-0 translate-middle-y',
|
18 | 'middle-center': 'top-50 start-50 translate-middle',
|
19 | 'middle-end': 'top-50 end-0 translate-middle-y',
|
20 | 'bottom-start': 'bottom-0 start-0',
|
21 | 'bottom-center': 'bottom-0 start-50 translate-middle-x',
|
22 | 'bottom-end': 'bottom-0 end-0'
|
23 | };
|
24 | const ToastContainer = React.forwardRef(({
|
25 | bsPrefix,
|
26 | position,
|
27 | containerPosition,
|
28 | className,
|
29 |
|
30 | as: Component = 'div',
|
31 | ...props
|
32 | }, ref) => {
|
33 | bsPrefix = (0, _ThemeProvider.useBootstrapPrefix)(bsPrefix, 'toast-container');
|
34 | return (0, _jsxRuntime.jsx)(Component, {
|
35 | ref: ref,
|
36 | ...props,
|
37 | className: (0, _classnames.default)(bsPrefix, position && positionClasses[position], containerPosition && `position-${containerPosition}`, className)
|
38 | });
|
39 | });
|
40 | ToastContainer.displayName = 'ToastContainer';
|
41 | var _default = ToastContainer;
|
42 | exports.default = _default;
|
43 | module.exports = exports.default; |
\ | No newline at end of file |