beer-assembly-biz 1.1.2-alpha.9 → 1.1.3-alpha.10
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/UploadModals.d.ts +12 -0
- package/UploadModals.js +233 -0
- package/UserModals.d.ts +7 -3
- package/UserModals.js +6 -0
- package/auth/AuthPassword.d.ts +2 -3
- package/auth/AuthPassword.js +5 -5
- package/auth/AuthStyle01.d.ts +3 -4
- package/auth/AuthStyle01.js +4 -5
- package/auth/AuthStyle02.d.ts +3 -4
- package/auth/AuthStyle02.js +4 -5
- package/auth/AuthThirdPartyAuth.d.ts +2 -3
- package/auth/AuthThirdPartyAuth.js +1 -2
- package/content/ParentContext.d.ts +4 -2
- package/content/ParentContext.js +4 -2
- package/content/PermissionContext.d.ts +4 -2
- package/content/PermissionContext.js +4 -2
- package/icon/icon/directory.svg +12 -0
- package/icon/icon/empty.svg +43 -0
- package/icon/icon/media.png +0 -0
- package/icon/icon/volc.svg +96 -0
- package/images/images/assets_background_01.png +0 -0
- package/images/images/avatar.png +0 -0
- package/images/images/layout_01.png +0 -0
- package/images/images/layout_02.png +0 -0
- package/images/images/layout_03.png +0 -0
- package/index.d.ts +18 -0
- package/index.js +18 -0
- package/{AppLayout.d.ts → layout/AppLayout.d.ts} +4 -2
- package/{AppLayout.js → layout/AppLayout.js} +7 -5
- package/{BackPageContainer.d.ts → layout/BackPageContainer.d.ts} +5 -2
- package/{BackPageContainer.js → layout/BackPageContainer.js} +8 -3
- package/{MyPageContainer.d.ts → layout/MyPageContainer.d.ts} +4 -2
- package/{MyPageContainer.js → layout/MyPageContainer.js} +5 -3
- package/{SubMenusContainer.d.ts → layout/SubMenusContainer.d.ts} +5 -5
- package/{SubMenusContainer.js → layout/SubMenusContainer.js} +2 -3
- package/media/Media.d.ts +84 -0
- package/media/Media.js +241 -0
- package/media/MediaModals.d.ts +17 -0
- package/media/MediaModals.js +172 -0
- package/net-disk/DirectoryMenusPanel.d.ts +0 -0
- package/net-disk/DirectoryMenusPanel.js +337 -0
- package/net-disk/DirectorySelect.d.ts +0 -0
- package/net-disk/DirectorySelect.js +240 -0
- package/net-disk/FileItemList.d.ts +0 -0
- package/net-disk/FileItemList.js +126 -0
- package/net-disk/FileItemTable.d.ts +0 -0
- package/net-disk/FileItemTable.js +422 -0
- package/net-disk/FileNavigation.d.ts +0 -0
- package/net-disk/FileNavigation.js +43 -0
- package/net-disk/NetDisk.d.ts +0 -0
- package/net-disk/NetDisk.js +36 -0
- package/net-disk/NetDiskModals.d.ts +0 -0
- package/net-disk/NetDiskModals.js +40 -0
- package/package.json +30 -19
- package/{Permission.d.ts → permission/Permission.d.ts} +4 -2
- package/{Permission.js → permission/Permission.js} +5 -3
- package/promises.d.ts +48 -0
- package/promises.js +141 -0
- package/rich/AIEditor.css +1647 -0
- package/rich/AIEditor.d.ts +51 -0
- package/rich/AIEditor.js +90 -0
- package/slider/SliderCode.d.ts +23 -0
- package/slider/SliderCode.js +203 -0
- package/type.d.ts +3 -0
- package/type.js +1 -0
- package/InlineContainer.d.ts +0 -6
- package/InlineContainer.js +0 -28
- package/MediaModals.d.ts +0 -32
- package/MediaModals.js +0 -373
- package/NetDiskModals.d.ts +0 -15
- package/NetDiskModals.js +0 -28
- package/Upgrade.d.ts +0 -7
- package/Upgrade.js +0 -46
- package/fonts/harmony/HarmonyOS_Medium.a.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.a0.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.a1.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.aa.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ab.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ac.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ad.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ae.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.af.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ag.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ah.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ai.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.aj.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ak.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.al.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.am.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.an.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ao.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ap.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.aq.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ar.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.as.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.at.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.au.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.av.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.aw.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ax.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ay.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.az.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.b.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.c.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.d.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.e.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.f.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.g.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.h.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.i.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.j.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.k.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.l.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.m.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.n.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.o.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.p.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.q.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.r.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.s.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.t.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.u.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.v.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.w.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.x.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.y.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.z.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.a.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.a0.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.a1.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.aa.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ab.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ac.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ad.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ae.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.af.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ag.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ah.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ai.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.aj.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ak.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.al.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.am.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.an.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ao.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ap.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.aq.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ar.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.as.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.at.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.au.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.av.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.aw.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ax.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ay.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.az.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.b.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.c.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.d.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.e.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.f.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.g.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.h.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.i.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.j.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.k.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.l.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.m.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.n.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.o.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.p.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.q.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.r.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.s.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.t.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.u.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.v.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.w.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.x.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.y.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.z.woff2 +0 -0
- package/fonts/harmony/medium.css +0 -485
- package/fonts/harmony/regular.css +0 -485
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React, { HTMLAttributes } from 'react';
|
|
2
|
+
import { AiEditorOptions } from 'aieditor';
|
|
3
|
+
import './AIEditor.css';
|
|
4
|
+
export interface HttpRequestParams {
|
|
5
|
+
[key: string]: string;
|
|
6
|
+
}
|
|
7
|
+
export interface HttpRequestHeader {
|
|
8
|
+
[key: string]: string;
|
|
9
|
+
}
|
|
10
|
+
export type AIEditorProps = Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> & {
|
|
11
|
+
/**
|
|
12
|
+
* 图片上传地址.
|
|
13
|
+
*/
|
|
14
|
+
actionImage?: string;
|
|
15
|
+
/**
|
|
16
|
+
* 图片上传参数.
|
|
17
|
+
*/
|
|
18
|
+
params?: HttpRequestParams;
|
|
19
|
+
/**
|
|
20
|
+
* 上传头.
|
|
21
|
+
*/
|
|
22
|
+
headers?: HttpRequestHeader;
|
|
23
|
+
placeholder?: string;
|
|
24
|
+
defaultValue?: string;
|
|
25
|
+
value?: string;
|
|
26
|
+
onChange?: (val: string) => void;
|
|
27
|
+
options?: Omit<AiEditorOptions, 'element'>;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* AIEditor 的富文本编辑器.
|
|
31
|
+
* @see https://aieditor.dev/zh/
|
|
32
|
+
*/
|
|
33
|
+
export declare const AIEditor: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> & {
|
|
34
|
+
/**
|
|
35
|
+
* 图片上传地址.
|
|
36
|
+
*/
|
|
37
|
+
actionImage?: string;
|
|
38
|
+
/**
|
|
39
|
+
* 图片上传参数.
|
|
40
|
+
*/
|
|
41
|
+
params?: HttpRequestParams;
|
|
42
|
+
/**
|
|
43
|
+
* 上传头.
|
|
44
|
+
*/
|
|
45
|
+
headers?: HttpRequestHeader;
|
|
46
|
+
placeholder?: string;
|
|
47
|
+
defaultValue?: string;
|
|
48
|
+
value?: string;
|
|
49
|
+
onChange?: (val: string) => void;
|
|
50
|
+
options?: Omit<AiEditorOptions, "element">;
|
|
51
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
package/rich/AIEditor.js
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import React, { forwardRef, useEffect, useRef } from 'react';
|
|
2
|
+
import { AiEditor } from 'aieditor';
|
|
3
|
+
import './AIEditor.css';
|
|
4
|
+
import { Session } from 'beer-network/session';
|
|
5
|
+
/**
|
|
6
|
+
* AIEditor 的富文本编辑器.
|
|
7
|
+
* @see https://aieditor.dev/zh/
|
|
8
|
+
*/
|
|
9
|
+
export const AIEditor = forwardRef(function AIEditor({ actionImage, params, headers, placeholder, defaultValue, value, onChange, options, ...props }, ref) {
|
|
10
|
+
const divRef = useRef(null);
|
|
11
|
+
const aiEditorRef = useRef(null);
|
|
12
|
+
const getAction = () => {
|
|
13
|
+
if (actionImage === undefined) {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
const paramQuery = new URLSearchParams();
|
|
17
|
+
Object.keys(params || {})
|
|
18
|
+
.forEach(key => {
|
|
19
|
+
paramQuery.append(key, params?.[key] || '');
|
|
20
|
+
});
|
|
21
|
+
return actionImage + '?' + paramQuery.toString();
|
|
22
|
+
};
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
if (!divRef.current)
|
|
25
|
+
return;
|
|
26
|
+
if (!aiEditorRef.current) {
|
|
27
|
+
aiEditorRef.current = new AiEditor({
|
|
28
|
+
element: divRef.current,
|
|
29
|
+
placeholder,
|
|
30
|
+
content: defaultValue,
|
|
31
|
+
image: {
|
|
32
|
+
defaultSize: 350,
|
|
33
|
+
uploadFormName: getAction() !== undefined ? 'file' : undefined,
|
|
34
|
+
uploadUrl: getAction(),
|
|
35
|
+
uploadHeaders: {
|
|
36
|
+
...(headers || {}),
|
|
37
|
+
authorization: 'Bearer ' + (Session.getBearer() || '')
|
|
38
|
+
},
|
|
39
|
+
uploaderEvent: {
|
|
40
|
+
onSuccess: (file, response) => {
|
|
41
|
+
return {
|
|
42
|
+
errorCode: 0,
|
|
43
|
+
data: {
|
|
44
|
+
src: response.data,
|
|
45
|
+
alt: file.name
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
toolbarKeys: [
|
|
52
|
+
'heading',
|
|
53
|
+
'|', 'bold', 'italic', 'underline', 'strike', 'link',
|
|
54
|
+
'|', 'highlight', 'font-color',
|
|
55
|
+
'|', 'align', 'line-height',
|
|
56
|
+
'|', 'bullet-list', 'ordered-list', 'indent-decrease', 'indent-increase', 'break',
|
|
57
|
+
'|', 'image'
|
|
58
|
+
],
|
|
59
|
+
onChange: (ed) => {
|
|
60
|
+
if (typeof onChange === 'function') {
|
|
61
|
+
onChange(ed.getHtml());
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
...options
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return () => {
|
|
68
|
+
if (aiEditorRef.current) {
|
|
69
|
+
aiEditorRef.current.destroy();
|
|
70
|
+
aiEditorRef.current = null;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
}, []);
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
if (ref) {
|
|
76
|
+
if (typeof ref === 'function') {
|
|
77
|
+
ref(divRef.current);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
ref.current = divRef.current;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}, [ref]);
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
if (aiEditorRef.current && value !== aiEditorRef.current.getHtml()) {
|
|
86
|
+
aiEditorRef.current.setContent(value || '');
|
|
87
|
+
}
|
|
88
|
+
}, [value]);
|
|
89
|
+
return React.createElement("div", { ref: divRef, ...props });
|
|
90
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CSSProperties, FC } from 'react';
|
|
2
|
+
export declare type SliderCodeComponentProps = {
|
|
3
|
+
style?: CSSProperties;
|
|
4
|
+
request: () => Promise<Slider>;
|
|
5
|
+
onReceipt?: (code: string, slider: Slider) => Promise<boolean>;
|
|
6
|
+
token?: SliderCodeToken | undefined;
|
|
7
|
+
};
|
|
8
|
+
export declare type Slider = {
|
|
9
|
+
authCode: string;
|
|
10
|
+
background: string;
|
|
11
|
+
cutout: string;
|
|
12
|
+
y: number;
|
|
13
|
+
};
|
|
14
|
+
export declare type SliderCodeToken = {
|
|
15
|
+
colorPrimary?: string;
|
|
16
|
+
colorBar?: string;
|
|
17
|
+
boxShadow?: string;
|
|
18
|
+
gradient?: string[];
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* 滑块验证码.
|
|
22
|
+
*/
|
|
23
|
+
export declare const SliderCode: FC<SliderCodeComponentProps>;
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { css } from '@emotion/css';
|
|
3
|
+
import { theme } from 'antd';
|
|
4
|
+
import { ReloadOutlined } from '@ant-design/icons';
|
|
5
|
+
const sliderParams = {
|
|
6
|
+
// 缩放比例
|
|
7
|
+
scale: 0.694,
|
|
8
|
+
// 控件原始坐标
|
|
9
|
+
x: 0,
|
|
10
|
+
// 起点坐标
|
|
11
|
+
start: 8,
|
|
12
|
+
// 终点坐标
|
|
13
|
+
end: 225,
|
|
14
|
+
disable: false
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* 滑块验证码.
|
|
18
|
+
*/
|
|
19
|
+
export const SliderCode = (props = {
|
|
20
|
+
token: {
|
|
21
|
+
colorPrimary: '#1677ff',
|
|
22
|
+
boxShadow: 'rgba(22, 93, 255, 0.4)',
|
|
23
|
+
gradient: ['#578aff', '#165dff'],
|
|
24
|
+
colorBar: '#165dff'
|
|
25
|
+
},
|
|
26
|
+
request: async () => {
|
|
27
|
+
throw new Error('Function not implemented.');
|
|
28
|
+
}
|
|
29
|
+
}) => {
|
|
30
|
+
const { token } = theme.useToken();
|
|
31
|
+
const [offset, setOffset] = useState(8);
|
|
32
|
+
const [slider, setSlider] = useState({});
|
|
33
|
+
const [status, setStatus] = useState(false);
|
|
34
|
+
const onRefreshSlider = async () => {
|
|
35
|
+
const slider = await props.request();
|
|
36
|
+
sliderParams.disable = false;
|
|
37
|
+
setOffset(sliderParams.start);
|
|
38
|
+
setSlider(slider);
|
|
39
|
+
};
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
onRefreshSlider()
|
|
42
|
+
.then();
|
|
43
|
+
}, []);
|
|
44
|
+
const onMouseDownSlider = (x) => {
|
|
45
|
+
if (sliderParams.disable) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
sliderParams.x = x;
|
|
49
|
+
let offsetX = 0;
|
|
50
|
+
const disableSelection = (e) => {
|
|
51
|
+
e.preventDefault();
|
|
52
|
+
};
|
|
53
|
+
const moveSlider = (e) => {
|
|
54
|
+
let offset = e.x - sliderParams.x + sliderParams.start;
|
|
55
|
+
if (offset <= sliderParams.start) {
|
|
56
|
+
offset = sliderParams.start;
|
|
57
|
+
}
|
|
58
|
+
else if (offset >= sliderParams.end) {
|
|
59
|
+
offset = sliderParams.end;
|
|
60
|
+
}
|
|
61
|
+
offsetX = offset;
|
|
62
|
+
setOffset(offset);
|
|
63
|
+
};
|
|
64
|
+
window.addEventListener('mousemove', moveSlider);
|
|
65
|
+
window.addEventListener('selectstart', disableSelection);
|
|
66
|
+
const onMouseUp = async () => {
|
|
67
|
+
sliderParams.disable = true;
|
|
68
|
+
const x = Math.floor((offsetX - sliderParams.start) / sliderParams.scale);
|
|
69
|
+
window.removeEventListener('mousemove', moveSlider);
|
|
70
|
+
window.removeEventListener('selectstart', disableSelection);
|
|
71
|
+
window.removeEventListener('mouseup', onMouseUp);
|
|
72
|
+
const code = Number('1' + x.toString(2))
|
|
73
|
+
.toString(16);
|
|
74
|
+
const result = await props.onReceipt?.(code, slider);
|
|
75
|
+
if (result === false) {
|
|
76
|
+
setStatus(true);
|
|
77
|
+
setTimeout(() => {
|
|
78
|
+
setStatus(false);
|
|
79
|
+
setOffset(sliderParams.start);
|
|
80
|
+
onRefreshSlider()
|
|
81
|
+
.then(() => sliderParams.disable = false);
|
|
82
|
+
}, 1200);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
window.addEventListener('mouseup', onMouseUp);
|
|
86
|
+
};
|
|
87
|
+
return React.createElement(React.Fragment, null,
|
|
88
|
+
React.createElement("div", { style: props.style, className: css `
|
|
89
|
+
background: #fff;
|
|
90
|
+
border-radius: ${token.borderRadius}px;
|
|
91
|
+
box-shadow: 0 0 3px 3px rgba(0, 0, 0, 0.03);
|
|
92
|
+
padding: 15px 10px;
|
|
93
|
+
width: 250px;
|
|
94
|
+
position: relative;
|
|
95
|
+
` },
|
|
96
|
+
React.createElement("div", { className: css `
|
|
97
|
+
display: flex;
|
|
98
|
+
justify-content: space-between;
|
|
99
|
+
margin-bottom: 10px;
|
|
100
|
+
` },
|
|
101
|
+
React.createElement("span", null, "\u5B8C\u6210\u62FC\u56FE\u9A8C\u8BC1"),
|
|
102
|
+
React.createElement("a", { style: {
|
|
103
|
+
userSelect: 'none',
|
|
104
|
+
color: props.token?.colorPrimary || token.colorPrimary
|
|
105
|
+
}, onClick: onRefreshSlider },
|
|
106
|
+
React.createElement(ReloadOutlined, null),
|
|
107
|
+
"\u00A0\u6362\u4E00\u5F20")),
|
|
108
|
+
React.createElement("div", { className: css `
|
|
109
|
+
width: 250px;
|
|
110
|
+
height: 95px;
|
|
111
|
+
background: #eee;
|
|
112
|
+
border-radius: ${token.borderRadius}px;
|
|
113
|
+
position: relative;
|
|
114
|
+
overflow: hidden;
|
|
115
|
+
` },
|
|
116
|
+
React.createElement("div", { className: css `
|
|
117
|
+
width: 100%;
|
|
118
|
+
height: 100%;
|
|
119
|
+
|
|
120
|
+
& > img {
|
|
121
|
+
width: 100%;
|
|
122
|
+
display: block;
|
|
123
|
+
}
|
|
124
|
+
` }, slider.background === undefined || slider.background === '' ? undefined : React.createElement("img", { alt: "", src: slider.background })),
|
|
125
|
+
React.createElement("div", { className: css `
|
|
126
|
+
display: block;
|
|
127
|
+
position: absolute;
|
|
128
|
+
left: 0;
|
|
129
|
+
top: 0;
|
|
130
|
+
bottom: 0;
|
|
131
|
+
|
|
132
|
+
& > img {
|
|
133
|
+
width: 100%;
|
|
134
|
+
display: block;
|
|
135
|
+
}
|
|
136
|
+
`, style: {
|
|
137
|
+
left: offset - 8 + 'px',
|
|
138
|
+
width: 50 * sliderParams.scale,
|
|
139
|
+
height: 50 * sliderParams.scale
|
|
140
|
+
} }, slider.cutout === undefined || slider.cutout === '' ? undefined : React.createElement("img", { src: slider.cutout, style: { marginTop: (slider.y * sliderParams.scale) + 'px' }, alt: "" }))),
|
|
141
|
+
React.createElement("div", { className: css `
|
|
142
|
+
width: 100%;
|
|
143
|
+
height: 32px;
|
|
144
|
+
margin: 10px 0 0 0;
|
|
145
|
+
` },
|
|
146
|
+
React.createElement("div", { className: css `
|
|
147
|
+
width: 36px;
|
|
148
|
+
height: 36px;
|
|
149
|
+
border-radius: 50%;
|
|
150
|
+
background: #fff;
|
|
151
|
+
box-shadow: 4px 2px 19px ${props.token?.boxShadow || token.colorPrimary};
|
|
152
|
+
filter: brightness(1.2);
|
|
153
|
+
position: absolute;
|
|
154
|
+
margin-top: -2px;
|
|
155
|
+
cursor: pointer;
|
|
156
|
+
z-index: 9;
|
|
157
|
+
display: flex;
|
|
158
|
+
justify-content: center;
|
|
159
|
+
align-items: center;
|
|
160
|
+
user-select: none;
|
|
161
|
+
`, style: { left: offset + 'px' }, onMouseDown: (e) => {
|
|
162
|
+
onMouseDownSlider(e.clientX);
|
|
163
|
+
} },
|
|
164
|
+
React.createElement("div", { style: {
|
|
165
|
+
width: '20px',
|
|
166
|
+
height: '20px',
|
|
167
|
+
userSelect: 'none'
|
|
168
|
+
} },
|
|
169
|
+
React.createElement("svg", { className: "icon", viewBox: "0 0 1024 1024", version: "1.1", xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20" },
|
|
170
|
+
React.createElement("path", { d: "M613.504 512L274.752 173.248l90.496-90.496L794.496 512l-429.248 429.248-90.496-90.496z", fill: props.token?.colorBar || '#000' })))),
|
|
171
|
+
React.createElement("div", { className: css `
|
|
172
|
+
width: 100%;
|
|
173
|
+
height: 32px;
|
|
174
|
+
background: #fff;
|
|
175
|
+
border-radius: 16px;
|
|
176
|
+
overflow: hidden;
|
|
177
|
+
position: relative;
|
|
178
|
+
box-shadow: inset 0 2px 16px ${props.token?.boxShadow || token.colorPrimary};
|
|
179
|
+
` },
|
|
180
|
+
React.createElement("div", { className: css `
|
|
181
|
+
height: 32px;
|
|
182
|
+
position: absolute;
|
|
183
|
+
`, style: {
|
|
184
|
+
width: ((offset > 8 ? offset + 8 : offset) - 8) + 'px',
|
|
185
|
+
background: status ? '#FF3C21' : `linear-gradient(90deg, ${props.token?.gradient?.[0]} 0%, ${props.token?.gradient?.[1]} 100%)`,
|
|
186
|
+
display: 'flex',
|
|
187
|
+
justifyContent: 'center',
|
|
188
|
+
alignItems: 'center',
|
|
189
|
+
color: '#fff',
|
|
190
|
+
fontSize: '13px'
|
|
191
|
+
} },
|
|
192
|
+
React.createElement("div", { style: { minWidth: '140px' } }, status ? '滑块验证失败,请重试' : undefined)),
|
|
193
|
+
React.createElement("div", { className: css `
|
|
194
|
+
width: 100%;
|
|
195
|
+
height: 100%;
|
|
196
|
+
display: flex;
|
|
197
|
+
justify-content: center;
|
|
198
|
+
align-items: center;
|
|
199
|
+
font-size: 13px;
|
|
200
|
+
font-weight: 500;
|
|
201
|
+
color: ${props.token?.colorPrimary || token.colorPrimary}
|
|
202
|
+
` }, "\u5411\u53F3\u6ED1\u52A8\u5B8C\u6210\u62FC\u56FE")))));
|
|
203
|
+
};
|
package/type.d.ts
ADDED
package/type.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/InlineContainer.d.ts
DELETED
package/InlineContainer.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { App, ConfigProvider } from 'antd';
|
|
3
|
-
export const Component = (props) => {
|
|
4
|
-
return React.createElement(App, null,
|
|
5
|
-
React.createElement(ConfigProvider, { theme: {
|
|
6
|
-
token: {
|
|
7
|
-
fontSize: 12,
|
|
8
|
-
controlHeight: 26,
|
|
9
|
-
fontWeightStrong: 500
|
|
10
|
-
},
|
|
11
|
-
components: {
|
|
12
|
-
Table: {
|
|
13
|
-
motion: false,
|
|
14
|
-
headerColor: '#333',
|
|
15
|
-
rowHoverBg: '#f5f6f7',
|
|
16
|
-
rowSelectedBg: '#f4f5f6',
|
|
17
|
-
rowSelectedHoverBg: '#e6e7e8',
|
|
18
|
-
headerBg: '#fafafa',
|
|
19
|
-
cellPaddingInlineSM: 6,
|
|
20
|
-
cellPaddingBlockSM: 7
|
|
21
|
-
},
|
|
22
|
-
Switch: {
|
|
23
|
-
fontSize: 10
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
} }, props?.children));
|
|
27
|
-
};
|
|
28
|
-
export default Component;
|
package/MediaModals.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { DirectorySelectProps } from 'beer-assembly/DirectorySelect';
|
|
3
|
-
export type Handler<T> = {
|
|
4
|
-
ok: (callback?: (params: T) => void) => void;
|
|
5
|
-
};
|
|
6
|
-
type DirectoryRequest = NonNullable<DirectorySelectProps['request']>;
|
|
7
|
-
export declare type MediaItem = {
|
|
8
|
-
id: string;
|
|
9
|
-
name: string;
|
|
10
|
-
type: 'DIRECTORY' | 'FILE';
|
|
11
|
-
url: string;
|
|
12
|
-
active: boolean;
|
|
13
|
-
};
|
|
14
|
-
export declare type RequestParams = {
|
|
15
|
-
/**
|
|
16
|
-
* 获取列表数据.
|
|
17
|
-
* @param parentId 父类ID.
|
|
18
|
-
*/
|
|
19
|
-
requestList: (parentId: string) => Promise<MediaItem[]>;
|
|
20
|
-
rename: (id: string, name: string) => Promise<Boolean>;
|
|
21
|
-
copy: (id: string) => Promise<Boolean>;
|
|
22
|
-
move: (moveId: string, targetId: string) => Promise<Boolean>;
|
|
23
|
-
remove: (id: string) => Promise<Boolean>;
|
|
24
|
-
createDirectory: (parentId: string, name: string) => Promise<Boolean>;
|
|
25
|
-
putFile: (parentId: string, files: FileList) => Promise<Boolean>;
|
|
26
|
-
} & {
|
|
27
|
-
directory: DirectoryRequest;
|
|
28
|
-
};
|
|
29
|
-
export declare class MediaModals {
|
|
30
|
-
static useMedia(request?: RequestParams): [Handler<string[]>, ReactNode];
|
|
31
|
-
}
|
|
32
|
-
export {};
|