-
Notifications
You must be signed in to change notification settings - Fork 763
feat(core): add print support with mediaQuery override #954
Conversation
@CaerusKaru - these include changes from PRs #946 and #912. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the approach overall. Some things missing or need to be added.
Also, scope should be |
6a8c59a
to
8e5f762
Compare
CLAs look good, thanks! |
735f6e1
to
72998b2
Compare
9c31ffa
to
21e68b5
Compare
0c60244
to
60d3153
Compare
9235c07
to
543e1f9
Compare
When printing developers can now configure how layouts should render by specifying 1..n mediaQuery aliases. This feature allows totally different print outputs without modifying the currently layout. Implement PrintHook service to intercept print mediaQuery activation events. * add fxShow.print and fxHide.print support to show/hide elements during printing * suspend activation changes in MediaMarshaller while print-mode is active * trigger MediaObserver to notify subscribers with print mqAlias(es) * use PrintHook to intercept activation changes in MediaMarshaller while print-mode is active * trigger MediaObserver to notify subscribers with print mqAlias(es) Using the new `printWithBreakpoint` allows developers to specify a breakpoint that should be used to render layouts only during printing. With the configuration below, the breakpoint associated with the **`md`** alias will be used. ```ts FlexLayoutModule.withConfig({ useColumnBasisZero: false, printWithBreakpoints: ['md', 'gt-sm', 'gt-xs'] }) ``` Shown below is the print layout rendered in floating dialog over the normal layout using 'lg' breakpoints.  Fixes #603.
9c80f62
to
631f2fd
Compare
@CaerusKaru - final quick review plz? Ready to merge after your lgtm. |
b3af138
to
29b0c2d
Compare
29b0c2d
to
febc7a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small changes, otherwise very close
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
aaf27c5
to
67e78b3
Compare
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Implement PrintHook service to intercept print mediaQuery activation events.
printWithBreakpoint
FlexLayoutModule.withConfig()
to merge overrides with defaultsfxShow.print
andfxHide.print
Example:
Using the new
printWithBreakpoint
allows developers to specify a breakpoint that should be used to render layouts only during printing. With the configuration below, the breakpoint associated with themd
alias will be used.Shown below is the print layout rendered in floating dialog over the normal layout using 'lg' breakpoints. The printed version uses:
fxHide.print
to hide the buttons, and a demofxShow.print
to show a watermark overlayFixes #603.