1.0.11 • Published 4 years ago

@urdenko/print-wanted v1.0.11

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

A prank about wanted criminal which you can print on the letterhead specifying anyone you knows.

This example help you understand or to recall principle of the web-components. Maybe you can find out some new about web-components or ways to print directly from web browsers.

How can you run it

The easiest way to run the example is do it in the Stackblitz. Just pick your stack: 1. Run on Stackblitz using Angular 2. Run on Stackblitz using React 3. Run in mobile browsers

If you want to dive into code use the Webpack Dev Server inside the example via npm i && npm start

What want I point

  • You can use instance of web-component to directly work with its properties and methods. It's more convenient than use string attributes and DOM events.
  • Use *.d.ts Typescript file to describe interface of your web component in the package.
  • Yes, the web component can influence whole DOM of web page after call connectedCallback method. Use it with caution. In this example it have done as an exception to the normal.
  • This is a good example a "plug and play" architecture which is the web-component strong suit. The PrintWantedForm does not require further setting for print. You need just call print() method.
  • Native JS allowed me made difficult work with async load of Google fonts and fit a whole content into one print page regardless of count of words.
  • It is not hard to give up the dependencies and make a little package.
  • You may use render() method for the print yourself. For example, you can generate pdf on the server side using Puppeteer. Maybe it is difficult way but you will be sure to the expected outcome.

I hope this example will be useful to you!

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.2

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago