UNPKG

tdesign-react

Version:
51 lines (47 loc) 2.32 kB
/** * tdesign v1.13.2 * (c) 2025 tdesign * @license MIT */ import { _ as _defineProperty } from '../_chunks/dep-8618a2f1.js'; import { _ as _objectWithoutProperties } from '../_chunks/dep-30ed04a0.js'; import React from 'react'; import classNames from 'classnames'; import useConfig from '../hooks/useConfig.js'; import useDefaultProps from '../hooks/useDefaultProps.js'; import '../_chunks/dep-c37cc2fd.js'; import '../config-provider/ConfigContext.js'; import 'lodash-es'; import '../_chunks/dep-698f8ddd.js'; import '../_chunks/dep-09955460.js'; import 'dayjs'; var _excluded = ["width", "className", "style", "children"]; function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } var Aside = function Aside(props) { var _useDefaultProps = useDefaultProps(props, { width: 232 }), width = _useDefaultProps.width, className = _useDefaultProps.className, style = _useDefaultProps.style, children = _useDefaultProps.children, otherAsideProps = _objectWithoutProperties(_useDefaultProps, _excluded); var _useConfig = useConfig(), classPrefix = _useConfig.classPrefix; var asideClassNames = classNames("".concat(classPrefix, "-layout__sider"), className); var asideWidth = isNaN(Number(width)) ? width : "".concat(width, "px"); var asideStyle = _objectSpread({ width: asideWidth, maxWidth: asideWidth, minWidth: asideWidth, flex: "0 0 ".concat(asideWidth) }, style); return /* @__PURE__ */React.createElement("aside", _objectSpread({ className: asideClassNames, style: asideStyle }, otherAsideProps), children); }; Aside.displayName = "Aside"; export { Aside as default }; //# sourceMappingURL=Aside.js.map