@lobehub/ui 2.0.4 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/Drawer/Drawer.js +32 -32
- package/es/Drawer/type.d.ts +1 -1
- package/package.json +1 -1
package/es/Drawer/Drawer.js
CHANGED
|
@@ -88,6 +88,34 @@ var Drawer = /*#__PURE__*/memo(function (_ref) {
|
|
|
88
88
|
onClick: onClose
|
|
89
89
|
}, closeIconProps))]
|
|
90
90
|
});
|
|
91
|
+
var sidebarContent = /*#__PURE__*/_jsxs(_Fragment, {
|
|
92
|
+
children: [/*#__PURE__*/_jsx(Flexbox, {
|
|
93
|
+
className: classNames === null || classNames === void 0 ? void 0 : classNames.sidebar,
|
|
94
|
+
paddingBlock: 12,
|
|
95
|
+
paddingInline: 16,
|
|
96
|
+
style: _objectSpread({
|
|
97
|
+
background: theme.colorBgLayout,
|
|
98
|
+
borderRight: "1px solid ".concat(theme.colorBorderSecondary),
|
|
99
|
+
height: '100%',
|
|
100
|
+
overflowX: 'hidden',
|
|
101
|
+
overflowY: 'auto'
|
|
102
|
+
}, styles === null || styles === void 0 ? void 0 : styles.sidebar),
|
|
103
|
+
width: sidebarWidth,
|
|
104
|
+
children: sidebar
|
|
105
|
+
}), /*#__PURE__*/_jsx(Flexbox, {
|
|
106
|
+
className: classNames === null || classNames === void 0 ? void 0 : classNames.sidebarContent,
|
|
107
|
+
flex: 1,
|
|
108
|
+
paddingBlock: 12,
|
|
109
|
+
paddingInline: 16,
|
|
110
|
+
style: _objectSpread({
|
|
111
|
+
background: theme.colorBgContainer,
|
|
112
|
+
height: '100%',
|
|
113
|
+
overflowX: 'hidden',
|
|
114
|
+
overflowY: 'auto'
|
|
115
|
+
}, styles === null || styles === void 0 ? void 0 : styles.sidebarContent),
|
|
116
|
+
children: children
|
|
117
|
+
})]
|
|
118
|
+
});
|
|
91
119
|
return /*#__PURE__*/_jsx(AntdDrawer, _objectSpread(_objectSpread({
|
|
92
120
|
classNames: classNames,
|
|
93
121
|
closable: false,
|
|
@@ -100,7 +128,8 @@ var Drawer = /*#__PURE__*/memo(function (_ref) {
|
|
|
100
128
|
styles: _objectSpread(_objectSpread({}, styles), {}, {
|
|
101
129
|
body: _objectSpread({
|
|
102
130
|
background: 'transparent',
|
|
103
|
-
|
|
131
|
+
paddingBlock: sidebar ? 0 : 12,
|
|
132
|
+
paddingInline: sidebar ? 0 : 16
|
|
104
133
|
}, styles === null || styles === void 0 ? void 0 : styles.body),
|
|
105
134
|
content: _objectSpread({
|
|
106
135
|
background: sidebar ? "linear-gradient(to right, ".concat(theme.colorBgLayout, " 49.9%, ").concat(theme.colorBgContainer, " 50%)") : theme.colorBgContainer
|
|
@@ -132,43 +161,14 @@ var Drawer = /*#__PURE__*/memo(function (_ref) {
|
|
|
132
161
|
}, rest), {}, {
|
|
133
162
|
children: /*#__PURE__*/_jsxs(Flexbox, {
|
|
134
163
|
className: classNames === null || classNames === void 0 ? void 0 : classNames.bodyContent,
|
|
135
|
-
height: '100%',
|
|
136
164
|
horizontal: !!sidebar,
|
|
137
|
-
paddingBlock: sidebar ? undefined : 12,
|
|
138
|
-
paddingInline: sidebar ? undefined : 16,
|
|
139
165
|
style: _objectSpread({
|
|
140
166
|
justifySelf: 'center',
|
|
141
167
|
maxWidth: containerMaxWidth,
|
|
168
|
+
minHeight: '100%',
|
|
142
169
|
width: '100%'
|
|
143
170
|
}, styles === null || styles === void 0 ? void 0 : styles.bodyContent),
|
|
144
|
-
children: [noHeader && extraNode, sidebar ?
|
|
145
|
-
children: [/*#__PURE__*/_jsx(Flexbox, {
|
|
146
|
-
className: classNames === null || classNames === void 0 ? void 0 : classNames.sidebar,
|
|
147
|
-
paddingBlock: 12,
|
|
148
|
-
paddingInline: 16,
|
|
149
|
-
style: _objectSpread({
|
|
150
|
-
background: theme.colorBgLayout,
|
|
151
|
-
borderRight: "1px solid ".concat(theme.colorBorderSecondary),
|
|
152
|
-
height: '100%',
|
|
153
|
-
overflowX: 'hidden',
|
|
154
|
-
overflowY: 'auto'
|
|
155
|
-
}, styles === null || styles === void 0 ? void 0 : styles.sidebar),
|
|
156
|
-
width: sidebarWidth,
|
|
157
|
-
children: sidebar
|
|
158
|
-
}), /*#__PURE__*/_jsx(Flexbox, {
|
|
159
|
-
className: classNames === null || classNames === void 0 ? void 0 : classNames.sidebarContent,
|
|
160
|
-
flex: 1,
|
|
161
|
-
paddingBlock: 12,
|
|
162
|
-
paddingInline: 16,
|
|
163
|
-
style: _objectSpread({
|
|
164
|
-
background: theme.colorBgContainer,
|
|
165
|
-
height: '100%',
|
|
166
|
-
overflowX: 'hidden',
|
|
167
|
-
overflowY: 'auto'
|
|
168
|
-
}, styles === null || styles === void 0 ? void 0 : styles.sidebarContent),
|
|
169
|
-
children: children
|
|
170
|
-
})]
|
|
171
|
-
}) : children]
|
|
171
|
+
children: [noHeader && extraNode, sidebar ? sidebarContent : children]
|
|
172
172
|
})
|
|
173
173
|
}));
|
|
174
174
|
});
|
package/es/Drawer/type.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export interface DrawerProps extends Omit<AntdDrawerProps, 'styles' | 'className
|
|
|
10
10
|
title?: string;
|
|
11
11
|
};
|
|
12
12
|
closeIconProps?: ActionIconProps;
|
|
13
|
-
containerMaxWidth?: number;
|
|
13
|
+
containerMaxWidth?: number | string;
|
|
14
14
|
noHeader?: boolean;
|
|
15
15
|
ref?: Ref<HTMLDivElement>;
|
|
16
16
|
sidebar?: ReactNode;
|