beer-assembly-biz 1.1.2-alpha.6 → 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/MediaModals.js +3 -2
- package/SubMenusContainer.d.ts +3 -1
- package/SubMenusContainer.js +22 -7
- package/package.json +1 -1
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/SubMenusContainer.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React, { CSSProperties, FC } from 'react';
|
|
2
2
|
import type { ComponentToken as MenuComponentToken } from 'antd/es/menu/style';
|
|
3
3
|
export declare type MenusItem = {
|
|
4
|
-
key
|
|
4
|
+
key?: string;
|
|
5
|
+
value?: string;
|
|
5
6
|
label: string | React.ReactNode;
|
|
6
7
|
children: MenusItem[];
|
|
7
8
|
};
|
|
@@ -10,6 +11,7 @@ export declare type SubMenusProps = {
|
|
|
10
11
|
token?: MenuComponentToken | undefined;
|
|
11
12
|
gap?: number | undefined;
|
|
12
13
|
height?: number | string | undefined;
|
|
14
|
+
width?: number | undefined;
|
|
13
15
|
padding?: number | string | undefined;
|
|
14
16
|
styles?: {
|
|
15
17
|
menus?: CSSProperties | undefined;
|
package/SubMenusContainer.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ConfigProvider, Menu
|
|
2
|
+
import { ConfigProvider, Menu } from 'antd';
|
|
3
3
|
export const Component = (props) => {
|
|
4
4
|
return React.createElement(React.Fragment, null,
|
|
5
5
|
React.createElement(ConfigProvider, { theme: {
|
|
@@ -19,11 +19,14 @@ export const Component = (props) => {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
} },
|
|
22
|
-
React.createElement(
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
React.createElement("div", { style: {
|
|
23
|
+
display: 'flex',
|
|
24
|
+
gap: `${props?.gap || 12}px`,
|
|
25
|
+
alignItems: 'flex-start',
|
|
26
|
+
width: '100%'
|
|
27
|
+
} },
|
|
25
28
|
React.createElement("div", { style: {
|
|
26
|
-
width: 200,
|
|
29
|
+
width: props?.width || 200,
|
|
27
30
|
backgroundColor: '#fff',
|
|
28
31
|
height: props?.height || '100vh',
|
|
29
32
|
userSelect: 'none',
|
|
@@ -40,7 +43,19 @@ export const Component = (props) => {
|
|
|
40
43
|
height: '100%'
|
|
41
44
|
}, onClick: (e) => {
|
|
42
45
|
props?.onChange?.(e.key);
|
|
43
|
-
}, subMenuCloseDelay: 0, defaultSelectedKeys: props?.defaultValue === undefined ? undefined : [props?.defaultValue], mode: "inline", inlineIndent: 16, items: props?.items
|
|
44
|
-
|
|
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))));
|
|
45
60
|
};
|
|
46
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"
|