ztxkutils 2.6.0 → 2.6.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/dist/print.d.ts +3 -2
- package/dist/print.js +9 -5
- package/dist/stompClient.js +2 -2
- package/package.json +9 -6
- package/dist/_commonjsHelpers-bdec4bbd.js +0 -7
- package/dist/index.es-9d1d897e.js +0 -11120
- package/dist/purify.es-67effdac.js +0 -1609
- package/dist/request-d385a629.js +0 -2736
package/dist/print.d.ts
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
*/
|
4
4
|
export declare function addWaterHandle({ waterText, waterClassName, isPrintWater, }?: {
|
5
5
|
waterText?: string;
|
6
|
-
waterClassName?: string;
|
6
|
+
waterClassName?: string[];
|
7
7
|
isPrintWater?: boolean;
|
8
8
|
}): void;
|
9
9
|
export declare function removeWaterHandle(): void;
|
@@ -16,9 +16,10 @@ interface IParams {
|
|
16
16
|
hiddenClassNames?: string[];
|
17
17
|
}
|
18
18
|
export declare function printCurrentDom({ hiddenClassNames }?: IParams): void;
|
19
|
-
export declare function htmlToPdf({ pageClassName, dom, pdfName, }: {
|
19
|
+
export declare function htmlToPdf({ pageClassName, dom, pdfName, isShowPage, }: {
|
20
20
|
pageClassName?: string;
|
21
21
|
dom: HTMLElement;
|
22
22
|
pdfName: string;
|
23
|
+
isShowPage?: boolean;
|
23
24
|
}): Promise<void>;
|
24
25
|
export {};
|
package/dist/print.js
CHANGED
@@ -8,7 +8,7 @@ import html2canvas from 'html2canvas';
|
|
8
8
|
function addWaterHandle(_a) {
|
9
9
|
var _b = _a === void 0 ? {
|
10
10
|
waterText: '',
|
11
|
-
waterClassName:
|
11
|
+
waterClassName: [],
|
12
12
|
isPrintWater: true,
|
13
13
|
} : _a, waterText = _b.waterText, waterClassName = _b.waterClassName, isPrintWater = _b.isPrintWater;
|
14
14
|
var canvas = document.createElement('canvas');
|
@@ -32,11 +32,15 @@ function addWaterHandle(_a) {
|
|
32
32
|
styleDom.setAttribute('id', 'water-style-dom-110011');
|
33
33
|
styleDom.innerText = isPrintWater
|
34
34
|
? '@media print{' +
|
35
|
-
(waterClassName
|
35
|
+
(Array.isArray(waterClassName) && waterClassName.length > 0
|
36
|
+
? "" + waterClassName.join(',')
|
37
|
+
: 'body') +
|
36
38
|
' {background: url(' +
|
37
39
|
canvas.toDataURL('image/png') +
|
38
40
|
') left top repeat;}}'
|
39
|
-
: (waterClassName
|
41
|
+
: (Array.isArray(waterClassName) && waterClassName.length > 0
|
42
|
+
? "" + waterClassName.join(',')
|
43
|
+
: 'body') +
|
40
44
|
' {background: url(' +
|
41
45
|
canvas.toDataURL('image/png') +
|
42
46
|
') left top repeat;}';
|
@@ -98,10 +102,10 @@ function createPdf(canvas, pdf) {
|
|
98
102
|
}
|
99
103
|
}
|
100
104
|
function htmlToPdf(_a) {
|
101
|
-
var pageClassName = _a.pageClassName, dom = _a.dom, pdfName = _a.pdfName;
|
105
|
+
var pageClassName = _a.pageClassName, dom = _a.dom, pdfName = _a.pdfName, isShowPage = _a.isShowPage;
|
102
106
|
var pdf = new jsPDF(undefined, 'pt', 'a4');
|
103
107
|
var allDom = document.querySelectorAll(pageClassName ? pageClassName : '.html2canvas-container-page');
|
104
|
-
if (allDom.length > 0) {
|
108
|
+
if (allDom.length > 0 && isShowPage) {
|
105
109
|
var allDomArray = Array.prototype.slice.call(allDom);
|
106
110
|
var promiseAllDomArray_1 = allDomArray.map(function (dom) { return html2canvas(dom); });
|
107
111
|
return (function () {
|
package/dist/stompClient.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import Stomp from 'stompjs';
|
1
|
+
import Stomp from 'zt-stompjs';
|
2
2
|
import SockJS from 'zt-sockjs-client';
|
3
3
|
import { g as getToken } from './authority-fad2028d.js';
|
4
4
|
|
@@ -108,7 +108,7 @@ var StompClient = /** @class */ (function () {
|
|
108
108
|
((_a = _this.connectWsConfig.reconnectionTime) !== null && _a !== void 0 ? _a : 3000);
|
109
109
|
setTimeout(function () {
|
110
110
|
_this.init();
|
111
|
-
}, timeInterval >
|
111
|
+
}, timeInterval > 10000 ? 10000 : timeInterval);
|
112
112
|
});
|
113
113
|
});
|
114
114
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "ztxkutils",
|
3
|
-
"version": "2.6.
|
3
|
+
"version": "2.6.3",
|
4
4
|
"description": "",
|
5
5
|
"main": "./dist/index.js",
|
6
6
|
"module": "./dist/index.js",
|
@@ -30,6 +30,8 @@
|
|
30
30
|
"eslint-config-prettier": "^8.1.0",
|
31
31
|
"eslint-plugin-prettier": "^3.3.1",
|
32
32
|
"eslint-webpack-plugin": "^2.5.4",
|
33
|
+
"html2canvas": "^1.4.1",
|
34
|
+
"jspdf": "^2.5.1",
|
33
35
|
"lodash": "^4.17.21",
|
34
36
|
"number-precision": "^1.5.0",
|
35
37
|
"prettier": "^2.2.1",
|
@@ -49,17 +51,18 @@
|
|
49
51
|
"screenfull": "^5.1.0",
|
50
52
|
"sockjs-client": "^1.5.1",
|
51
53
|
"stompjs": "^2.3.3",
|
52
|
-
"zt-sockjs-client": "^0.0.1"
|
54
|
+
"zt-sockjs-client": "^0.0.1",
|
55
|
+
"zt-stompjs": "^1.0.3"
|
53
56
|
},
|
54
57
|
"peerDependencies": {
|
55
58
|
"axios": ">=0.21.1",
|
56
59
|
"dayjs": ">=1.10.4",
|
60
|
+
"html2canvas": ">=1.4.1",
|
61
|
+
"jspdf": ">=2.5.1",
|
57
62
|
"lodash": ">=4.17.21",
|
58
63
|
"number-precision": ">=1.5.0",
|
59
64
|
"react": ">=17.0.1",
|
60
65
|
"react-dom": ">=17.0.1",
|
61
|
-
"ztxkui": ">=0.4.1"
|
62
|
-
"jspdf": ">=2.5.1",
|
63
|
-
"html2canvas": ">=1.4.1"
|
66
|
+
"ztxkui": ">=0.4.1"
|
64
67
|
}
|
65
|
-
}
|
68
|
+
}
|
@@ -1,7 +0,0 @@
|
|
1
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
2
|
-
|
3
|
-
function commonjsRequire (path) {
|
4
|
-
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
5
|
-
}
|
6
|
-
|
7
|
-
export { commonjsRequire as a, commonjsGlobal as c };
|