bhd-components 0.9.21 → 0.9.23
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/README.md +1 -1
- package/dist/index.esm.es5.development.js +28 -11
- package/dist/index.esm.es5.production.js +1 -1
- package/dist/vendor.esm.es5.development.js +1 -1
- package/dist/vendor.esm.es5.production.js +1 -1
- package/es2017/customerService/index.js +16 -3
- package/es2017/viewImage/index.d.ts +1 -0
- package/es2017/viewImage/index.js +14 -12
- package/esm/customerService/index.js +16 -3
- package/esm/viewImage/index.d.ts +1 -0
- package/esm/viewImage/index.js +12 -8
- package/package.json +1 -1
|
@@ -400,16 +400,29 @@ const CustomerService = (props)=>{
|
|
|
400
400
|
getHistoryMessage(pageNum, 1);
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
|
+
// //复制代码功能
|
|
404
|
+
// let chat_content = document.getElementById('chat_content');
|
|
405
|
+
// if(chat_content){
|
|
406
|
+
// chat_content = document.getElementById('chat_content');
|
|
407
|
+
// delegate(chat_content, 'click', `.${styles.copyCode}`, (event:any, target:any) => {
|
|
408
|
+
// findCopyContent(event);
|
|
409
|
+
// });
|
|
410
|
+
// }
|
|
411
|
+
}, [
|
|
412
|
+
roomId
|
|
413
|
+
]);
|
|
414
|
+
useEffect(()=>{
|
|
403
415
|
//复制代码功能
|
|
404
|
-
let chat_content = document.getElementById(
|
|
416
|
+
let chat_content = document.getElementById(showType == 1 || showType == 3 ? "chat_content" : "chat_content_modal");
|
|
405
417
|
if (chat_content) {
|
|
406
|
-
chat_content = document.getElementById(
|
|
418
|
+
chat_content = document.getElementById(showType == 1 || showType == 3 ? "chat_content" : "chat_content_modal");
|
|
407
419
|
delegate(chat_content, 'click', `.${styles.copyCode}`, (event, target)=>{
|
|
408
420
|
findCopyContent(event);
|
|
409
421
|
});
|
|
410
422
|
}
|
|
411
423
|
}, [
|
|
412
|
-
roomId
|
|
424
|
+
roomId,
|
|
425
|
+
showType
|
|
413
426
|
]);
|
|
414
427
|
//进入页面,发送打招呼信息
|
|
415
428
|
useEffect(()=>{
|
|
@@ -43,7 +43,7 @@ class ViewImage extends React.Component {
|
|
|
43
43
|
className: `${styles.viewImgAction} ${styles.actionTop}`,
|
|
44
44
|
children: /*#__PURE__*/ _jsx("span", {
|
|
45
45
|
// id="actionClose"
|
|
46
|
-
// style={{right:`calc(-40px + (-12px * (1 / ${scaleValue / 100}) ))` ,transform: `scale(calc(1 / ${scaleValue / 100}),calc(1 / ${scaleValue / 100}))`,transformOrigin: `top left`}}
|
|
46
|
+
// style={{right:`calc(-40px + (-12px * (1 / ${scaleValue / 100}) ))` ,transform: `scale(calc(1 / ${scaleValue / 100}),calc(1 / ${scaleValue / 100}))`,transformOrigin: `top left`}}
|
|
47
47
|
className: styles.viewImgActionClose,
|
|
48
48
|
title: "关闭",
|
|
49
49
|
onClick: this.close,
|
|
@@ -128,15 +128,15 @@ class ViewImage extends React.Component {
|
|
|
128
128
|
// this.state.actionCloseFlag===0&&(
|
|
129
129
|
// <span
|
|
130
130
|
// id="actionClose"
|
|
131
|
-
// style={{right:`calc(-40px + (-12px * (1 / ${scaleValue / 100}) ))` ,transform: `scale(calc(1 / ${scaleValue / 100}),calc(1 / ${scaleValue / 100}))`,transformOrigin: `top left`}}
|
|
132
|
-
// className={styles.viewImgActionClose}
|
|
133
|
-
// title="关闭"
|
|
131
|
+
// style={{right:`calc(-40px + (-12px * (1 / ${scaleValue / 100}) ))` ,transform: `scale(calc(1 / ${scaleValue / 100}),calc(1 / ${scaleValue / 100}))`,transformOrigin: `top left`}}
|
|
132
|
+
// className={styles.viewImgActionClose}
|
|
133
|
+
// title="关闭"
|
|
134
134
|
// onClick={this.close}>
|
|
135
135
|
// <CustomClose />
|
|
136
136
|
// </span>
|
|
137
137
|
// )
|
|
138
138
|
// }
|
|
139
|
-
// </div>
|
|
139
|
+
// </div>
|
|
140
140
|
/*#__PURE__*/ _jsxs(_Fragment, {
|
|
141
141
|
children: [
|
|
142
142
|
/*#__PURE__*/ _jsx("img", {
|
|
@@ -202,7 +202,7 @@ class ViewImage extends React.Component {
|
|
|
202
202
|
curIndex: 0,
|
|
203
203
|
multiSelect: false,
|
|
204
204
|
imgError: false,
|
|
205
|
-
actionCloseFlag: 0
|
|
205
|
+
actionCloseFlag: 0
|
|
206
206
|
});
|
|
207
207
|
_define_property(this, "scaleChange", (value)=>{
|
|
208
208
|
let { maxScale, minScale } = this.state;
|
|
@@ -220,17 +220,17 @@ class ViewImage extends React.Component {
|
|
|
220
220
|
});
|
|
221
221
|
_define_property(this, "moveActionClose", ()=>{
|
|
222
222
|
setTimeout(()=>{
|
|
223
|
-
const pic = document.getElementById(
|
|
223
|
+
const pic = document.getElementById("viewImgBody_pic");
|
|
224
224
|
if (pic) {
|
|
225
225
|
const rect = pic.getBoundingClientRect();
|
|
226
226
|
if (rect.top >= 0 && rect.top <= (window.innerHeight || document.documentElement.clientHeight) - 40 && rect.right <= (window.innerWidth || document.documentElement.clientWidth) - 52) {
|
|
227
227
|
this.setState({
|
|
228
228
|
actionCloseFlag: 0
|
|
229
229
|
}, ()=>{
|
|
230
|
-
const actionCloseDom = document.getElementById(
|
|
230
|
+
const actionCloseDom = document.getElementById("actionClose");
|
|
231
231
|
if (actionCloseDom) {
|
|
232
|
-
actionCloseDom.style.top = rect.top +
|
|
233
|
-
actionCloseDom.style.left = rect.left + rect.width + 12 +
|
|
232
|
+
actionCloseDom.style.top = rect.top + "px";
|
|
233
|
+
actionCloseDom.style.left = rect.left + rect.width + 12 + "px";
|
|
234
234
|
}
|
|
235
235
|
});
|
|
236
236
|
} else {
|
|
@@ -438,7 +438,8 @@ class ViewImage extends React.Component {
|
|
|
438
438
|
});
|
|
439
439
|
_define_property(this, "imgErr", ()=>{
|
|
440
440
|
this.setState({
|
|
441
|
-
imgError: true
|
|
441
|
+
imgError: true,
|
|
442
|
+
actionCloseFlag: 1 //报错时关闭按钮固定右上角
|
|
442
443
|
}, ()=>{
|
|
443
444
|
this.moveActionClose();
|
|
444
445
|
});
|
|
@@ -446,7 +447,7 @@ class ViewImage extends React.Component {
|
|
|
446
447
|
}
|
|
447
448
|
}
|
|
448
449
|
const AppViewImage = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
449
|
-
let { visible, className } = props;
|
|
450
|
+
let { visible, className, getContainer = ()=>document.body } = props;
|
|
450
451
|
const viewRef = useRef(null);
|
|
451
452
|
useImperativeHandle(ref, ()=>({
|
|
452
453
|
updateSrc: ()=>{
|
|
@@ -467,6 +468,7 @@ const AppViewImage = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
467
468
|
background: "rgba(0, 0, 0, 0.65)"
|
|
468
469
|
},
|
|
469
470
|
wrapClassName: `${styles.AppViewImage} ${className || ""}`,
|
|
471
|
+
getContainer: getContainer,
|
|
470
472
|
children: visible && /*#__PURE__*/ _jsx(ViewImage, _object_spread_props(_object_spread({}, props), {
|
|
471
473
|
ref: viewRef
|
|
472
474
|
}))
|
|
@@ -405,16 +405,29 @@ var CustomerService = function(props) {
|
|
|
405
405
|
getHistoryMessage(pageNum, 1);
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
|
+
// //复制代码功能
|
|
409
|
+
// let chat_content = document.getElementById('chat_content');
|
|
410
|
+
// if(chat_content){
|
|
411
|
+
// chat_content = document.getElementById('chat_content');
|
|
412
|
+
// delegate(chat_content, 'click', `.${styles.copyCode}`, (event:any, target:any) => {
|
|
413
|
+
// findCopyContent(event);
|
|
414
|
+
// });
|
|
415
|
+
// }
|
|
416
|
+
}, [
|
|
417
|
+
roomId
|
|
418
|
+
]);
|
|
419
|
+
useEffect(function() {
|
|
408
420
|
//复制代码功能
|
|
409
|
-
var chat_content = document.getElementById("chat_content");
|
|
421
|
+
var chat_content = document.getElementById(showType == 1 || showType == 3 ? "chat_content" : "chat_content_modal");
|
|
410
422
|
if (chat_content) {
|
|
411
|
-
chat_content = document.getElementById("chat_content");
|
|
423
|
+
chat_content = document.getElementById(showType == 1 || showType == 3 ? "chat_content" : "chat_content_modal");
|
|
412
424
|
delegate(chat_content, "click", ".".concat(styles.copyCode), function(event, target) {
|
|
413
425
|
findCopyContent(event);
|
|
414
426
|
});
|
|
415
427
|
}
|
|
416
428
|
}, [
|
|
417
|
-
roomId
|
|
429
|
+
roomId,
|
|
430
|
+
showType
|
|
418
431
|
]);
|
|
419
432
|
//进入页面,发送打招呼信息
|
|
420
433
|
useEffect(function() {
|
package/esm/viewImage/index.d.ts
CHANGED
package/esm/viewImage/index.js
CHANGED
|
@@ -37,7 +37,7 @@ var ViewImage = /*#__PURE__*/ function(_React_Component) {
|
|
|
37
37
|
curIndex: 0,
|
|
38
38
|
multiSelect: false,
|
|
39
39
|
imgError: false,
|
|
40
|
-
actionCloseFlag: 0
|
|
40
|
+
actionCloseFlag: 0
|
|
41
41
|
});
|
|
42
42
|
_define_property(_assert_this_initialized(_this), "scaleChange", function(value) {
|
|
43
43
|
var _this_state = _this.state, maxScale = _this_state.maxScale, minScale = _this_state.minScale;
|
|
@@ -340,7 +340,8 @@ var ViewImage = /*#__PURE__*/ function(_React_Component) {
|
|
|
340
340
|
});
|
|
341
341
|
_define_property(_assert_this_initialized(_this), "imgErr", function() {
|
|
342
342
|
_this.setState({
|
|
343
|
-
imgError: true
|
|
343
|
+
imgError: true,
|
|
344
|
+
actionCloseFlag: 1 //报错时关闭按钮固定右上角
|
|
344
345
|
}, function() {
|
|
345
346
|
_this.moveActionClose();
|
|
346
347
|
});
|
|
@@ -390,7 +391,7 @@ var ViewImage = /*#__PURE__*/ function(_React_Component) {
|
|
|
390
391
|
className: "".concat(styles.viewImgAction, " ").concat(styles.actionTop),
|
|
391
392
|
children: /*#__PURE__*/ _jsx("span", {
|
|
392
393
|
// id="actionClose"
|
|
393
|
-
// style={{right:`calc(-40px + (-12px * (1 / ${scaleValue / 100}) ))` ,transform: `scale(calc(1 / ${scaleValue / 100}),calc(1 / ${scaleValue / 100}))`,transformOrigin: `top left`}}
|
|
394
|
+
// style={{right:`calc(-40px + (-12px * (1 / ${scaleValue / 100}) ))` ,transform: `scale(calc(1 / ${scaleValue / 100}),calc(1 / ${scaleValue / 100}))`,transformOrigin: `top left`}}
|
|
394
395
|
className: styles.viewImgActionClose,
|
|
395
396
|
title: "关闭",
|
|
396
397
|
onClick: this.close,
|
|
@@ -475,15 +476,15 @@ var ViewImage = /*#__PURE__*/ function(_React_Component) {
|
|
|
475
476
|
// this.state.actionCloseFlag===0&&(
|
|
476
477
|
// <span
|
|
477
478
|
// id="actionClose"
|
|
478
|
-
// style={{right:`calc(-40px + (-12px * (1 / ${scaleValue / 100}) ))` ,transform: `scale(calc(1 / ${scaleValue / 100}),calc(1 / ${scaleValue / 100}))`,transformOrigin: `top left`}}
|
|
479
|
-
// className={styles.viewImgActionClose}
|
|
480
|
-
// title="关闭"
|
|
479
|
+
// style={{right:`calc(-40px + (-12px * (1 / ${scaleValue / 100}) ))` ,transform: `scale(calc(1 / ${scaleValue / 100}),calc(1 / ${scaleValue / 100}))`,transformOrigin: `top left`}}
|
|
480
|
+
// className={styles.viewImgActionClose}
|
|
481
|
+
// title="关闭"
|
|
481
482
|
// onClick={this.close}>
|
|
482
483
|
// <CustomClose />
|
|
483
484
|
// </span>
|
|
484
485
|
// )
|
|
485
486
|
// }
|
|
486
|
-
// </div>
|
|
487
|
+
// </div>
|
|
487
488
|
/*#__PURE__*/ _jsxs(_Fragment, {
|
|
488
489
|
children: [
|
|
489
490
|
/*#__PURE__*/ _jsx("img", {
|
|
@@ -540,7 +541,9 @@ var ViewImage = /*#__PURE__*/ function(_React_Component) {
|
|
|
540
541
|
return ViewImage;
|
|
541
542
|
}(React.Component);
|
|
542
543
|
var AppViewImage = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
543
|
-
var visible = props.visible, className = props.className
|
|
544
|
+
var visible = props.visible, className = props.className, _props_getContainer = props.getContainer, getContainer = _props_getContainer === void 0 ? function() {
|
|
545
|
+
return document.body;
|
|
546
|
+
} : _props_getContainer;
|
|
544
547
|
var viewRef = useRef(null);
|
|
545
548
|
useImperativeHandle(ref, function() {
|
|
546
549
|
return {
|
|
@@ -563,6 +566,7 @@ var AppViewImage = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
563
566
|
background: "rgba(0, 0, 0, 0.65)"
|
|
564
567
|
},
|
|
565
568
|
wrapClassName: "".concat(styles.AppViewImage, " ").concat(className || ""),
|
|
569
|
+
getContainer: getContainer,
|
|
566
570
|
children: visible && /*#__PURE__*/ _jsx(ViewImage, _object_spread_props(_object_spread({}, props), {
|
|
567
571
|
ref: viewRef
|
|
568
572
|
}))
|