ngx-doc-viewer 21.0.6 → 22.0.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/README.md CHANGED
@@ -16,6 +16,15 @@ Pdf files and word document that are not publicly available can be shown using t
16
16
  npm install ngx-doc-viewer --save
17
17
  ```
18
18
 
19
+ ### Angular compatibility
20
+
21
+ ngx-doc-viewer works with Angular 17.3 and newer (use ngx-doc-viewer 21 for Angular 15 to 17.2). The component does not set a change detection strategy, so it follows the default of the Angular version your app uses:
22
+
23
+ - Angular 22 and newer: `OnPush`
24
+ - Angular 21 and older: `Eager` (previously called `Default`)
25
+
26
+ Projected templates (`loadingContent`, `errorContent`, `errorActions`, `officeReloadContent`) keep updating with your component's state under both strategies.
27
+
19
28
  ### Usage
20
29
 
21
30
  #### 1. Import `NgxDocViewerModule`
@@ -39,8 +48,6 @@ export class AppModule {}
39
48
 
40
49
  The component now shows an internal loading overlay while external viewers such as Google Docs Viewer and Office Online are initializing, so viewer switches do not appear as a blank panel.
41
50
 
42
- To
43
-
44
51
  #### API:
45
52
 
46
53
  Input:
@@ -132,11 +139,19 @@ There are some issues loading document in the google viewer. See: https://stacko
132
139
  - googleMaxChecks = 5 | max number of retries
133
140
  Output:
134
141
 
135
- - loaded: emitted when the current iframe is ready. Can be used to hook into custom loading or telemetry flows.
142
+ - loaded: emitted each time the document is ready, for every viewer (iframe, pdf or mammoth). Can be used to hook into custom loading or telemetry flows.
136
143
  - loading: emitted when the viewer enters the `loading` phase. Payload includes `viewer`, `url`, `phase`, `errorText`, `retry()`, and `actionUrl`.
137
144
  - error: emitted when the viewer enters the `error` phase. Payload includes `viewer`, `url`, `phase`, `errorText`, `retry()`, and `actionUrl`.
138
145
  - phaseChange: emitted whenever the internal phase changes to `idle`, `loading`, `ready`, or `error`.
139
146
 
147
+ ### Styling
148
+
149
+ The rendered elements have class names you can target from your own CSS:
150
+
151
+ - `ngx-doc-viewer-iframe`: the iframe used by the google, office and url viewers
152
+ - `ngx-doc-viewer-object`: the object used by the pdf viewer
153
+ - `overlay`: the `disableContent` overlay
154
+
140
155
  ### Recent behavior improvements
141
156
 
142
157
  - External viewer switches now remount the iframe cleanly when changing between viewers such as Google and Office.