ngx-smz-ui 3.4.22 → 3.5.2
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/ngx-smz-ui.umd.js +142 -41
- package/bundles/ngx-smz-ui.umd.js.map +1 -1
- package/esm2015/lib/builders/common/smz-conditional-builder.js +3 -3
- package/esm2015/lib/builders/smz-documents/document-builder.js +32 -1
- package/esm2015/lib/builders/smz-documents/document-viewer.js +48 -0
- package/esm2015/lib/modules/smz-dialogs/features/document-content/document-content.component.js +1 -1
- package/esm2015/lib/modules/smz-documents/features/document-viewer/document-viewer.component.js +10 -28
- package/esm2015/lib/modules/smz-documents/models/smz-document-config.js +1 -1
- package/esm2015/lib/modules/smz-documents/models/smz-document-viewer.js +2 -0
- package/esm2015/lib/modules/smz-documents/models/smz-document.js +1 -1
- package/esm2015/lib/modules/smz-documents/services/smz-documents.service.js +41 -6
- package/fesm2015/ngx-smz-ui.js +129 -37
- package/fesm2015/ngx-smz-ui.js.map +1 -1
- package/lib/builders/smz-documents/document-builder.d.ts +2 -0
- package/lib/builders/smz-documents/document-viewer.d.ts +17 -0
- package/lib/modules/smz-documents/features/document-viewer/document-viewer.component.d.ts +3 -8
- package/lib/modules/smz-documents/models/smz-document-config.d.ts +4 -0
- package/lib/modules/smz-documents/models/smz-document-viewer.d.ts +25 -0
- package/lib/modules/smz-documents/models/smz-document.d.ts +2 -0
- package/lib/modules/smz-documents/services/smz-documents.service.d.ts +15 -2
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('@angular/flex-layout'), require('primeng/dialog'), require('primeng/toast'), require('primeng/table'), require('primeng/button'), require('primeng/message'), require('primeng/progressspinner'), require('primeng/toolbar'), require('primeng/listbox'), require('rxjs/operators'), require('lodash-es'), require('rxjs'), require('primeng/password'), require('primeng/tooltip'), require('@angular/flex-layout/flex'), require('primeng/inputmask'), require('primeng/inputtext'), require('@ngxs/store'), require('primeng/api'), require('primeng/inputnumber'), require('primeng/inputtextarea'), require('@angular/flex-layout/extended'), require('primeng/overlaypanel'), require('primeng/dropdown'), require('primeng/radiobutton'), require('primeng/inputswitch'), require('primeng/checkbox'), require('primeng/calendar'), require('primeng/messages'), require('@angular/platform-browser'), require('primeng/multiselect'), require('primeng/colorpicker'), require('primeng/fileupload'), require('@angular/common/http'), require('moment'), require('primeng/utils'), require('primeng/dynamicdialog'), require('@angular/animations'), require('primeng/dom'), require('@ngneat/until-destroy'), require('primeng/progressbar'), require('angular2-uuid'), require('@auth0/angular-jwt'), require('primeng/skeleton'), require('@angular/router'), require('primeng/ripple'), require('jspdf'), require('primeng/badge'), require('primeng/selectbutton'), require('ngx-pipes'), require('primeng/accordion'), require('@ngxs/router-plugin'), require('lodash-es/forIn'), require('lodash-es/startsWith'), require('@angular/platform-browser/animations'), require('@angular/common/locales/pt'), require('primeng/menubar'), require('primeng/sidebar'), require('primeng/contextmenu'), require('primeng/tree'), require('chart.js/auto'), require('chart.js/helpers'), require('lodash-es/cloneDeep'), require('ngx-device-detector')
|
|
3
|
-
typeof define === 'function' && define.amd ? define('ngx-smz-ui', ['exports', '@angular/core', '@angular/common', '@angular/forms', '@angular/flex-layout', 'primeng/dialog', 'primeng/toast', 'primeng/table', 'primeng/button', 'primeng/message', 'primeng/progressspinner', 'primeng/toolbar', 'primeng/listbox', 'rxjs/operators', 'lodash-es', 'rxjs', 'primeng/password', 'primeng/tooltip', '@angular/flex-layout/flex', 'primeng/inputmask', 'primeng/inputtext', '@ngxs/store', 'primeng/api', 'primeng/inputnumber', 'primeng/inputtextarea', '@angular/flex-layout/extended', 'primeng/overlaypanel', 'primeng/dropdown', 'primeng/radiobutton', 'primeng/inputswitch', 'primeng/checkbox', 'primeng/calendar', 'primeng/messages', '@angular/platform-browser', 'primeng/multiselect', 'primeng/colorpicker', 'primeng/fileupload', '@angular/common/http', 'moment', 'primeng/utils', 'primeng/dynamicdialog', '@angular/animations', 'primeng/dom', '@ngneat/until-destroy', 'primeng/progressbar', 'angular2-uuid', '@auth0/angular-jwt', 'primeng/skeleton', '@angular/router', 'primeng/ripple', 'jspdf', 'primeng/badge', 'primeng/selectbutton', 'ngx-pipes', 'primeng/accordion', '@ngxs/router-plugin', 'lodash-es/forIn', 'lodash-es/startsWith', '@angular/platform-browser/animations', '@angular/common/locales/pt', 'primeng/menubar', 'primeng/sidebar', 'primeng/contextmenu', 'primeng/tree', 'chart.js/auto', 'chart.js/helpers', 'lodash-es/cloneDeep', 'ngx-device-detector'
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["ngx-smz-ui"] = {}, global.ng.core, global.ng.common, global.ng.forms, global.ng.flexLayout, global.dialog, global.toast, global.table, global.button, global.message, global.progressspinner, global.toolbar, global.listbox, global.rxjs.operators, global["lodash-es"], global.rxjs, global.password, global.tooltip, global.ng.flexLayout.flex, global.inputmask, global.inputtext, global.store, global.api, global.inputnumber, global.inputtextarea, global.ng.flexLayout.extended, global.overlaypanel, global.dropdown, global.radiobutton, global.inputswitch, global.checkbox, global.calendar, global.messages, global.ng.platformBrowser, global.multiselect, global.colorpicker, global.fileupload, global.ng.common.http, global.moment, global.utils, global.dynamicdialog, global.ng.animations, global.dom, global["until-destroy"], global.progressbar, global.angularuuid, global.angularJwt, global.skeleton, global.ng.router, global.ripple, global.jspdf, global.badge, global.selectbutton, global.ngxpipes, global.accordion, global["router-plugin"], global.forin, global.startswith, global.ng.platformBrowser.animations, global.ng.common.locales.pt, global.menubar, global.sidebar, global.contextmenu, global.tree, global.chartjaauto, global.chartjshelpers, global.cloneDeep, global.ngxDeviceDetector
|
|
5
|
-
})(this, (function (exports, i0, i1$1, i1, flexLayout, dialog, i7, i5, i6, message, progressspinner, i8, i3$1, operators, lodashEs, rxjs, i1$2, i10, i3, i1$3, i4, i1$4, i1$5, i2, i3$2, i4$1, i2$1, i4$2, i1$6, i1$7, i3$3, i1$8, i1$a, i1$9, i1$b, i1$c, fileupload, i1$d, moment_, utils, i2$2, animations, dom, untilDestroy, progressbar, angular2Uuid, angularJwt, i9, i1$e, i3$4, jspdf, i6$1, i4$3, i3$5, i3$6, routerPlugin, forIn, startsWith, animations$1, localePt, menubar, i3$7, i1$f, i2$3, Chart, helpers, cloneDeep, ngxDeviceDetector
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('@angular/flex-layout'), require('primeng/dialog'), require('primeng/toast'), require('primeng/table'), require('primeng/button'), require('primeng/message'), require('primeng/progressspinner'), require('primeng/toolbar'), require('primeng/listbox'), require('rxjs/operators'), require('lodash-es'), require('rxjs'), require('primeng/password'), require('primeng/tooltip'), require('@angular/flex-layout/flex'), require('primeng/inputmask'), require('primeng/inputtext'), require('@ngxs/store'), require('primeng/api'), require('primeng/inputnumber'), require('primeng/inputtextarea'), require('@angular/flex-layout/extended'), require('primeng/overlaypanel'), require('primeng/dropdown'), require('primeng/radiobutton'), require('primeng/inputswitch'), require('primeng/checkbox'), require('primeng/calendar'), require('primeng/messages'), require('@angular/platform-browser'), require('primeng/multiselect'), require('primeng/colorpicker'), require('primeng/fileupload'), require('@angular/common/http'), require('moment'), require('primeng/utils'), require('primeng/dynamicdialog'), require('@angular/animations'), require('primeng/dom'), require('@ngneat/until-destroy'), require('primeng/progressbar'), require('angular2-uuid'), require('@auth0/angular-jwt'), require('primeng/skeleton'), require('@angular/router'), require('primeng/ripple'), require('jspdf'), require('primeng/badge'), require('primeng/selectbutton'), require('ngx-pipes'), require('primeng/accordion'), require('@ngxs/router-plugin'), require('lodash-es/forIn'), require('lodash-es/startsWith'), require('@angular/platform-browser/animations'), require('@angular/common/locales/pt'), require('primeng/menubar'), require('primeng/sidebar'), require('primeng/contextmenu'), require('primeng/tree'), require('chart.js/auto'), require('chart.js/helpers'), require('lodash-es/cloneDeep'), require('ngx-device-detector')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('ngx-smz-ui', ['exports', '@angular/core', '@angular/common', '@angular/forms', '@angular/flex-layout', 'primeng/dialog', 'primeng/toast', 'primeng/table', 'primeng/button', 'primeng/message', 'primeng/progressspinner', 'primeng/toolbar', 'primeng/listbox', 'rxjs/operators', 'lodash-es', 'rxjs', 'primeng/password', 'primeng/tooltip', '@angular/flex-layout/flex', 'primeng/inputmask', 'primeng/inputtext', '@ngxs/store', 'primeng/api', 'primeng/inputnumber', 'primeng/inputtextarea', '@angular/flex-layout/extended', 'primeng/overlaypanel', 'primeng/dropdown', 'primeng/radiobutton', 'primeng/inputswitch', 'primeng/checkbox', 'primeng/calendar', 'primeng/messages', '@angular/platform-browser', 'primeng/multiselect', 'primeng/colorpicker', 'primeng/fileupload', '@angular/common/http', 'moment', 'primeng/utils', 'primeng/dynamicdialog', '@angular/animations', 'primeng/dom', '@ngneat/until-destroy', 'primeng/progressbar', 'angular2-uuid', '@auth0/angular-jwt', 'primeng/skeleton', '@angular/router', 'primeng/ripple', 'jspdf', 'primeng/badge', 'primeng/selectbutton', 'ngx-pipes', 'primeng/accordion', '@ngxs/router-plugin', 'lodash-es/forIn', 'lodash-es/startsWith', '@angular/platform-browser/animations', '@angular/common/locales/pt', 'primeng/menubar', 'primeng/sidebar', 'primeng/contextmenu', 'primeng/tree', 'chart.js/auto', 'chart.js/helpers', 'lodash-es/cloneDeep', 'ngx-device-detector'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["ngx-smz-ui"] = {}, global.ng.core, global.ng.common, global.ng.forms, global.ng.flexLayout, global.dialog, global.toast, global.table, global.button, global.message, global.progressspinner, global.toolbar, global.listbox, global.rxjs.operators, global["lodash-es"], global.rxjs, global.password, global.tooltip, global.ng.flexLayout.flex, global.inputmask, global.inputtext, global.store, global.api, global.inputnumber, global.inputtextarea, global.ng.flexLayout.extended, global.overlaypanel, global.dropdown, global.radiobutton, global.inputswitch, global.checkbox, global.calendar, global.messages, global.ng.platformBrowser, global.multiselect, global.colorpicker, global.fileupload, global.ng.common.http, global.moment, global.utils, global.dynamicdialog, global.ng.animations, global.dom, global["until-destroy"], global.progressbar, global.angularuuid, global.angularJwt, global.skeleton, global.ng.router, global.ripple, global.jspdf, global.badge, global.selectbutton, global.ngxpipes, global.accordion, global["router-plugin"], global.forin, global.startswith, global.ng.platformBrowser.animations, global.ng.common.locales.pt, global.menubar, global.sidebar, global.contextmenu, global.tree, global.chartjaauto, global.chartjshelpers, global.cloneDeep, global.ngxDeviceDetector));
|
|
5
|
+
})(this, (function (exports, i0, i1$1, i1, flexLayout, dialog, i7, i5, i6, message, progressspinner, i8, i3$1, operators, lodashEs, rxjs, i1$2, i10, i3, i1$3, i4, i1$4, i1$5, i2, i3$2, i4$1, i2$1, i4$2, i1$6, i1$7, i3$3, i1$8, i1$a, i1$9, i1$b, i1$c, fileupload, i1$d, moment_, utils, i2$2, animations, dom, untilDestroy, progressbar, angular2Uuid, angularJwt, i9, i1$e, i3$4, jspdf, i6$1, i4$3, i3$5, i3$6, routerPlugin, forIn, startsWith, animations$1, localePt, menubar, i3$7, i1$f, i2$3, Chart, helpers, cloneDeep, ngxDeviceDetector) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -9263,15 +9263,50 @@
|
|
|
9263
9263
|
ApplicationActions.SetLogApplicationAreaAndExtraData = SetLogApplicationAreaAndExtraData;
|
|
9264
9264
|
})(exports.ApplicationActions || (exports.ApplicationActions = {}));
|
|
9265
9265
|
|
|
9266
|
-
var INITIAL_ZOOM
|
|
9266
|
+
var INITIAL_ZOOM = 1;
|
|
9267
9267
|
var SmzDocumentsService = /** @class */ (function () {
|
|
9268
|
-
function SmzDocumentsService() {
|
|
9269
|
-
this.
|
|
9270
|
-
this.zoom = INITIAL_ZOOM
|
|
9268
|
+
function SmzDocumentsService(store) {
|
|
9269
|
+
this.store = store;
|
|
9270
|
+
this.zoom = INITIAL_ZOOM;
|
|
9271
|
+
this.filename = 'sample';
|
|
9272
|
+
this.zoom = INITIAL_ZOOM;
|
|
9271
9273
|
this.showDownloadControl = true;
|
|
9272
9274
|
this.showExportControl = true;
|
|
9273
9275
|
}
|
|
9276
|
+
SmzDocumentsService.prototype.setZoom = function (zoom) {
|
|
9277
|
+
this.zoom = zoom;
|
|
9278
|
+
};
|
|
9279
|
+
SmzDocumentsService.prototype.setFilename = function (filename) {
|
|
9280
|
+
this.filename = filename;
|
|
9281
|
+
};
|
|
9282
|
+
SmzDocumentsService.prototype.setState = function (state) {
|
|
9283
|
+
this.state = state;
|
|
9284
|
+
};
|
|
9285
|
+
SmzDocumentsService.prototype.setPaperElement = function (paperElement) {
|
|
9286
|
+
this.paperElement = paperElement;
|
|
9287
|
+
};
|
|
9288
|
+
SmzDocumentsService.prototype.generate = function (action) {
|
|
9289
|
+
var _this = this;
|
|
9290
|
+
this.store.dispatch(new exports.ApplicationActions.StartGlobalLoading());
|
|
9291
|
+
setTimeout(function () {
|
|
9292
|
+
_this.generatePdf(action, _this.paperElement, _this.state).then(function () {
|
|
9293
|
+
_this.store.dispatch(new exports.ApplicationActions.StopGlobalLoading());
|
|
9294
|
+
});
|
|
9295
|
+
}, 0);
|
|
9296
|
+
};
|
|
9297
|
+
SmzDocumentsService.prototype.moreZoom = function () {
|
|
9298
|
+
var next = this.zoom + this.state.viewer.zoom.variation;
|
|
9299
|
+
this.setZoom(next <= this.state.viewer.zoom.max ? next : this.state.viewer.zoom.max);
|
|
9300
|
+
};
|
|
9301
|
+
SmzDocumentsService.prototype.lessZoom = function () {
|
|
9302
|
+
var next = this.zoom - this.state.viewer.zoom.variation;
|
|
9303
|
+
this.setZoom(next >= this.state.viewer.zoom.min ? next : this.state.viewer.zoom.min);
|
|
9304
|
+
};
|
|
9305
|
+
SmzDocumentsService.prototype.restoreZoom = function () {
|
|
9306
|
+
this.setZoom(this.state.viewer.zoom.initial);
|
|
9307
|
+
};
|
|
9274
9308
|
SmzDocumentsService.prototype.generatePdf = function (action, element, state) {
|
|
9309
|
+
var _this = this;
|
|
9275
9310
|
return new Promise(function (resolve) {
|
|
9276
9311
|
var docOptions = {
|
|
9277
9312
|
orientation: 'portrait',
|
|
@@ -9303,13 +9338,13 @@
|
|
|
9303
9338
|
doc.html(element.nativeElement, options).then(function () {
|
|
9304
9339
|
switch (action) {
|
|
9305
9340
|
case 'open': {
|
|
9306
|
-
doc.output('dataurlnewwindow', { filename:
|
|
9341
|
+
doc.output('dataurlnewwindow', { filename: _this.filename + ".pdf" });
|
|
9307
9342
|
resolve('Resolved');
|
|
9308
9343
|
break;
|
|
9309
9344
|
}
|
|
9310
9345
|
// case 'print': this.pdfMakeService.pdfMake.createPdf(document).print(); break;
|
|
9311
9346
|
case 'download': {
|
|
9312
|
-
var saving = doc.save(
|
|
9347
|
+
var saving = doc.save(_this.filename + ".pdf", { returnPromise: true });
|
|
9313
9348
|
saving.then(function () {
|
|
9314
9349
|
resolve('Resolved');
|
|
9315
9350
|
});
|
|
@@ -9321,18 +9356,14 @@
|
|
|
9321
9356
|
};
|
|
9322
9357
|
return SmzDocumentsService;
|
|
9323
9358
|
}());
|
|
9324
|
-
SmzDocumentsService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SmzDocumentsService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
9359
|
+
SmzDocumentsService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SmzDocumentsService, deps: [{ token: i1__namespace$4.Store }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
9325
9360
|
SmzDocumentsService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SmzDocumentsService, providedIn: 'root' });
|
|
9326
9361
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SmzDocumentsService, decorators: [{
|
|
9327
9362
|
type: i0.Injectable,
|
|
9328
9363
|
args: [{ providedIn: 'root' }]
|
|
9329
|
-
}], ctorParameters: function () { return []; } });
|
|
9364
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$4.Store }]; } });
|
|
9330
9365
|
|
|
9331
9366
|
var moment$1 = moment___namespace;
|
|
9332
|
-
var MAX_ZOOM = 2.5;
|
|
9333
|
-
var MIN_ZOOM = 1;
|
|
9334
|
-
var ZOOM_VARIATION = MAX_ZOOM / 5;
|
|
9335
|
-
var INITIAL_ZOOM = MIN_ZOOM;
|
|
9336
9367
|
var SmzDocumentViewerComponent = /** @class */ (function () {
|
|
9337
9368
|
function SmzDocumentViewerComponent(el, documentService, location, cdf, store, renderer) {
|
|
9338
9369
|
this.el = el;
|
|
@@ -9341,41 +9372,27 @@
|
|
|
9341
9372
|
this.cdf = cdf;
|
|
9342
9373
|
this.store = store;
|
|
9343
9374
|
this.renderer = renderer;
|
|
9344
|
-
this.maxZoom = MAX_ZOOM;
|
|
9345
|
-
this.minZoom = MIN_ZOOM;
|
|
9346
9375
|
this.now = moment$1().format('MMMM Do YYYY, h:mm:ss a');
|
|
9347
9376
|
}
|
|
9348
9377
|
SmzDocumentViewerComponent.prototype.ngOnInit = function () {
|
|
9378
|
+
this.documentService.setZoom(this.state.viewer.zoom.initial);
|
|
9379
|
+
this.documentService.setFilename(this.state.viewer.filename);
|
|
9380
|
+
this.documentService.setState(this.state);
|
|
9349
9381
|
};
|
|
9350
9382
|
SmzDocumentViewerComponent.prototype.ngAfterViewInit = function () {
|
|
9351
|
-
|
|
9352
|
-
SmzDocumentViewerComponent.prototype.generate = function (action, element) {
|
|
9353
|
-
var _this = this;
|
|
9354
|
-
this.store.dispatch(new exports.ApplicationActions.StartGlobalLoading());
|
|
9355
|
-
setTimeout(function () {
|
|
9356
|
-
_this.documentService.generatePdf(action, element, _this.state).then(function () {
|
|
9357
|
-
_this.store.dispatch(new exports.ApplicationActions.StopGlobalLoading());
|
|
9358
|
-
});
|
|
9359
|
-
}, 0);
|
|
9360
|
-
};
|
|
9361
|
-
SmzDocumentViewerComponent.prototype.moreZoom = function () {
|
|
9362
|
-
var next = this.documentService.zoom + ZOOM_VARIATION;
|
|
9363
|
-
this.documentService.zoom = next <= MAX_ZOOM ? next : MAX_ZOOM;
|
|
9364
|
-
};
|
|
9365
|
-
SmzDocumentViewerComponent.prototype.lessZoom = function () {
|
|
9366
|
-
var next = this.documentService.zoom - ZOOM_VARIATION;
|
|
9367
|
-
this.documentService.zoom = next >= MIN_ZOOM ? next : MIN_ZOOM;
|
|
9368
|
-
};
|
|
9369
|
-
SmzDocumentViewerComponent.prototype.restoreZoom = function () {
|
|
9370
|
-
this.documentService.zoom = INITIAL_ZOOM;
|
|
9383
|
+
this.documentService.setPaperElement(this.paperElement);
|
|
9371
9384
|
};
|
|
9372
9385
|
SmzDocumentViewerComponent.prototype.goBack = function () {
|
|
9373
9386
|
this.location.back();
|
|
9374
9387
|
};
|
|
9388
|
+
SmzDocumentViewerComponent.prototype.ngOnDestroy = function () {
|
|
9389
|
+
this.documentService.setState(null);
|
|
9390
|
+
this.documentService.setPaperElement(null);
|
|
9391
|
+
};
|
|
9375
9392
|
return SmzDocumentViewerComponent;
|
|
9376
9393
|
}());
|
|
9377
9394
|
SmzDocumentViewerComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SmzDocumentViewerComponent, deps: [{ token: i0__namespace.ElementRef }, { token: SmzDocumentsService }, { token: i1__namespace.Location }, { token: i0__namespace.ChangeDetectorRef }, { token: i1__namespace$4.Store }, { token: i0__namespace.Renderer2 }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
9378
|
-
SmzDocumentViewerComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.5", type: SmzDocumentViewerComponent, selector: "document-viewer", inputs: { state: "state" }, viewQueries: [{ propertyName: "paperElement", first: true, predicate: ["paper"], descendants: true, static: true }], ngImport: i0__namespace, template: "<div class=\"p-grid p-nogutter p-align-center p-justify-start p-flex-column gap-2\">\n\n <div class=\"p-grid p-nogutter p-align-start p-justify-start gap-2\">\n <button pButton type=\"button\" class=\"p-button p-button-outlined\" label=\"ZOOM -\" (click)=\"lessZoom()\"></button>\n
|
|
9395
|
+
SmzDocumentViewerComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.5", type: SmzDocumentViewerComponent, selector: "document-viewer", inputs: { state: "state" }, viewQueries: [{ propertyName: "paperElement", first: true, predicate: ["paper"], descendants: true, static: true }], ngImport: i0__namespace, template: "<div class=\"p-grid p-nogutter p-align-center p-justify-start p-flex-column gap-2\" [ngClass]=\"state.viewer.container.styleClass\">\n\n <div class=\"p-grid p-nogutter p-align-start p-justify-start gap-2\">\n\n <ng-container *ngIf=\"state.viewer.zoom.isEnabled\">\n <button pButton type=\"button\" class=\"p-button p-button-outlined\" label=\"ZOOM -\" (click)=\"documentService.lessZoom()\"></button>\n <button pButton type=\"button\" class=\"p-button p-button-outlined\" label=\"100%\" (click)=\"documentService.restoreZoom()\"></button>\n <button pButton type=\"button\" class=\"p-button p-button-outlined\" label=\"ZOOM +\" (click)=\"documentService.moreZoom()\"></button>\n </ng-container>\n\n <button *ngIf=\"state.viewer.open.isEnabled\" pButton type=\"button\" class=\"p-button p-button-success\" label=\"OPEN\" (click)=\"documentService.generate('open')\"></button>\n <button *ngIf=\"state.viewer.print.isEnabled\" pButton type=\"button\" class=\"p-button p-button-success\" label=\"PRINT\" (click)=\"documentService.generate('print')\"></button>\n <button *ngIf=\"state.viewer.download.isEnabled\" pButton type=\"button\" class=\"p-button p-button-success\" label=\"DOWNLOAD\" (click)=\"documentService.generate('download')\"></button>\n </div>\n\n <div class=\"pager\" [ngClass]=\"state.viewer.paper.styleClass\"[ngStyle]=\"{ 'transform': 'scale(' + documentService.zoom + ')' }\">\n <div #paper [ngStyle]=\"{ 'font-family': state.globals.font.family }\">\n <ng-content select=\"header\"></ng-content>\n <ng-content select=\"content\"></ng-content>\n </div>\n </div>\n\n</div>", styles: [".pager{width:595.276pt;transform-origin:top center;transition:transform .1s ease-in-out;margin-top:0;margin-left:auto;margin-right:auto}.footer-container{position:absolute;bottom:calc(.5 * 28.346px);right:calc(.8 * 28.346px);font-size:\"0.8px\"}.sticky-header{position:absolute}\n"], directives: [{ type: i1__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i1__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.Default, encapsulation: i0__namespace.ViewEncapsulation.None });
|
|
9379
9396
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SmzDocumentViewerComponent, decorators: [{
|
|
9380
9397
|
type: i0.Component,
|
|
9381
9398
|
args: [{
|
|
@@ -23709,14 +23726,14 @@
|
|
|
23709
23726
|
function SmzConditionalBuilder() {
|
|
23710
23727
|
}
|
|
23711
23728
|
SmzConditionalBuilder.prototype.if = function (condition) {
|
|
23712
|
-
if (this._currentConditionMethod
|
|
23729
|
+
if (this._currentConditionMethod != null)
|
|
23713
23730
|
throw new Error("You cannot call more than one condition method at the same time.");
|
|
23714
23731
|
// Registrando flag de method condicional em execução
|
|
23715
23732
|
this._currentConditionMethod = 'if';
|
|
23716
23733
|
// Se a condição for nula
|
|
23717
23734
|
if (!condition) {
|
|
23718
23735
|
// Preparar modelo de backup para o endif retornar dados originais descartando todos os dados feitos pelos builders entre o IF e o ENDIF
|
|
23719
|
-
this.backup =
|
|
23736
|
+
this.backup = cloneDeep__default["default"](this.that);
|
|
23720
23737
|
}
|
|
23721
23738
|
return this.that;
|
|
23722
23739
|
};
|
|
@@ -24313,6 +24330,60 @@
|
|
|
24313
24330
|
return SmzDocumentRowBuilder;
|
|
24314
24331
|
}());
|
|
24315
24332
|
|
|
24333
|
+
var SmzDocumentViewerBuilder = /** @class */ (function (_super) {
|
|
24334
|
+
__extends(SmzDocumentViewerBuilder, _super);
|
|
24335
|
+
function SmzDocumentViewerBuilder(_documentBuilder, _viewer) {
|
|
24336
|
+
var _this = _super.call(this) || this;
|
|
24337
|
+
_this._documentBuilder = _documentBuilder;
|
|
24338
|
+
_this._viewer = _viewer;
|
|
24339
|
+
return _this;
|
|
24340
|
+
}
|
|
24341
|
+
SmzDocumentViewerBuilder.prototype.setFilename = function (filename) {
|
|
24342
|
+
this._viewer.filename = filename;
|
|
24343
|
+
return this;
|
|
24344
|
+
};
|
|
24345
|
+
SmzDocumentViewerBuilder.prototype.overrideContainerStyles = function (styleClass) {
|
|
24346
|
+
this._viewer.container.styleClass = styleClass;
|
|
24347
|
+
return this;
|
|
24348
|
+
};
|
|
24349
|
+
SmzDocumentViewerBuilder.prototype.overridePaperStyles = function (styleClass) {
|
|
24350
|
+
this._viewer.paper.styleClass = styleClass;
|
|
24351
|
+
return this;
|
|
24352
|
+
};
|
|
24353
|
+
SmzDocumentViewerBuilder.prototype.setZoom = function (initial, min, max, variation) {
|
|
24354
|
+
this._viewer.zoom.isEnabled = true;
|
|
24355
|
+
this._viewer.zoom.min = min !== null && min !== void 0 ? min : initial;
|
|
24356
|
+
this._viewer.zoom.max = max !== null && max !== void 0 ? max : initial;
|
|
24357
|
+
this._viewer.zoom.initial = initial;
|
|
24358
|
+
this._viewer.zoom.variation = variation !== null && variation !== void 0 ? variation : initial;
|
|
24359
|
+
return this;
|
|
24360
|
+
};
|
|
24361
|
+
SmzDocumentViewerBuilder.prototype.disableZoomControls = function () {
|
|
24362
|
+
this._viewer.zoom.isEnabled = false;
|
|
24363
|
+
return this;
|
|
24364
|
+
};
|
|
24365
|
+
SmzDocumentViewerBuilder.prototype.allowOpen = function () {
|
|
24366
|
+
this._viewer.open.isEnabled = true;
|
|
24367
|
+
return this;
|
|
24368
|
+
};
|
|
24369
|
+
SmzDocumentViewerBuilder.prototype.allowPrint = function () {
|
|
24370
|
+
this._viewer.print.isEnabled = true;
|
|
24371
|
+
return this;
|
|
24372
|
+
};
|
|
24373
|
+
SmzDocumentViewerBuilder.prototype.allowDownload = function () {
|
|
24374
|
+
this._viewer.download.isEnabled = true;
|
|
24375
|
+
return this;
|
|
24376
|
+
};
|
|
24377
|
+
Object.defineProperty(SmzDocumentViewerBuilder.prototype, "document", {
|
|
24378
|
+
get: function () {
|
|
24379
|
+
return this._documentBuilder;
|
|
24380
|
+
},
|
|
24381
|
+
enumerable: false,
|
|
24382
|
+
configurable: true
|
|
24383
|
+
});
|
|
24384
|
+
return SmzDocumentViewerBuilder;
|
|
24385
|
+
}(SmzConditionalBuilder));
|
|
24386
|
+
|
|
24316
24387
|
var pixelCmFactor = 28.346;
|
|
24317
24388
|
var SmzDocumentBuilder = /** @class */ (function (_super) {
|
|
24318
24389
|
__extends(SmzDocumentBuilder, _super);
|
|
@@ -24345,6 +24416,31 @@
|
|
|
24345
24416
|
text: null,
|
|
24346
24417
|
showPrintHour: true,
|
|
24347
24418
|
showPageNumbers: true
|
|
24419
|
+
},
|
|
24420
|
+
viewer: {
|
|
24421
|
+
filename: 'sample',
|
|
24422
|
+
zoom: {
|
|
24423
|
+
isEnabled: true,
|
|
24424
|
+
min: 1,
|
|
24425
|
+
max: 2.5,
|
|
24426
|
+
initial: 1,
|
|
24427
|
+
variation: 2.5 / 5
|
|
24428
|
+
},
|
|
24429
|
+
open: {
|
|
24430
|
+
isEnabled: false
|
|
24431
|
+
},
|
|
24432
|
+
print: {
|
|
24433
|
+
isEnabled: false
|
|
24434
|
+
},
|
|
24435
|
+
download: {
|
|
24436
|
+
isEnabled: false
|
|
24437
|
+
},
|
|
24438
|
+
container: {
|
|
24439
|
+
styleClass: null
|
|
24440
|
+
},
|
|
24441
|
+
paper: {
|
|
24442
|
+
styleClass: null
|
|
24443
|
+
}
|
|
24348
24444
|
}
|
|
24349
24445
|
};
|
|
24350
24446
|
if (state != null) {
|
|
@@ -24360,6 +24456,8 @@
|
|
|
24360
24456
|
var config = cloneDeep__default["default"](this.defaultConfig.documents.defaultStyles);
|
|
24361
24457
|
this._state.config = config;
|
|
24362
24458
|
this._state.globals = config.globals;
|
|
24459
|
+
this._state.viewer.container.styleClass = config.viewer.container;
|
|
24460
|
+
this._state.viewer.paper.styleClass = config.viewer.paper;
|
|
24363
24461
|
var marginCm = config.paper.marginCm;
|
|
24364
24462
|
var globalHeaderHeightCm = config.paper.headerHeightCm ? config.paper.headerHeightCm + "cm" : null;
|
|
24365
24463
|
this.applyMargin('cm', globalHeaderHeightCm, null, marginCm.left, marginCm.right, marginCm.top, marginCm.bottom);
|
|
@@ -24391,6 +24489,9 @@
|
|
|
24391
24489
|
this._state.config = newConfig;
|
|
24392
24490
|
return this;
|
|
24393
24491
|
};
|
|
24492
|
+
SmzDocumentBuilder.prototype.viewer = function () {
|
|
24493
|
+
return new SmzDocumentViewerBuilder(this, this._state.viewer);
|
|
24494
|
+
};
|
|
24394
24495
|
SmzDocumentBuilder.prototype.content = function () {
|
|
24395
24496
|
if (this._state.content == null)
|
|
24396
24497
|
this._state.content = { type: 'content', rows: [], cellStyles: '' };
|