beer-assembly-biz 1.1.3-alpha.8 → 1.1.5-beta.1

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.
@@ -1,240 +0,0 @@
1
- "use strict";
2
- // import React, { FC, useEffect, useState } from 'react';
3
- // import { Modal, Space, Spin, theme, Typography } from 'antd';
4
- // import { css } from '@emotion/css';
5
- // import { RootPath } from './FileItemTable';
6
- // import FileNavigation from './FileNavigation';
7
- // import IconDirectory from './icon/directory.svg';
8
- // import IconConfirm from './icon/select_confirm.svg';
9
- // import IconCancel from './icon/close.svg';
10
- //
11
- // const { Text } = Typography;
12
- // export declare type Directory = {
13
- // id: string
14
- // name: string
15
- // }
16
- // export declare type DirectorySelectProps = {
17
- // phrase?: string | undefined
18
- // open?: boolean | undefined
19
- // isCreate?: boolean | undefined
20
- // request?: {
21
- // getDirectoryList?: (parentId: string | undefined) => Promise<Directory[]> | undefined;
22
- // create?: (parentId: string, name: string) => Promise<boolean> | undefined;
23
- // } | undefined
24
- // onCancel?: () => void | undefined
25
- // onOk?: (value: string) => Promise<void> | undefined
26
- // };
27
- // const App: FC<DirectorySelectProps> = (props) => {
28
- // const { token } = theme.useToken();
29
- // const inputRef = React.createRef<HTMLInputElement>();
30
- // const [loading, setLoading] = useState(false);
31
- // const [isCreate, setIsCreate] = useState(false);
32
- // const [directoryList, setDirectoryList] = useState([] as Directory[]);
33
- // const [modal, setModal] = useState(false);
34
- // const [rootPaths, setRootPaths] = useState([] as RootPath[]);
35
- // const [directoryName, setDirectoryName] = useState('');
36
- // const Directory = () => {
37
- // return <div style={{
38
- // width: 20,
39
- // height: 20,
40
- // marginRight: 6,
41
- // display: 'flex',
42
- // alignItems: 'center'
43
- // }}>
44
- // <img src={IconDirectory} style={{
45
- // width: 18,
46
- // display: 'block'
47
- // }} alt=""/>
48
- // </div>;
49
- // };
50
- // const requestDirectory = async () => {
51
- // setLoading(true);
52
- // const result = await props?.request?.getDirectoryList?.(rootPaths[rootPaths.length - 1]?.id);
53
- // setLoading(false);
54
- // if (result !== undefined) {
55
- // setDirectoryList(result);
56
- // }
57
- // };
58
- // const onSwitchPath = async (_id: string, index: number) => {
59
- // setRootPaths(rootPaths.slice(0, index + 1));
60
- // };
61
- // const onOpen = async (fileId: string, name: string) => {
62
- // setRootPaths([...rootPaths, {
63
- // id: fileId,
64
- // title: name
65
- // }]);
66
- // };
67
- // const onConfirm = async () => {
68
- // props?.onOk?.(rootPaths[rootPaths.length - 1]?.id);
69
- // };
70
- // const onCancelCreate = async () => {
71
- // setIsCreate(false);
72
- // };
73
- // const onConfirmCreate = async () => {
74
- // setLoading(true);
75
- // const result = await props?.request?.create?.(rootPaths[rootPaths.length - 1]?.id || '', directoryName);
76
- // setLoading(false);
77
- // if (result !== undefined && result) {
78
- // await requestDirectory();
79
- // setIsCreate(false);
80
- // }
81
- // };
82
- // useEffect(() => {
83
- // inputRef?.current?.focus();
84
- // }, [isCreate]);
85
- // useEffect(() => {
86
- // if (props?.open === true) {
87
- // setRootPaths([{
88
- // id: '',
89
- // title: '根目录'
90
- // }]);
91
- // }
92
- // setModal(props?.open || false);
93
- // }, [props.open]);
94
- // useEffect(() => {
95
- // if (props?.open === true) {
96
- // requestDirectory()
97
- // .then();
98
- // }
99
- // }, [rootPaths]);
100
- // return <>
101
- // <Modal open={modal} width={380} title={<><span style={{ marginInlineStart: 10 }}>{props?.phrase || '移动'}到</span></>} onCancel={props?.onCancel} styles={{
102
- // content: {
103
- // padding: '15px 12px 15px 12px'
104
- // },
105
- // body: {
106
- // padding: '0',
107
- // borderBottom: '1px solid #eee',
108
- // height: 356
109
- // },
110
- // footer: {
111
- // textAlign: 'inherit'
112
- // }
113
- // }} onOk={onConfirm} okText={(props?.phrase || '移动') + '到此'} maskClosable={false} footer={(node) => {
114
- // return <div style={{
115
- // display: 'flex',
116
- // alignItems: 'center',
117
- // marginInlineStart: 10,
118
- // userSelect: 'none'
119
- // }}>
120
- // <div style={{
121
- // width: '100%',
122
- // flex: 1
123
- // }}>
124
- // {props?.isCreate === false ? undefined : <a onClick={() => {
125
- // setDirectoryName('');
126
- // setIsCreate(true);
127
- // }}>新建文件夹</a>}
128
- // </div>
129
- // <Space>
130
- // {node}
131
- // </Space>
132
- // </div>;
133
- // }}>
134
- // <div>
135
- // <FileNavigation style={{
136
- // marginBottom: 4,
137
- // marginLeft: 10,
138
- // marginTop: 4
139
- // }} paths={rootPaths} onSwitchPath={onSwitchPath}/>
140
- // <Spin spinning={loading}>
141
- // <div style={{
142
- // maxHeight: 320,
143
- // overflow: 'auto',
144
- // marginBottom: 5
145
- // }} className={css`
146
- // .item:hover {
147
- // background: #efefef;
148
- // }
149
- // `}>
150
- // {isCreate ? <>
151
- // <div className="item" style={{
152
- // height: 34,
153
- // padding: '0 12px',
154
- // display: 'flex',
155
- // marginBottom: 2,
156
- // alignItems: 'center',
157
- // cursor: 'pointer',
158
- // position: 'relative',
159
- // userSelect: 'none',
160
- // borderRadius: token.borderRadius,
161
- // overflow: 'hidden'
162
- // }}>
163
- // <Directory/>
164
- // <div style={{ marginRight: '10px' }}>
165
- // <input
166
- // ref={inputRef as never}
167
- // style={{
168
- // outline: 'none',
169
- // border: '1px solid #d3d3d3',
170
- // padding: '3px 5px',
171
- // borderRadius: 2
172
- // }}
173
- // className={css`
174
- // :focus {
175
- // outline: 2px solid ${token.colorPrimary} !important;
176
- // border-color: ${token.colorPrimary};
177
- // }
178
- // `}
179
- // type="text"
180
- // value={directoryName}
181
- // onChange={(e) => setDirectoryName(e.target.value)}/>
182
- // </div>
183
- // <div style={{
184
- // backgroundImage: `url(${IconConfirm})`,
185
- // backgroundSize: '22px 22px',
186
- // backgroundPosition: 'center',
187
- // backgroundRepeat: 'no-repeat',
188
- // width: 22,
189
- // height: 22,
190
- // marginRight: 8,
191
- // borderRadius: 10,
192
- // overflow: 'hidden'
193
- // }} className={css`
194
- // &:hover {
195
- // background: #ddd;
196
- // }
197
- // `} onClick={onConfirmCreate}/>
198
- // <div style={{
199
- // backgroundImage: `url(${IconCancel})`,
200
- // backgroundSize: '16px 16px',
201
- // backgroundPosition: 'center',
202
- // backgroundRepeat: 'no-repeat',
203
- // width: 22,
204
- // height: 22,
205
- // borderRadius: 10,
206
- // overflow: 'hidden'
207
- // }} className={css`
208
- // &:hover {
209
- // background: #ddd;
210
- // }
211
- // `} onClick={onCancelCreate}/>
212
- // </div>
213
- // </> : undefined}
214
- // {directoryList.map(it => (
215
- // <div key={it.id} className="item" style={{
216
- // height: 30,
217
- // padding: '0 12px',
218
- // display: 'flex',
219
- // marginBottom: 2,
220
- // alignItems: 'center',
221
- // cursor: 'pointer',
222
- // position: 'relative',
223
- // userSelect: 'none',
224
- // borderRadius: token.borderRadius,
225
- // overflow: 'hidden'
226
- // }} onDoubleClick={() => onOpen(it.id, it.name)}>
227
- // <Directory/>
228
- // <Text style={{
229
- // width: '100%',
230
- // fontSize: token.fontSize
231
- // }} ellipsis={true}>{it.name}</Text>
232
- // </div>
233
- // ))}
234
- // </div>
235
- // </Spin>
236
- // </div>
237
- // </Modal>
238
- // </>;
239
- // };
240
- // export default App;
File without changes
@@ -1,126 +0,0 @@
1
- "use strict";
2
- // import React, { FC } from 'react';
3
- // import { css } from '@emotion/css';
4
- // import { App, ConfigProvider, Table, theme, Typography } from 'antd';
5
- // import zhCN from 'antd/lib/locale/zh_CN';
6
- // import MIME from './mime';
7
- //
8
- // export declare type FileItem = {
9
- // id: string
10
- // icon?: string | undefined
11
- // name: string
12
- // size: string
13
- // type: 'FILE' | 'DIRECTORY',
14
- // typeName?: string | undefined
15
- // createTime?: string | undefined
16
- // updateTime?: string | undefined
17
- // }
18
- // export declare type FileItemProps = {
19
- // style?: React.CSSProperties
20
- // data?: FileItem[] | undefined
21
- // };
22
- //
23
- // const { Text } = Typography;
24
- // const Component: FC<FileItemProps> = (props) => {
25
- // const { token } = theme.useToken();
26
- // const columns = [
27
- // {
28
- // title: '文件名称',
29
- // dataIndex: 'name',
30
- // key: 'name',
31
- // ellipsis: true,
32
- // render: (_: any, record: any) => (
33
- // <div style={{
34
- // width: '100%',
35
- // display: 'flex',
36
- // alignItems: 'center',
37
- // overflow: 'hidden'
38
- // }}>
39
- // <div style={{
40
- // minWidth: 18,
41
- // minHeight: 18,
42
- // marginRight: 8,
43
- // overflow: 'hidden',
44
- // backgroundImage: `url(${record.icon})`,
45
- // backgroundSize: record.type === 'FILE' ? '22px 22px' : '100% 100%',
46
- // backgroundPosition: 'center',
47
- // backgroundRepeat: 'no-repeat'
48
- // }}/>
49
- // <Text style={{
50
- // fontSize: token.fontSize
51
- // }} ellipsis={{ tooltip: <span style={{ fontSize: token.fontSize }}>{record.name}</span> }}>
52
- // {record.name}
53
- // </Text>
54
- // </div>
55
- // )
56
- // },
57
- // {
58
- // title: '文件类型',
59
- // dataIndex: 'type',
60
- // width: 90,
61
- // key: 'type',
62
- // render: (_: any, record: any) => (
63
- // <>
64
- // {record.typeName}
65
- // </>
66
- // )
67
- // },
68
- // {
69
- // title: '大小',
70
- // width: 80,
71
- // dataIndex: 'size',
72
- // key: 'size'
73
- // },
74
- // {
75
- // title: '修改时间',
76
- // dataIndex: 'updateTime',
77
- // width: 135,
78
- // key: 'updateTime'
79
- // }
80
- // ];
81
- // return <>
82
- // <App>
83
- // <ConfigProvider theme={{
84
- // token: {
85
- // fontSize: token.fontSize
86
- // },
87
- // components: {
88
- // Table: {
89
- // motion: false,
90
- // headerColor: '#333',
91
- // rowHoverBg: '#f5f6f7',
92
- // rowSelectedBg: '#f4f5f6',
93
- // rowSelectedHoverBg: '#e6e7e8'
94
- // }
95
- // }
96
- // }} locale={zhCN}>
97
- // <Table style={props.style} className={css`
98
- // user-select: none;
99
- //
100
- // .ant-table-thead {
101
- // & .ant-table-cell {
102
- // font-size: 12px;
103
- // padding: 5px 8px !important;
104
- // }
105
- // }
106
- //
107
- // .ant-table-tbody {
108
- // & .ant-table-cell {
109
- // font-size: 13px;
110
- // padding: 5px 8px !important;
111
- // }
112
- // }
113
- // `} columns={columns} dataSource={props?.data?.map(it => {
114
- // const [typeName, icon] = (MIME.parse(it.name) || []);
115
- // return {
116
- // ...it,
117
- // typeName,
118
- // icon,
119
- // size: MIME.formatBytes(Number(it.size))
120
- // };
121
- // })} size="small" pagination={false}/>
122
- // </ConfigProvider>
123
- // </App>
124
- // </>;
125
- // };
126
- // export default Component;
File without changes