beer-assembly-biz 1.1.3-alpha.16 → 1.1.3-alpha.18

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.
@@ -19,11 +19,11 @@ export declare type App = {
19
19
  /**
20
20
  * App图标
21
21
  */
22
- icon: string;
22
+ icon?: string;
23
23
  /**
24
24
  * App描述
25
25
  */
26
- description: string;
26
+ description?: string;
27
27
  /**
28
28
  * 路径
29
29
  */
@@ -32,6 +32,10 @@ export declare type App = {
32
32
  * App 默认路径
33
33
  */
34
34
  defaultPath: string;
35
+ /**
36
+ * 配置.
37
+ */
38
+ config?: {};
35
39
  };
36
40
  /**
37
41
  * 用户信息实体.
@@ -66,6 +70,18 @@ export declare type LayoutProps = {
66
70
  * App列表 (切换应用)
67
71
  */
68
72
  apps: App[];
73
+ /**
74
+ * 菜单宽度.
75
+ */
76
+ siderWidth?: number;
77
+ /**
78
+ * 菜单选项高度.
79
+ */
80
+ siderMenusItemHeight?: number;
81
+ /**
82
+ * 菜单类型.
83
+ */
84
+ siderMenuType?: 'sub' | 'group';
69
85
  /**
70
86
  * 布局内容
71
87
  */
@@ -158,7 +158,9 @@ export const AppLayout = (props) => {
158
158
  .ant-pro-sider-collapsed-button {
159
159
  inset-block-start: 15px;
160
160
  }
161
- `, selectedKeys: pathKeys, locale: "zh-CN", navTheme: "light", fixSiderbar: true, layout: "mix", contentWidth: "Fluid", splitMenus: false, bgLayoutImgList: [
161
+ `, style: {
162
+ minWidth: 1000
163
+ }, selectedKeys: pathKeys, locale: "zh-CN", navTheme: "light", fixSiderbar: true, layout: "mix", contentWidth: "Fluid", splitMenus: false, bgLayoutImgList: [
162
164
  {
163
165
  src: ImageLayout01,
164
166
  left: 85,
@@ -177,26 +179,26 @@ export const AppLayout = (props) => {
177
179
  left: 0,
178
180
  width: '331px'
179
181
  }
180
- ], siderWidth: 200, token: {
181
- bgLayout: '#f5f7fa',
182
+ ], siderWidth: props?.siderWidth ?? 190, breakpoint: props?.siderMenuType === 'group' ? 'xs' : undefined, token: {
183
+ bgLayout: '#F5F7FA',
182
184
  header: {
183
185
  heightLayoutHeader: 48
184
186
  },
185
187
  sider: {
186
- menuHeight: token.controlHeight + 2,
188
+ menuHeight: props?.siderMenusItemHeight ?? token.controlHeight,
187
189
  paddingBlockLayoutMenu: 4,
188
190
  paddingInlineLayoutMenu: 4,
189
191
  colorMenuBackground: '#fff',
190
- colorTextMenu: 'rgb(87, 89, 102)',
191
- colorTextMenuSelected: 'rgba(0,0,0,0.8)',
192
+ colorTextMenu: 'rgba(0,0,0,0.75)',
193
+ colorTextMenuSelected: 'rgba(0,0,0,0.85)',
192
194
  colorBgMenuItemSelected: 'rgba(0,0,0,0.08)'
193
195
  },
194
196
  pageContainer: {
195
197
  paddingInlinePageContainerContent: 0,
196
198
  paddingBlockPageContainerContent: 0
197
199
  }
198
- }, siderMenuType: 'sub', fixedHeader: true, collapsedButtonRender: (collapsed, reactNode) => {
199
- return isMobile ? undefined : reactNode;
200
+ }, siderMenuType: props?.siderMenuType ?? 'sub', fixedHeader: true, collapsedButtonRender: (collapsed, reactNode) => {
201
+ return isMobile || props?.siderMenuType === 'group' ? undefined : reactNode;
200
202
  }, appList: (props.apps?.length || 0) > 1 || collapsed ? props.apps?.map(it => {
201
203
  return {
202
204
  ...it,
@@ -217,7 +219,8 @@ export const AppLayout = (props) => {
217
219
  textIndent: 10,
218
220
  fontSize: token.fontSize + 2,
219
221
  color: '#333',
220
- fontWeight: 600
222
+ fontWeight: 600,
223
+ minWidth: ((props?.siderWidth ?? 190) - 30)
221
224
  } }, app?.name));
222
225
  }, menu: {
223
226
  collapsedShowTitle: false,
@@ -226,35 +229,40 @@ export const AppLayout = (props) => {
226
229
  request: async () => {
227
230
  return requestMenuItems();
228
231
  }
229
- }, subMenuItemRender: (props, _defaultDom, menuProps) => {
232
+ }, subMenuItemRender: (menuDataItemProps, _defaultDom, menuProps) => {
233
+ if (props?.siderMenuType === 'group') {
234
+ return React.createElement("span", { style: {
235
+ marginLeft: 4,
236
+ color: 'rgba(0,0,0,0.55)',
237
+ fontSize: token.fontSize - 2
238
+ } }, menuDataItemProps.name);
239
+ }
230
240
  return React.createElement("div", { style: {
231
- height: token.controlHeight + 2,
241
+ height: props?.siderMenusItemHeight ?? token.controlHeight,
232
242
  fontSize: token.fontSize,
233
243
  display: 'flex',
234
244
  alignItems: 'center',
235
245
  justifyContent: menuProps.collapsed ? 'center' : undefined,
236
246
  cursor: 'pointer',
237
- width: '100%',
238
- color: '#0c0d0e'
247
+ width: '100%'
239
248
  } },
240
- React.createElement("img", { src: (props.icon || '') === '' ? undefined : props.icon?.toString(), style: {
249
+ React.createElement("img", { src: (menuDataItemProps.icon || '') === '' ? undefined : menuDataItemProps.icon?.toString(), style: {
241
250
  width: 20,
242
251
  display: 'block',
243
- marginInlineEnd: menuProps.collapsed ? 0 : 4
252
+ marginInlineEnd: menuDataItemProps.collapsed ? 0 : 4
244
253
  }, alt: "" }),
245
- menuProps.collapsed ? undefined : props.name);
254
+ menuProps.collapsed ? undefined : menuDataItemProps.name);
246
255
  }, menuItemRender: (props, defaultDom, menuProps) => {
247
256
  const isSub = (props.locale?.toString()
248
257
  ?.split('.') || []).length > 2;
249
258
  return React.createElement("a", { style: {
250
259
  fontSize: token.fontSize,
251
260
  userSelect: 'none',
252
- height: token.controlHeight + 2,
261
+ height: props?.siderMenusItemHeight ?? token.controlHeight,
253
262
  display: 'flex',
254
263
  alignItems: 'center',
255
264
  justifyContent: menuProps.collapsed && !isSub ? 'center' : undefined,
256
- cursor: 'pointer',
257
- color: '#0c0d0e'
265
+ cursor: 'pointer'
258
266
  }, onClick: (e) => {
259
267
  e.preventDefault();
260
268
  if (props.isUrl || !props.path) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "beer-assembly-biz",
3
3
  "private": false,
4
- "version": "1.1.3-alpha.16",
4
+ "version": "1.1.3-alpha.18",
5
5
  "scripts": {
6
6
  "pub-w": "tsc && copy package.json .\\dist\\package.json && npm publish ./dist",
7
7
  "copy": "cp -a src/rich/AIEditor.css dist/rich/AIEditor.css && cp -a src/icon dist/icon && cp -a src/images dist/images",