bhd-components 0.9.28 → 0.10.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.
- package/dist/index.esm.es5.development.css +970 -0
- package/dist/index.esm.es5.development.js +2831 -153
- package/dist/index.esm.es5.production.css +10 -1
- package/dist/index.esm.es5.production.js +1 -1
- package/dist/vendor.esm.es5.development.js +8138 -1570
- package/dist/vendor.esm.es5.production.js +157 -149
- package/es2017/AIMessageList/components/content/index.d.ts +4 -0
- package/es2017/AIMessageList/components/content/index.js +29 -0
- package/es2017/AIMessageList/components/content/index.module.less +8 -0
- package/es2017/AIMessageList/components/copyIcon/index.d.ts +7 -0
- package/es2017/AIMessageList/components/copyIcon/index.js +58 -0
- package/es2017/AIMessageList/components/copyIcon/index.module.less +22 -0
- package/es2017/AIMessageList/components/errorCallback/index.d.ts +3 -0
- package/es2017/AIMessageList/components/errorCallback/index.js +6 -0
- package/es2017/AIMessageList/components/fileList/fileIcon.d.ts +3 -0
- package/es2017/AIMessageList/components/fileList/fileIcon.js +970 -0
- package/es2017/AIMessageList/components/fileList/index.d.ts +4 -0
- package/es2017/AIMessageList/components/fileList/index.js +299 -0
- package/es2017/AIMessageList/components/fileList/index.module.less +95 -0
- package/es2017/AIMessageList/components/footer/index.d.ts +10 -0
- package/es2017/AIMessageList/components/footer/index.js +296 -0
- package/es2017/AIMessageList/components/footer/index.module.less +51 -0
- package/es2017/AIMessageList/components/header/index.d.ts +9 -0
- package/es2017/AIMessageList/components/header/index.js +94 -0
- package/es2017/AIMessageList/components/header/index.module.less +31 -0
- package/es2017/AIMessageList/components/referencesIcon/index.d.ts +9 -0
- package/es2017/AIMessageList/components/referencesIcon/index.js +37 -0
- package/es2017/AIMessageList/components/referencesIcon/index.module.less +13 -0
- package/es2017/AIMessageList/components/renderReferrnce/index.d.ts +10 -0
- package/es2017/AIMessageList/components/renderReferrnce/index.js +68 -0
- package/es2017/AIMessageList/components/renderReferrnce/index.module.less +64 -0
- package/es2017/AIMessageList/components/sendBtn/index.d.ts +4 -0
- package/es2017/AIMessageList/components/sendBtn/index.js +46 -0
- package/es2017/AIMessageList/components/sendBtn/index.module.less +25 -0
- package/es2017/AIMessageList/components/uplodaFileBtn/index.d.ts +4 -0
- package/es2017/AIMessageList/components/uplodaFileBtn/index.js +33 -0
- package/es2017/AIMessageList/components/uplodaFileBtn/index.module.less +5 -0
- package/es2017/AIMessageList/components/virtuosoList/index.d.ts +5 -0
- package/es2017/AIMessageList/components/virtuosoList/index.js +507 -0
- package/es2017/AIMessageList/components/virtuosoList/index.module.less +381 -0
- package/es2017/AIMessageList/index.d.ts +4 -0
- package/es2017/AIMessageList/index.js +58 -0
- package/es2017/AIMessageList/index.module.less +20 -0
- package/es2017/AIMessageList/type.d.ts +242 -0
- package/es2017/bhdEditor/index.d.ts +2 -0
- package/es2017/bhdEditor/index.js +3 -0
- package/es2017/bhdModalCropper/index.d.ts +10 -0
- package/es2017/bhdModalCropper/index.js +144 -0
- package/es2017/bhdModalCropper/index.module.less +362 -0
- package/es2017/customerService/index.js +1 -0
- package/es2017/images/loading2.js +2 -0
- package/es2017/index.d.ts +2 -0
- package/es2017/index.js +2 -0
- package/es2017/utils/Date.d.ts +2 -1
- package/es2017/utils/Date.js +2 -1
- package/es2017/utils/dom.d.ts +4 -1
- package/es2017/utils/dom.js +44 -1
- package/es2017/utils/number.d.ts +1 -0
- package/es2017/utils/number.js +9 -0
- package/esm/AIMessageList/components/content/index.d.ts +4 -0
- package/esm/AIMessageList/components/content/index.js +29 -0
- package/esm/AIMessageList/components/content/index.module.less +8 -0
- package/esm/AIMessageList/components/copyIcon/index.d.ts +7 -0
- package/esm/AIMessageList/components/copyIcon/index.js +61 -0
- package/esm/AIMessageList/components/copyIcon/index.module.less +22 -0
- package/esm/AIMessageList/components/errorCallback/index.d.ts +3 -0
- package/esm/AIMessageList/components/errorCallback/index.js +6 -0
- package/esm/AIMessageList/components/fileList/fileIcon.d.ts +3 -0
- package/esm/AIMessageList/components/fileList/fileIcon.js +970 -0
- package/esm/AIMessageList/components/fileList/index.d.ts +4 -0
- package/esm/AIMessageList/components/fileList/index.js +325 -0
- package/esm/AIMessageList/components/fileList/index.module.less +95 -0
- package/esm/AIMessageList/components/footer/index.d.ts +10 -0
- package/esm/AIMessageList/components/footer/index.js +304 -0
- package/esm/AIMessageList/components/footer/index.module.less +51 -0
- package/esm/AIMessageList/components/header/index.d.ts +9 -0
- package/esm/AIMessageList/components/header/index.js +96 -0
- package/esm/AIMessageList/components/header/index.module.less +31 -0
- package/esm/AIMessageList/components/referencesIcon/index.d.ts +9 -0
- package/esm/AIMessageList/components/referencesIcon/index.js +39 -0
- package/esm/AIMessageList/components/referencesIcon/index.module.less +13 -0
- package/esm/AIMessageList/components/renderReferrnce/index.d.ts +10 -0
- package/esm/AIMessageList/components/renderReferrnce/index.js +72 -0
- package/esm/AIMessageList/components/renderReferrnce/index.module.less +64 -0
- package/esm/AIMessageList/components/sendBtn/index.d.ts +4 -0
- package/esm/AIMessageList/components/sendBtn/index.js +48 -0
- package/esm/AIMessageList/components/sendBtn/index.module.less +25 -0
- package/esm/AIMessageList/components/uplodaFileBtn/index.d.ts +4 -0
- package/esm/AIMessageList/components/uplodaFileBtn/index.js +33 -0
- package/esm/AIMessageList/components/uplodaFileBtn/index.module.less +5 -0
- package/esm/AIMessageList/components/virtuosoList/index.d.ts +5 -0
- package/esm/AIMessageList/components/virtuosoList/index.js +484 -0
- package/esm/AIMessageList/components/virtuosoList/index.module.less +381 -0
- package/esm/AIMessageList/index.d.ts +4 -0
- package/esm/AIMessageList/index.js +58 -0
- package/esm/AIMessageList/index.module.less +20 -0
- package/esm/AIMessageList/type.d.ts +242 -0
- package/esm/bhdEditor/index.d.ts +2 -0
- package/esm/bhdEditor/index.js +3 -0
- package/esm/bhdModalCropper/index.d.ts +10 -0
- package/esm/bhdModalCropper/index.js +151 -0
- package/esm/bhdModalCropper/index.module.less +362 -0
- package/esm/customerService/index.js +1 -0
- package/esm/images/loading2.js +2 -0
- package/esm/index.d.ts +2 -0
- package/esm/index.js +2 -0
- package/esm/utils/Date.d.ts +2 -1
- package/esm/utils/Date.js +2 -1
- package/esm/utils/dom.d.ts +4 -1
- package/esm/utils/dom.js +45 -1
- package/esm/utils/number.d.ts +1 -0
- package/esm/utils/number.js +9 -0
- package/package.json +7 -2
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { ModalProps } from "antd";
|
|
3
|
+
interface BhdModalCropperProps extends ModalProps {
|
|
4
|
+
cropperProps?: any;
|
|
5
|
+
imgSrc: string;
|
|
6
|
+
uploadMaxSize?: number;
|
|
7
|
+
accept?: string[];
|
|
8
|
+
}
|
|
9
|
+
declare const BhdModalCropper: React.ForwardRefExoticComponent<BhdModalCropperProps & React.RefAttributes<unknown>>;
|
|
10
|
+
export default BhdModalCropper;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
2
|
+
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
3
|
+
import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
4
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@ice/jsx-runtime/jsx-runtime";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { useState, useRef, forwardRef, useImperativeHandle } from "react";
|
|
7
|
+
import styles from "./index.module.less";
|
|
8
|
+
import { Modal, Upload, Button } from "antd";
|
|
9
|
+
import BhdTipModal from "../bhdTipModal";
|
|
10
|
+
import Cropper from "react-cropper";
|
|
11
|
+
import { PlusOutlined, MinusOutlined } from "../icons";
|
|
12
|
+
var BhdModalCropper = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
13
|
+
var _props_centered = props.centered, centered = _props_centered === void 0 ? true : _props_centered, _props_wrapClassName = props.wrapClassName, wrapClassName = _props_wrapClassName === void 0 ? "" : _props_wrapClassName, _props_width = props.width, width = _props_width === void 0 ? 456 : _props_width, _props_cropperProps = props.cropperProps, cropperProps = _props_cropperProps === void 0 ? {} : _props_cropperProps, _props_uploadMaxSize = props.uploadMaxSize, uploadMaxSize = _props_uploadMaxSize === void 0 ? 500 * 1024 : _props_uploadMaxSize, _props_accept = props.accept, accept = _props_accept === void 0 ? [
|
|
14
|
+
"jpg",
|
|
15
|
+
"png",
|
|
16
|
+
"jpeg"
|
|
17
|
+
] : _props_accept;
|
|
18
|
+
useImperativeHandle(ref, function() {
|
|
19
|
+
return {
|
|
20
|
+
getCropper: function() {
|
|
21
|
+
return cropperRef.current.cropper;
|
|
22
|
+
},
|
|
23
|
+
getSrc: function() {
|
|
24
|
+
return cropperRef.current.cropper.getCroppedCanvas().toDataURL();
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
var _useState = _sliced_to_array(useState(props.imgSrc), 2), imgSrc = _useState[0], setImgSrc = _useState[1];
|
|
29
|
+
var cropperRef = useRef(null);
|
|
30
|
+
var enlarge = function() {
|
|
31
|
+
console.dir(cropperRef.current);
|
|
32
|
+
try {
|
|
33
|
+
// 放大
|
|
34
|
+
cropperRef.current.cropper.zoom(0.1);
|
|
35
|
+
} catch (err) {
|
|
36
|
+
console.log(err);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
var shrink = function() {
|
|
40
|
+
try {
|
|
41
|
+
// 缩小
|
|
42
|
+
cropperRef.current.cropper.zoom(-0.1);
|
|
43
|
+
} catch (err) {
|
|
44
|
+
console.log(err);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
var customRequest = function(files) {
|
|
48
|
+
var file = files.file;
|
|
49
|
+
var flag = false;
|
|
50
|
+
for(var i = 0; i < accept.length; i++){
|
|
51
|
+
var reg = new RegExp("\\." + accept[i] + "$");
|
|
52
|
+
if (reg.test(file.name)) {
|
|
53
|
+
flag = true;
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (file.size > uploadMaxSize || !flag) {
|
|
58
|
+
var uploadMaxSizeStr = "";
|
|
59
|
+
if (uploadMaxSize < 1024 * 1024) {
|
|
60
|
+
uploadMaxSizeStr = "".concat(uploadMaxSize / 1024, "K");
|
|
61
|
+
} else {
|
|
62
|
+
uploadMaxSizeStr = "".concat(uploadMaxSize / 1024 / 1024, "M");
|
|
63
|
+
}
|
|
64
|
+
BhdTipModal.warning({
|
|
65
|
+
title: "提示",
|
|
66
|
+
content: "支持的图片格式为(".concat(accept.join("、"), "),大小限制为").concat(uploadMaxSizeStr)
|
|
67
|
+
});
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
var reader = new FileReader();
|
|
71
|
+
reader.onload = function customRequest(evt) {
|
|
72
|
+
var replaceSrc = evt.target.result;
|
|
73
|
+
setImgSrc(replaceSrc);
|
|
74
|
+
};
|
|
75
|
+
reader.readAsDataURL(file);
|
|
76
|
+
};
|
|
77
|
+
var getAcceptStr = function() {
|
|
78
|
+
var str = "";
|
|
79
|
+
accept.forEach(function(item, index) {
|
|
80
|
+
str += ".".concat(item);
|
|
81
|
+
if (index != accept.length - 1) {
|
|
82
|
+
str += ",";
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
return str;
|
|
86
|
+
};
|
|
87
|
+
return /*#__PURE__*/ _jsx(Modal, _object_spread_props(_object_spread({}, props), {
|
|
88
|
+
centered: centered,
|
|
89
|
+
wrapClassName: "".concat(wrapClassName, " ").concat(styles.BhdModalCropper),
|
|
90
|
+
width: width,
|
|
91
|
+
children: open && /*#__PURE__*/ _jsxs("div", {
|
|
92
|
+
className: styles.cropperBox,
|
|
93
|
+
children: [
|
|
94
|
+
/*#__PURE__*/ _jsx("div", {
|
|
95
|
+
className: styles.cropperMain,
|
|
96
|
+
children: /*#__PURE__*/ _jsx(Cropper, _object_spread_props(_object_spread({
|
|
97
|
+
src: imgSrc,
|
|
98
|
+
orginStyle: {
|
|
99
|
+
width: 30,
|
|
100
|
+
height: 20
|
|
101
|
+
},
|
|
102
|
+
background: false,
|
|
103
|
+
aspectRatio: 80 / 80,
|
|
104
|
+
guides: true,
|
|
105
|
+
cropBoxMovable: false,
|
|
106
|
+
cropBoxResizable: false,
|
|
107
|
+
dragMode: "move",
|
|
108
|
+
dragCrop: false,
|
|
109
|
+
style: {
|
|
110
|
+
width: "392px",
|
|
111
|
+
height: "240px"
|
|
112
|
+
}
|
|
113
|
+
}, cropperProps), {
|
|
114
|
+
ref: cropperRef
|
|
115
|
+
}))
|
|
116
|
+
}),
|
|
117
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
118
|
+
className: styles.cropperBtn,
|
|
119
|
+
children: [
|
|
120
|
+
/*#__PURE__*/ _jsx(Upload, {
|
|
121
|
+
fileList: [],
|
|
122
|
+
accept: getAcceptStr(),
|
|
123
|
+
customRequest: customRequest,
|
|
124
|
+
children: /*#__PURE__*/ _jsx(Button, {
|
|
125
|
+
children: "重新上传"
|
|
126
|
+
})
|
|
127
|
+
}),
|
|
128
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
129
|
+
className: styles.icons,
|
|
130
|
+
children: [
|
|
131
|
+
/*#__PURE__*/ _jsx("span", {
|
|
132
|
+
onClick: function() {
|
|
133
|
+
return enlarge();
|
|
134
|
+
},
|
|
135
|
+
children: /*#__PURE__*/ _jsx(MinusOutlined, {})
|
|
136
|
+
}),
|
|
137
|
+
/*#__PURE__*/ _jsx("span", {
|
|
138
|
+
onClick: function() {
|
|
139
|
+
return shrink();
|
|
140
|
+
},
|
|
141
|
+
children: /*#__PURE__*/ _jsx(PlusOutlined, {})
|
|
142
|
+
})
|
|
143
|
+
]
|
|
144
|
+
})
|
|
145
|
+
]
|
|
146
|
+
})
|
|
147
|
+
]
|
|
148
|
+
})
|
|
149
|
+
}));
|
|
150
|
+
});
|
|
151
|
+
export default BhdModalCropper;
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
.BhdModalCropper {
|
|
2
|
+
:global {
|
|
3
|
+
.bhd-modal-content {
|
|
4
|
+
.bhd-modal-header {
|
|
5
|
+
border-bottom: 0;
|
|
6
|
+
padding: 24px 32px;
|
|
7
|
+
}
|
|
8
|
+
.bhd-modal-body {
|
|
9
|
+
padding: 0 32px;
|
|
10
|
+
}
|
|
11
|
+
.bhd-modal-close {
|
|
12
|
+
right: 29px;
|
|
13
|
+
top: 24px;
|
|
14
|
+
}
|
|
15
|
+
.bhd-modal-footer {
|
|
16
|
+
border-top: 0;
|
|
17
|
+
padding: 24px 32px;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.cropperBox {
|
|
24
|
+
:global {
|
|
25
|
+
/*!
|
|
26
|
+
* Cropper.js v1.6.2
|
|
27
|
+
* https://fengyuanchen.github.io/cropperjs
|
|
28
|
+
*
|
|
29
|
+
* Copyright 2015-present Chen Fengyuan
|
|
30
|
+
* Released under the MIT license
|
|
31
|
+
*
|
|
32
|
+
* Date: 2024-04-21T07:43:02.731Z
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
.cropper-container {
|
|
36
|
+
direction: ltr;
|
|
37
|
+
font-size: 0;
|
|
38
|
+
line-height: 0;
|
|
39
|
+
position: relative;
|
|
40
|
+
-ms-touch-action: none;
|
|
41
|
+
touch-action: none;
|
|
42
|
+
-webkit-touch-callout: none;
|
|
43
|
+
-webkit-user-select: none;
|
|
44
|
+
-moz-user-select: none;
|
|
45
|
+
-ms-user-select: none;
|
|
46
|
+
user-select: none;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.cropper-container img {
|
|
50
|
+
backface-visibility: hidden;
|
|
51
|
+
display: block;
|
|
52
|
+
height: 100%;
|
|
53
|
+
image-orientation: 0deg;
|
|
54
|
+
max-height: none !important;
|
|
55
|
+
max-width: none !important;
|
|
56
|
+
min-height: 0 !important;
|
|
57
|
+
min-width: 0 !important;
|
|
58
|
+
width: 100%;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.cropper-wrap-box,
|
|
62
|
+
.cropper-canvas,
|
|
63
|
+
.cropper-drag-box,
|
|
64
|
+
.cropper-crop-box,
|
|
65
|
+
.cropper-modal {
|
|
66
|
+
bottom: 0;
|
|
67
|
+
left: 0;
|
|
68
|
+
position: absolute;
|
|
69
|
+
right: 0;
|
|
70
|
+
top: 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.cropper-wrap-box,
|
|
74
|
+
.cropper-canvas {
|
|
75
|
+
overflow: hidden;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.cropper-drag-box {
|
|
79
|
+
background-color: #fff;
|
|
80
|
+
opacity: 0;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.cropper-modal {
|
|
84
|
+
background-color: #000;
|
|
85
|
+
opacity: 0.5;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.cropper-view-box {
|
|
89
|
+
display: block;
|
|
90
|
+
height: 100%;
|
|
91
|
+
outline: 1px solid #39f;
|
|
92
|
+
outline-color: rgba(51, 153, 255, 0.75);
|
|
93
|
+
overflow: hidden;
|
|
94
|
+
width: 100%;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.cropper-dashed {
|
|
98
|
+
border: 0 dashed #eee;
|
|
99
|
+
display: block;
|
|
100
|
+
opacity: 0.5;
|
|
101
|
+
position: absolute;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.cropper-dashed.dashed-h {
|
|
105
|
+
border-bottom-width: 1px;
|
|
106
|
+
border-top-width: 1px;
|
|
107
|
+
height: calc(100% / 3);
|
|
108
|
+
left: 0;
|
|
109
|
+
top: calc(100% / 3);
|
|
110
|
+
width: 100%;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.cropper-dashed.dashed-v {
|
|
114
|
+
border-left-width: 1px;
|
|
115
|
+
border-right-width: 1px;
|
|
116
|
+
height: 100%;
|
|
117
|
+
left: calc(100% / 3);
|
|
118
|
+
top: 0;
|
|
119
|
+
width: calc(100% / 3);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.cropper-center {
|
|
123
|
+
display: block;
|
|
124
|
+
height: 0;
|
|
125
|
+
left: 50%;
|
|
126
|
+
opacity: 0.75;
|
|
127
|
+
position: absolute;
|
|
128
|
+
top: 50%;
|
|
129
|
+
width: 0;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.cropper-center::before,
|
|
133
|
+
.cropper-center::after {
|
|
134
|
+
background-color: #eee;
|
|
135
|
+
content: " ";
|
|
136
|
+
display: block;
|
|
137
|
+
position: absolute;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.cropper-center::before {
|
|
141
|
+
height: 1px;
|
|
142
|
+
left: -3px;
|
|
143
|
+
top: 0;
|
|
144
|
+
width: 7px;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.cropper-center::after {
|
|
148
|
+
height: 7px;
|
|
149
|
+
left: 0;
|
|
150
|
+
top: -3px;
|
|
151
|
+
width: 1px;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.cropper-face,
|
|
155
|
+
.cropper-line,
|
|
156
|
+
.cropper-point {
|
|
157
|
+
display: block;
|
|
158
|
+
height: 100%;
|
|
159
|
+
opacity: 0.1;
|
|
160
|
+
position: absolute;
|
|
161
|
+
width: 100%;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.cropper-face {
|
|
165
|
+
background-color: #fff;
|
|
166
|
+
left: 0;
|
|
167
|
+
top: 0;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.cropper-line {
|
|
171
|
+
background-color: #39f;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.cropper-line.line-e {
|
|
175
|
+
cursor: ew-resize;
|
|
176
|
+
right: -3px;
|
|
177
|
+
top: 0;
|
|
178
|
+
width: 5px;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.cropper-line.line-n {
|
|
182
|
+
cursor: ns-resize;
|
|
183
|
+
height: 5px;
|
|
184
|
+
left: 0;
|
|
185
|
+
top: -3px;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.cropper-line.line-w {
|
|
189
|
+
cursor: ew-resize;
|
|
190
|
+
left: -3px;
|
|
191
|
+
top: 0;
|
|
192
|
+
width: 5px;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.cropper-line.line-s {
|
|
196
|
+
bottom: -3px;
|
|
197
|
+
cursor: ns-resize;
|
|
198
|
+
height: 5px;
|
|
199
|
+
left: 0;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.cropper-point {
|
|
203
|
+
background-color: #39f;
|
|
204
|
+
height: 5px;
|
|
205
|
+
opacity: 0.75;
|
|
206
|
+
width: 5px;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.cropper-point.point-e {
|
|
210
|
+
cursor: ew-resize;
|
|
211
|
+
margin-top: -3px;
|
|
212
|
+
right: -3px;
|
|
213
|
+
top: 50%;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.cropper-point.point-n {
|
|
217
|
+
cursor: ns-resize;
|
|
218
|
+
left: 50%;
|
|
219
|
+
margin-left: -3px;
|
|
220
|
+
top: -3px;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.cropper-point.point-w {
|
|
224
|
+
cursor: ew-resize;
|
|
225
|
+
left: -3px;
|
|
226
|
+
margin-top: -3px;
|
|
227
|
+
top: 50%;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.cropper-point.point-s {
|
|
231
|
+
bottom: -3px;
|
|
232
|
+
cursor: s-resize;
|
|
233
|
+
left: 50%;
|
|
234
|
+
margin-left: -3px;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.cropper-point.point-ne {
|
|
238
|
+
cursor: nesw-resize;
|
|
239
|
+
right: -3px;
|
|
240
|
+
top: -3px;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.cropper-point.point-nw {
|
|
244
|
+
cursor: nwse-resize;
|
|
245
|
+
left: -3px;
|
|
246
|
+
top: -3px;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.cropper-point.point-sw {
|
|
250
|
+
bottom: -3px;
|
|
251
|
+
cursor: nesw-resize;
|
|
252
|
+
left: -3px;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.cropper-point.point-se {
|
|
256
|
+
bottom: -3px;
|
|
257
|
+
cursor: nwse-resize;
|
|
258
|
+
height: 20px;
|
|
259
|
+
opacity: 1;
|
|
260
|
+
right: -3px;
|
|
261
|
+
width: 20px;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
@media (min-width: 768px) {
|
|
265
|
+
.cropper-point.point-se {
|
|
266
|
+
height: 15px;
|
|
267
|
+
width: 15px;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
@media (min-width: 992px) {
|
|
272
|
+
.cropper-point.point-se {
|
|
273
|
+
height: 10px;
|
|
274
|
+
width: 10px;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
@media (min-width: 1200px) {
|
|
279
|
+
.cropper-point.point-se {
|
|
280
|
+
height: 5px;
|
|
281
|
+
opacity: 0.75;
|
|
282
|
+
width: 5px;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.cropper-point.point-se::before {
|
|
287
|
+
background-color: #39f;
|
|
288
|
+
bottom: -50%;
|
|
289
|
+
content: " ";
|
|
290
|
+
display: block;
|
|
291
|
+
height: 200%;
|
|
292
|
+
opacity: 0;
|
|
293
|
+
position: absolute;
|
|
294
|
+
right: -50%;
|
|
295
|
+
width: 200%;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.cropper-invisible {
|
|
299
|
+
opacity: 0;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.cropper-bg {
|
|
303
|
+
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC");
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.cropper-hide {
|
|
307
|
+
display: block;
|
|
308
|
+
height: 0;
|
|
309
|
+
position: absolute;
|
|
310
|
+
width: 0;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.cropper-hidden {
|
|
314
|
+
display: none !important;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.cropper-move {
|
|
318
|
+
cursor: move;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.cropper-crop {
|
|
322
|
+
cursor: crosshair;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.cropper-disabled .cropper-drag-box,
|
|
326
|
+
.cropper-disabled .cropper-face,
|
|
327
|
+
.cropper-disabled .cropper-line,
|
|
328
|
+
.cropper-disabled .cropper-point {
|
|
329
|
+
cursor: not-allowed;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.cropperBtn {
|
|
335
|
+
display: flex;
|
|
336
|
+
align-items: center;
|
|
337
|
+
justify-content: space-between;
|
|
338
|
+
margin-top: 24px;
|
|
339
|
+
.icons {
|
|
340
|
+
display: flex;
|
|
341
|
+
align-items: center;
|
|
342
|
+
gap: 8px;
|
|
343
|
+
& > span {
|
|
344
|
+
display: flex;
|
|
345
|
+
align-items: center;
|
|
346
|
+
border: 1px solid rgba(0, 0, 0, 0.15);
|
|
347
|
+
padding: 4px;
|
|
348
|
+
cursor: pointer;
|
|
349
|
+
color: rgba(0, 0, 0, 0.65);
|
|
350
|
+
&:hover {
|
|
351
|
+
border-color: #ff7d66;
|
|
352
|
+
color: #ff7d66;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
:global {
|
|
356
|
+
.anticon {
|
|
357
|
+
font-size: 14px;
|
|
358
|
+
cursor: pointer;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
@@ -476,6 +476,7 @@ var CustomerService = function(props) {
|
|
|
476
476
|
message.replaceAll(new RegExp(/```(?:.|\n)*?```/, "ig"), function(con) {
|
|
477
477
|
i++;
|
|
478
478
|
if (i == position) {
|
|
479
|
+
con = con.replace(/^```[\s\S]*?\n/, "").replace(/\n```$/, "");
|
|
479
480
|
codeConment = con;
|
|
480
481
|
return con;
|
|
481
482
|
} else {
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var loading2 = "data:image/gif;base64,R0lGODlhgACAAKIEAN3d3bu7u////5mZmf///wAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTM4IDc5LjE1OTgyNCwgMjAxNi8wOS8xNC0wMTowOTowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvd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f2uTVY+Xi5+bt7Onu8fDQ6PX2y/jM8vf0+frb1M3Td2afhgQAIfkECQgABAAsAgAKADAAVwAAA+tIutz+S0gBq71tTsy70ponVuA2nkxpoqe6sqJLwa1Lj/KN23onzz1MLigcEi3GI4mnhCSbjic0Ip0SqtOfNcqEAL6AHpYABuuw5fSty0i7YeyFe84qVeZ0VMiCz0/7flCAb3+DZVuGh1aJZoWMiI+Qg1tygJSVeJdthJqbX52goaKjpKWmp6ipOgGsra6vsK8wsbS1rii2ubUnur2yI77BAbzCvbjFtrPIsarNzs/Q0dLT1M8D1wOj2Nug297Zl9/elOLfVuXiUOjpTevmSu7j8PHY6vTX7ffg8/RT91v9AK7ThC7UO1HcrCQAADs=";
|
|
2
|
+
export default loading2;
|
package/esm/index.d.ts
CHANGED
|
@@ -82,3 +82,5 @@ export { default as BhdAppLayout } from "./bhdAppLayout";
|
|
|
82
82
|
export { default as CustomerService } from "./customerService";
|
|
83
83
|
export { default as BhdDatePicker } from "./bhdDatePicker";
|
|
84
84
|
export { default as BhdEnterInput } from "./bhdEnterInput";
|
|
85
|
+
export { default as BhdModalCropper } from "./bhdModalCropper";
|
|
86
|
+
export { default as AIMessageList } from "./AIMessageList";
|
package/esm/index.js
CHANGED
|
@@ -87,3 +87,5 @@ export { default as BhdAppLayout } from "./bhdAppLayout"; //封装 BhdAppLayout
|
|
|
87
87
|
export { default as CustomerService } from "./customerService"; //封装 智能客服
|
|
88
88
|
export { default as BhdDatePicker } from "./bhdDatePicker"; //封装 日历组件
|
|
89
89
|
export { default as BhdEnterInput } from "./bhdEnterInput"; //封装 Input
|
|
90
|
+
export { default as BhdModalCropper } from "./bhdModalCropper"; //裁剪头像
|
|
91
|
+
export { default as AIMessageList } from "./AIMessageList"; //AI 对话列表
|
package/esm/utils/Date.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
declare const parseDate: (dateStr: string) => {
|
|
1
|
+
declare const parseDate: (dateStr: string | number) => {
|
|
2
2
|
year: string;
|
|
3
3
|
month: string;
|
|
4
4
|
day: string;
|
|
5
5
|
hours: string;
|
|
6
6
|
minutes: string;
|
|
7
7
|
seconds: string;
|
|
8
|
+
timestamp: number;
|
|
8
9
|
};
|
|
9
10
|
export { parseDate };
|
package/esm/utils/Date.js
CHANGED
package/esm/utils/dom.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
declare var getStyle: (dom: any, key: any) => number;
|
|
2
|
-
|
|
2
|
+
declare const delegate: (element: any, eventType: string, selector: string, callback: any) => () => void;
|
|
3
|
+
declare const findParent: (e: any, className: string) => any;
|
|
4
|
+
declare const copyText: (text: string) => boolean;
|
|
5
|
+
export { getStyle, copyText, findParent, delegate };
|
package/esm/utils/dom.js
CHANGED
|
@@ -1,5 +1,49 @@
|
|
|
1
1
|
//获取css样式
|
|
2
|
+
import { _ as _instanceof } from "@swc/helpers/_/_instanceof";
|
|
2
3
|
var getStyle = function getStyle(dom, key) {
|
|
3
4
|
return dom.currentStyle ? parseFloat(dom.currentStyle[key]) : parseFloat(document.defaultView.getComputedStyle(dom)[key]);
|
|
4
5
|
};
|
|
5
|
-
|
|
6
|
+
// 事件委托函数封装
|
|
7
|
+
var delegate = function(element, eventType, selector, callback) {
|
|
8
|
+
if (!_instanceof(element, HTMLElement)) {
|
|
9
|
+
throw new Error("第一个参数必须是一个HTMLElement");
|
|
10
|
+
}
|
|
11
|
+
if (typeof eventType !== "string") {
|
|
12
|
+
throw new Error("第二个参数必须是字符串");
|
|
13
|
+
}
|
|
14
|
+
if (typeof selector !== "string") {
|
|
15
|
+
throw new Error("第三个参数必须是字符串");
|
|
16
|
+
}
|
|
17
|
+
if (typeof callback !== "function") {
|
|
18
|
+
throw new Error("第四个参数必须是一个函数");
|
|
19
|
+
}
|
|
20
|
+
var fn = function(event) {
|
|
21
|
+
var possibleTargets = element.querySelectorAll(selector);
|
|
22
|
+
for(var i = 0; i < possibleTargets.length; i++){
|
|
23
|
+
if (possibleTargets[i] === event.target || possibleTargets[i].contains(event.target)) {
|
|
24
|
+
callback.call(possibleTargets[i], event, possibleTargets[i]);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
element.addEventListener(eventType, fn);
|
|
29
|
+
return function() {
|
|
30
|
+
element.removeEventListener(eventType, fn);
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
var findParent = function(e, className) {
|
|
34
|
+
while(e && !e.classList.contains(className)){
|
|
35
|
+
e = e.parentElement;
|
|
36
|
+
}
|
|
37
|
+
return e;
|
|
38
|
+
};
|
|
39
|
+
//复制内容
|
|
40
|
+
var copyText = function(text) {
|
|
41
|
+
var tempInput = document.createElement("textarea");
|
|
42
|
+
document.body.appendChild(tempInput);
|
|
43
|
+
tempInput.value = text;
|
|
44
|
+
tempInput.select();
|
|
45
|
+
document.execCommand("copy");
|
|
46
|
+
document.body.removeChild(tempInput);
|
|
47
|
+
return true;
|
|
48
|
+
};
|
|
49
|
+
export { getStyle, copyText, findParent, delegate };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const guidGenerator: () => string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export var guidGenerator = function() {
|
|
2
|
+
var d = new Date().getTime();
|
|
3
|
+
var uuid = "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g, function(c) {
|
|
4
|
+
var r = (d + Math.random() * 16) % 16 | 0;
|
|
5
|
+
d = Math.floor(d / 16);
|
|
6
|
+
return (c == "x" ? r : r & 3 | 8).toString(16);
|
|
7
|
+
});
|
|
8
|
+
return uuid;
|
|
9
|
+
};
|