"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "SideNavBar", {
    enumerable: true,
    get: function() {
        return SideNavBar;
    }
});
var _interop_require_default = require("@swc/helpers/_/_interop_require_default");
var _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
var _object_spread = require("@swc/helpers/_/_object_spread");
var _object_spread_props = require("@swc/helpers/_/_object_spread_props");
var _object_without_properties = require("@swc/helpers/_/_object_without_properties");
var _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
var _classnames = /*#__PURE__*/ _interop_require_default._(require("classnames"));
var _popup = /*#__PURE__*/ _interop_require_default._(require("../popup"));
var _utils = require("./utils");
var _context = require("./context");
var _typings = require("../../utils/typings");
var defaultProps = (0, _object_spread_props._)((0, _object_spread._)({}, _typings.ComponentDefaults), {
    position: 'left',
    width: '80%'
});
var SideNavBar = function SideNavBar(props) {
    (0, _react.useEffect)(function() {
        console.warn('Warning: SideNavBar is deprecated and will be removed in future versions. Please use NewComponent SideBar instead.');
    }, []);
    var classPrefix = 'nut-sidenavbar';
    var _ref = (0, _object_spread._)({}, defaultProps, props), title = _ref.title, visible = _ref.visible, width = _ref.width, position = _ref.position, children = _ref.children, className = _ref.className, onClose = _ref.onClose, indent = _ref.indent, rest = (0, _object_without_properties._)(_ref, [
        "title",
        "visible",
        "width",
        "position",
        "children",
        "className",
        "onClose",
        "indent"
    ]);
    var innerIndent = indent ? Number(indent) : 20;
    return /*#__PURE__*/ _react.default.createElement(_popup.default, {
        visible: visible,
        style: {
            width: width,
            height: '100%'
        },
        position: position,
        onClose: onClose
    }, /*#__PURE__*/ _react.default.createElement("div", (0, _object_spread._)({
        className: (0, _classnames.default)(classPrefix, className)
    }, rest), /*#__PURE__*/ _react.default.createElement("div", {
        className: "".concat(classPrefix, "-content")
    }, /*#__PURE__*/ _react.default.createElement("div", {
        className: "".concat(classPrefix, "-list sidenavbar-show"),
        onClick: _utils.handleClick
    }, /*#__PURE__*/ _react.default.createElement("div", {
        className: "".concat(classPrefix, "-title ").concat(classPrefix, "-border-bt"),
        style: {
            paddingLeft: "".concat(innerIndent, "px")
        }
    }, title, " ", /*#__PURE__*/ _react.default.createElement("i", {
        className: "arrow-icon arrow-down"
    })), /*#__PURE__*/ _react.default.createElement(_context.OffsetContext.Provider, {
        value: innerIndent
    }, /*#__PURE__*/ _react.default.createElement("div", {
        className: "".concat(classPrefix, "-content")
    }, children))))));
};
SideNavBar.displayName = 'NutSideNavBar';
