bhd-components 0.9.2 → 0.9.3
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.css +454 -363
- package/dist/index.esm.es5.development.js +333 -325
- package/dist/index.esm.es5.production.css +1 -1
- package/dist/index.esm.es5.production.js +1 -1
- package/dist/vendor.esm.es5.development.css +119 -0
- package/dist/{a5565b8a.esm.es5.development.js → vendor.esm.es5.development.js} +8472 -7204
- package/dist/vendor.esm.es5.production.css +11 -0
- package/dist/vendor.esm.es5.production.js +485 -0
- package/es2017/bhdAppLayout/components/BhdTableSimple/index.js +1 -1
- package/es2017/bhdAppLayout/components/BhdTableSimple/index/347/232/204/345/211/257/346/234/254.js +2 -2
- package/es2017/bhdAppLayout/index.js +16 -16
- package/es2017/bhdDatePicker/index.d.ts +1 -2
- package/es2017/bhdDatePicker/index.js +253 -256
- package/es2017/bhdDatePicker/index.module.less +120 -8
- package/es2017/bhdSelect/index.js +4 -4
- package/es2017/bhdTipModal/index.js +6 -6
- package/es2017/customerService/contactsList.d.ts +2 -2
- package/es2017/customerService/contactsList.js +2 -2
- package/es2017/customerService/function.js +2 -1
- package/es2017/customerService/historyFun.d.ts +2 -2
- package/es2017/customerService/historyFun.js +2 -2
- package/es2017/customerService/index.d.ts +2 -2
- package/es2017/customerService/index.js +5 -5
- package/es2017/customerService/js-screen-shot/lib/common-methods/GetCanvasImgData.js +1 -1
- package/es2017/customerService/js-screen-shot/lib/common-methods/SaveBorderArrInfo.js +1 -1
- package/es2017/customerService/js-screen-shot/lib/common-methods/SaveCanvasToBase64.js +3 -2
- package/es2017/customerService/js-screen-shot/lib/common-methods/SaveCanvasToImage.js +2 -1
- package/es2017/customerService/js-screen-shot/lib/common-methods/ZoomCutOutBoxPosition.d.ts +3 -3
- package/es2017/customerService/js-screen-shot/lib/main-entrance/CreateDom.js +4 -3
- package/es2017/customerService/js-screen-shot/lib/main-entrance/InitData.js +2 -2
- package/es2017/customerService/js-screen-shot/lib/split-methods/DrawCutOutBox.js +6 -5
- package/es2017/customerService/js-screen-shot/lib/split-methods/SetPlugInParameters.js +15 -14
- package/es2017/customerService/js-screen-shot/lib/split-methods/ToolClickEvent.js +1 -1
- package/es2017/customerService/js-screen-shot/lib/split-methods/drawCrossImg.js +2 -1
- package/es2017/customerService/js-screen-shot/main.js +38 -35
- package/es2017/customerService/screenshotTool.d.ts +2 -2
- package/es2017/customerService/screenshotTool.js +2 -2
- package/es2017/customerService/teacherList.d.ts +2 -2
- package/es2017/customerService/teacherList.js +2 -2
- package/es2017/i18n/en_US.js +4 -1
- package/es2017/i18n/zh_CN.js +4 -1
- package/es2017/icons/index.js +2 -2
- package/es2017/index.js +14 -14
- package/es2017/provider/index.js +2 -2
- package/es2017/table/index.js +4 -4
- package/es2017/tableSelect/index.js +3 -3
- package/es2017/textTootip/index.js +1 -1
- package/es2017/titleBar/index.js +3 -3
- package/es2017/viewImage/index.js +13 -13
- package/esm/bhdAppLayout/index.js +15 -15
- package/esm/bhdDatePicker/index.d.ts +1 -2
- package/esm/bhdDatePicker/index.js +254 -257
- package/esm/bhdDatePicker/index.module.less +120 -8
- package/esm/bhdSelect/index.js +1 -1
- package/esm/bhdTipModal/index.js +1 -1
- package/esm/customerService/contactsList.d.ts +2 -2
- package/esm/customerService/contactsList.js +1 -1
- package/esm/customerService/function.js +2 -1
- package/esm/customerService/historyFun.d.ts +2 -2
- package/esm/customerService/historyFun.js +1 -1
- package/esm/customerService/index.d.ts +2 -2
- package/esm/customerService/index.js +1 -1
- package/esm/customerService/js-screen-shot/lib/common-methods/SaveCanvasToBase64.js +3 -2
- package/esm/customerService/js-screen-shot/lib/common-methods/SaveCanvasToImage.js +2 -1
- package/esm/customerService/js-screen-shot/lib/common-methods/ZoomCutOutBoxPosition.d.ts +3 -3
- package/esm/customerService/js-screen-shot/lib/main-entrance/CreateDom.js +4 -3
- package/esm/customerService/js-screen-shot/lib/split-methods/DrawCutOutBox.js +5 -4
- package/esm/customerService/js-screen-shot/lib/split-methods/SetPlugInParameters.js +15 -14
- package/esm/customerService/js-screen-shot/lib/split-methods/drawCrossImg.js +2 -1
- package/esm/customerService/js-screen-shot/main.js +31 -28
- package/esm/customerService/screenshotTool.d.ts +2 -2
- package/esm/customerService/screenshotTool.js +1 -1
- package/esm/customerService/teacherList.d.ts +2 -2
- package/esm/customerService/teacherList.js +1 -1
- package/esm/i18n/en_US.js +4 -1
- package/esm/i18n/zh_CN.js +4 -1
- package/esm/icons/index.js +1 -1
- package/esm/index.js +14 -14
- package/esm/tableSelect/index.js +1 -1
- package/esm/viewImage/index.js +3 -3
- package/package.json +1 -1
- package/dist/deb6cc9b.esm.es5.production.js +0 -485
- package/dist/vendor.esm.es5.development.esm.es5.development.css +0 -119
- package/dist/vendor.esm.es5.production.esm.es5.production.css +0 -11
- package/es2017/customerService/screenShotPlugin.esm.js +0 -6515
- package/esm/customerService/screenShotPlugin.esm.js +0 -6516
|
@@ -255,6 +255,13 @@
|
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
257
|
|
|
258
|
+
// 多面板
|
|
259
|
+
.bhd-picker-panels {
|
|
260
|
+
& .bhd-picker-panel {
|
|
261
|
+
border: none;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
258
265
|
// 设置底部区域
|
|
259
266
|
.bhd-picker-footer {
|
|
260
267
|
padding: 12px 16px;
|
|
@@ -267,12 +274,14 @@
|
|
|
267
274
|
border-top: 1px solid @color-background-fillsecondary-Tr !important;
|
|
268
275
|
line-height: 30px !important;
|
|
269
276
|
align-items: center;
|
|
270
|
-
flex-direction: row-reverse;
|
|
271
|
-
justify-content: flex-start;
|
|
272
277
|
|
|
273
278
|
& .bhd-picker-footer-extra {
|
|
274
279
|
padding: 0;
|
|
275
280
|
line-height: 30px;
|
|
281
|
+
width: 100%;
|
|
282
|
+
display: flex;
|
|
283
|
+
flex-direction: column;
|
|
284
|
+
gap: 16px;
|
|
276
285
|
|
|
277
286
|
&:not(:last-child) {
|
|
278
287
|
border-bottom: none;
|
|
@@ -285,6 +294,16 @@
|
|
|
285
294
|
height: 30px;
|
|
286
295
|
gap: 10px;
|
|
287
296
|
align-items: center;
|
|
297
|
+
justify-content: flex-end;
|
|
298
|
+
width: 100%;
|
|
299
|
+
& > li {
|
|
300
|
+
line-height: 30px;
|
|
301
|
+
height: 30px;
|
|
302
|
+
margin: 0;
|
|
303
|
+
&.bhd-picker-ok {
|
|
304
|
+
font-size: 0;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
288
307
|
|
|
289
308
|
& .bhd-picker-now {
|
|
290
309
|
color: @color-background-primary-base;
|
|
@@ -294,6 +313,22 @@
|
|
|
294
313
|
}
|
|
295
314
|
}
|
|
296
315
|
|
|
316
|
+
// 自己扩展
|
|
317
|
+
& .bhddatepicker-picker-footer-extra-extend {
|
|
318
|
+
position: relative;
|
|
319
|
+
padding-bottom: 8px;
|
|
320
|
+
&::after {
|
|
321
|
+
content: "";
|
|
322
|
+
width: calc(100% + 100px);
|
|
323
|
+
height: 0px;
|
|
324
|
+
border-bottom: 1px solid @color-background-fillsecondary-Tr;
|
|
325
|
+
// background-color: @color-background-fillsecondary-Tr;
|
|
326
|
+
position: absolute;
|
|
327
|
+
left: -50px;
|
|
328
|
+
bottom: 0;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
297
332
|
// 今天按钮
|
|
298
333
|
.bhd-picker-today-btn {
|
|
299
334
|
font-size: 14px;
|
|
@@ -331,10 +366,9 @@
|
|
|
331
366
|
& .bhd-btn-primary {
|
|
332
367
|
height: 30px;
|
|
333
368
|
padding: 0 16px;
|
|
334
|
-
|
|
369
|
+
line-height: 30px;
|
|
335
370
|
border: none;
|
|
336
371
|
box-shadow: none;
|
|
337
|
-
line-height: 21px;
|
|
338
372
|
|
|
339
373
|
&:disabled,
|
|
340
374
|
&.disabled {
|
|
@@ -356,11 +390,12 @@
|
|
|
356
390
|
// }
|
|
357
391
|
}
|
|
358
392
|
|
|
359
|
-
//
|
|
393
|
+
// 默认颜色
|
|
360
394
|
.bhd-picker-cell-in-view {
|
|
361
395
|
color: @color-text-Secondary-Tr;
|
|
362
396
|
}
|
|
363
397
|
|
|
398
|
+
//禁用后的今天
|
|
364
399
|
.bhd-picker-cell-disabled.bhd-picker-cell-today
|
|
365
400
|
.bhd-picker-cell-inner::before {
|
|
366
401
|
border-color: @color-background-primary-base !important;
|
|
@@ -370,6 +405,64 @@
|
|
|
370
405
|
color: @color-text-quaternary-Tr !important;
|
|
371
406
|
}
|
|
372
407
|
}
|
|
408
|
+
|
|
409
|
+
&.showTime {
|
|
410
|
+
:global {
|
|
411
|
+
.bhd-picker-footer {
|
|
412
|
+
justify-content: flex-end;
|
|
413
|
+
.bhd-picker-footer-extra {
|
|
414
|
+
width: auto;
|
|
415
|
+
}
|
|
416
|
+
.bhd-picker-ranges {
|
|
417
|
+
width: auto;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
&.showExtraFooter {
|
|
422
|
+
:global {
|
|
423
|
+
.bhd-picker-footer {
|
|
424
|
+
justify-content: flex-start;
|
|
425
|
+
flex-direction: column;
|
|
426
|
+
.bhd-picker-footer-extra {
|
|
427
|
+
width: 100% !important;
|
|
428
|
+
}
|
|
429
|
+
.bhd-picker-ranges {
|
|
430
|
+
width: 100% !important;
|
|
431
|
+
&.showPresets {
|
|
432
|
+
position: absolute;
|
|
433
|
+
width: auto !important;
|
|
434
|
+
bottom: 12px;
|
|
435
|
+
right: 100px;
|
|
436
|
+
&.showNow {
|
|
437
|
+
right: 128px;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
// &.showNow {
|
|
447
|
+
// :global {
|
|
448
|
+
// .bhd-picker-footer {
|
|
449
|
+
// & > a.bhd-picker-today-btn {
|
|
450
|
+
// position: absolute;
|
|
451
|
+
// right: 91px;
|
|
452
|
+
// }
|
|
453
|
+
// }
|
|
454
|
+
// }
|
|
455
|
+
// }
|
|
456
|
+
|
|
457
|
+
// &.hideShow {
|
|
458
|
+
// :global {
|
|
459
|
+
// .bhd-picker-footer {
|
|
460
|
+
// & > a {
|
|
461
|
+
// display: none;
|
|
462
|
+
// }
|
|
463
|
+
// }
|
|
464
|
+
// }
|
|
465
|
+
// }
|
|
373
466
|
}
|
|
374
467
|
|
|
375
468
|
// 单选
|
|
@@ -701,12 +794,22 @@
|
|
|
701
794
|
// 隐藏底部
|
|
702
795
|
.bhd-picker-footer {
|
|
703
796
|
display: none !important;
|
|
797
|
+
.bhd-picker-ranges {
|
|
798
|
+
display: none !important;
|
|
799
|
+
}
|
|
800
|
+
.bhddatepicker-picker-footer-extra-extend {
|
|
801
|
+
padding-bottom: 0;
|
|
802
|
+
&::after {
|
|
803
|
+
display: none;
|
|
804
|
+
}
|
|
805
|
+
}
|
|
704
806
|
}
|
|
705
807
|
|
|
706
808
|
// 头部位置变更
|
|
707
809
|
.bhd-picker-header {
|
|
708
810
|
position: relative;
|
|
709
|
-
.bhd-picker-header-prev-btn
|
|
811
|
+
.bhd-picker-header-prev-btn,
|
|
812
|
+
.bhd-picker-header-super-prev-btn {
|
|
710
813
|
position: absolute;
|
|
711
814
|
right: 40px;
|
|
712
815
|
border: none !important;
|
|
@@ -715,7 +818,8 @@
|
|
|
715
818
|
position: absolute;
|
|
716
819
|
left: 0;
|
|
717
820
|
}
|
|
718
|
-
.bhd-picker-header-next-btn
|
|
821
|
+
.bhd-picker-header-next-btn,
|
|
822
|
+
.bhd-picker-header-super-next-btn {
|
|
719
823
|
position: absolute;
|
|
720
824
|
right: 0;
|
|
721
825
|
border: none !important;
|
|
@@ -726,6 +830,14 @@
|
|
|
726
830
|
color: @color-text-Secondary-Tr;
|
|
727
831
|
}
|
|
728
832
|
}
|
|
833
|
+
|
|
834
|
+
&.showExtraFooter {
|
|
835
|
+
:global {
|
|
836
|
+
.bhd-picker-footer {
|
|
837
|
+
display: flex !important;
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
}
|
|
729
841
|
}
|
|
730
842
|
}
|
|
731
843
|
|
|
@@ -762,7 +874,7 @@
|
|
|
762
874
|
}
|
|
763
875
|
tbody {
|
|
764
876
|
tr {
|
|
765
|
-
background-color:
|
|
877
|
+
background-color: transparent;
|
|
766
878
|
border: none !important;
|
|
767
879
|
td {
|
|
768
880
|
border: none !important;
|
package/esm/bhdSelect/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
|
5
5
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@ice/jsx-runtime/jsx-runtime";
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
import { useState, useEffect, useRef } from "react";
|
|
8
|
-
import { CaretDownOutlined, CustomArrow } from "../icons
|
|
8
|
+
import { CaretDownOutlined, CustomArrow } from "../icons";
|
|
9
9
|
import { Select, Input } from "antd";
|
|
10
10
|
import styles from "./index.module.less";
|
|
11
11
|
var Search = Input.Search;
|
package/esm/bhdTipModal/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
|
3
3
|
import { jsx as _jsx, jsxs as _jsxs } from "@ice/jsx-runtime/jsx-runtime";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import { Modal } from "./modal";
|
|
6
|
-
import { Confirm, Success, Info } from "../images
|
|
6
|
+
import { Confirm, Success, Info } from "../images";
|
|
7
7
|
import styles from "./index.module.less";
|
|
8
8
|
var initConFirmModal = function(obj) {
|
|
9
9
|
var title = obj.title, content = obj.content, _obj_cancelBtn = obj.cancelBtn, cancelBtn = _obj_cancelBtn === void 0 ? true : _obj_cancelBtn, _obj_okText = obj.okText, okText = _obj_okText === void 0 ? "确定" : _obj_okText, _obj_keyboard = obj.keyboard, keyboard = _obj_keyboard === void 0 ? false : _obj_keyboard, _obj_cancelText = obj.cancelText, cancelText = _obj_cancelText === void 0 ? "取消" : _obj_cancelText, _obj_autoFocusButton = obj.autoFocusButton, autoFocusButton = _obj_autoFocusButton === void 0 ? null : _obj_autoFocusButton;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
interface data {
|
|
3
3
|
type: number;
|
|
4
4
|
roomId: string;
|
|
@@ -10,5 +10,5 @@ interface data {
|
|
|
10
10
|
contactsList: any;
|
|
11
11
|
ref: any;
|
|
12
12
|
}
|
|
13
|
-
declare const ContactsList:
|
|
13
|
+
declare const ContactsList: React.ForwardRefExoticComponent<Omit<data, "ref"> & React.RefAttributes<unknown>>;
|
|
14
14
|
export default ContactsList;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "@ice/jsx-runtime/jsx-runtime";
|
|
|
2
2
|
import React, { forwardRef } from "react";
|
|
3
3
|
import styles from "./index.module.less";
|
|
4
4
|
import { Tooltip } from "antd";
|
|
5
|
-
import { CustomAiIcon, CustomRetract } from "../icons
|
|
5
|
+
import { CustomAiIcon, CustomRetract } from "../icons";
|
|
6
6
|
import { CloseOutlined } from "@ant-design/icons";
|
|
7
7
|
import { getByteLen, formatDate } from "./function"; //录音使用文件
|
|
8
8
|
var ContactsList = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
@@ -126,11 +126,12 @@ var getBase64Image = function(src) {
|
|
|
126
126
|
img.crossOrigin = "";
|
|
127
127
|
img.src = src;
|
|
128
128
|
img.onload = function() {
|
|
129
|
+
var _ctx;
|
|
129
130
|
var canvas = document.createElement("canvas");
|
|
130
131
|
canvas.width = img.width;
|
|
131
132
|
canvas.height = img.height;
|
|
132
133
|
var ctx = canvas.getContext("2d");
|
|
133
|
-
ctx === null ||
|
|
134
|
+
(_ctx = ctx) === null || _ctx === void 0 ? void 0 : _ctx.drawImage(img, 0, 0, img.width, img.height);
|
|
134
135
|
var ext = img.src.substring(img.src.lastIndexOf(".") + 1).toLowerCase();
|
|
135
136
|
var dataURL = canvas.toDataURL("image/" + ext);
|
|
136
137
|
resolve(dataURL);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import "highlight.js/styles/github.css";
|
|
3
3
|
interface data {
|
|
4
4
|
type: number;
|
|
@@ -9,5 +9,5 @@ interface data {
|
|
|
9
9
|
onClose: any;
|
|
10
10
|
loadSpecifiedData: any;
|
|
11
11
|
}
|
|
12
|
-
declare const HistoryFun: (props: data) => JSX.Element;
|
|
12
|
+
declare const HistoryFun: (props: data) => React.JSX.Element;
|
|
13
13
|
export default HistoryFun;
|
|
@@ -7,7 +7,7 @@ import styles from "./index.module.less";
|
|
|
7
7
|
//import "highlight.js/styles/default.css";
|
|
8
8
|
import "highlight.js/styles/github.css";
|
|
9
9
|
import { Input } from "antd";
|
|
10
|
-
import { CustomClose, CustomExpand, CustomAiIcon } from "../icons
|
|
10
|
+
import { CustomClose, CustomExpand, CustomAiIcon } from "../icons";
|
|
11
11
|
import { SearchOutlined } from "@ant-design/icons";
|
|
12
12
|
import { formatDate } from "./function"; //录音使用文件
|
|
13
13
|
var HistoryFun = function(props) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import "highlight.js/styles/github.css";
|
|
3
3
|
interface Service {
|
|
4
4
|
type: string;
|
|
@@ -16,5 +16,5 @@ interface Service {
|
|
|
16
16
|
config: any;
|
|
17
17
|
screenshotAreaId: string;
|
|
18
18
|
}
|
|
19
|
-
declare const CustomerService: (props: Service) => JSX.Element;
|
|
19
|
+
declare const CustomerService: (props: Service) => React.JSX.Element;
|
|
20
20
|
export default CustomerService;
|
|
@@ -12,7 +12,7 @@ var styles = cssStyle;
|
|
|
12
12
|
if (false) {
|
|
13
13
|
styles = cssStyleOnline;
|
|
14
14
|
}
|
|
15
|
-
import { CustomAiIcon, CustomRecord, CustomFullScreen, CustomExitFullScreen, CustomReloading, CustomCopy, CustomLike, CustomDislike, CustomQuote, CustomSending, CustomContacts, CustomDuihao, CustomRoundClose, CustomScreenshot, CustomKnowledgeContent, CustomWenhaoRound } from "../icons
|
|
15
|
+
import { CustomAiIcon, CustomRecord, CustomFullScreen, CustomExitFullScreen, CustomReloading, CustomCopy, CustomLike, CustomDislike, CustomQuote, CustomSending, CustomContacts, CustomDuihao, CustomRoundClose, CustomScreenshot, CustomKnowledgeContent, CustomWenhaoRound } from "../icons";
|
|
16
16
|
import { CloseOutlined, RightOutlined, ZoomInOutlined } from "@ant-design/icons";
|
|
17
17
|
import HistoryFun from "./historyFun";
|
|
18
18
|
import ContactsList from "./contactsList";
|
|
@@ -16,8 +16,9 @@ export function saveCanvasToBase64(context, startX, startY, width, height) {
|
|
|
16
16
|
// 将图片放进canvas中
|
|
17
17
|
imgContext.putImageData(img, 0, 0);
|
|
18
18
|
if (writeBase64) {
|
|
19
|
-
// 将图片自动添加至剪贴板中
|
|
20
|
-
|
|
19
|
+
var // 将图片自动添加至剪贴板中
|
|
20
|
+
_canvas;
|
|
21
|
+
(_canvas = canvas) === null || _canvas === void 0 ? void 0 : _canvas.toBlob(function(blob) {
|
|
21
22
|
var _navigator_clipboard;
|
|
22
23
|
if (blob == null) return;
|
|
23
24
|
var Clipboard = window.ClipboardItem;
|
|
@@ -12,13 +12,14 @@ export function saveCanvasToImage(context, startX, startY, width, height) {
|
|
|
12
12
|
// 获取裁剪框区域画布
|
|
13
13
|
var imgContext = getCanvas2dCtx(canvas, width, height);
|
|
14
14
|
if (imgContext) {
|
|
15
|
+
var _plugInParameters;
|
|
15
16
|
// 将图片放进裁剪框内
|
|
16
17
|
imgContext.putImageData(img, 0, 0);
|
|
17
18
|
var a = document.createElement("a");
|
|
18
19
|
// 获取图片
|
|
19
20
|
a.href = canvas.toDataURL("png");
|
|
20
21
|
// 获取用户传入的文件名
|
|
21
|
-
var imgName = (plugInParameters === null ||
|
|
22
|
+
var imgName = ((_plugInParameters = plugInParameters) === null || _plugInParameters === void 0 ? void 0 : _plugInParameters.getSaveImgTitle()) || new Date().getTime();
|
|
22
23
|
// 下载图片
|
|
23
24
|
a.download = "".concat(imgName, ".png");
|
|
24
25
|
a.click();
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* @private
|
|
11
11
|
*/
|
|
12
12
|
export declare function zoomCutOutBoxPosition(currentX: number, currentY: number, startX: number, startY: number, width: number, height: number, option: number): {
|
|
13
|
-
tempStartX:
|
|
14
|
-
tempStartY:
|
|
15
|
-
tempWidth:
|
|
13
|
+
tempStartX: number;
|
|
14
|
+
tempStartY: number;
|
|
15
|
+
tempWidth: number;
|
|
16
16
|
tempHeight: number;
|
|
17
17
|
};
|
|
@@ -11,6 +11,7 @@ var CreateDom = /*#__PURE__*/ function() {
|
|
|
11
11
|
"use strict";
|
|
12
12
|
function CreateDom(options) {
|
|
13
13
|
_class_call_check(this, CreateDom);
|
|
14
|
+
var _options, _options1, _options2;
|
|
14
15
|
// 截图区域canvas容器
|
|
15
16
|
_define_property(this, "screenShotController", void 0);
|
|
16
17
|
// 截图工具栏容器
|
|
@@ -52,8 +53,8 @@ var CreateDom = /*#__PURE__*/ function() {
|
|
|
52
53
|
this.optionController = document.createElement("div");
|
|
53
54
|
// this.cutBoxSizeContainer = document.createElement("div");
|
|
54
55
|
this.textInputController = document.createElement("div");
|
|
55
|
-
this.completeCallback = options === null ||
|
|
56
|
-
this.closeCallback = options === null ||
|
|
56
|
+
this.completeCallback = (_options = options) === null || _options === void 0 ? void 0 : _options.completeCallback;
|
|
57
|
+
this.closeCallback = (_options1 = options) === null || _options1 === void 0 ? void 0 : _options1.closeCallback;
|
|
57
58
|
this.hiddenIcoArr = [];
|
|
58
59
|
this.optionController.addEventListener("click", function(evt) {
|
|
59
60
|
var target = evt.target;
|
|
@@ -71,7 +72,7 @@ var CreateDom = /*#__PURE__*/ function() {
|
|
|
71
72
|
};
|
|
72
73
|
}
|
|
73
74
|
// 筛选需要隐藏的图标
|
|
74
|
-
if (options === null ||
|
|
75
|
+
if ((_options2 = options) === null || _options2 === void 0 ? void 0 : _options2.hiddenToolIco) {
|
|
75
76
|
for(var iconKey in options.hiddenToolIco){
|
|
76
77
|
if (options.hiddenToolIco[iconKey]) {
|
|
77
78
|
this.filterHideIcon(iconKey);
|
|
@@ -13,9 +13,10 @@ import PlugInParameters from "../main-entrance/PlugInParameters";
|
|
|
13
13
|
* @private
|
|
14
14
|
*/ export function drawCutOutBox(mouseX, mouseY, width, height, context, borderSize, controller, imageController) {
|
|
15
15
|
var drawBorders = arguments.length > 8 && arguments[8] !== void 0 ? arguments[8] : true;
|
|
16
|
+
var _controller, _controller1, _controller2, _controller3;
|
|
16
17
|
// 获取画布宽高
|
|
17
|
-
var canvasWidth = controller === null ||
|
|
18
|
-
var canvasHeight = controller === null ||
|
|
18
|
+
var canvasWidth = (_controller = controller) === null || _controller === void 0 ? void 0 : _controller.width;
|
|
19
|
+
var canvasHeight = (_controller1 = controller) === null || _controller1 === void 0 ? void 0 : _controller1.height;
|
|
19
20
|
var dpr = window.devicePixelRatio || 1;
|
|
20
21
|
var data = new PlugInParameters();
|
|
21
22
|
// 画布、图片不存在则return
|
|
@@ -60,8 +61,8 @@ import PlugInParameters from "../main-entrance/PlugInParameters";
|
|
|
60
61
|
context.globalCompositeOperation = "destination-over";
|
|
61
62
|
// 图片尺寸使用canvas容器的css中的尺寸
|
|
62
63
|
var _ref = {
|
|
63
|
-
imgWidth: parseInt(controller === null ||
|
|
64
|
-
imgHeight: parseInt(controller === null ||
|
|
64
|
+
imgWidth: parseInt((_controller2 = controller) === null || _controller2 === void 0 ? void 0 : _controller2.style.width),
|
|
65
|
+
imgHeight: parseInt((_controller3 = controller) === null || _controller3 === void 0 ? void 0 : _controller3.style.height)
|
|
65
66
|
}, imgWidth = _ref.imgWidth, imgHeight = _ref.imgHeight;
|
|
66
67
|
// 用户有传入截图dom绘制时使用其dom的尺寸
|
|
67
68
|
var screenShotDom = data.getScreenShotDom();
|
|
@@ -2,61 +2,62 @@ import { _ as _instanceof } from "@swc/helpers/_/_instanceof";
|
|
|
2
2
|
import PlugInParameters from "../main-entrance/PlugInParameters";
|
|
3
3
|
// 为插件的全局参数设置数据
|
|
4
4
|
export function setPlugInParameters(options) {
|
|
5
|
+
var _options, _options1, _options2, _options3, _options4, _options5, _options6, _options7, _options8, _options9, _options10, _options11, _options12, _options13, _options14;
|
|
5
6
|
var plugInParameters = new PlugInParameters();
|
|
6
7
|
// webrtc启用状态, 默认为true,如果设置了false则修改默认值
|
|
7
|
-
if ((options === null ||
|
|
8
|
+
if (((_options = options) === null || _options === void 0 ? void 0 : _options.enableWebRtc) === false) {
|
|
8
9
|
plugInParameters.setWebRtcStatus(false);
|
|
9
10
|
plugInParameters.setInitStatus(false);
|
|
10
11
|
}
|
|
11
12
|
// 读取并设置参数中的视频流数据
|
|
12
|
-
if (_instanceof(options === null ||
|
|
13
|
+
if (_instanceof((_options1 = options) === null || _options1 === void 0 ? void 0 : _options1.screenFlow, MediaStream)) {
|
|
13
14
|
plugInParameters.setScreenFlow(options.screenFlow);
|
|
14
15
|
}
|
|
15
16
|
// 读取参数中的画布宽高, 两者都存在时才设置
|
|
16
|
-
if ((options === null ||
|
|
17
|
+
if (((_options2 = options) === null || _options2 === void 0 ? void 0 : _options2.canvasWidth) && ((_options3 = options) === null || _options3 === void 0 ? void 0 : _options3.canvasHeight)) {
|
|
17
18
|
plugInParameters.setCanvasSize(options.canvasWidth, options.canvasHeight);
|
|
18
19
|
}
|
|
19
20
|
// 读取参数设置默认展示截屏数据的状态,默认为false,如果设置了true才修改
|
|
20
|
-
if ((options === null ||
|
|
21
|
+
if (((_options4 = options) === null || _options4 === void 0 ? void 0 : _options4.showScreenData) === true) {
|
|
21
22
|
plugInParameters.setShowScreenDataStatus(true);
|
|
22
23
|
}
|
|
23
|
-
if ((options === null ||
|
|
24
|
+
if (((_options5 = options) === null || _options5 === void 0 ? void 0 : _options5.maskColor) && typeof options.maskColor === "object") {
|
|
24
25
|
plugInParameters.setMaskColor(options.maskColor);
|
|
25
26
|
}
|
|
26
27
|
// 调用者关闭了剪切板写入,则修改全局变量(默认为true)
|
|
27
|
-
if ((options === null ||
|
|
28
|
+
if (((_options6 = options) === null || _options6 === void 0 ? void 0 : _options6.writeBase64) === false) {
|
|
28
29
|
plugInParameters.setWriteImgState(options.writeBase64);
|
|
29
30
|
}
|
|
30
31
|
// 调用者传入了截图dom
|
|
31
|
-
if (options === null ||
|
|
32
|
+
if ((_options7 = options) === null || _options7 === void 0 ? void 0 : _options7.screenShotDom) {
|
|
32
33
|
plugInParameters.setScreenShotDom(options.screenShotDom);
|
|
33
34
|
}
|
|
34
35
|
// 调用者传入了裁剪区域边框像素点颜色信息
|
|
35
|
-
if (options === null ||
|
|
36
|
+
if ((_options8 = options) === null || _options8 === void 0 ? void 0 : _options8.cutBoxBdColor) {
|
|
36
37
|
plugInParameters.setCutBoxBdColor(options.cutBoxBdColor);
|
|
37
38
|
}
|
|
38
39
|
// 调用者传入了保存截图回调
|
|
39
|
-
if (options === null ||
|
|
40
|
+
if ((_options9 = options) === null || _options9 === void 0 ? void 0 : _options9.saveCallback) {
|
|
40
41
|
plugInParameters.setSaveCallback(options.saveCallback);
|
|
41
42
|
}
|
|
42
43
|
// 设置最大撤销次数
|
|
43
|
-
if (options === null ||
|
|
44
|
+
if ((_options10 = options) === null || _options10 === void 0 ? void 0 : _options10.maxUndoNum) {
|
|
44
45
|
plugInParameters.setMaxUndoNum(options.maxUndoNum);
|
|
45
46
|
}
|
|
46
47
|
// 箭头绘制工具是否使用等比例绘制方式
|
|
47
|
-
if (options === null ||
|
|
48
|
+
if ((_options11 = options) === null || _options11 === void 0 ? void 0 : _options11.useRatioArrow) {
|
|
48
49
|
plugInParameters.setRatioArrow(options.useRatioArrow);
|
|
49
50
|
}
|
|
50
51
|
// 设置图片自适应开启状态
|
|
51
|
-
if (options === null ||
|
|
52
|
+
if ((_options12 = options) === null || _options12 === void 0 ? void 0 : _options12.imgAutoFit) {
|
|
52
53
|
plugInParameters.setImgAutoFit(options.imgAutoFit);
|
|
53
54
|
}
|
|
54
55
|
// 设置图片保存时的文件名称
|
|
55
|
-
if (options === null ||
|
|
56
|
+
if ((_options13 = options) === null || _options13 === void 0 ? void 0 : _options13.saveImgTitle) {
|
|
56
57
|
plugInParameters.setSaveImgTitle(options.saveImgTitle);
|
|
57
58
|
}
|
|
58
59
|
// 确认截图时,是否需要销毁dom
|
|
59
|
-
if ((options === null ||
|
|
60
|
+
if (((_options14 = options) === null || _options14 === void 0 ? void 0 : _options14.destroyContainer) === false) {
|
|
60
61
|
plugInParameters.setDestroyContainerState(options.destroyContainer);
|
|
61
62
|
}
|
|
62
63
|
}
|
|
@@ -10,6 +10,7 @@ export function drawCrossImg(html) {
|
|
|
10
10
|
img.crossOrigin = "anonymous";
|
|
11
11
|
img.src = "".concat(href, "&time=").concat(+new Date().getTime());
|
|
12
12
|
img.onload = function() {
|
|
13
|
+
var _canvas;
|
|
13
14
|
var width = element.width;
|
|
14
15
|
var height = element.height;
|
|
15
16
|
var canvas = document.createElement("canvas");
|
|
@@ -17,7 +18,7 @@ export function drawCrossImg(html) {
|
|
|
17
18
|
canvas.height = height;
|
|
18
19
|
var ctx = canvas.getContext("2d");
|
|
19
20
|
ctx.drawImage(img, 0, 0, width, height);
|
|
20
|
-
var base64 = canvas === null ||
|
|
21
|
+
var base64 = (_canvas = canvas) === null || _canvas === void 0 ? void 0 : _canvas.toDataURL();
|
|
21
22
|
element.setAttribute("src", base64);
|
|
22
23
|
resolve("转换成功");
|
|
23
24
|
};
|