├── .gitignore ├── README.md ├── dist └── index.js ├── package-lock.json ├── package.json └── webpack.config.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | /index.js -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Welcome to ink-html! 2 | 3 |

4 | 5 |
6 | 7 |

8 | 9 | **Prints a specific area/element of your html page** for any frontend framework 10 | 11 | - [x] Form Input Values 12 | - [x] CSS @media print 13 | - [x] Popup [Options](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#Window_features) 14 | 15 | ## Installation 16 | 17 | ```bash 18 | npm install ink-html 19 | ``` 20 | or 21 | ```bash 22 | yarn add ink-html 23 | ``` 24 | 25 | ## CDN 26 | ```html 27 | 28 | ``` 29 | 30 | ## Usage 31 | 32 | ```javascript 33 | import print from 'ink-html' 34 | // const print = inkHtml // for CDN 35 | 36 | // js 37 | print(window.querySelector('#printable')) 38 | // Vue.js 39 | print(this.$refs.printable.$el) 40 | ``` 41 | 42 | > **Join and support our Community**
43 | > Web and Mobile Developers PH
44 | > [ [Facebook Page](https://fb.com/webmobile.ph) | [Group](https://fb.com/groups/webmobile.ph/) ] 45 | 46 | # *Join and support our Community*
**Web and Mobile Developers PH**
[ [Facebook Page](https://fb.com/webmobile.ph) | [Group](https://fb.com/groups/webmobile.ph/) ] 47 | 48 | -------------------------------------------------------------------------------- /dist/index.js: -------------------------------------------------------------------------------- 1 | !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.inkHtml=t():e.inkHtml=t()}(window,(function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){e.exports=function(e,t){t=t||"menubar=no, toolbar=no, location=no, status=no, scrollbars=no, resizable=no, dependent, fullscreen=yes, width="+screen.availWidth+", height="+screen.availHeight;var n=e;Array.prototype.slice.call(n.querySelectorAll("input")).map((function(e){["checkbox","radio"].includes(e.type)&&e.checked?e.setAttribute("checked",""):e.setAttribute("value",e.value)})),Array.prototype.slice.call(n.querySelectorAll("textarea")).map((function(e){e.innerHTML=e.value})),Array.prototype.slice.call(n.querySelectorAll("select")).map((function(e){e.map(e=>{e.selected&&e.setAttribute("selected","selected")})}));const o=e.innerHTML,r=window.open("","",t);r.document.write(`\n \n \n ${document.head.innerHTML}\n \n \n \n ${o}\n