bhd-components 0.9.2 → 0.9.4

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 (87) hide show
  1. package/README.md +1 -1
  2. package/dist/index.esm.es5.development.css +456 -364
  3. package/dist/index.esm.es5.development.js +414 -323
  4. package/dist/index.esm.es5.production.css +1 -1
  5. package/dist/index.esm.es5.production.js +1 -1
  6. package/dist/vendor.esm.es5.development.css +119 -0
  7. package/dist/{a5565b8a.esm.es5.development.js → vendor.esm.es5.development.js} +8247 -6856
  8. package/dist/vendor.esm.es5.production.css +11 -0
  9. package/dist/vendor.esm.es5.production.js +485 -0
  10. package/es2017/bhdAppLayout/components/BhdTableSimple/index.js +1 -1
  11. package/es2017/bhdAppLayout/components/BhdTableSimple/index/347/232/204/345/211/257/346/234/254.js +2 -2
  12. package/es2017/bhdAppLayout/index.js +16 -16
  13. package/es2017/bhdDatePicker/index.d.ts +1 -2
  14. package/es2017/bhdDatePicker/index.js +311 -254
  15. package/es2017/bhdDatePicker/index.module.less +106 -9
  16. package/es2017/bhdSelect/index.js +4 -4
  17. package/es2017/bhdTipModal/index.js +6 -6
  18. package/es2017/customerService/contactsList.d.ts +2 -2
  19. package/es2017/customerService/contactsList.js +2 -2
  20. package/es2017/customerService/function.js +2 -1
  21. package/es2017/customerService/historyFun.d.ts +2 -2
  22. package/es2017/customerService/historyFun.js +2 -2
  23. package/es2017/customerService/index.d.ts +2 -2
  24. package/es2017/customerService/index.js +5 -5
  25. package/es2017/customerService/js-screen-shot/lib/common-methods/GetCanvasImgData.js +1 -1
  26. package/es2017/customerService/js-screen-shot/lib/common-methods/SaveBorderArrInfo.js +1 -1
  27. package/es2017/customerService/js-screen-shot/lib/common-methods/SaveCanvasToBase64.js +3 -2
  28. package/es2017/customerService/js-screen-shot/lib/common-methods/SaveCanvasToImage.js +2 -1
  29. package/es2017/customerService/js-screen-shot/lib/common-methods/ZoomCutOutBoxPosition.d.ts +3 -3
  30. package/es2017/customerService/js-screen-shot/lib/main-entrance/CreateDom.js +4 -3
  31. package/es2017/customerService/js-screen-shot/lib/main-entrance/InitData.js +2 -2
  32. package/es2017/customerService/js-screen-shot/lib/split-methods/DrawCutOutBox.js +6 -5
  33. package/es2017/customerService/js-screen-shot/lib/split-methods/SetPlugInParameters.js +15 -14
  34. package/es2017/customerService/js-screen-shot/lib/split-methods/ToolClickEvent.js +1 -1
  35. package/es2017/customerService/js-screen-shot/lib/split-methods/drawCrossImg.js +2 -1
  36. package/es2017/customerService/js-screen-shot/main.js +38 -35
  37. package/es2017/customerService/screenshotTool.d.ts +2 -2
  38. package/es2017/customerService/screenshotTool.js +2 -2
  39. package/es2017/customerService/teacherList.d.ts +2 -2
  40. package/es2017/customerService/teacherList.js +2 -2
  41. package/es2017/i18n/en_US.js +16 -1
  42. package/es2017/i18n/zh_CN.js +16 -1
  43. package/es2017/icons/index.js +2 -2
  44. package/es2017/index.js +14 -14
  45. package/es2017/provider/index.js +2 -2
  46. package/es2017/table/index.js +4 -4
  47. package/es2017/tableSelect/index.js +3 -3
  48. package/es2017/textTootip/index.js +1 -1
  49. package/es2017/titleBar/index.js +3 -3
  50. package/es2017/viewImage/index.js +13 -13
  51. package/esm/bhdAppLayout/index.js +15 -15
  52. package/esm/bhdDatePicker/index.d.ts +1 -2
  53. package/esm/bhdDatePicker/index.js +312 -255
  54. package/esm/bhdDatePicker/index.module.less +106 -9
  55. package/esm/bhdSelect/index.js +1 -1
  56. package/esm/bhdTipModal/index.js +1 -1
  57. package/esm/customerService/contactsList.d.ts +2 -2
  58. package/esm/customerService/contactsList.js +1 -1
  59. package/esm/customerService/function.js +2 -1
  60. package/esm/customerService/historyFun.d.ts +2 -2
  61. package/esm/customerService/historyFun.js +1 -1
  62. package/esm/customerService/index.d.ts +2 -2
  63. package/esm/customerService/index.js +1 -1
  64. package/esm/customerService/js-screen-shot/lib/common-methods/SaveCanvasToBase64.js +3 -2
  65. package/esm/customerService/js-screen-shot/lib/common-methods/SaveCanvasToImage.js +2 -1
  66. package/esm/customerService/js-screen-shot/lib/common-methods/ZoomCutOutBoxPosition.d.ts +3 -3
  67. package/esm/customerService/js-screen-shot/lib/main-entrance/CreateDom.js +4 -3
  68. package/esm/customerService/js-screen-shot/lib/split-methods/DrawCutOutBox.js +5 -4
  69. package/esm/customerService/js-screen-shot/lib/split-methods/SetPlugInParameters.js +15 -14
  70. package/esm/customerService/js-screen-shot/lib/split-methods/drawCrossImg.js +2 -1
  71. package/esm/customerService/js-screen-shot/main.js +31 -28
  72. package/esm/customerService/screenshotTool.d.ts +2 -2
  73. package/esm/customerService/screenshotTool.js +1 -1
  74. package/esm/customerService/teacherList.d.ts +2 -2
  75. package/esm/customerService/teacherList.js +1 -1
  76. package/esm/i18n/en_US.js +16 -1
  77. package/esm/i18n/zh_CN.js +16 -1
  78. package/esm/icons/index.js +1 -1
  79. package/esm/index.js +14 -14
  80. package/esm/tableSelect/index.js +1 -1
  81. package/esm/viewImage/index.js +3 -3
  82. package/package.json +1 -1
  83. package/dist/deb6cc9b.esm.es5.production.js +0 -485
  84. package/dist/vendor.esm.es5.development.esm.es5.development.css +0 -119
  85. package/dist/vendor.esm.es5.production.esm.es5.production.css +0 -11
  86. package/es2017/customerService/screenShotPlugin.esm.js +0 -6515
  87. package/esm/customerService/screenShotPlugin.esm.js +0 -6516
@@ -255,6 +255,14 @@
255
255
  }
256
256
  }
257
257
 
258
+
259
+ // 多面板
260
+ .bhd-picker-panels {
261
+ & .bhd-picker-panel {
262
+ border: none;
263
+ }
264
+ }
265
+
258
266
  // 设置底部区域
259
267
  .bhd-picker-footer {
260
268
  padding: 12px 16px;
@@ -267,12 +275,14 @@
267
275
  border-top: 1px solid @color-background-fillsecondary-Tr !important;
268
276
  line-height: 30px !important;
269
277
  align-items: center;
270
- flex-direction: row-reverse;
271
- justify-content: flex-start;
272
278
 
273
279
  & .bhd-picker-footer-extra {
274
280
  padding: 0;
275
281
  line-height: 30px;
282
+ width: 100%;
283
+ display: flex;
284
+ flex-direction: column;
285
+ gap: 16px;
276
286
 
277
287
  &:not(:last-child) {
278
288
  border-bottom: none;
@@ -285,6 +295,16 @@
285
295
  height: 30px;
286
296
  gap: 10px;
287
297
  align-items: center;
298
+ justify-content: flex-end;
299
+ width: 100%;
300
+ & > li {
301
+ line-height: 30px;
302
+ height: 30px;
303
+ margin: 0;
304
+ &.bhd-picker-ok {
305
+ font-size: 0;
306
+ }
307
+ }
288
308
 
289
309
  & .bhd-picker-now {
290
310
  color: @color-background-primary-base;
@@ -294,6 +314,22 @@
294
314
  }
295
315
  }
296
316
 
317
+ // 自己扩展
318
+ & .bhddatepicker-picker-footer-extra-extend {
319
+ position: relative;
320
+ padding-bottom: 8px;
321
+ &::after {
322
+ content: "";
323
+ width: calc(100% + 100px);
324
+ height: 0px;
325
+ border-bottom: 1px solid @color-background-fillsecondary-Tr;
326
+ // background-color: @color-background-fillsecondary-Tr;
327
+ position: absolute;
328
+ left: -50px;
329
+ bottom: 0;
330
+ }
331
+ }
332
+
297
333
  // 今天按钮
298
334
  .bhd-picker-today-btn {
299
335
  font-size: 14px;
@@ -331,10 +367,9 @@
331
367
  & .bhd-btn-primary {
332
368
  height: 30px;
333
369
  padding: 0 16px;
334
- // line-height: 30px;
370
+ line-height: 30px;
335
371
  border: none;
336
372
  box-shadow: none;
337
- line-height: 21px;
338
373
 
339
374
  &:disabled,
340
375
  &.disabled {
@@ -349,18 +384,24 @@
349
384
 
350
385
  // 隐藏默认的当前
351
386
  & > a {
352
- display: none;
387
+ // display: none;
353
388
  }
354
389
  // & > .bhd-picker-ranges {
355
390
  // display: none;
356
391
  // }
392
+
393
+ & > a.bhd-picker-today-btn {
394
+ position: absolute;
395
+ right: 91px;
396
+ }
357
397
  }
358
398
 
359
- // 默认
399
+ // 默认颜色
360
400
  .bhd-picker-cell-in-view {
361
401
  color: @color-text-Secondary-Tr;
362
402
  }
363
403
 
404
+ //禁用后的今天
364
405
  .bhd-picker-cell-disabled.bhd-picker-cell-today
365
406
  .bhd-picker-cell-inner::before {
366
407
  border-color: @color-background-primary-base !important;
@@ -370,6 +411,43 @@
370
411
  color: @color-text-quaternary-Tr !important;
371
412
  }
372
413
  }
414
+
415
+ &.showTime {
416
+ :global {
417
+ .bhd-picker-footer {
418
+ justify-content: flex-end;
419
+ .bhd-picker-footer-extra {
420
+ width: auto;
421
+ }
422
+ .bhd-picker-ranges {
423
+ width: auto;
424
+ }
425
+ }
426
+ }
427
+ &.showExtraFooter {
428
+ :global {
429
+ .bhd-picker-footer {
430
+ justify-content: flex-start;
431
+ flex-direction: column;
432
+ .bhd-picker-footer-extra {
433
+ width: 100% !important;
434
+ }
435
+ .bhd-picker-ranges {
436
+ width: 100% !important;
437
+ &.showPresets {
438
+ position: absolute;
439
+ width: auto !important;
440
+ bottom: 12px;
441
+ right: 100px;
442
+ &.showNow {
443
+ right: 128px;
444
+ }
445
+ }
446
+ }
447
+ }
448
+ }
449
+ }
450
+ }
373
451
  }
374
452
 
375
453
  // 单选
@@ -701,12 +779,22 @@
701
779
  // 隐藏底部
702
780
  .bhd-picker-footer {
703
781
  display: none !important;
782
+ .bhd-picker-ranges {
783
+ display: none !important;
784
+ }
785
+ .bhddatepicker-picker-footer-extra-extend {
786
+ padding-bottom: 0;
787
+ &::after {
788
+ display: none;
789
+ }
790
+ }
704
791
  }
705
792
 
706
793
  // 头部位置变更
707
794
  .bhd-picker-header {
708
795
  position: relative;
709
- .bhd-picker-header-prev-btn {
796
+ .bhd-picker-header-prev-btn,
797
+ .bhd-picker-header-super-prev-btn {
710
798
  position: absolute;
711
799
  right: 40px;
712
800
  border: none !important;
@@ -715,7 +803,8 @@
715
803
  position: absolute;
716
804
  left: 0;
717
805
  }
718
- .bhd-picker-header-next-btn {
806
+ .bhd-picker-header-next-btn,
807
+ .bhd-picker-header-super-next-btn {
719
808
  position: absolute;
720
809
  right: 0;
721
810
  border: none !important;
@@ -726,6 +815,14 @@
726
815
  color: @color-text-Secondary-Tr;
727
816
  }
728
817
  }
818
+
819
+ &.showExtraFooter {
820
+ :global {
821
+ .bhd-picker-footer {
822
+ display: flex !important;
823
+ }
824
+ }
825
+ }
729
826
  }
730
827
  }
731
828
 
@@ -762,7 +859,7 @@
762
859
  }
763
860
  tbody {
764
861
  tr {
765
- background-color: @color-background-elevated;
862
+ background-color: transparent;
766
863
  border: none !important;
767
864
  td {
768
865
  border: none !important;
@@ -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/index";
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;
@@ -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/index";
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
- /// <reference types="react" />
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: import("react").ForwardRefExoticComponent<Omit<data, "ref"> & import("react").RefAttributes<unknown>>;
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/index";
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 || ctx === void 0 ? void 0 : ctx.drawImage(img, 0, 0, img.width, img.height);
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
- /// <reference types="react" />
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/index";
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
- /// <reference types="react" />
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/index";
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
- canvas === null || canvas === void 0 ? void 0 : canvas.toBlob(function(blob) {
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 || plugInParameters === void 0 ? void 0 : plugInParameters.getSaveImgTitle()) || new Date().getTime();
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: any;
14
- tempStartY: any;
15
- tempWidth: any;
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 || options === void 0 ? void 0 : options.completeCallback;
56
- this.closeCallback = options === null || options === void 0 ? void 0 : options.closeCallback;
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 || options === void 0 ? void 0 : options.hiddenToolIco) {
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 || controller === void 0 ? void 0 : controller.width;
18
- var canvasHeight = controller === null || controller === void 0 ? void 0 : controller.height;
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 || controller === void 0 ? void 0 : controller.style.width),
64
- imgHeight: parseInt(controller === null || controller === void 0 ? void 0 : controller.style.height)
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 || options === void 0 ? void 0 : options.enableWebRtc) === false) {
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 || options === void 0 ? void 0 : options.screenFlow, MediaStream)) {
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 || options === void 0 ? void 0 : options.canvasWidth) && (options === null || options === void 0 ? void 0 : options.canvasHeight)) {
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 || options === void 0 ? void 0 : options.showScreenData) === true) {
21
+ if (((_options4 = options) === null || _options4 === void 0 ? void 0 : _options4.showScreenData) === true) {
21
22
  plugInParameters.setShowScreenDataStatus(true);
22
23
  }
23
- if ((options === null || options === void 0 ? void 0 : options.maskColor) && typeof options.maskColor === "object") {
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 || options === void 0 ? void 0 : options.writeBase64) === false) {
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 || options === void 0 ? void 0 : options.screenShotDom) {
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 || options === void 0 ? void 0 : options.cutBoxBdColor) {
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 || options === void 0 ? void 0 : options.saveCallback) {
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 || options === void 0 ? void 0 : options.maxUndoNum) {
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 || options === void 0 ? void 0 : options.useRatioArrow) {
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 || options === void 0 ? void 0 : options.imgAutoFit) {
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 || options === void 0 ? void 0 : options.saveImgTitle) {
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 || options === void 0 ? void 0 : options.destroyContainer) === false) {
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 || canvas === void 0 ? void 0 : canvas.toDataURL();
21
+ var base64 = (_canvas = canvas) === null || _canvas === void 0 ? void 0 : _canvas.toDataURL();
21
22
  element.setAttribute("src", base64);
22
23
  resolve("转换成功");
23
24
  };