cbvirtua 1.0.39 → 1.0.40
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/package.json +1 -1
- package/vue-pdf-embed-1/.babelrc +3 -0
- package/vue-pdf-embed-1/.eslintrc +10 -0
- package/vue-pdf-embed-1/.github/workflows/publish-to-npm.yml +20 -0
- package/vue-pdf-embed-1/.husky/pre-commit +4 -0
- package/vue-pdf-embed-1/.lintstagedrc +5 -0
- package/vue-pdf-embed-1/.prettierrc +7 -0
- package/vue-pdf-embed-1/CONTRIBUTING.md +14 -0
- package/vue-pdf-embed-1/LICENSE +21 -0
- package/vue-pdf-embed-1/README.md +156 -0
- package/vue-pdf-embed-1/demo/App.vue +56 -0
- package/vue-pdf-embed-1/demo/index.html +11 -0
- package/vue-pdf-embed-1/demo/main.js +8 -0
- package/vue-pdf-embed-1/jest.config.json +6 -0
- package/vue-pdf-embed-1/package-lock.json +12212 -0
- package/vue-pdf-embed-1/package.json +64 -0
- package/vue-pdf-embed-1/src/index.js +10 -0
- package/vue-pdf-embed-1/src/styles/annotation-layer.css +219 -0
- package/vue-pdf-embed-1/src/styles/text-layer.css +95 -0
- package/vue-pdf-embed-1/src/util.js +67 -0
- package/vue-pdf-embed-1/src/vue-pdf-embed.vue +462 -0
- package/vue-pdf-embed-1/test/.eslintrc +5 -0
- package/vue-pdf-embed-1/test/vue-pdf-embed.test.js +55 -0
- package/vue-pdf-embed-1/types/vue2-pdf-embed.d.ts +34 -0
- package/vue-pdf-embed-1/types/vue3-pdf-embed.d.ts +34 -0
- package/vue-pdf-embed-1/webpack.config.js +77 -0
- package/vue-pdf-embed-1/webpack.dev.config.js +29 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "vue-pdf-embed",
|
|
3
|
+
"version": "1.2.1",
|
|
4
|
+
"description": "PDF embed component for Vue 2 and Vue 3",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"vue",
|
|
7
|
+
"vuejs",
|
|
8
|
+
"pdf"
|
|
9
|
+
],
|
|
10
|
+
"main": "dist/vue3-pdf-embed.js",
|
|
11
|
+
"types": "types/vue3-pdf-embed.d.ts",
|
|
12
|
+
"files": [
|
|
13
|
+
"dist/*",
|
|
14
|
+
"src/*",
|
|
15
|
+
"types/*"
|
|
16
|
+
],
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"author": "Aliaksei Hrynko (https://github.com/hrynko)",
|
|
19
|
+
"repository": "github:hrynko/vue-pdf-embed",
|
|
20
|
+
"scripts": {
|
|
21
|
+
"prepare": "husky install && webpack build",
|
|
22
|
+
"build": "webpack build --progress",
|
|
23
|
+
"serve": "webpack serve --config webpack.dev.config.js --hot",
|
|
24
|
+
"test": "jest",
|
|
25
|
+
"lint": "eslint src demo --ext js,vue --fix"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@babel/core": "^7.14.2",
|
|
29
|
+
"@babel/preset-env": "^7.14.2",
|
|
30
|
+
"@vue/compiler-sfc": "^3.0.11",
|
|
31
|
+
"babel-jest": "^26.6.3",
|
|
32
|
+
"babel-loader": "^8.2.2",
|
|
33
|
+
"copy-webpack-plugin": "^9.1.0",
|
|
34
|
+
"css-loader": "^5.2.6",
|
|
35
|
+
"eslint": "^7.27.0",
|
|
36
|
+
"eslint-config-prettier": "^8.3.0",
|
|
37
|
+
"eslint-plugin-prettier": "^3.4.0",
|
|
38
|
+
"eslint-plugin-vue": "^7.10.0",
|
|
39
|
+
"file-loader": "^6.2.0",
|
|
40
|
+
"html-webpack-plugin": "^5.3.2",
|
|
41
|
+
"husky": "^8.0.0",
|
|
42
|
+
"jest": "^26.6.3",
|
|
43
|
+
"lint-staged": "^13.2.2",
|
|
44
|
+
"pdfjs-dist": "^2.9.359",
|
|
45
|
+
"prettier": "^2.3.0",
|
|
46
|
+
"sass": "^1.49.8",
|
|
47
|
+
"sass-loader": "^12.6.0",
|
|
48
|
+
"terser-webpack-plugin": "^5.3.1",
|
|
49
|
+
"vue": "^2.6.12",
|
|
50
|
+
"vue-jest": "^4.0.1",
|
|
51
|
+
"vue-loader": "^15.9.7",
|
|
52
|
+
"vue-loader-next": "npm:vue-loader@^16.2.0",
|
|
53
|
+
"vue-style-loader": "^4.1.3",
|
|
54
|
+
"vue-template-compiler": "^2.6.12",
|
|
55
|
+
"webpack": "^5.37.1",
|
|
56
|
+
"webpack-cli": "^4.7.0",
|
|
57
|
+
"webpack-dev-server": "^3.11.2",
|
|
58
|
+
"webpack-merge": "^5.8.0",
|
|
59
|
+
"worker-loader": "^3.0.8"
|
|
60
|
+
},
|
|
61
|
+
"peerDependencies": {
|
|
62
|
+
"vue": "^2.x || ^3.x"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import VuePdfEmbed from './vue-pdf-embed.vue'
|
|
2
|
+
import { getDocument } from 'pdfjs-dist/legacy/build/pdf.js'
|
|
3
|
+
|
|
4
|
+
VuePdfEmbed.getDocument = getDocument
|
|
5
|
+
|
|
6
|
+
if (typeof window !== 'undefined' && window.Vue) {
|
|
7
|
+
window.VuePdfEmbed = VuePdfEmbed
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default VuePdfEmbed
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2014 Mozilla Foundation
|
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
:root {
|
|
8
|
+
--annotation-unfocused-field-background: url("data:image/svg+xml;charset=UTF-8,<svg width='1px' height='1px' xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' style='fill:rgba(0, 54, 255, 0.13);'/></svg>");
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.annotationLayer section {
|
|
12
|
+
position: absolute;
|
|
13
|
+
text-align: initial;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.annotationLayer .linkAnnotation > a,
|
|
17
|
+
.annotationLayer .buttonWidgetAnnotation.pushButton > a {
|
|
18
|
+
position: absolute;
|
|
19
|
+
font-size: 1em;
|
|
20
|
+
top: 0;
|
|
21
|
+
left: 0;
|
|
22
|
+
width: 100%;
|
|
23
|
+
height: 100%;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.annotationLayer .buttonWidgetAnnotation.pushButton > canvas {
|
|
27
|
+
position: relative;
|
|
28
|
+
top: 0;
|
|
29
|
+
left: 0;
|
|
30
|
+
z-index: -1;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.annotationLayer .linkAnnotation > a:hover,
|
|
34
|
+
.annotationLayer .buttonWidgetAnnotation.pushButton > a:hover {
|
|
35
|
+
opacity: 0.2;
|
|
36
|
+
background: rgba(255, 255, 0, 1);
|
|
37
|
+
box-shadow: 0 2px 10px rgba(255, 255, 0, 1);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.annotationLayer .textAnnotation img {
|
|
41
|
+
position: absolute;
|
|
42
|
+
cursor: pointer;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.annotationLayer .textWidgetAnnotation input,
|
|
46
|
+
.annotationLayer .textWidgetAnnotation textarea,
|
|
47
|
+
.annotationLayer .choiceWidgetAnnotation select,
|
|
48
|
+
.annotationLayer .buttonWidgetAnnotation.checkBox input,
|
|
49
|
+
.annotationLayer .buttonWidgetAnnotation.radioButton input {
|
|
50
|
+
background-image: var(--annotation-unfocused-field-background);
|
|
51
|
+
border: 1px solid transparent;
|
|
52
|
+
box-sizing: border-box;
|
|
53
|
+
font-size: 9px;
|
|
54
|
+
height: 100%;
|
|
55
|
+
margin: 0;
|
|
56
|
+
padding: 0 3px;
|
|
57
|
+
vertical-align: top;
|
|
58
|
+
width: 100%;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.annotationLayer .choiceWidgetAnnotation select option {
|
|
62
|
+
padding: 0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.annotationLayer .buttonWidgetAnnotation.radioButton input {
|
|
66
|
+
border-radius: 50%;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.annotationLayer .textWidgetAnnotation textarea {
|
|
70
|
+
font: message-box;
|
|
71
|
+
font-size: 9px;
|
|
72
|
+
resize: none;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.annotationLayer .textWidgetAnnotation input[disabled],
|
|
76
|
+
.annotationLayer .textWidgetAnnotation textarea[disabled],
|
|
77
|
+
.annotationLayer .choiceWidgetAnnotation select[disabled],
|
|
78
|
+
.annotationLayer .buttonWidgetAnnotation.checkBox input[disabled],
|
|
79
|
+
.annotationLayer .buttonWidgetAnnotation.radioButton input[disabled] {
|
|
80
|
+
background: none;
|
|
81
|
+
border: 1px solid transparent;
|
|
82
|
+
cursor: not-allowed;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.annotationLayer .textWidgetAnnotation input:hover,
|
|
86
|
+
.annotationLayer .textWidgetAnnotation textarea:hover,
|
|
87
|
+
.annotationLayer .choiceWidgetAnnotation select:hover,
|
|
88
|
+
.annotationLayer .buttonWidgetAnnotation.checkBox input:hover,
|
|
89
|
+
.annotationLayer .buttonWidgetAnnotation.radioButton input:hover {
|
|
90
|
+
border: 1px solid rgba(0, 0, 0, 1);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.annotationLayer .textWidgetAnnotation input:focus,
|
|
94
|
+
.annotationLayer .textWidgetAnnotation textarea:focus,
|
|
95
|
+
.annotationLayer .choiceWidgetAnnotation select:focus {
|
|
96
|
+
background: none;
|
|
97
|
+
border: 1px solid transparent;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.annotationLayer .textWidgetAnnotation input :focus,
|
|
101
|
+
.annotationLayer .textWidgetAnnotation textarea :focus,
|
|
102
|
+
.annotationLayer .choiceWidgetAnnotation select :focus,
|
|
103
|
+
.annotationLayer .buttonWidgetAnnotation.checkBox :focus,
|
|
104
|
+
.annotationLayer .buttonWidgetAnnotation.radioButton :focus {
|
|
105
|
+
background-image: none;
|
|
106
|
+
background-color: transparent;
|
|
107
|
+
outline: auto;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,
|
|
111
|
+
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after,
|
|
112
|
+
.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before {
|
|
113
|
+
background-color: rgba(0, 0, 0, 1);
|
|
114
|
+
content: '';
|
|
115
|
+
display: block;
|
|
116
|
+
position: absolute;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,
|
|
120
|
+
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after {
|
|
121
|
+
height: 80%;
|
|
122
|
+
left: 45%;
|
|
123
|
+
width: 1px;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before {
|
|
127
|
+
transform: rotate(45deg);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after {
|
|
131
|
+
transform: rotate(-45deg);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before {
|
|
135
|
+
border-radius: 50%;
|
|
136
|
+
height: 50%;
|
|
137
|
+
left: 30%;
|
|
138
|
+
top: 20%;
|
|
139
|
+
width: 50%;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.annotationLayer .textWidgetAnnotation input.comb {
|
|
143
|
+
font-family: monospace;
|
|
144
|
+
padding-left: 2px;
|
|
145
|
+
padding-right: 0;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.annotationLayer .textWidgetAnnotation input.comb:focus {
|
|
149
|
+
width: 103%;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.annotationLayer .buttonWidgetAnnotation.checkBox input,
|
|
153
|
+
.annotationLayer .buttonWidgetAnnotation.radioButton input {
|
|
154
|
+
-webkit-appearance: none;
|
|
155
|
+
-moz-appearance: none;
|
|
156
|
+
appearance: none;
|
|
157
|
+
padding: 0;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.annotationLayer .popupWrapper {
|
|
161
|
+
position: absolute;
|
|
162
|
+
width: 20em;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.annotationLayer .popup {
|
|
166
|
+
position: absolute;
|
|
167
|
+
z-index: 200;
|
|
168
|
+
max-width: 20em;
|
|
169
|
+
background-color: rgba(255, 255, 153, 1);
|
|
170
|
+
box-shadow: 0 2px 5px rgba(136, 136, 136, 1);
|
|
171
|
+
border-radius: 2px;
|
|
172
|
+
padding: 6px;
|
|
173
|
+
margin-left: 5px;
|
|
174
|
+
cursor: pointer;
|
|
175
|
+
font: message-box;
|
|
176
|
+
font-size: 9px;
|
|
177
|
+
white-space: normal;
|
|
178
|
+
word-wrap: break-word;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.annotationLayer .popup > * {
|
|
182
|
+
font-size: 9px;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.annotationLayer .popup h1 {
|
|
186
|
+
display: inline-block;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.annotationLayer .popupDate {
|
|
190
|
+
display: inline-block;
|
|
191
|
+
margin-left: 5px;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.annotationLayer .popupContent {
|
|
195
|
+
border-top: 1px solid rgba(51, 51, 51, 1);
|
|
196
|
+
margin-top: 2px;
|
|
197
|
+
padding-top: 2px;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.annotationLayer .richText > * {
|
|
201
|
+
white-space: pre-wrap;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.annotationLayer .highlightAnnotation,
|
|
205
|
+
.annotationLayer .underlineAnnotation,
|
|
206
|
+
.annotationLayer .squigglyAnnotation,
|
|
207
|
+
.annotationLayer .strikeoutAnnotation,
|
|
208
|
+
.annotationLayer .freeTextAnnotation,
|
|
209
|
+
.annotationLayer .lineAnnotation svg line,
|
|
210
|
+
.annotationLayer .squareAnnotation svg rect,
|
|
211
|
+
.annotationLayer .circleAnnotation svg ellipse,
|
|
212
|
+
.annotationLayer .polylineAnnotation svg polyline,
|
|
213
|
+
.annotationLayer .polygonAnnotation svg polygon,
|
|
214
|
+
.annotationLayer .caretAnnotation,
|
|
215
|
+
.annotationLayer .inkAnnotation svg polyline,
|
|
216
|
+
.annotationLayer .stampAnnotation,
|
|
217
|
+
.annotationLayer .fileAttachmentAnnotation {
|
|
218
|
+
cursor: pointer;
|
|
219
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2014 Mozilla Foundation
|
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
.textLayer {
|
|
8
|
+
position: absolute;
|
|
9
|
+
text-align: initial;
|
|
10
|
+
left: 0;
|
|
11
|
+
top: 0;
|
|
12
|
+
right: 0;
|
|
13
|
+
bottom: 0;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
opacity: 0.2;
|
|
16
|
+
line-height: 1;
|
|
17
|
+
-webkit-text-size-adjust: none;
|
|
18
|
+
-moz-text-size-adjust: none;
|
|
19
|
+
text-size-adjust: none;
|
|
20
|
+
forced-color-adjust: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.textLayer span,
|
|
24
|
+
.textLayer br {
|
|
25
|
+
color: transparent;
|
|
26
|
+
position: absolute;
|
|
27
|
+
white-space: pre;
|
|
28
|
+
cursor: text;
|
|
29
|
+
transform-origin: 0% 0%;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.textLayer span.markedContent {
|
|
33
|
+
top: 0;
|
|
34
|
+
height: 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.textLayer .highlight {
|
|
38
|
+
margin: -1px;
|
|
39
|
+
padding: 1px;
|
|
40
|
+
background-color: rgba(180, 0, 170, 1);
|
|
41
|
+
border-radius: 4px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.textLayer .highlight.appended {
|
|
45
|
+
position: initial;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.textLayer .highlight.begin {
|
|
49
|
+
border-radius: 4px 0 0 4px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.textLayer .highlight.end {
|
|
53
|
+
border-radius: 0 4px 4px 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.textLayer .highlight.middle {
|
|
57
|
+
border-radius: 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.textLayer .highlight.selected {
|
|
61
|
+
background-color: rgba(0, 100, 0, 1);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.textLayer ::-moz-selection {
|
|
65
|
+
background: rgba(0, 0, 255, 1);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.textLayer ::selection {
|
|
69
|
+
background: rgba(0, 0, 255, 1);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.textLayer br::-moz-selection {
|
|
73
|
+
background: transparent;
|
|
74
|
+
}
|
|
75
|
+
.textLayer br::selection {
|
|
76
|
+
background: transparent;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.textLayer .endOfContent {
|
|
80
|
+
display: block;
|
|
81
|
+
position: absolute;
|
|
82
|
+
left: 0;
|
|
83
|
+
top: 100%;
|
|
84
|
+
right: 0;
|
|
85
|
+
bottom: 0;
|
|
86
|
+
z-index: -1;
|
|
87
|
+
cursor: default;
|
|
88
|
+
-webkit-user-select: none;
|
|
89
|
+
-moz-user-select: none;
|
|
90
|
+
user-select: none;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.textLayer .endOfContent.active {
|
|
94
|
+
top: 0;
|
|
95
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export function addPrintStyles(iframe, sizeX, sizeY) {
|
|
2
|
+
const style = iframe.contentWindow.document.createElement('style')
|
|
3
|
+
style.textContent = `
|
|
4
|
+
@page {
|
|
5
|
+
margin: 0;
|
|
6
|
+
size: ${sizeX}pt ${sizeY}pt;
|
|
7
|
+
}
|
|
8
|
+
body {
|
|
9
|
+
margin: 0;
|
|
10
|
+
}
|
|
11
|
+
canvas {
|
|
12
|
+
width: 100%;
|
|
13
|
+
page-break-after: always;
|
|
14
|
+
page-break-before: avoid;
|
|
15
|
+
page-break-inside: avoid;
|
|
16
|
+
}
|
|
17
|
+
`
|
|
18
|
+
iframe.contentWindow.document.head.appendChild(style)
|
|
19
|
+
iframe.contentWindow.document.body.style.width = '100%'
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function createPrintIframe(container) {
|
|
23
|
+
return new Promise((resolve) => {
|
|
24
|
+
const iframe = document.createElement('iframe')
|
|
25
|
+
iframe.width = 0
|
|
26
|
+
iframe.height = 0
|
|
27
|
+
iframe.style.position = 'absolute'
|
|
28
|
+
iframe.style.top = 0
|
|
29
|
+
iframe.style.left = 0
|
|
30
|
+
iframe.style.border = 'none'
|
|
31
|
+
iframe.style.overflow = 'hidden'
|
|
32
|
+
iframe.onload = () => resolve(iframe)
|
|
33
|
+
container.appendChild(iframe)
|
|
34
|
+
})
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function downloadPdf(data, filename) {
|
|
38
|
+
const url = URL.createObjectURL(
|
|
39
|
+
new Blob([data], {
|
|
40
|
+
type: 'application/pdf',
|
|
41
|
+
})
|
|
42
|
+
)
|
|
43
|
+
const anchor = document.createElement('a')
|
|
44
|
+
anchor.href = url
|
|
45
|
+
anchor.download = filename
|
|
46
|
+
anchor.style.display = 'none'
|
|
47
|
+
document.body.append(anchor)
|
|
48
|
+
anchor.click()
|
|
49
|
+
setTimeout(() => {
|
|
50
|
+
URL.revokeObjectURL(url)
|
|
51
|
+
document.body.removeChild(anchor)
|
|
52
|
+
}, 1000)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function emptyElement(el) {
|
|
56
|
+
while (el.firstChild) {
|
|
57
|
+
el.removeChild(el.firstChild)
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function releaseChildCanvases(el) {
|
|
62
|
+
el.querySelectorAll('canvas').forEach((canvas) => {
|
|
63
|
+
canvas.width = 1
|
|
64
|
+
canvas.height = 1
|
|
65
|
+
canvas.getContext('2d')?.clearRect(0, 0, 1, 1)
|
|
66
|
+
})
|
|
67
|
+
}
|