nuxeo-development-framework 5.0.1 → 5.0.3
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/bundles/nuxeo-development-framework.umd.js +37 -22
- package/bundles/nuxeo-development-framework.umd.js.map +1 -1
- package/esm2015/lib/components/dynamic-form/components/dynamic-form-hijri-dateitem/dynamic-form-hijri-dateitem.component.js +14 -1
- package/esm2015/lib/components/pdf-tron/pdftron/pdftron.component.js +5 -2
- package/fesm2015/nuxeo-development-framework.js +16 -1
- package/fesm2015/nuxeo-development-framework.js.map +1 -1
- package/lib/components/dynamic-form/components/dynamic-form-hijri-dateitem/dynamic-form-hijri-dateitem.component.d.ts +2 -0
- package/lib/components/pdf-tron/pdftron/pdftron.component.d.ts +1 -0
- package/package.json +1 -1
|
@@ -10763,6 +10763,10 @@
|
|
|
10763
10763
|
function DynamicFormHijriDateitemComponent(dateFormatterService, control) {
|
|
10764
10764
|
this.dateFormatterService = dateFormatterService;
|
|
10765
10765
|
this.control = control;
|
|
10766
|
+
/** Minimum Hijri Date */
|
|
10767
|
+
this.minHijri = this.getHijriDateMinusYears(50);
|
|
10768
|
+
/** Minimum Gregorian Date */
|
|
10769
|
+
this.minGreg = this.getGregDateMinusYears(50);
|
|
10766
10770
|
/** list inputs vertically (for range only) */
|
|
10767
10771
|
this.vertical = false;
|
|
10768
10772
|
/** Sets picker to readonly mode */
|
|
@@ -10777,6 +10781,14 @@
|
|
|
10777
10781
|
// this.date = this.dateFormatterService.GetTodayGregorian();
|
|
10778
10782
|
}
|
|
10779
10783
|
}
|
|
10784
|
+
DynamicFormHijriDateitemComponent.prototype.getGregDateMinusYears = function (years) {
|
|
10785
|
+
var today = this.dateFormatterService.GetTodayGregorian();
|
|
10786
|
+
return new i1$5.NgbDate(today.year - years, today.month, today.day);
|
|
10787
|
+
};
|
|
10788
|
+
DynamicFormHijriDateitemComponent.prototype.getHijriDateMinusYears = function (years) {
|
|
10789
|
+
var today = this.dateFormatterService.GetTodayHijri();
|
|
10790
|
+
return new i1$5.NgbDate(today.year - years, today.month, today.day);
|
|
10791
|
+
};
|
|
10780
10792
|
DynamicFormHijriDateitemComponent.prototype.writeValue = function (obj) {
|
|
10781
10793
|
if (obj) {
|
|
10782
10794
|
if (!this.range) {
|
|
@@ -30121,10 +30133,10 @@
|
|
|
30121
30133
|
}
|
|
30122
30134
|
PdftronComponent.prototype.ngOnInit = function () {
|
|
30123
30135
|
return __awaiter(this, void 0, void 0, function () {
|
|
30124
|
-
var
|
|
30136
|
+
var _c;
|
|
30125
30137
|
var _this = this;
|
|
30126
|
-
return __generator(this, function (
|
|
30127
|
-
switch (
|
|
30138
|
+
return __generator(this, function (_d) {
|
|
30139
|
+
switch (_d.label) {
|
|
30128
30140
|
case 0:
|
|
30129
30141
|
this.transelationSubscrition = this.translationService.isArabic.subscribe(function (res) {
|
|
30130
30142
|
_this.isArabic = res;
|
|
@@ -30147,8 +30159,10 @@
|
|
|
30147
30159
|
if (!this.silentPdfTronService.isEnabled) return [3 /*break*/, 2];
|
|
30148
30160
|
return [4 /*yield*/, this.silentPdfTronService.getWebViewer()];
|
|
30149
30161
|
case 1:
|
|
30150
|
-
|
|
30162
|
+
_c = __read.apply(void 0, [_d.sent(), 2]), this.silentPdfTron = _c[0], this.webViewerInstance = _c[1];
|
|
30151
30163
|
__classPrivateFieldGet(this, _PdftronComponent_instances, "m", _PdftronComponent_afterLoadWebViewer).call(this, this.webViewerInstance);
|
|
30164
|
+
this.mutationObserver = new MutationObserver(function () { return __classPrivateFieldGet(_this, _PdftronComponent_instances, "m", _PdftronComponent_updateSilentPdfTron).call(_this); });
|
|
30165
|
+
this.mutationObserver.observe(document.body, { childList: true, subtree: true });
|
|
30152
30166
|
this.resizeObserver = new ResizeObserver(function () { return __classPrivateFieldGet(_this, _PdftronComponent_instances, "m", _PdftronComponent_updateSilentPdfTron).call(_this); });
|
|
30153
30167
|
this.resizeObserver.observe(this.viewerRef.nativeElement);
|
|
30154
30168
|
__classPrivateFieldGet(this, _PdftronComponent_instances, "m", _PdftronComponent_updateSilentPdfTron).call(this);
|
|
@@ -30165,12 +30179,12 @@
|
|
|
30165
30179
|
annotationUser: this.nuxeo.nuxeoClient.user.properties.firstName + ' ' + this.nuxeo.nuxeoClient.user.properties.lastName,
|
|
30166
30180
|
disabledElements: ['downloadButton', 'printButton']
|
|
30167
30181
|
}, this.viewerRef.nativeElement).then(function (instance) { return __awaiter(_this, void 0, void 0, function () {
|
|
30168
|
-
return __generator(this, function (
|
|
30182
|
+
return __generator(this, function (_c) {
|
|
30169
30183
|
__classPrivateFieldGet(this, _PdftronComponent_instances, "m", _PdftronComponent_afterLoadWebViewer).call(this, instance);
|
|
30170
30184
|
return [2 /*return*/];
|
|
30171
30185
|
});
|
|
30172
30186
|
}); });
|
|
30173
|
-
|
|
30187
|
+
_d.label = 3;
|
|
30174
30188
|
case 3: return [2 /*return*/];
|
|
30175
30189
|
}
|
|
30176
30190
|
});
|
|
@@ -30191,8 +30205,8 @@
|
|
|
30191
30205
|
// exctract all anotations on the file and send it out side to be saved and leave the file as it is without any anotations on it
|
|
30192
30206
|
PdftronComponent.prototype.exportAnotationsToOutside = function () {
|
|
30193
30207
|
var _this = this;
|
|
30194
|
-
this.webViewerInstance.annotManager.on('annotationChanged', function (annotations, action,
|
|
30195
|
-
var imported =
|
|
30208
|
+
this.webViewerInstance.annotManager.on('annotationChanged', function (annotations, action, _c) {
|
|
30209
|
+
var imported = _c.imported;
|
|
30196
30210
|
if (imported)
|
|
30197
30211
|
return;
|
|
30198
30212
|
_this.webViewerInstance.annotManager.exportAnnotations().then(function (exctractedAnotations) {
|
|
@@ -30259,7 +30273,7 @@
|
|
|
30259
30273
|
return __awaiter(this, void 0, void 0, function () {
|
|
30260
30274
|
var canvas, pageMatrix, ctx;
|
|
30261
30275
|
var _this = this;
|
|
30262
|
-
return __generator(this, function (
|
|
30276
|
+
return __generator(this, function (_c) {
|
|
30263
30277
|
canvas = document.createElement('canvas');
|
|
30264
30278
|
pageMatrix = docViewer.getDocument().getPageMatrix(annotation.PageNumber);
|
|
30265
30279
|
// Set the height & width of the canvas to madeleteSavedSignaturetch the annotation
|
|
@@ -30303,9 +30317,9 @@
|
|
|
30303
30317
|
img: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-file-earmark-arrow-down" viewBox="0 0 16 16"> <path d="M8.5 6.5a.5.5 0 0 0-1 0v3.793L6.354 9.146a.5.5 0 1 0-.708.708l2 2a.5.5 0 0 0 .708 0l2-2a.5.5 0 0 0-.708-.708L8.5 10.293V6.5z"/> <path d="M14 14V4.5L9.5 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2zM9.5 3A1.5 1.5 0 0 0 11 4.5h2V14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h5.5v2z"/></svg>',
|
|
30304
30318
|
title: _this.isArabic ? 'تنزيل' : 'Download',
|
|
30305
30319
|
onClick: function () { return __awaiter(_this, void 0, void 0, function () {
|
|
30306
|
-
var
|
|
30307
|
-
return __generator(this, function (
|
|
30308
|
-
|
|
30320
|
+
var _c, DocumentViewer, AnnotationManager, SaveOptions, saveOptions, options;
|
|
30321
|
+
return __generator(this, function (_d) {
|
|
30322
|
+
_c = this.webViewerInstance.CoreControls, DocumentViewer = _c.DocumentViewer, AnnotationManager = _c.AnnotationManager, SaveOptions = _c.SaveOptions;
|
|
30309
30323
|
saveOptions = SaveOptions;
|
|
30310
30324
|
options = {
|
|
30311
30325
|
filename: this.correspondance.title ? this.correspondance.title : 'myDocument.pdf',
|
|
@@ -30356,7 +30370,7 @@
|
|
|
30356
30370
|
if (!this.webViewerInstance || (!this.fileData && !this.fileURL)) {
|
|
30357
30371
|
return;
|
|
30358
30372
|
}
|
|
30359
|
-
var
|
|
30373
|
+
var _c = this.webViewerInstance, docViewer = _c.docViewer, annotManager = _c.annotManager, Annotations = _c.Annotations;
|
|
30360
30374
|
docViewer.on('documentLoaded', __classPrivateFieldGet(this, _PdftronComponent_docLoaded, "f"));
|
|
30361
30375
|
if (!this.editMode) {
|
|
30362
30376
|
this.webViewerInstance.annotManager.setReadOnly(true);
|
|
@@ -30398,19 +30412,19 @@
|
|
|
30398
30412
|
PdftronComponent.prototype.exportAsBlob = function () {
|
|
30399
30413
|
return __awaiter(this, void 0, void 0, function () {
|
|
30400
30414
|
var doc, xfdfString, data, arr, blob;
|
|
30401
|
-
return __generator(this, function (
|
|
30402
|
-
switch (
|
|
30415
|
+
return __generator(this, function (_c) {
|
|
30416
|
+
switch (_c.label) {
|
|
30403
30417
|
case 0:
|
|
30404
30418
|
doc = this.webViewerInstance.docViewer.getDocument();
|
|
30405
30419
|
return [4 /*yield*/, this.webViewerInstance.annotManager.exportAnnotations()];
|
|
30406
30420
|
case 1:
|
|
30407
|
-
xfdfString =
|
|
30421
|
+
xfdfString = _c.sent();
|
|
30408
30422
|
return [4 /*yield*/, doc.getFileData({
|
|
30409
30423
|
// saves the document with annotations in it
|
|
30410
30424
|
xfdfString: xfdfString
|
|
30411
30425
|
})];
|
|
30412
30426
|
case 2:
|
|
30413
|
-
data =
|
|
30427
|
+
data = _c.sent();
|
|
30414
30428
|
arr = new Uint8Array(data);
|
|
30415
30429
|
blob = new Blob([arr], { type: this.DOCUMENT_TYPE });
|
|
30416
30430
|
return [2 /*return*/, Promise.resolve(blob)];
|
|
@@ -30478,9 +30492,9 @@
|
|
|
30478
30492
|
// adding search lisner to lisen to internal search from ui and without ocr
|
|
30479
30493
|
PdftronComponent.prototype.addSearchListner = function () {
|
|
30480
30494
|
var _this = this;
|
|
30481
|
-
var
|
|
30495
|
+
var _c = this.webViewerInstance, annotManager = _c.annotManager, docViewer = _c.docViewer, Annotations = _c.Annotations;
|
|
30482
30496
|
var searchListener = function (searchPattern, options, results) {
|
|
30483
|
-
var
|
|
30497
|
+
var _c;
|
|
30484
30498
|
_this.mySearchStringResults = [];
|
|
30485
30499
|
if (_this.savedAnotations.length > 0) {
|
|
30486
30500
|
_this.savedAnotations.map(function (annotation) {
|
|
@@ -30500,7 +30514,7 @@
|
|
|
30500
30514
|
annotation.Author = _this.webViewerInstance.annotManager.getCurrentUser();
|
|
30501
30515
|
return annotation;
|
|
30502
30516
|
});
|
|
30503
|
-
(
|
|
30517
|
+
(_c = _this.savedAnotations).push.apply(_c, __spreadArray([], __read(_this.newAnnotations)));
|
|
30504
30518
|
annotManager.addAnnotations(_this.newAnnotations);
|
|
30505
30519
|
annotManager.drawAnnotationsFromList(_this.newAnnotations);
|
|
30506
30520
|
}
|
|
@@ -30515,7 +30529,7 @@
|
|
|
30515
30529
|
// perform automatic search when intering the page
|
|
30516
30530
|
PdftronComponent.prototype.automaticSearch = function (searchTextArray) {
|
|
30517
30531
|
var _this = this;
|
|
30518
|
-
var
|
|
30532
|
+
var _c = this.webViewerInstance, annotManager = _c.annotManager, docViewer = _c.docViewer, Annotations = _c.Annotations;
|
|
30519
30533
|
var searchOptions;
|
|
30520
30534
|
this.webViewerInstance.openElements(['searchPanel']);
|
|
30521
30535
|
docViewer.on('documentLoaded', function () {
|
|
@@ -30766,7 +30780,7 @@
|
|
|
30766
30780
|
}
|
|
30767
30781
|
this.loadDocument();
|
|
30768
30782
|
}, _PdftronComponent_reset = function _PdftronComponent_reset() {
|
|
30769
|
-
var _a;
|
|
30783
|
+
var _a, _b;
|
|
30770
30784
|
this.webViewerInstance.closeDocument().then(function () {
|
|
30771
30785
|
console.log('document closed!');
|
|
30772
30786
|
});
|
|
@@ -30774,6 +30788,7 @@
|
|
|
30774
30788
|
this.transelationSubscrition ? this.transelationSubscrition.unsubscribe() : null;
|
|
30775
30789
|
this.silentPdfTron.style.display = 'none';
|
|
30776
30790
|
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
30791
|
+
(_b = this.mutationObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
|
|
30777
30792
|
this.webViewerInstance.setHeaderItems(function (header) {
|
|
30778
30793
|
header.headers.default = header.headers.default.filter(function (q) { var _a; return !((_a = q.img) === null || _a === void 0 ? void 0 : _a.includes('<svg')); });
|
|
30779
30794
|
});
|