UNPKG

@wulperstudio/cms

Version:
66 lines (65 loc) 2.75 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.LayoutMenuContent = void 0; var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")); var _material = require("@mui/material"); var _react = _interopRequireDefault(require("react")); var _jsxRuntime = require("react/jsx-runtime"); var _excluded = ["sx"], _excluded2 = ["sx", "className"], _excluded3 = ["sx", "className"]; var LayoutMenuContent = exports.LayoutMenuContent = function LayoutMenuContent(_ref) { var menu = _ref.menu, children = _ref.children, RootProps = _ref.RootProps, MenuSlotProps = _ref.MenuSlotProps, ChildSlotProps = _ref.ChildSlotProps; var _ref2 = RootProps || {}, sxRoot = _ref2.sx, rootProps = (0, _objectWithoutProperties2["default"])(_ref2, _excluded); var _ref3 = MenuSlotProps || {}, sxMenu = _ref3.sx, menuClassName = _ref3.className, menuProps = (0, _objectWithoutProperties2["default"])(_ref3, _excluded2); var _ref4 = ChildSlotProps || {}, sxChild = _ref4.sx, childClassName = _ref4.className, childProps = (0, _objectWithoutProperties2["default"])(_ref4, _excluded3); var _useTheme = (0, _material.useTheme)(), breakpoints = _useTheme.breakpoints; return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, Object.assign({}, rootProps, { sx: Object.assign({ display: 'grid', gridTemplateColumns: 'auto 1fr', width: '100%', height: '100%', columnGap: 1.25 }, sxRoot, (0, _defineProperty2["default"])({}, breakpoints.down('md'), Object.assign({ gridTemplateColumns: '1fr', gridTemplateRows: 'auto 1fr' }, (sxRoot == null ? void 0 : sxRoot[breakpoints.down('md')]) || {}))), children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, Object.assign({}, menuProps, { sx: Object.assign({ width: '100%', height: '100%', overflow: 'auto' }, sxMenu), className: "".concat(menuClassName || '', " menu__slot"), children: menu })), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, Object.assign({}, childProps, { sx: Object.assign({ width: '100%', height: '100%', overflow: 'auto' }, sxChild, (0, _defineProperty2["default"])({}, breakpoints.down('md'), Object.assign({ overflow: 'unset' }, (sxChild == null ? void 0 : sxChild[breakpoints.down('md')]) || {}))), className: "".concat(childClassName || '', " child__slot"), children: children }))] })); };