bhd-components 0.9.17 → 0.9.19

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 (35) hide show
  1. package/dist/index.esm.es5.development.css +1265 -1221
  2. package/dist/index.esm.es5.development.js +109 -62
  3. package/dist/index.esm.es5.production.css +1 -1
  4. package/dist/index.esm.es5.production.js +1 -1
  5. package/dist/vendor.esm.es5.development.js +1 -1
  6. package/dist/vendor.esm.es5.production.js +1 -1
  7. package/es2017/customerService/index.module.less +15 -4
  8. package/es2017/customerService/index2.module.less +14 -4
  9. package/es2017/icons/components/custom-screen-xuanzuan.d.ts +4 -0
  10. package/es2017/icons/components/custom-screen-xuanzuan.js +28 -0
  11. package/es2017/icons/components/custom-xuanzuan.js +16 -14
  12. package/es2017/icons/components/index.d.ts +1 -0
  13. package/es2017/icons/components/index.js +1 -0
  14. package/es2017/table/index.module.less +22 -14
  15. package/es2017/viewImage/index(/345/216/237).d.ts +31 -0
  16. package/es2017/viewImage/index(/345/216/237).js +384 -0
  17. package/es2017/viewImage/index.d.ts +1 -0
  18. package/es2017/viewImage/index.js +90 -45
  19. package/es2017/viewImage/index.module(/345/216/237).less +173 -0
  20. package/es2017/viewImage/index.module.less +29 -9
  21. package/esm/customerService/index.module.less +15 -4
  22. package/esm/customerService/index2.module.less +14 -4
  23. package/esm/icons/components/custom-screen-xuanzuan.d.ts +4 -0
  24. package/esm/icons/components/custom-screen-xuanzuan.js +30 -0
  25. package/esm/icons/components/custom-xuanzuan.js +16 -14
  26. package/esm/icons/components/index.d.ts +1 -0
  27. package/esm/icons/components/index.js +1 -0
  28. package/esm/table/index.module.less +22 -14
  29. package/esm/viewImage/index(/345/216/237).d.ts +31 -0
  30. package/esm/viewImage/index(/345/216/237).js +480 -0
  31. package/esm/viewImage/index.d.ts +1 -0
  32. package/esm/viewImage/index.js +90 -45
  33. package/esm/viewImage/index.module(/345/216/237).less +173 -0
  34. package/esm/viewImage/index.module.less +29 -9
  35. package/package.json +1 -1
@@ -13,7 +13,7 @@ import * as React from "react";
13
13
  import { useRef, useImperativeHandle, forwardRef } from "react";
14
14
  import styles from "./index.module.less";
15
15
  import { Modal } from "antd";
16
- import { LeftOutlined, RightOutlined, MinusOutlined, PlusOutlined, CustomClose, CustomXuanZuan, CustomDownLoad } from "../icons";
16
+ import { LeftOutlined, RightOutlined, MinusOutlined, PlusOutlined, CustomClose, CustomScreenXuanZuan, CustomDownLoad } from "../icons";
17
17
  import { getStyle } from "../utils/dom";
18
18
  import { Loading } from "../images";
19
19
  import BhdTipModal from "../bhdTipModal";
@@ -36,7 +36,8 @@ var ViewImage = /*#__PURE__*/ function(_React_Component) {
36
36
  loading: false,
37
37
  curIndex: 0,
38
38
  multiSelect: false,
39
- imgError: false
39
+ imgError: false,
40
+ actionCloseFlag: 0 // 关闭按钮位置 0是跟随图片 1固定右上角
40
41
  });
41
42
  _define_property(_assert_this_initialized(_this), "scaleChange", function(value) {
42
43
  var _this_state = _this.state, maxScale = _this_state.maxScale, minScale = _this_state.minScale;
@@ -48,8 +49,24 @@ var ViewImage = /*#__PURE__*/ function(_React_Component) {
48
49
  }
49
50
  _this.setState({
50
51
  scaleValue: value
52
+ }, function() {
53
+ _this.moveActionClose();
51
54
  });
52
55
  });
56
+ _define_property(_assert_this_initialized(_this), "moveActionClose", function() {
57
+ setTimeout(function() {
58
+ var rect = document.getElementById("viewImgBody_pic").getBoundingClientRect();
59
+ if (rect.top >= 0 && rect.top <= (window.innerHeight || document.documentElement.clientHeight) - 40 && rect.right <= (window.innerWidth || document.documentElement.clientWidth) - 52) {
60
+ _this.setState({
61
+ actionCloseFlag: 0
62
+ });
63
+ } else {
64
+ _this.setState({
65
+ actionCloseFlag: 1
66
+ });
67
+ }
68
+ }, 10);
69
+ });
53
70
  _define_property(_assert_this_initialized(_this), "moveImg", function(ev) {
54
71
  var _this_state = _this.state, imgLeft = _this_state.imgLeft, imgTop = _this_state.imgTop;
55
72
  ev.preventDefault();
@@ -67,7 +84,9 @@ var ViewImage = /*#__PURE__*/ function(_React_Component) {
67
84
  _this.setState({
68
85
  imgLeft: ev.pageX - disx,
69
86
  imgTop: ev.pageY - disy
70
- }, function() {});
87
+ }, function() {
88
+ _this.moveActionClose();
89
+ });
71
90
  };
72
91
  var mouseUp = function() {
73
92
  document.removeEventListener("mousemove", mouseMove);
@@ -345,23 +364,58 @@ var ViewImage = /*#__PURE__*/ function(_React_Component) {
345
364
  /*#__PURE__*/ _jsxs("div", {
346
365
  className: styles.viewImgContent,
347
366
  children: [
367
+ this.state.actionCloseFlag === 1 && /*#__PURE__*/ _jsx("div", {
368
+ className: "".concat(styles.viewImgAction, " ").concat(styles.actionTop),
369
+ children: /*#__PURE__*/ _jsx("span", {
370
+ // id="actionClose"
371
+ // style={{right:`calc(-40px + (-12px * (1 / ${scaleValue / 100}) ))` ,transform: `scale(calc(1 / ${scaleValue / 100}),calc(1 / ${scaleValue / 100}))`,transformOrigin: `top left`}}
372
+ className: styles.viewImgActionClose,
373
+ title: "关闭",
374
+ onClick: this.close,
375
+ children: /*#__PURE__*/ _jsx(CustomClose, {})
376
+ })
377
+ }),
348
378
  /*#__PURE__*/ _jsxs("div", {
349
379
  className: styles.viewImgAction,
350
380
  children: [
351
381
  /*#__PURE__*/ _jsx("span", {
352
382
  title: "旋转",
353
383
  onClick: this.rotate,
354
- children: /*#__PURE__*/ _jsx(CustomXuanZuan, {})
384
+ children: /*#__PURE__*/ _jsx(CustomScreenXuanZuan, {})
355
385
  }),
356
386
  download && !imgError && /*#__PURE__*/ _jsx("span", {
357
387
  title: "下载",
358
388
  onClick: this.downloadUrl,
359
389
  children: /*#__PURE__*/ _jsx(CustomDownLoad, {})
360
390
  }),
361
- /*#__PURE__*/ _jsx("span", {
362
- title: "关闭",
363
- onClick: this.close,
364
- children: /*#__PURE__*/ _jsx(CustomClose, {})
391
+ /*#__PURE__*/ _jsxs("div", {
392
+ className: styles.viewImgBodyScale,
393
+ children: [
394
+ /*#__PURE__*/ _jsx("span", {
395
+ className: styles.viewImgBodyScale_minu,
396
+ onClick: function() {
397
+ scaleValue = scaleValue - 10;
398
+ _this.scaleChange(scaleValue);
399
+ },
400
+ children: /*#__PURE__*/ _jsx(MinusOutlined, {})
401
+ }),
402
+ /*#__PURE__*/ _jsxs("span", {
403
+ className: styles.viewImgBodyScale_value,
404
+ onClick: this.reset,
405
+ children: [
406
+ scaleValue,
407
+ "%"
408
+ ]
409
+ }),
410
+ /*#__PURE__*/ _jsx("span", {
411
+ className: styles.viewImgBodyScale_add,
412
+ onClick: function() {
413
+ scaleValue = scaleValue + 10;
414
+ _this.scaleChange(scaleValue);
415
+ },
416
+ children: /*#__PURE__*/ _jsx(PlusOutlined, {})
417
+ })
418
+ ]
365
419
  })
366
420
  ]
367
421
  }),
@@ -376,20 +430,40 @@ var ViewImage = /*#__PURE__*/ function(_React_Component) {
376
430
  color: "#FFFFFF"
377
431
  },
378
432
  children: imgSrc ? "图片加载错误" : "暂无内容"
379
- }) : /*#__PURE__*/ _jsx("img", {
380
- src: imgSrc,
381
- alt: "图片加载错误",
382
- draggable: "false",
433
+ }) : /*#__PURE__*/ _jsxs("div", {
383
434
  onMouseDown: this.moveImg,
384
435
  style: {
385
- transform: "scale(".concat(scaleValue / 100, ",").concat(scaleValue / 100, ") rotate(").concat(rotateValue, "deg)"),
436
+ transform: "scale(".concat(scaleValue / 100, ",").concat(scaleValue / 100, ")"),
386
437
  left: imgLeft == "auto" ? "auto" : imgLeft + "px",
387
438
  top: imgTop == "auto" ? "auto" : imgTop + "px"
388
439
  },
389
440
  className: styles.viewImgBody_pic,
390
- onLoad: this.imgLoad,
391
- onError: this.imgErr
392
- }, "img"),
441
+ children: [
442
+ /*#__PURE__*/ _jsx("img", {
443
+ id: "viewImgBody_pic",
444
+ src: imgSrc,
445
+ alt: "图片加载错误",
446
+ draggable: "false",
447
+ style: {
448
+ transform: "rotate(".concat(rotateValue, "deg)")
449
+ },
450
+ onLoad: this.imgLoad,
451
+ onError: this.imgErr
452
+ }, "img"),
453
+ this.state.actionCloseFlag === 0 && /*#__PURE__*/ _jsx("span", {
454
+ id: "actionClose",
455
+ style: {
456
+ right: "calc(-40px + (-12px * (1 / ".concat(scaleValue / 100, ") ))"),
457
+ transform: "scale(calc(1 / ".concat(scaleValue / 100, "),calc(1 / ").concat(scaleValue / 100, "))"),
458
+ transformOrigin: "top left"
459
+ },
460
+ className: styles.viewImgActionClose,
461
+ title: "关闭",
462
+ onClick: this.close,
463
+ children: /*#__PURE__*/ _jsx(CustomClose, {})
464
+ })
465
+ ]
466
+ }),
393
467
  multiSelect && /*#__PURE__*/ _jsxs(_Fragment, {
394
468
  children: [
395
469
  this.state.curIndex !== 0 && /*#__PURE__*/ _jsx("div", {
@@ -405,35 +479,6 @@ var ViewImage = /*#__PURE__*/ function(_React_Component) {
405
479
  ]
406
480
  })
407
481
  ]
408
- }),
409
- /*#__PURE__*/ _jsxs("div", {
410
- className: styles.viewImgBodyScale,
411
- children: [
412
- /*#__PURE__*/ _jsx("span", {
413
- className: styles.viewImgBodyScale_minu,
414
- onClick: function() {
415
- scaleValue = scaleValue - 10;
416
- _this.scaleChange(scaleValue);
417
- },
418
- children: /*#__PURE__*/ _jsx(MinusOutlined, {})
419
- }),
420
- /*#__PURE__*/ _jsxs("span", {
421
- className: styles.viewImgBodyScale_value,
422
- onClick: this.reset,
423
- children: [
424
- scaleValue,
425
- "%"
426
- ]
427
- }),
428
- /*#__PURE__*/ _jsx("span", {
429
- className: styles.viewImgBodyScale_add,
430
- onClick: function() {
431
- scaleValue = scaleValue + 10;
432
- _this.scaleChange(scaleValue);
433
- },
434
- children: /*#__PURE__*/ _jsx(PlusOutlined, {})
435
- })
436
- ]
437
482
  })
438
483
  ]
439
484
  }),
@@ -0,0 +1,173 @@
1
+ @import "../theme/variable.less";
2
+ .AppViewImage {
3
+ :global {
4
+ .bhd-modal {
5
+ width: 100% !important;
6
+ height: 100% !important;
7
+ min-height: 600px;
8
+ margin: 0;
9
+ padding: 0;
10
+ overflow: hidden;
11
+ max-width: none;
12
+ .bhd-modal-content {
13
+ width: 100%;
14
+ height: 100%;
15
+ background: transparent;
16
+ box-shadow: none;
17
+ border-radius: none;
18
+ .bhd-modal-body {
19
+ width: 100%;
20
+ height: 100%;
21
+ padding: 0px;
22
+ }
23
+ }
24
+ }
25
+ }
26
+ }
27
+
28
+ .viewImgBody {
29
+ display: flex;
30
+ width: 100%;
31
+ height: 100%;
32
+ .viewImgContent {
33
+ width: 100%;
34
+ height: 100%;
35
+ position: relative;
36
+ .viewImgAction {
37
+ width: 100%;
38
+ display: flex;
39
+ position: absolute;
40
+ top: 40px;
41
+ justify-content: flex-end;
42
+ padding-right: 40px;
43
+ box-sizing: border-box;
44
+ z-index: 10;
45
+ & > span {
46
+ display: flex;
47
+ width: 40px;
48
+ height: 40px;
49
+ background: rgba(0, 0, 0, 0.45);
50
+ align-items: center;
51
+ justify-content: center;
52
+ font-size: 16px;
53
+ color: #ffffff;
54
+ cursor: pointer;
55
+ border-radius: 8px;
56
+ margin-left: 24px;
57
+ &:first-child {
58
+ margin-left: 0;
59
+ }
60
+ }
61
+ }
62
+ .viewImgBody {
63
+ width: 100%;
64
+ height: 100%;
65
+ display: flex;
66
+ align-items: center;
67
+ justify-content: center;
68
+ .viewImgBody_load {
69
+ width: 80px;
70
+ height: 80px;
71
+ }
72
+ .viewImgBody_pic {
73
+ max-width: 80%;
74
+ max-height: 80%;
75
+ cursor: move;
76
+ position: absolute;
77
+ user-select: none;
78
+ }
79
+ .viewImgBody_pre {
80
+ position: absolute;
81
+ width: 40px;
82
+ height: 40px;
83
+ border-left: 1px solid rgba(255, 255, 255, 0.25);
84
+ border-right: 1px solid rgba(255, 255, 255, 0.25);
85
+ box-sizing: border-box;
86
+ background: rgba(0, 0, 0, 0.45);
87
+ display: flex;
88
+ align-items: center;
89
+ justify-content: center;
90
+ color: #ffffff;
91
+ cursor: pointer;
92
+ user-select: none;
93
+ top: 50%;
94
+ transform: translateY(-50%);
95
+ left: 40px;
96
+ border-radius: 50%;
97
+ }
98
+ .viewImgBody_next {
99
+ position: absolute;
100
+ width: 40px;
101
+ height: 40px;
102
+ border-left: 1px solid rgba(255, 255, 255, 0.25);
103
+ border-right: 1px solid rgba(255, 255, 255, 0.25);
104
+ box-sizing: border-box;
105
+ background: rgba(0, 0, 0, 0.45);
106
+ display: flex;
107
+ align-items: center;
108
+ justify-content: center;
109
+ color: #ffffff;
110
+ cursor: pointer;
111
+ user-select: none;
112
+ top: 50%;
113
+ transform: translateY(-50%);
114
+ right: 40px;
115
+ border-radius: 50%;
116
+ }
117
+ }
118
+ .viewImgBodyScale {
119
+ width: 100%;
120
+ padding-right: 40px;
121
+ box-sizing: border-box;
122
+ position: absolute;
123
+ bottom: 40px;
124
+ display: flex;
125
+ align-items: center;
126
+ justify-content: flex-end;
127
+ user-select: none;
128
+ z-index: 10;
129
+ .viewImgBodyScale_minu,
130
+ .viewImgBodyScale_add {
131
+ width: 40px;
132
+ height: 40px;
133
+ display: flex;
134
+ align-items: center;
135
+ justify-content: center;
136
+ font-size: 16px;
137
+ color: #ffffff;
138
+ background-color: rgba(0, 0, 0, 0.45);
139
+ cursor: pointer;
140
+ }
141
+
142
+ .viewImgBodyScale_minu {
143
+ border-radius: 4px 0 0 4px;
144
+ }
145
+
146
+ .viewImgBodyScale_add {
147
+ border-radius: 0 4px 4px 0;
148
+ }
149
+ .viewImgBodyScale_value {
150
+ width: 80px;
151
+ height: 40px;
152
+ border-left: 1px solid rgba(255, 255, 255, 0.25);
153
+ border-right: 1px solid rgba(255, 255, 255, 0.25);
154
+ box-sizing: border-box;
155
+ background: rgba(0, 0, 0, 0.45);
156
+ display: flex;
157
+ align-items: center;
158
+ justify-content: center;
159
+ color: #ffffff;
160
+ cursor: pointer;
161
+ user-select: none;
162
+ }
163
+ }
164
+ }
165
+ .viewImgInfo {
166
+ height: 100%;
167
+ flex-shrink: 0;
168
+ background: #ffffff;
169
+ position: relative;
170
+ z-index: 1001;
171
+ min-height: 600px;
172
+ }
173
+ }
@@ -37,11 +37,16 @@
37
37
  width: 100%;
38
38
  display: flex;
39
39
  position: absolute;
40
- top: 40px;
40
+ bottom: 40px;
41
41
  justify-content: flex-end;
42
42
  padding-right: 40px;
43
43
  box-sizing: border-box;
44
44
  z-index: 10;
45
+ gap: 24px;
46
+ &.actionTop{
47
+ top: 40px;
48
+ bottom: auto;
49
+ }
45
50
  & > span {
46
51
  display: flex;
47
52
  width: 40px;
@@ -53,7 +58,6 @@
53
58
  color: #ffffff;
54
59
  cursor: pointer;
55
60
  border-radius: 8px;
56
- margin-left: 24px;
57
61
  &:first-child {
58
62
  margin-left: 0;
59
63
  }
@@ -71,10 +75,29 @@
71
75
  }
72
76
  .viewImgBody_pic {
73
77
  max-width: 80%;
74
- max-height: 80%;
78
+ max-height: 80%;
75
79
  cursor: move;
76
80
  position: absolute;
77
81
  user-select: none;
82
+ img{
83
+ width: 100%;
84
+ height: 100%;
85
+ }
86
+ }
87
+ .viewImgActionClose{
88
+ position: absolute;
89
+ top: 0;
90
+ right: -52px;
91
+ display: flex;
92
+ width: 40px;
93
+ height: 40px;
94
+ background: rgba(0, 0, 0, 0.45);
95
+ align-items: center;
96
+ justify-content: center;
97
+ font-size: 16px;
98
+ color: #ffffff;
99
+ cursor: pointer;
100
+ border-radius: 8px;
78
101
  }
79
102
  .viewImgBody_pre {
80
103
  position: absolute;
@@ -116,16 +139,13 @@
116
139
  }
117
140
  }
118
141
  .viewImgBodyScale {
119
- width: 100%;
120
- padding-right: 40px;
121
142
  box-sizing: border-box;
122
- position: absolute;
123
- bottom: 40px;
124
- display: flex;
143
+ display: inline-flex;
125
144
  align-items: center;
126
- justify-content: flex-end;
145
+ justify-content: center;
127
146
  user-select: none;
128
147
  z-index: 10;
148
+ gap: 4px;
129
149
  .viewImgBodyScale_minu,
130
150
  .viewImgBodyScale_add {
131
151
  width: 40px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bhd-components",
3
- "version": "0.9.17",
3
+ "version": "0.9.19",
4
4
  "description": "组件功能描述",
5
5
  "config": {
6
6
  "commitizen": {