aefis-core-ui 3.0.0-rc100 → 3.0.0-rc102
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/dist/index.modern.js +10 -3
- package/dist/index.modern.js.map +1 -1
- package/package.json +2 -2
package/dist/index.modern.js
CHANGED
|
@@ -17750,7 +17750,9 @@ const DocViewer = ({
|
|
|
17750
17750
|
style,
|
|
17751
17751
|
includeJquery: _includeJquery = false,
|
|
17752
17752
|
prizmDocViewerUiElementOptions: _prizmDocViewerUiElementOptions = {},
|
|
17753
|
-
prizmDocViewerSettings: _prizmDocViewerSettings = {}
|
|
17753
|
+
prizmDocViewerSettings: _prizmDocViewerSettings = {},
|
|
17754
|
+
onRequest,
|
|
17755
|
+
onError
|
|
17754
17756
|
}) => {
|
|
17755
17757
|
const isControlled = openProp !== undefined;
|
|
17756
17758
|
const [controlledOpen, setControlledOpen] = useState(true);
|
|
@@ -17773,6 +17775,7 @@ const DocViewer = ({
|
|
|
17773
17775
|
const encodedURL = encodeURIComponent(url);
|
|
17774
17776
|
const baseUrl = documentPreviewServer;
|
|
17775
17777
|
const reqUrl = `${baseUrl}/beginViewing?document=${file}&url=${encodedURL}`;
|
|
17778
|
+
if (onRequest) onRequest(reqUrl);
|
|
17776
17779
|
try {
|
|
17777
17780
|
const res = await fetch(reqUrl, {
|
|
17778
17781
|
method: "POST"
|
|
@@ -17782,7 +17785,7 @@ const DocViewer = ({
|
|
|
17782
17785
|
}
|
|
17783
17786
|
setViewingSessionId((await res.json()).viewingSessionId);
|
|
17784
17787
|
} catch (err) {
|
|
17785
|
-
console.log(err);
|
|
17788
|
+
if (onError) onError(err);else console.log(err);
|
|
17786
17789
|
}
|
|
17787
17790
|
})();
|
|
17788
17791
|
}, []);
|
|
@@ -17862,7 +17865,11 @@ DocViewer.propTypes = {
|
|
|
17862
17865
|
/** To manipulate the prizmDocViewer's UI buttons */
|
|
17863
17866
|
prizmDocViewerUiElementOptions: PropTypes.object,
|
|
17864
17867
|
/** To manipulate the prizmDocViewer's settings */
|
|
17865
|
-
prizmDocViewerSettings: PropTypes.object
|
|
17868
|
+
prizmDocViewerSettings: PropTypes.object,
|
|
17869
|
+
/** Function to be called on error */
|
|
17870
|
+
onError: PropTypes.func,
|
|
17871
|
+
/** Function to be called on request */
|
|
17872
|
+
onRequest: PropTypes.func
|
|
17866
17873
|
};
|
|
17867
17874
|
|
|
17868
17875
|
const styles = {
|