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.
- package/README.md +1 -1
- package/dist/index.esm.es5.development.css +456 -364
- package/dist/index.esm.es5.development.js +414 -323
- 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} +8247 -6856
- 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 +311 -254
- package/es2017/bhdDatePicker/index.module.less +106 -9
- 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 +16 -1
- package/es2017/i18n/zh_CN.js +16 -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 +312 -255
- package/esm/bhdDatePicker/index.module.less +106 -9
- 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 +16 -1
- package/esm/i18n/zh_CN.js +16 -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,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
|
-
|
|
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:
|
|
862
|
+
background-color: transparent;
|
|
766
863
|
border: none !important;
|
|
767
864
|
td {
|
|
768
865
|
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
|
};
|