beer-assembly-biz 1.1.2-alpha.5 → 1.1.2-alpha.7
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/AppLayout.js +6 -6
- package/MediaModals.js +3 -2
- package/MyPageContainer.d.ts +3 -1
- package/MyPageContainer.js +5 -4
- package/SubMenusContainer.d.ts +26 -0
- package/SubMenusContainer.js +61 -0
- package/package.json +1 -1
package/AppLayout.js
CHANGED
|
@@ -137,7 +137,7 @@ const Component = (props) => {
|
|
|
137
137
|
padding: 3px;
|
|
138
138
|
|
|
139
139
|
& > div {
|
|
140
|
-
height:
|
|
140
|
+
height: ${token.controlHeight + 2}px;
|
|
141
141
|
line-height: 1.5;
|
|
142
142
|
}
|
|
143
143
|
}
|
|
@@ -178,7 +178,7 @@ const Component = (props) => {
|
|
|
178
178
|
heightLayoutHeader: 48
|
|
179
179
|
},
|
|
180
180
|
sider: {
|
|
181
|
-
menuHeight:
|
|
181
|
+
menuHeight: token.controlHeight + 2,
|
|
182
182
|
paddingBlockLayoutMenu: 4,
|
|
183
183
|
paddingInlineLayoutMenu: 4,
|
|
184
184
|
colorMenuBackground: '#fff',
|
|
@@ -223,7 +223,7 @@ const Component = (props) => {
|
|
|
223
223
|
}
|
|
224
224
|
}, subMenuItemRender: (props, _defaultDom, menuProps) => {
|
|
225
225
|
return React.createElement("div", { style: {
|
|
226
|
-
height:
|
|
226
|
+
height: token.controlHeight + 2,
|
|
227
227
|
fontSize: token.fontSize,
|
|
228
228
|
display: 'flex',
|
|
229
229
|
alignItems: 'center',
|
|
@@ -244,7 +244,7 @@ const Component = (props) => {
|
|
|
244
244
|
return React.createElement("a", { style: {
|
|
245
245
|
fontSize: token.fontSize,
|
|
246
246
|
userSelect: 'none',
|
|
247
|
-
height:
|
|
247
|
+
height: token.controlHeight + 2,
|
|
248
248
|
display: 'flex',
|
|
249
249
|
alignItems: 'center',
|
|
250
250
|
justifyContent: menuProps.collapsed && !isSub ? 'center' : undefined,
|
|
@@ -284,7 +284,7 @@ const Component = (props) => {
|
|
|
284
284
|
size: 'small',
|
|
285
285
|
title: React.createElement("span", { style: {
|
|
286
286
|
color: '#333',
|
|
287
|
-
fontSize:
|
|
287
|
+
fontSize: token.fontSize + 1
|
|
288
288
|
} }, userInfo?.nickName || '系统用户'),
|
|
289
289
|
render: (_props, dom) => {
|
|
290
290
|
return (React.createElement(Dropdown, { menu: {
|
|
@@ -304,7 +304,7 @@ const Component = (props) => {
|
|
|
304
304
|
React.createElement(Typography.Text, { ellipsis: true, style: {
|
|
305
305
|
width: 200,
|
|
306
306
|
fontWeight: 500,
|
|
307
|
-
fontSize:
|
|
307
|
+
fontSize: token.fontSize + 1
|
|
308
308
|
} }, userInfo?.companyName || userInfo?.nickName)),
|
|
309
309
|
React.createElement("p", null,
|
|
310
310
|
React.createElement(Typography.Text, { ellipsis: true, style: { width: 200 } },
|
package/MediaModals.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { css } from '@emotion/css';
|
|
3
|
-
import { Breadcrumb, Button, Dropdown, Input, message, Modal, Popconfirm, Space, Spin, Typography } from 'antd';
|
|
3
|
+
import { Breadcrumb, Button, Dropdown, Input, message, Modal, Popconfirm, Space, Spin, theme, Typography } from 'antd';
|
|
4
4
|
import ElementUtils from 'beer-network/elementUtils';
|
|
5
5
|
import Flux from 'beer-assembly/Flux';
|
|
6
6
|
import { CloudDownloadOutlined, CopyOutlined, DeleteOutlined, ExclamationCircleFilled, HighlightOutlined, RightCircleOutlined, ScissorOutlined } from '@ant-design/icons';
|
|
@@ -11,6 +11,7 @@ import IconMedia from './icon/media.png';
|
|
|
11
11
|
export class MediaModals {
|
|
12
12
|
static useMedia(request) {
|
|
13
13
|
const [messageApi, contextHolder] = message.useMessage();
|
|
14
|
+
const { token } = theme.useToken();
|
|
14
15
|
const [isOpenModal, setIsOpenModal] = useState(false);
|
|
15
16
|
const [isOpenMoveModal, setIsOpenMoveModal] = useState(false);
|
|
16
17
|
const [isOpenRenameModal, setIsOpenRenameModal] = useState(false);
|
|
@@ -336,7 +337,7 @@ export class MediaModals {
|
|
|
336
337
|
React.createElement(Space, null,
|
|
337
338
|
React.createElement(Button, { type: "primary", onClick: () => onPutFile(), size: "small", style: {
|
|
338
339
|
height: 24,
|
|
339
|
-
fontSize:
|
|
340
|
+
fontSize: token.fontSize - 1
|
|
340
341
|
}, loading: isLoading }, "\u4E0A\u4F20\u6587\u4EF6"),
|
|
341
342
|
React.createElement(Popconfirm, { title: "\u8BF7\u8F93\u5165\u76EE\u5F55\u540D\u79F0", description: React.createElement(Input, { value: selectName, onChange: (e) => setSelectName(e.currentTarget.value) }), onCancel: () => setSelectName(''), onConfirm: () => onCreateDirectory(selectName), okText: "\u786E\u5B9A", cancelText: "\u53D6\u6D88" },
|
|
342
343
|
React.createElement(Button, { size: "small", style: {
|
package/MyPageContainer.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { FC } from 'react';
|
|
1
|
+
import React, { CSSProperties, FC } from 'react';
|
|
2
2
|
import { TabPaneProps } from 'antd';
|
|
3
3
|
export interface Tab extends Omit<TabPaneProps, 'tab'> {
|
|
4
4
|
key: string;
|
|
@@ -6,6 +6,8 @@ export interface Tab extends Omit<TabPaneProps, 'tab'> {
|
|
|
6
6
|
}
|
|
7
7
|
export declare type MyPageContainerProps = {
|
|
8
8
|
title?: string | undefined;
|
|
9
|
+
padding?: string | number | undefined;
|
|
10
|
+
style?: CSSProperties | undefined;
|
|
9
11
|
children?: React.ReactNode | undefined;
|
|
10
12
|
tabList?: Tab[];
|
|
11
13
|
onTabChange?: (e: string) => void;
|
package/MyPageContainer.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { css } from '@emotion/css';
|
|
3
3
|
import { PageContainer } from '@ant-design/pro-components';
|
|
4
|
-
import { message, Modal, Tabs } from 'antd';
|
|
4
|
+
import { message, Modal, Tabs, theme } from 'antd';
|
|
5
5
|
import { Outlet, useLocation } from 'react-router-dom';
|
|
6
6
|
import ParentContext from './content/ParentContext';
|
|
7
7
|
const pathPartition = (sessionStorage.getItem('DETAIL_PARTITION') || '') === ''
|
|
8
8
|
? ['CREATE', 'EDIT', 'COPY', 'AUDIT', 'PREVIEW', 'DETAIL', 'READ', 'IN', 'INPUT', 'OUTPUT']
|
|
9
9
|
: JSON.parse(sessionStorage.getItem('DETAIL_PARTITION') || '[]');
|
|
10
10
|
export const Component = (props) => {
|
|
11
|
+
const { token } = theme.useToken();
|
|
11
12
|
const location = useLocation();
|
|
12
13
|
const [messageApi, contextHolder] = message.useMessage();
|
|
13
14
|
const [modal, contextModalHolder] = Modal.useModal();
|
|
@@ -40,7 +41,7 @@ export const Component = (props) => {
|
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
.ant-page-header-heading-title {
|
|
43
|
-
font-size:
|
|
44
|
+
font-size: ${token.fontSize + 2}px;
|
|
44
45
|
line-height: 1.5;
|
|
45
46
|
color: #333;
|
|
46
47
|
}
|
|
@@ -64,8 +65,8 @@ export const Component = (props) => {
|
|
|
64
65
|
`, tabBarStyle: { margin: '0 24px' }, onChange: (e) => props?.onTabChange?.(e) })) : undefined,
|
|
65
66
|
props?.banner,
|
|
66
67
|
React.createElement("div", { className: css `
|
|
67
|
-
padding: 12px 16px;
|
|
68
|
-
|
|
68
|
+
padding: ${props?.padding || '12px 16px'};
|
|
69
|
+
`, style: props?.style }, props.children)),
|
|
69
70
|
React.createElement(Outlet, null)));
|
|
70
71
|
};
|
|
71
72
|
export default Component;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React, { CSSProperties, FC } from 'react';
|
|
2
|
+
import type { ComponentToken as MenuComponentToken } from 'antd/es/menu/style';
|
|
3
|
+
export declare type MenusItem = {
|
|
4
|
+
key?: string;
|
|
5
|
+
value?: string;
|
|
6
|
+
label: string | React.ReactNode;
|
|
7
|
+
children: MenusItem[];
|
|
8
|
+
};
|
|
9
|
+
export declare type SubMenusProps = {
|
|
10
|
+
items: MenusItem[];
|
|
11
|
+
token?: MenuComponentToken | undefined;
|
|
12
|
+
gap?: number | undefined;
|
|
13
|
+
height?: number | string | undefined;
|
|
14
|
+
width?: number | undefined;
|
|
15
|
+
padding?: number | string | undefined;
|
|
16
|
+
styles?: {
|
|
17
|
+
menus?: CSSProperties | undefined;
|
|
18
|
+
body?: CSSProperties | undefined;
|
|
19
|
+
};
|
|
20
|
+
header?: React.ReactNode | undefined;
|
|
21
|
+
children?: React.ReactNode | undefined;
|
|
22
|
+
defaultValue?: string | undefined;
|
|
23
|
+
onChange?: (key: string) => void;
|
|
24
|
+
};
|
|
25
|
+
export declare const Component: FC<SubMenusProps>;
|
|
26
|
+
export default Component;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ConfigProvider, Menu } from 'antd';
|
|
3
|
+
export const Component = (props) => {
|
|
4
|
+
return React.createElement(React.Fragment, null,
|
|
5
|
+
React.createElement(ConfigProvider, { theme: {
|
|
6
|
+
components: {
|
|
7
|
+
Menu: props?.token || {
|
|
8
|
+
itemHeight: 36,
|
|
9
|
+
itemBorderRadius: 0,
|
|
10
|
+
iconMarginInlineEnd: 0,
|
|
11
|
+
itemMarginBlock: 0,
|
|
12
|
+
itemMarginInline: 0,
|
|
13
|
+
itemPaddingInline: 0,
|
|
14
|
+
subMenuItemBg: 'transparent',
|
|
15
|
+
itemHoverBg: 'rgba(22,100,255,.04)',
|
|
16
|
+
itemHoverColor: '#000',
|
|
17
|
+
itemActiveBg: 'rgba(22,100,255,.08)',
|
|
18
|
+
itemSelectedBg: 'rgba(22,100,255,.08)'
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
} },
|
|
22
|
+
React.createElement("div", { style: {
|
|
23
|
+
display: 'flex',
|
|
24
|
+
gap: `${props?.gap || 12}px`,
|
|
25
|
+
alignItems: 'flex-start',
|
|
26
|
+
width: '100%'
|
|
27
|
+
} },
|
|
28
|
+
React.createElement("div", { style: {
|
|
29
|
+
width: props?.width || 200,
|
|
30
|
+
backgroundColor: '#fff',
|
|
31
|
+
height: props?.height || '100vh',
|
|
32
|
+
userSelect: 'none',
|
|
33
|
+
overflow: 'hidden',
|
|
34
|
+
...(props?.styles?.menus || {})
|
|
35
|
+
} },
|
|
36
|
+
props?.header !== undefined ? React.createElement("div", { style: {
|
|
37
|
+
padding: '12px 0',
|
|
38
|
+
fontWeight: 500,
|
|
39
|
+
borderInlineEnd: '1px solid rgba(5,5,5,.06)',
|
|
40
|
+
borderBlockEnd: '1px solid rgba(5,5,5,.06)'
|
|
41
|
+
} }, props?.header) : undefined,
|
|
42
|
+
React.createElement(Menu, { style: {
|
|
43
|
+
height: '100%'
|
|
44
|
+
}, onClick: (e) => {
|
|
45
|
+
props?.onChange?.(e.key);
|
|
46
|
+
}, subMenuCloseDelay: 0, defaultSelectedKeys: props?.defaultValue === undefined ? undefined : [props?.defaultValue], mode: "inline", inlineIndent: 16, items: props?.items?.map(item => {
|
|
47
|
+
return {
|
|
48
|
+
...item,
|
|
49
|
+
key: item.key || item.value
|
|
50
|
+
};
|
|
51
|
+
}) })),
|
|
52
|
+
React.createElement("div", { style: {
|
|
53
|
+
width: `calc(100% - ${(props?.width || 200) + (props?.gap || 12) + (props?.gap || 12)}px)`,
|
|
54
|
+
marginRight: (props?.gap || 12),
|
|
55
|
+
height: '100%',
|
|
56
|
+
padding: props?.padding || '12px 0',
|
|
57
|
+
...(props?.styles?.body || {}),
|
|
58
|
+
overflow: 'auto'
|
|
59
|
+
} }, props?.children))));
|
|
60
|
+
};
|
|
61
|
+
export default Component;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "beer-assembly-biz",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.1.2-alpha.
|
|
4
|
+
"version": "1.1.2-alpha.7",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"pub-w": "tsc && copy package.json .\\dist\\package.json && npm publish ./dist",
|
|
7
7
|
"pub-m": "tsc && cp -a src/icon ./dist && cp -a src/fonts ./dist && cp -a src/images ./dist && cp package.json ./dist/package.json && npm publish ./dist"
|