printjs-rpk 1.6.0
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/.babelrc +12 -0
- package/LICENSE +21 -0
- package/README.md +98 -0
- package/dist/print.css +97 -0
- package/dist/print.js +991 -0
- package/dist/print.map +1 -0
- package/package.json +60 -0
- package/src/index.d.ts +46 -0
- package/src/index.js +10 -0
- package/src/js/browser.js +29 -0
- package/src/js/functions.js +111 -0
- package/src/js/html.js +70 -0
- package/src/js/image.js +48 -0
- package/src/js/init.js +169 -0
- package/src/js/json.js +109 -0
- package/src/js/modal.js +62 -0
- package/src/js/pdf.js +57 -0
- package/src/js/print.js +102 -0
- package/src/js/raw-html.js +15 -0
- package/src/sass/index.scss +14 -0
- package/src/sass/modules/_colors.scss +10 -0
- package/src/sass/partials/_modal.scss +41 -0
- package/src/sass/partials/_spinner.scss +46 -0
package/.babelrc
ADDED
package/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016-present, Rodrigo Vieira (@crabbly)
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
# Print.js
|
2
|
+
|
3
|
+
[](https://travis-ci.org/crabbly/Print.js)
|
4
|
+
[](LICENSE)
|
5
|
+
[](http://standardjs.com/)
|
6
|
+
[](https://www.npmjs.com/package/print-js)
|
7
|
+
|
8
|
+
A tiny javascript library to help printing from the web.
|
9
|
+
|
10
|
+
> For documentation and examples please visit: [printjs.crabbly.com](http://printjs.crabbly.com)
|
11
|
+
|
12
|
+
## Installation
|
13
|
+
|
14
|
+
You can download the latest version of Print.js from the [GitHub releases](https://github.com/crabbly/Print.js/releases/latest) or use the [Print.js CDN](http://printjs.crabbly.com/#cdn) available on the documentation page.
|
15
|
+
|
16
|
+
To install via npm:
|
17
|
+
|
18
|
+
```bash
|
19
|
+
npm install print-js --save
|
20
|
+
```
|
21
|
+
|
22
|
+
To install via yarn:
|
23
|
+
|
24
|
+
```bash
|
25
|
+
yarn add print-js
|
26
|
+
```
|
27
|
+
|
28
|
+
Import the library into your project:
|
29
|
+
|
30
|
+
```js
|
31
|
+
import printJS from 'print-js'
|
32
|
+
```
|
33
|
+
|
34
|
+
## Documentation
|
35
|
+
|
36
|
+
You can find documentation at [printjs.crabbly.com](http://printjs.crabbly.com/#documentation).
|
37
|
+
|
38
|
+
## Contributing to Print.js
|
39
|
+
|
40
|
+
[](https://david-dm.org/crabbly/print.js?type=dev)
|
41
|
+
[](https://david-dm.org/crabbly/print.js)
|
42
|
+
|
43
|
+
Contributions to Print.js are greatly welcomed and encouraged.
|
44
|
+
|
45
|
+
##### Using issues
|
46
|
+
|
47
|
+
The [issue tracker](https://github.com/crabbly/Print.js/issues) is the preferred channel for reporting bugs, requesting new features and submitting pull requests.
|
48
|
+
|
49
|
+
Keep in mind that we would like to keep this a lightweight library.
|
50
|
+
|
51
|
+
Please do not use the issues channel for support requests. For help with using Print.js, please ask questions on Stack Overflow and use the tag `printjs`.
|
52
|
+
|
53
|
+
##### Reporting bugs
|
54
|
+
|
55
|
+
Well structured, detailed bug reports are hugely valuable for the project.
|
56
|
+
|
57
|
+
* Check the issue search to see if it has already been reported.
|
58
|
+
* Isolate the problem to a simple test case.
|
59
|
+
* Create a codepen, fiddle, codesandbox or similar online example replicating the issue.
|
60
|
+
|
61
|
+
Please provide any additional details associated with the bug.
|
62
|
+
|
63
|
+
##### Pull requests
|
64
|
+
|
65
|
+
Clear, concise pull requests are excellent at continuing the project's community driven growth.
|
66
|
+
|
67
|
+
Please make your commits in logical sections with clear commit messages.
|
68
|
+
|
69
|
+
##### Setting up a dev environment
|
70
|
+
|
71
|
+
```bash
|
72
|
+
npm install
|
73
|
+
npm run watch
|
74
|
+
```
|
75
|
+
|
76
|
+
##### Tests
|
77
|
+
|
78
|
+
The library is written following the [Javascript Standard](https://standardjs.com) code style. When running tests, we will also test for any style issues or warnings.
|
79
|
+
|
80
|
+
Automated tests are written using the [Jasmine](https://jasmine.github.io) framework and [Karma](https://karma-runner.github.io) runner.
|
81
|
+
|
82
|
+
To run the automated tests:
|
83
|
+
|
84
|
+
```bash
|
85
|
+
npm run test
|
86
|
+
```
|
87
|
+
|
88
|
+
To manually test the library features:
|
89
|
+
|
90
|
+
```bash
|
91
|
+
npm start
|
92
|
+
```
|
93
|
+
|
94
|
+
This will serve `test\manual\test.html` and open `http://localhost:8080/test/manual` in your default browser.
|
95
|
+
|
96
|
+
## License
|
97
|
+
|
98
|
+
Print.js is available under the [MIT license](https://github.com/crabbly/Print.js/blob/master/LICENSE).
|
package/dist/print.css
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
/*
|
2
|
+
|--------------------------------------------------------------------------
|
3
|
+
| Modules
|
4
|
+
|--------------------------------------------------------------------------
|
5
|
+
*/
|
6
|
+
/*
|
7
|
+
|--------------------------------------------------------------------------
|
8
|
+
| Aliases
|
9
|
+
|--------------------------------------------------------------------------
|
10
|
+
*/
|
11
|
+
/*
|
12
|
+
|--------------------------------------------------------------------------
|
13
|
+
| Partials
|
14
|
+
|--------------------------------------------------------------------------
|
15
|
+
*/
|
16
|
+
.printModal {
|
17
|
+
font-family: sans-serif;
|
18
|
+
display: flex;
|
19
|
+
text-align: center;
|
20
|
+
font-weight: 300;
|
21
|
+
font-size: 30px;
|
22
|
+
left: 0;
|
23
|
+
top: 0;
|
24
|
+
position: absolute;
|
25
|
+
color: #045fb4;
|
26
|
+
width: 100%;
|
27
|
+
height: 100%;
|
28
|
+
background-color: rgba(255, 255, 255, 0.9); }
|
29
|
+
|
30
|
+
/*
|
31
|
+
|--------------------------------------------------------------------------
|
32
|
+
| Close Button
|
33
|
+
|--------------------------------------------------------------------------
|
34
|
+
*/
|
35
|
+
.printClose {
|
36
|
+
position: absolute;
|
37
|
+
right: 10px;
|
38
|
+
top: 10px; }
|
39
|
+
|
40
|
+
.printClose:before {
|
41
|
+
content: "\00D7";
|
42
|
+
font-family: "Helvetica Neue", sans-serif;
|
43
|
+
font-weight: 100;
|
44
|
+
line-height: 1px;
|
45
|
+
padding-top: 0.5em;
|
46
|
+
display: block;
|
47
|
+
font-size: 2em;
|
48
|
+
text-indent: 1px;
|
49
|
+
overflow: hidden;
|
50
|
+
height: 1.25em;
|
51
|
+
width: 1.25em;
|
52
|
+
text-align: center;
|
53
|
+
cursor: pointer; }
|
54
|
+
|
55
|
+
.printSpinner {
|
56
|
+
margin-top: 3px;
|
57
|
+
margin-left: -40px;
|
58
|
+
position: absolute;
|
59
|
+
display: inline-block;
|
60
|
+
width: 25px;
|
61
|
+
height: 25px;
|
62
|
+
border: 2px solid #045fb4;
|
63
|
+
border-radius: 50%;
|
64
|
+
animation: spin 0.75s infinite linear; }
|
65
|
+
|
66
|
+
.printSpinner::before, .printSpinner::after {
|
67
|
+
left: -2px;
|
68
|
+
top: -2px;
|
69
|
+
display: none;
|
70
|
+
position: absolute;
|
71
|
+
content: '';
|
72
|
+
width: inherit;
|
73
|
+
height: inherit;
|
74
|
+
border: inherit;
|
75
|
+
border-radius: inherit; }
|
76
|
+
|
77
|
+
.printSpinner, .printSpinner::before, .printSpinner::after {
|
78
|
+
display: inline-block;
|
79
|
+
border-color: transparent;
|
80
|
+
border-top-color: #045fb4;
|
81
|
+
animation-duration: 1.2s; }
|
82
|
+
|
83
|
+
.printSpinner::before {
|
84
|
+
transform: rotate(120deg); }
|
85
|
+
|
86
|
+
.printSpinner::after {
|
87
|
+
transform: rotate(240deg); }
|
88
|
+
|
89
|
+
/* Keyframes for the animation */
|
90
|
+
@keyframes spin {
|
91
|
+
from {
|
92
|
+
transform: rotate(0deg); }
|
93
|
+
to {
|
94
|
+
transform: rotate(360deg); } }
|
95
|
+
|
96
|
+
|
97
|
+
/*# sourceMappingURL=print.map*/
|