beer-assembly-biz 1.1.2-alpha.9 → 1.1.3-alpha.2

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.
Files changed (179) hide show
  1. package/UserModals.d.ts +7 -3
  2. package/UserModals.js +6 -0
  3. package/auth/AuthPassword.d.ts +2 -3
  4. package/auth/AuthPassword.js +5 -5
  5. package/auth/AuthStyle01.d.ts +3 -4
  6. package/auth/AuthStyle01.js +4 -5
  7. package/auth/AuthStyle02.d.ts +3 -4
  8. package/auth/AuthStyle02.js +4 -5
  9. package/auth/AuthThirdPartyAuth.d.ts +2 -3
  10. package/auth/AuthThirdPartyAuth.js +1 -2
  11. package/content/ParentContext.d.ts +4 -2
  12. package/content/ParentContext.js +4 -2
  13. package/content/PermissionContext.d.ts +4 -2
  14. package/content/PermissionContext.js +4 -2
  15. package/icon/icon/directory.svg +12 -0
  16. package/icon/icon/empty.svg +43 -0
  17. package/icon/icon/media.png +0 -0
  18. package/icon/icon/volc.svg +96 -0
  19. package/images/images/assets_background_01.png +0 -0
  20. package/images/images/avatar.png +0 -0
  21. package/images/images/layout_01.png +0 -0
  22. package/images/images/layout_02.png +0 -0
  23. package/images/images/layout_03.png +0 -0
  24. package/index.d.ts +14 -0
  25. package/index.js +14 -0
  26. package/{AppLayout.d.ts → layout/AppLayout.d.ts} +4 -2
  27. package/{AppLayout.js → layout/AppLayout.js} +4 -2
  28. package/{BackPageContainer.d.ts → layout/BackPageContainer.d.ts} +4 -2
  29. package/{BackPageContainer.js → layout/BackPageContainer.js} +4 -2
  30. package/{MyPageContainer.d.ts → layout/MyPageContainer.d.ts} +4 -2
  31. package/{MyPageContainer.js → layout/MyPageContainer.js} +5 -3
  32. package/media/MediaModals.d.ts +0 -0
  33. package/media/MediaModals.js +461 -0
  34. package/net-disk/DirectoryMenusPanel.d.ts +0 -0
  35. package/net-disk/DirectoryMenusPanel.js +337 -0
  36. package/net-disk/DirectorySelect.d.ts +0 -0
  37. package/net-disk/DirectorySelect.js +240 -0
  38. package/net-disk/FileItemList.d.ts +0 -0
  39. package/net-disk/FileItemList.js +126 -0
  40. package/net-disk/FileItemTable.d.ts +0 -0
  41. package/net-disk/FileItemTable.js +422 -0
  42. package/net-disk/FileNavigation.d.ts +0 -0
  43. package/net-disk/FileNavigation.js +43 -0
  44. package/net-disk/NetDisk.d.ts +0 -0
  45. package/net-disk/NetDisk.js +36 -0
  46. package/net-disk/NetDiskModals.d.ts +0 -0
  47. package/net-disk/NetDiskModals.js +40 -0
  48. package/package.json +29 -19
  49. package/{Permission.d.ts → permission/Permission.d.ts} +4 -2
  50. package/{Permission.js → permission/Permission.js} +5 -3
  51. package/promises.d.ts +42 -0
  52. package/promises.js +128 -0
  53. package/rich/AIEditor.css +1647 -0
  54. package/rich/AIEditor.d.ts +51 -0
  55. package/rich/AIEditor.js +90 -0
  56. package/slider/SliderCode.d.ts +23 -0
  57. package/slider/SliderCode.js +203 -0
  58. package/type.d.ts +3 -0
  59. package/type.js +1 -0
  60. package/InlineContainer.d.ts +0 -6
  61. package/InlineContainer.js +0 -28
  62. package/MediaModals.d.ts +0 -32
  63. package/MediaModals.js +0 -373
  64. package/NetDiskModals.d.ts +0 -15
  65. package/NetDiskModals.js +0 -28
  66. package/SubMenusContainer.d.ts +0 -27
  67. package/SubMenusContainer.js +0 -72
  68. package/Upgrade.d.ts +0 -7
  69. package/Upgrade.js +0 -46
  70. package/fonts/harmony/HarmonyOS_Medium.a.woff2 +0 -0
  71. package/fonts/harmony/HarmonyOS_Medium.a0.woff2 +0 -0
  72. package/fonts/harmony/HarmonyOS_Medium.a1.woff2 +0 -0
  73. package/fonts/harmony/HarmonyOS_Medium.aa.woff2 +0 -0
  74. package/fonts/harmony/HarmonyOS_Medium.ab.woff2 +0 -0
  75. package/fonts/harmony/HarmonyOS_Medium.ac.woff2 +0 -0
  76. package/fonts/harmony/HarmonyOS_Medium.ad.woff2 +0 -0
  77. package/fonts/harmony/HarmonyOS_Medium.ae.woff2 +0 -0
  78. package/fonts/harmony/HarmonyOS_Medium.af.woff2 +0 -0
  79. package/fonts/harmony/HarmonyOS_Medium.ag.woff2 +0 -0
  80. package/fonts/harmony/HarmonyOS_Medium.ah.woff2 +0 -0
  81. package/fonts/harmony/HarmonyOS_Medium.ai.woff2 +0 -0
  82. package/fonts/harmony/HarmonyOS_Medium.aj.woff2 +0 -0
  83. package/fonts/harmony/HarmonyOS_Medium.ak.woff2 +0 -0
  84. package/fonts/harmony/HarmonyOS_Medium.al.woff2 +0 -0
  85. package/fonts/harmony/HarmonyOS_Medium.am.woff2 +0 -0
  86. package/fonts/harmony/HarmonyOS_Medium.an.woff2 +0 -0
  87. package/fonts/harmony/HarmonyOS_Medium.ao.woff2 +0 -0
  88. package/fonts/harmony/HarmonyOS_Medium.ap.woff2 +0 -0
  89. package/fonts/harmony/HarmonyOS_Medium.aq.woff2 +0 -0
  90. package/fonts/harmony/HarmonyOS_Medium.ar.woff2 +0 -0
  91. package/fonts/harmony/HarmonyOS_Medium.as.woff2 +0 -0
  92. package/fonts/harmony/HarmonyOS_Medium.at.woff2 +0 -0
  93. package/fonts/harmony/HarmonyOS_Medium.au.woff2 +0 -0
  94. package/fonts/harmony/HarmonyOS_Medium.av.woff2 +0 -0
  95. package/fonts/harmony/HarmonyOS_Medium.aw.woff2 +0 -0
  96. package/fonts/harmony/HarmonyOS_Medium.ax.woff2 +0 -0
  97. package/fonts/harmony/HarmonyOS_Medium.ay.woff2 +0 -0
  98. package/fonts/harmony/HarmonyOS_Medium.az.woff2 +0 -0
  99. package/fonts/harmony/HarmonyOS_Medium.b.woff2 +0 -0
  100. package/fonts/harmony/HarmonyOS_Medium.c.woff2 +0 -0
  101. package/fonts/harmony/HarmonyOS_Medium.d.woff2 +0 -0
  102. package/fonts/harmony/HarmonyOS_Medium.e.woff2 +0 -0
  103. package/fonts/harmony/HarmonyOS_Medium.f.woff2 +0 -0
  104. package/fonts/harmony/HarmonyOS_Medium.g.woff2 +0 -0
  105. package/fonts/harmony/HarmonyOS_Medium.h.woff2 +0 -0
  106. package/fonts/harmony/HarmonyOS_Medium.i.woff2 +0 -0
  107. package/fonts/harmony/HarmonyOS_Medium.j.woff2 +0 -0
  108. package/fonts/harmony/HarmonyOS_Medium.k.woff2 +0 -0
  109. package/fonts/harmony/HarmonyOS_Medium.l.woff2 +0 -0
  110. package/fonts/harmony/HarmonyOS_Medium.m.woff2 +0 -0
  111. package/fonts/harmony/HarmonyOS_Medium.n.woff2 +0 -0
  112. package/fonts/harmony/HarmonyOS_Medium.o.woff2 +0 -0
  113. package/fonts/harmony/HarmonyOS_Medium.p.woff2 +0 -0
  114. package/fonts/harmony/HarmonyOS_Medium.q.woff2 +0 -0
  115. package/fonts/harmony/HarmonyOS_Medium.r.woff2 +0 -0
  116. package/fonts/harmony/HarmonyOS_Medium.s.woff2 +0 -0
  117. package/fonts/harmony/HarmonyOS_Medium.t.woff2 +0 -0
  118. package/fonts/harmony/HarmonyOS_Medium.u.woff2 +0 -0
  119. package/fonts/harmony/HarmonyOS_Medium.v.woff2 +0 -0
  120. package/fonts/harmony/HarmonyOS_Medium.w.woff2 +0 -0
  121. package/fonts/harmony/HarmonyOS_Medium.x.woff2 +0 -0
  122. package/fonts/harmony/HarmonyOS_Medium.y.woff2 +0 -0
  123. package/fonts/harmony/HarmonyOS_Medium.z.woff2 +0 -0
  124. package/fonts/harmony/HarmonyOS_Regular.a.woff2 +0 -0
  125. package/fonts/harmony/HarmonyOS_Regular.a0.woff2 +0 -0
  126. package/fonts/harmony/HarmonyOS_Regular.a1.woff2 +0 -0
  127. package/fonts/harmony/HarmonyOS_Regular.aa.woff2 +0 -0
  128. package/fonts/harmony/HarmonyOS_Regular.ab.woff2 +0 -0
  129. package/fonts/harmony/HarmonyOS_Regular.ac.woff2 +0 -0
  130. package/fonts/harmony/HarmonyOS_Regular.ad.woff2 +0 -0
  131. package/fonts/harmony/HarmonyOS_Regular.ae.woff2 +0 -0
  132. package/fonts/harmony/HarmonyOS_Regular.af.woff2 +0 -0
  133. package/fonts/harmony/HarmonyOS_Regular.ag.woff2 +0 -0
  134. package/fonts/harmony/HarmonyOS_Regular.ah.woff2 +0 -0
  135. package/fonts/harmony/HarmonyOS_Regular.ai.woff2 +0 -0
  136. package/fonts/harmony/HarmonyOS_Regular.aj.woff2 +0 -0
  137. package/fonts/harmony/HarmonyOS_Regular.ak.woff2 +0 -0
  138. package/fonts/harmony/HarmonyOS_Regular.al.woff2 +0 -0
  139. package/fonts/harmony/HarmonyOS_Regular.am.woff2 +0 -0
  140. package/fonts/harmony/HarmonyOS_Regular.an.woff2 +0 -0
  141. package/fonts/harmony/HarmonyOS_Regular.ao.woff2 +0 -0
  142. package/fonts/harmony/HarmonyOS_Regular.ap.woff2 +0 -0
  143. package/fonts/harmony/HarmonyOS_Regular.aq.woff2 +0 -0
  144. package/fonts/harmony/HarmonyOS_Regular.ar.woff2 +0 -0
  145. package/fonts/harmony/HarmonyOS_Regular.as.woff2 +0 -0
  146. package/fonts/harmony/HarmonyOS_Regular.at.woff2 +0 -0
  147. package/fonts/harmony/HarmonyOS_Regular.au.woff2 +0 -0
  148. package/fonts/harmony/HarmonyOS_Regular.av.woff2 +0 -0
  149. package/fonts/harmony/HarmonyOS_Regular.aw.woff2 +0 -0
  150. package/fonts/harmony/HarmonyOS_Regular.ax.woff2 +0 -0
  151. package/fonts/harmony/HarmonyOS_Regular.ay.woff2 +0 -0
  152. package/fonts/harmony/HarmonyOS_Regular.az.woff2 +0 -0
  153. package/fonts/harmony/HarmonyOS_Regular.b.woff2 +0 -0
  154. package/fonts/harmony/HarmonyOS_Regular.c.woff2 +0 -0
  155. package/fonts/harmony/HarmonyOS_Regular.d.woff2 +0 -0
  156. package/fonts/harmony/HarmonyOS_Regular.e.woff2 +0 -0
  157. package/fonts/harmony/HarmonyOS_Regular.f.woff2 +0 -0
  158. package/fonts/harmony/HarmonyOS_Regular.g.woff2 +0 -0
  159. package/fonts/harmony/HarmonyOS_Regular.h.woff2 +0 -0
  160. package/fonts/harmony/HarmonyOS_Regular.i.woff2 +0 -0
  161. package/fonts/harmony/HarmonyOS_Regular.j.woff2 +0 -0
  162. package/fonts/harmony/HarmonyOS_Regular.k.woff2 +0 -0
  163. package/fonts/harmony/HarmonyOS_Regular.l.woff2 +0 -0
  164. package/fonts/harmony/HarmonyOS_Regular.m.woff2 +0 -0
  165. package/fonts/harmony/HarmonyOS_Regular.n.woff2 +0 -0
  166. package/fonts/harmony/HarmonyOS_Regular.o.woff2 +0 -0
  167. package/fonts/harmony/HarmonyOS_Regular.p.woff2 +0 -0
  168. package/fonts/harmony/HarmonyOS_Regular.q.woff2 +0 -0
  169. package/fonts/harmony/HarmonyOS_Regular.r.woff2 +0 -0
  170. package/fonts/harmony/HarmonyOS_Regular.s.woff2 +0 -0
  171. package/fonts/harmony/HarmonyOS_Regular.t.woff2 +0 -0
  172. package/fonts/harmony/HarmonyOS_Regular.u.woff2 +0 -0
  173. package/fonts/harmony/HarmonyOS_Regular.v.woff2 +0 -0
  174. package/fonts/harmony/HarmonyOS_Regular.w.woff2 +0 -0
  175. package/fonts/harmony/HarmonyOS_Regular.x.woff2 +0 -0
  176. package/fonts/harmony/HarmonyOS_Regular.y.woff2 +0 -0
  177. package/fonts/harmony/HarmonyOS_Regular.z.woff2 +0 -0
  178. package/fonts/harmony/medium.css +0 -485
  179. package/fonts/harmony/regular.css +0 -485
package/MediaModals.js DELETED
@@ -1,373 +0,0 @@
1
- import React, { useEffect, useRef, useState } from 'react';
2
- import { css } from '@emotion/css';
3
- import { Breadcrumb, Button, Dropdown, Input, message, Modal, Popconfirm, Space, Spin, theme, Typography } from 'antd';
4
- import ElementUtils from 'beer-network/elementUtils';
5
- import Flux from 'beer-assembly/Flux';
6
- import { CloudDownloadOutlined, CopyOutlined, DeleteOutlined, ExclamationCircleFilled, HighlightOutlined, RightCircleOutlined, ScissorOutlined } from '@ant-design/icons';
7
- import DirectorySelect from 'beer-assembly/DirectorySelect';
8
- import InlineContainer from './InlineContainer';
9
- import IconDirectory from './icon/directory.svg';
10
- import IconMedia from './icon/media.png';
11
- export class MediaModals {
12
- static useMedia(request) {
13
- const [messageApi, contextHolder] = message.useMessage();
14
- const { token } = theme.useToken();
15
- const [isOpenModal, setIsOpenModal] = useState(false);
16
- const [isOpenMoveModal, setIsOpenMoveModal] = useState(false);
17
- const [isOpenRenameModal, setIsOpenRenameModal] = useState(false);
18
- const [isOpenConfirmModal, setIsOpenConfirmModal] = useState(false);
19
- const [isLoading, setIsLoading] = useState(false);
20
- const [path, setPath] = useState([]);
21
- const [dataList, setDataList] = useState([]);
22
- const [selectId, setSelectId] = useState('');
23
- const [selectName, setSelectName] = useState('');
24
- const callbackRef = useRef(undefined);
25
- const refreshData = (force) => {
26
- const item = path[path.length - 1];
27
- const chunkArray = (array, size) => {
28
- const result = [];
29
- for (let i = 0; i < array.length; i += size) {
30
- result.push(array.slice(i, i + size));
31
- }
32
- return result;
33
- };
34
- setIsLoading(true);
35
- if (force === true) {
36
- setDataList([]);
37
- }
38
- request?.requestList?.(item.id)
39
- .then(result => {
40
- setIsLoading(false);
41
- setDataList(chunkArray(result || [], 5));
42
- })
43
- .catch(() => {
44
- setIsLoading(false);
45
- });
46
- };
47
- const onActiveItem = (id) => {
48
- setDataList(dataList?.map(item => {
49
- return item.map(it => {
50
- return {
51
- ...it,
52
- active: it.id === id
53
- };
54
- });
55
- }));
56
- };
57
- const onDownload = async (name, url) => {
58
- if ((url || '').trim() === '') {
59
- return;
60
- }
61
- ElementUtils.download(url || '', name);
62
- };
63
- const onPutFile = async () => {
64
- const files = await ElementUtils.selectFile();
65
- if (files === null) {
66
- return;
67
- }
68
- for (let i = 0; i < files.length; i += 1) {
69
- const file = files[i];
70
- if (file.size > (1048576 * 15)) {
71
- messageApi.error(`文件 ${file.name} 太大,不能超过 15MB`);
72
- return;
73
- }
74
- if (!['image/jpeg', 'image/png', 'image/gif', 'image/webp'].includes(file.type)) {
75
- messageApi.error(`文件 ${file.name} 不是有效的图片格式`);
76
- return;
77
- }
78
- }
79
- const parentId = path[path.length - 1]?.id;
80
- setIsLoading(true);
81
- const result = await request?.putFile(parentId, files);
82
- setIsLoading(false);
83
- if (result === true) {
84
- refreshData();
85
- }
86
- };
87
- const onCreateDirectory = async (name) => {
88
- const parentId = path[path.length - 1]?.id;
89
- setIsLoading(true);
90
- const result = await request?.createDirectory(parentId, name);
91
- setIsLoading(false);
92
- if (result === true) {
93
- refreshData();
94
- }
95
- setSelectName('');
96
- return true;
97
- };
98
- const onOpenDirectory = async (id, name) => {
99
- if (isLoading) {
100
- return;
101
- }
102
- const paths = [...getPaths(), {
103
- id,
104
- name
105
- }];
106
- setPaths(paths);
107
- };
108
- const onBackDirectory = async (id) => {
109
- if (isLoading) {
110
- return;
111
- }
112
- const paths = getPaths();
113
- const index = paths.findIndex(it => it.id === id);
114
- if (index < 0) {
115
- return;
116
- }
117
- paths.splice(index + 1);
118
- setPaths(paths);
119
- };
120
- const onSelectItem = async (id, name, url) => {
121
- const current = callbackRef?.current;
122
- if (current === undefined) {
123
- return;
124
- }
125
- current?.([url || '']);
126
- setIsOpenModal(false);
127
- };
128
- const onRename = async (id, name) => {
129
- setIsOpenRenameModal(true);
130
- setSelectId(id);
131
- setSelectName(name);
132
- };
133
- const onConfirmRename = async () => {
134
- if (await request?.rename(selectId, selectName)) {
135
- refreshData();
136
- setSelectName('');
137
- setIsOpenRenameModal(false);
138
- }
139
- };
140
- const onCopy = async (id) => {
141
- const result = await request?.copy(id);
142
- if (result === true) {
143
- refreshData();
144
- }
145
- return result;
146
- };
147
- const onMove = async (id) => {
148
- setIsOpenMoveModal(true);
149
- setSelectId(id);
150
- };
151
- const onConfirmMove = async (targetId) => {
152
- const result = await request?.move(selectId, targetId);
153
- if (result === true) {
154
- setIsOpenMoveModal(false);
155
- refreshData();
156
- }
157
- };
158
- const onRemove = async (id) => {
159
- setIsOpenConfirmModal(true);
160
- setSelectId(id);
161
- };
162
- const onConfirmRemove = async () => {
163
- const result = await request?.remove(selectId);
164
- if (result === true) {
165
- setIsOpenConfirmModal(false);
166
- refreshData();
167
- }
168
- return result;
169
- };
170
- const setPaths = (items) => {
171
- setPath(items);
172
- sessionStorage.setItem('MEDIA_MODALS_PATHS', JSON.stringify(items));
173
- };
174
- const getPaths = () => {
175
- const paths = JSON.parse(sessionStorage.getItem('MEDIA_MODALS_PATHS') || '[]');
176
- if (paths.length <= 0) {
177
- paths.push({
178
- id: '0',
179
- name: '根目录'
180
- });
181
- }
182
- return paths;
183
- };
184
- const Item = (props) => {
185
- const directoryMenusItem = props.type === 'DIRECTORY' ? [
186
- {
187
- label: React.createElement(Space, { style: { width: 100 }, size: 5, onClick: () => onOpenDirectory(props.id, props.name) },
188
- React.createElement(RightCircleOutlined, null),
189
- "\u6253\u5F00\u76EE\u5F55"),
190
- key: '0'
191
- },
192
- {
193
- type: 'divider'
194
- }
195
- ] : [
196
- {
197
- label: React.createElement(Space, { style: { width: 100 }, size: 5, onClick: () => onDownload(props.name, props.src) },
198
- React.createElement(CloudDownloadOutlined, null),
199
- "\u4E0B\u8F7D\u6587\u4EF6"),
200
- key: '0'
201
- },
202
- {
203
- type: 'divider'
204
- }
205
- ];
206
- const menusItems = [
207
- ...directoryMenusItem,
208
- {
209
- label: React.createElement(Space, { style: { width: 100 }, size: 5, onClick: () => onRename(props.id, props.name) },
210
- React.createElement(HighlightOutlined, null),
211
- "\u91CD\u547D\u540D"),
212
- key: '1'
213
- },
214
- {
215
- label: React.createElement(Space, { style: { width: 100 }, size: 5, onClick: () => onCopy(props.id) },
216
- React.createElement(CopyOutlined, null),
217
- props?.type === 'DIRECTORY' ? '复制目录' : '复制文件'),
218
- key: '2'
219
- },
220
- {
221
- label: React.createElement(Space, { style: { width: 100 }, size: 5, onClick: () => onMove(props.id) },
222
- React.createElement(ScissorOutlined, null),
223
- props?.type === 'DIRECTORY' ? '移动目录' : '移动文件'),
224
- key: '3'
225
- },
226
- {
227
- type: 'divider'
228
- },
229
- {
230
- label: React.createElement(Space, { style: { width: 100 }, size: 5, onClick: () => onRemove(props.id) },
231
- React.createElement(DeleteOutlined, null),
232
- props?.type === 'DIRECTORY' ? '删除目录' : '删除文件'),
233
- key: '4',
234
- danger: true
235
- }
236
- ];
237
- return React.createElement(Dropdown, { menu: {
238
- items: menusItems
239
- }, trigger: ['contextMenu'] },
240
- React.createElement("div", { style: {
241
- padding: '8px 12px',
242
- backgroundColor: props?.active ? '#e6f1ff' : undefined,
243
- display: 'block',
244
- cursor: 'pointer',
245
- userSelect: 'none',
246
- position: 'relative',
247
- ...props.style
248
- }, className: css `
249
- border: ${props?.active ? '1px solid #cddef5' : '1px solid #fff'};
250
-
251
- &:hover {
252
- background-color: #eef1f5;
253
- border: 1px solid ${props.active ? '#cddef5' : '#e6e6e6'};
254
- }
255
- `, onClick: () => {
256
- setTimeout(() => onActiveItem(props.id), 10);
257
- }, onDoubleClick: () => {
258
- if (props.type === 'DIRECTORY') {
259
- onOpenDirectory(props.id, props.name)
260
- .then();
261
- return;
262
- }
263
- onSelectItem(props.id, props.name, props.src)
264
- .then();
265
- } },
266
- React.createElement("img", { src: props?.type === 'DIRECTORY' ? IconDirectory : props?.src, alt: "", style: {
267
- width: 56,
268
- height: 56,
269
- margin: 'auto',
270
- display: 'block',
271
- overflow: 'hidden',
272
- objectFit: props?.type === 'DIRECTORY' ? undefined : 'cover'
273
- } }),
274
- React.createElement(Typography.Text, { style: {
275
- width: 70,
276
- fontSize: 11,
277
- display: 'block',
278
- textAlign: 'center',
279
- color: '#323232',
280
- marginTop: props?.type === 'DIRECTORY' ? undefined : 1
281
- }, ellipsis: true }, props?.name)));
282
- };
283
- const handler = {
284
- ok: (callback) => {
285
- setPath(getPaths());
286
- setIsOpenModal(true);
287
- if (callbackRef !== undefined) {
288
- callbackRef.current = callback;
289
- }
290
- }
291
- };
292
- useEffect(() => {
293
- if ((path || []).length <= 0) {
294
- return;
295
- }
296
- refreshData(true);
297
- }, [path]);
298
- return [handler, React.createElement(React.Fragment, null,
299
- React.createElement(InlineContainer, null,
300
- React.createElement(Modal, { width: 565, footer: null, styles: {
301
- content: { padding: 0 }
302
- }, open: isOpenModal, maskClosable: false, onCancel: () => {
303
- if (isLoading) {
304
- return;
305
- }
306
- setIsOpenModal(false);
307
- }, title: React.createElement("div", { style: {
308
- padding: '16px 0 0 0'
309
- } },
310
- React.createElement("img", { style: {
311
- marginInlineStart: 20,
312
- display: 'block',
313
- height: '17px',
314
- padding: '2px 0 0 0'
315
- }, alt: "", src: IconMedia })) },
316
- React.createElement(Flux, { style: {
317
- marginBottom: 6,
318
- padding: '0 20px 10px 20px',
319
- borderBottom: '1px solid #f3f3f3',
320
- justifyContent: 'space-between'
321
- } },
322
- React.createElement(Breadcrumb, { items: path?.map((it, index) => {
323
- return {
324
- title: (index + 1 === path.length
325
- ? React.createElement(Typography.Text, { style: {
326
- maxWidth: 70,
327
- fontSize: 12
328
- }, ellipsis: true }, it.name)
329
- : React.createElement("a", { onClick: () => onBackDirectory(it.id) },
330
- React.createElement(Typography.Text, { style: {
331
- maxWidth: 70,
332
- fontSize: 12,
333
- color: 'rgba(0, 0, 0, 0.45)'
334
- }, ellipsis: true }, it.name)))
335
- };
336
- }) }),
337
- React.createElement(Space, null,
338
- React.createElement(Button, { type: "primary", onClick: () => onPutFile(), size: "small", style: {
339
- height: 24,
340
- fontSize: token.fontSize - 1
341
- }, loading: isLoading }, "\u4E0A\u4F20\u6587\u4EF6"),
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" },
343
- React.createElement(Button, { size: "small", style: {
344
- height: 24,
345
- fontSize: 12
346
- }, loading: isLoading }, "\u65B0\u5EFA\u76EE\u5F55")))),
347
- React.createElement(Spin, { spinning: isLoading },
348
- React.createElement("div", { style: {
349
- padding: '6px 0 24px 0',
350
- height: 333,
351
- maxHeight: 333,
352
- overflowY: 'auto',
353
- overflowX: 'hidden'
354
- } }, dataList?.map((group, index) => (React.createElement("div", { key: index, style: {
355
- padding: '0 20px 10px 20px',
356
- display: 'flex'
357
- } }, group?.map((item) => (React.createElement(Item, { id: item.id, key: item.id, active: item.active, style: { marginRight: 10 }, type: item.type, src: item.url, name: item.name })))))))))),
358
- React.createElement(Modal, { title: "\u91CD\u547D\u540D", width: 340, open: isOpenRenameModal, onOk: () => onConfirmRename(), onCancel: () => setIsOpenRenameModal(false), okText: "\u786E\u5B9A", cancelText: "\u53D6\u6D88" },
359
- React.createElement(Input, { value: selectName, onChange: (e) => setSelectName(e.currentTarget.value) })),
360
- React.createElement(Modal, { title: React.createElement(React.Fragment, null,
361
- React.createElement(ExclamationCircleFilled, { style: {
362
- marginRight: 6,
363
- fontSize: 16,
364
- color: '#faad14'
365
- } }),
366
- "\u662F\u5426\u786E\u8BA4\u5220\u9664?"), width: 400, open: isOpenConfirmModal, onOk: () => onConfirmRemove(), onCancel: () => setIsOpenConfirmModal(false), okText: "\u786E\u5B9A", cancelText: "\u53D6\u6D88" }, "\u5220\u9664\u64CD\u4F5C\u4E0D\u80FD\u56DE\u590D\uFF0C\u786E\u5B9A\u8981\u5220\u9664\u9009\u4E2D\u7684\u6587\u4EF6\u6216\u6587\u4EF6\u5939\u5417\uFF1F"),
367
- React.createElement(DirectorySelect, { open: isOpenMoveModal, onCancel: () => {
368
- refreshData();
369
- setIsOpenMoveModal(false);
370
- }, request: request?.directory, onOk: (value) => onConfirmMove(value) }),
371
- contextHolder)];
372
- }
373
- }
@@ -1,15 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { FileItemTableProps } from 'beer-assembly/FileItemTable';
3
- import { DirectorySelectProps } from 'beer-assembly/DirectorySelect';
4
- export type Handler<T> = {
5
- ok: (callback: (params: T) => Promise<boolean>, args?: {}, initialValues?: {}) => void;
6
- };
7
- type FileItemTableRequest = NonNullable<FileItemTableProps['request']>;
8
- type DirectoryRequest = NonNullable<DirectorySelectProps['request']>;
9
- export type NetDiskRequest = FileItemTableRequest & {
10
- directory: DirectoryRequest;
11
- };
12
- export declare class NetDiskModals {
13
- static useNetDisk(netDiskRequest: NetDiskRequest, fileFormat?: string[], errorMessage?: ReactNode): [Handler<boolean>, ReactNode];
14
- }
15
- export {};
package/NetDiskModals.js DELETED
@@ -1,28 +0,0 @@
1
- import React, { useState } from 'react';
2
- import NetDisk from 'beer-assembly/NetDisk';
3
- export class NetDiskModals {
4
- static useNetDisk(netDiskRequest, fileFormat, errorMessage) {
5
- const [isOpenModal, setIsOpenModal] = useState(false);
6
- const handler = {
7
- ok: (_callback) => {
8
- setIsOpenModal(true);
9
- }
10
- };
11
- return [handler, React.createElement(React.Fragment, null,
12
- React.createElement(NetDisk, { open: isOpenModal, onCancel: () => setIsOpenModal(false), tableProps: {
13
- request: {
14
- ...netDiskRequest
15
- },
16
- directoryProps: {
17
- request: {
18
- ...netDiskRequest.directory
19
- }
20
- },
21
- uploadFormat: fileFormat || ['xls', 'xlsx', 'doc', 'docx', 'pdf'],
22
- uploadSize: 20,
23
- uploadFormatMessage: errorMessage || React.createElement(React.Fragment, null,
24
- "\u62B1\u6B49\uFF0C\u6587\u4EF6\u683C\u5F0F\u4E0D\u53D7\u652F\u6301\uFF0C\u8BF7\u4E0A\u4F20",
25
- React.createElement("span", { style: { fontWeight: 500 } }, "\u6587\u6863\u6587\u4EF6"))
26
- } }))];
27
- }
28
- }
@@ -1,27 +0,0 @@
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
- value?: string | undefined;
23
- openKeys?: string[] | undefined;
24
- onChange?: (key: string) => void;
25
- };
26
- export declare const Component: FC<SubMenusProps>;
27
- export default Component;
@@ -1,72 +0,0 @@
1
- import React, { useEffect, useState } from 'react';
2
- import { ConfigProvider, Menu } from 'antd';
3
- export const Component = (props) => {
4
- const [selectKeys, setSelectKeys] = useState([]);
5
- const [openKeys, setOpenKeys] = useState([]);
6
- useEffect(() => {
7
- if (props?.value === undefined) {
8
- return;
9
- }
10
- setSelectKeys([props.value]);
11
- }, [props?.value]);
12
- useEffect(() => {
13
- if (props?.openKeys === undefined) {
14
- return;
15
- }
16
- setOpenKeys(props.openKeys);
17
- }, [props?.openKeys]);
18
- return React.createElement(React.Fragment, null,
19
- React.createElement(ConfigProvider, { theme: {
20
- components: {
21
- Menu: props?.token || {
22
- itemHeight: 36,
23
- itemBorderRadius: 0,
24
- iconMarginInlineEnd: 0,
25
- itemMarginBlock: 0,
26
- itemMarginInline: 0,
27
- itemPaddingInline: 0,
28
- subMenuItemBg: 'transparent',
29
- itemHoverBg: 'rgba(22,100,255,.04)',
30
- itemHoverColor: '#000',
31
- itemActiveBg: 'rgba(22,100,255,.08)',
32
- itemSelectedBg: 'rgba(22,100,255,.08)'
33
- }
34
- }
35
- } },
36
- React.createElement("div", { style: {
37
- display: 'flex',
38
- gap: `${props?.gap || 12}px`,
39
- alignItems: 'flex-start',
40
- width: '100%'
41
- } },
42
- React.createElement("div", { style: {
43
- width: props?.width || 200,
44
- backgroundColor: '#fff',
45
- height: props?.height || '100vh',
46
- userSelect: 'none',
47
- overflow: 'hidden',
48
- ...(props?.styles?.menus || {})
49
- } },
50
- props?.header !== undefined ? React.createElement("div", { style: {
51
- padding: '12px 0',
52
- fontWeight: 500,
53
- borderInlineEnd: '1px solid rgba(5,5,5,.06)',
54
- borderBlockEnd: '1px solid rgba(5,5,5,.06)'
55
- } }, props?.header) : undefined,
56
- React.createElement(Menu, { style: {
57
- height: '100%'
58
- }, onClick: (e) => {
59
- props?.onChange?.(e.key);
60
- }, onOpenChange: (e) => {
61
- setOpenKeys(e);
62
- }, subMenuCloseDelay: 0, selectedKeys: selectKeys, openKeys: openKeys, mode: "inline", inlineIndent: 16, items: props?.items })),
63
- React.createElement("div", { style: {
64
- width: `calc(100% - ${(props?.width || 200) + (props?.gap || 12) + (props?.gap || 12)}px)`,
65
- marginRight: (props?.gap || 12),
66
- height: '100%',
67
- padding: props?.padding || '12px 0',
68
- ...(props?.styles?.body || {}),
69
- overflow: 'auto'
70
- } }, props?.children))));
71
- };
72
- export default Component;
package/Upgrade.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import { FC } from 'react';
2
- export declare type UpgradeComponentProps = {
3
- localVersion: string;
4
- request?: () => Promise<string> | undefined;
5
- };
6
- declare const App: FC<UpgradeComponentProps>;
7
- export default App;
package/Upgrade.js DELETED
@@ -1,46 +0,0 @@
1
- import React, { useEffect } from 'react';
2
- import { Modal } from 'antd';
3
- const TIME_KEY = 'VERSION_TIME';
4
- const App = (props) => {
5
- useEffect(() => {
6
- // 每5分钟执行一次
7
- setTimeout(async () => {
8
- // 读取缓存的上次弹出更新时间
9
- const lastTime = Number(localStorage.getItem(TIME_KEY) || 0);
10
- if (Number.isNaN(lastTime)) {
11
- localStorage.removeItem(TIME_KEY);
12
- return;
13
- }
14
- // 30分钟执行一次
15
- if (new Date().getTime() <= lastTime + 1800000) {
16
- return;
17
- }
18
- // 更新刷新时间
19
- localStorage.setItem(TIME_KEY, new Date().getTime()
20
- .toString());
21
- const newVersion = await props.request?.();
22
- if (newVersion === undefined || newVersion === '') {
23
- return;
24
- }
25
- if (newVersion === props.localVersion) {
26
- return;
27
- }
28
- // 弹出提示框
29
- Modal.confirm({
30
- title: '版本更新提示',
31
- content: React.createElement(React.Fragment, null,
32
- React.createElement("p", { style: {
33
- fontSize: '15px',
34
- lineHeight: '26px'
35
- } }, "\u60A8\u5DF2\u7ECF\u957F\u65F6\u95F4\u672A\u4F7F\u7528\u6B64\u9875\u9762\uFF0C\u5728\u6B64\u671F\u95F4\u5E73\u53F0\u6709\u8FC7\u66F4\u65B0\uFF0C\u5982\u60A8\u6B64\u65F6\u5728\u9875\u9762\u4E2D\u6CA1\u6709\u586B\u5199\u76F8\u5173\u4FE1\u606F\u7B49\u64CD\u4F5C\uFF0C\u8BF7\u70B9\u51FB\u5237\u65B0\u9875\u9762\u4F7F\u7528\u6700\u65B0\u7248\u672C\uFF01")),
36
- okText: '确定',
37
- cancelText: '取消',
38
- onOk: () => {
39
- window.location.reload();
40
- }
41
- });
42
- }, 5000);
43
- }, []);
44
- return React.createElement(React.Fragment, null);
45
- };
46
- export default App;