ngx-smz-ui 3.6.1 → 3.6.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.
@@ -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('lodash-es/cloneDeep'), 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('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', 'lodash-es/cloneDeep', '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', '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.cloneDeep, 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.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, cloneDeep, i3$6, routerPlugin, forIn, startsWith, animations$1, localePt, menubar, i3$7, i1$f, i2$3, Chart, helpers, ngxDeviceDetector) { 'use strict';
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('chart.js/auto'), require('chart.js/helpers'), require('lodash-es/cloneDeep'), 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('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', 'chart.js/auto', 'chart.js/helpers', 'lodash-es/cloneDeep', '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', '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.chartjaauto, global.chartjshelpers, global.cloneDeep, 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.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, Chart, helpers, cloneDeep, i3$6, routerPlugin, forIn, startsWith, animations$1, localePt, menubar, i3$7, i1$f, i2$3, ngxDeviceDetector) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -61,6 +61,7 @@
61
61
  var i6__namespace$1 = /*#__PURE__*/_interopNamespace(i6$1);
62
62
  var i4__namespace$3 = /*#__PURE__*/_interopNamespace(i4$3);
63
63
  var i3__namespace$7 = /*#__PURE__*/_interopNamespace(i3$5);
64
+ var Chart__default = /*#__PURE__*/_interopDefaultLegacy(Chart);
64
65
  var cloneDeep__default = /*#__PURE__*/_interopDefaultLegacy(cloneDeep);
65
66
  var i3__namespace$5 = /*#__PURE__*/_interopNamespace(i3$6);
66
67
  var forIn__default = /*#__PURE__*/_interopDefaultLegacy(forIn);
@@ -69,7 +70,6 @@
69
70
  var i3__namespace$6 = /*#__PURE__*/_interopNamespace(i3$7);
70
71
  var i1__namespace$f = /*#__PURE__*/_interopNamespace(i1$f);
71
72
  var i2__namespace$3 = /*#__PURE__*/_interopNamespace(i2$3);
72
- var Chart__default = /*#__PURE__*/_interopDefaultLegacy(Chart);
73
73
 
74
74
  /*! *****************************************************************************
75
75
  Copyright (c) Microsoft Corporation.
@@ -9242,6 +9242,7 @@
9242
9242
  SmzDocumentFeatureDefinitions[SmzDocumentFeatureDefinitions["SUB_TITLE"] = 5] = "SUB_TITLE";
9243
9243
  SmzDocumentFeatureDefinitions[SmzDocumentFeatureDefinitions["TITLE"] = 6] = "TITLE";
9244
9244
  SmzDocumentFeatureDefinitions[SmzDocumentFeatureDefinitions["TABLE"] = 7] = "TABLE";
9245
+ SmzDocumentFeatureDefinitions[SmzDocumentFeatureDefinitions["CHART"] = 8] = "CHART";
9245
9246
  })(SmzDocumentFeatureDefinitions || (SmzDocumentFeatureDefinitions = {}));
9246
9247
 
9247
9248
  exports.ApplicationActions = void 0;
@@ -10350,6 +10351,196 @@
10350
10351
  }]
10351
10352
  }] });
10352
10353
 
10354
+ var SmzChartComponent = /** @class */ (function () {
10355
+ function SmzChartComponent(el, defaultConfig) {
10356
+ this.el = el;
10357
+ this.defaultConfig = defaultConfig;
10358
+ this.plugins = [];
10359
+ this.responsive = true;
10360
+ this.chartClick = new i0.EventEmitter();
10361
+ this.chartHover = new i0.EventEmitter();
10362
+ this._options = {};
10363
+ }
10364
+ Object.defineProperty(SmzChartComponent.prototype, "data", {
10365
+ get: function () {
10366
+ return this._data;
10367
+ },
10368
+ set: function (val) {
10369
+ this._data = val;
10370
+ this._originalData = JSON.parse(JSON.stringify(val));
10371
+ this.reinit();
10372
+ },
10373
+ enumerable: false,
10374
+ configurable: true
10375
+ });
10376
+ Object.defineProperty(SmzChartComponent.prototype, "options", {
10377
+ get: function () {
10378
+ return this._options;
10379
+ },
10380
+ set: function (val) {
10381
+ var _this = this;
10382
+ var _a, _b;
10383
+ this._options = val;
10384
+ if (this._options != null) {
10385
+ this.title = (_b = (_a = this._options.plugins) === null || _a === void 0 ? void 0 : _a.title) === null || _b === void 0 ? void 0 : _b.text;
10386
+ // 'info' is an array of all elements in the clicked index
10387
+ this._options.onClick = function (e, info) {
10388
+ var _a;
10389
+ var canvasPosition = helpers.getRelativePosition(e, _this.chart);
10390
+ var element = _this.chart.getElementsAtEventForMode(e, 'dataset', { axis: '', intersect: true }, true);
10391
+ var datasetIndex = -1;
10392
+ var pointIndex = -1;
10393
+ var value = null;
10394
+ // TODO: tratar o clique em gráficos de barras horizontais
10395
+ if (_this.chart.scales.x != null) {
10396
+ // linear charts, except horizontal bar charts
10397
+ if (element != null && element.length > 0) {
10398
+ datasetIndex = element[0].datasetIndex;
10399
+ }
10400
+ pointIndex = _this.chart.scales.x.getValueForPixel(canvasPosition.x);
10401
+ if (datasetIndex != -1 && pointIndex != -1) {
10402
+ value = _this._originalData.datasets[datasetIndex].data[pointIndex];
10403
+ }
10404
+ }
10405
+ else {
10406
+ // radial charts
10407
+ var activeElements = _this.chart.getActiveElements();
10408
+ if (activeElements.length > 0) {
10409
+ datasetIndex = activeElements[0].datasetIndex;
10410
+ pointIndex = activeElements[0].index;
10411
+ }
10412
+ if (datasetIndex != -1 && pointIndex != -1 && ((_a = _this._originalData.datasets[datasetIndex].extra) === null || _a === void 0 ? void 0 : _a.length) > 0) {
10413
+ value = _this._originalData.datasets[datasetIndex].extra[pointIndex];
10414
+ }
10415
+ }
10416
+ _this.chartClick.emit({ chart: _this.chart, event: e, value: value });
10417
+ };
10418
+ this._options.onHover = function (e, dataset, chart) {
10419
+ _this.chartHover.emit({ chart: _this.chart, event: e, value: dataset });
10420
+ };
10421
+ // this._options.events = ['mousemove', 'mouseout', 'click', 'touchstart', 'touchmove'];
10422
+ }
10423
+ this.reinit();
10424
+ },
10425
+ enumerable: false,
10426
+ configurable: true
10427
+ });
10428
+ SmzChartComponent.prototype.ngAfterViewInit = function () {
10429
+ this.initChart();
10430
+ };
10431
+ SmzChartComponent.prototype.initChart = function () {
10432
+ if (this.type === 'empty')
10433
+ return;
10434
+ var opts = this.options || {};
10435
+ opts.responsive = this.responsive;
10436
+ // allows chart to resize in responsive mode
10437
+ if (opts.responsive && (this.height || this.width)) {
10438
+ opts.maintainAspectRatio = false;
10439
+ }
10440
+ this.chart = new Chart__default["default"](this.el.nativeElement.children[0].children[0], {
10441
+ type: this.type,
10442
+ data: this.data,
10443
+ options: this.options,
10444
+ plugins: this.plugins
10445
+ });
10446
+ };
10447
+ SmzChartComponent.prototype.getCanvas = function () {
10448
+ return this.el.nativeElement.children[0].children[0];
10449
+ };
10450
+ SmzChartComponent.prototype.getBase64Image = function () {
10451
+ return this.chart.toBase64Image();
10452
+ };
10453
+ SmzChartComponent.prototype.generateLegend = function () {
10454
+ if (this.chart) {
10455
+ return this.chart.generateLegend();
10456
+ }
10457
+ };
10458
+ SmzChartComponent.prototype.refresh = function () {
10459
+ if (this.chart) {
10460
+ this.chart.update();
10461
+ }
10462
+ };
10463
+ SmzChartComponent.prototype.reinit = function () {
10464
+ if (this.chart) {
10465
+ this.chart.destroy();
10466
+ this.initChart();
10467
+ }
10468
+ };
10469
+ SmzChartComponent.prototype.ngOnDestroy = function () {
10470
+ if (this.chart) {
10471
+ this.chart.destroy();
10472
+ this.chart = null;
10473
+ }
10474
+ };
10475
+ return SmzChartComponent;
10476
+ }());
10477
+ SmzChartComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SmzChartComponent, deps: [{ token: i0__namespace.ElementRef }, { token: SmzDialogsConfig }], target: i0__namespace.ɵɵFactoryTarget.Component });
10478
+ SmzChartComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.5", type: SmzChartComponent, selector: "smz-ui-chart", inputs: { type: "type", plugins: "plugins", width: "width", height: "height", responsive: "responsive", data: "data", options: "options" }, outputs: { chartClick: "chartClick", chartHover: "chartHover" }, ngImport: i0__namespace, template: "<div [ngClass]=\"{ 'invisible fixed': type == null || type === 'empty' }\"\n [style.width]=\"responsive && !width ? null : width\"\n [style.height]=\"responsive && !height ? null : height\">\n <canvas [attr.width]=\"responsive && !width ? null : width\"\n [attr.height]=\"responsive && !height ? null : height\">\n </canvas>\n</div>\n\n<ng-container *ngIf=\"type === 'empty'\" >\n <div class=\"relative h-full\"\n [ngStyle]=\"{ height: responsive && !height ? 'auto' : height + 'px', width: responsive && !width ? 'auto' : width + 'px'}\"\n class=\"h-full\">\n <div class=\"text-center smz-chart-title\">{{title}}</div>\n <div class=\"p-grid p-nogutter p-flex-column gap-3 p-align-center p-justify-center h-full\">\n <i class=\"far fa-chart-bar text-4xl\"></i>\n <p>{{defaultConfig.charts.emptyMessage}}</p>\n </div>\n </div>\n</ng-container>", directives: [{ type: i1__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
10479
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SmzChartComponent, decorators: [{
10480
+ type: i0.Component,
10481
+ args: [{
10482
+ selector: 'smz-ui-chart',
10483
+ templateUrl: './chart.component.html',
10484
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
10485
+ encapsulation: i0.ViewEncapsulation.None
10486
+ }]
10487
+ }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: SmzDialogsConfig }]; }, propDecorators: { type: [{
10488
+ type: i0.Input
10489
+ }], plugins: [{
10490
+ type: i0.Input
10491
+ }], width: [{
10492
+ type: i0.Input
10493
+ }], height: [{
10494
+ type: i0.Input
10495
+ }], responsive: [{
10496
+ type: i0.Input
10497
+ }], chartClick: [{
10498
+ type: i0.Output
10499
+ }], chartHover: [{
10500
+ type: i0.Output
10501
+ }], data: [{
10502
+ type: i0.Input
10503
+ }], options: [{
10504
+ type: i0.Input
10505
+ }] } });
10506
+
10507
+ var SmzDocumentChartComponent = /** @class */ (function () {
10508
+ function SmzDocumentChartComponent() {
10509
+ }
10510
+ SmzDocumentChartComponent.prototype.ngOnInit = function () { };
10511
+ return SmzDocumentChartComponent;
10512
+ }());
10513
+ SmzDocumentChartComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SmzDocumentChartComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
10514
+ SmzDocumentChartComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.5", type: SmzDocumentChartComponent, selector: "smz-document-chart", inputs: { data: "data", config: "config" }, ngImport: i0__namespace, template: "<div\n [ngStyle]=\"{ background: data.container.background }\"\n class=\"p-grid p-nogutter p-align-stretch p-justify-start h-full w-full relative\"\n [ngClass]=\"data.container.styles\">\n\n <smz-ui-chart\n class=\"w-full h-full\"\n [type]=\"data.content.chartData.type\"\n [data]=\"data.content.chartData.data\"\n [options]=\"data.content.chartData.config\">\n </smz-ui-chart>\n\n</div>", components: [{ type: SmzChartComponent, selector: "smz-ui-chart", inputs: ["type", "plugins", "width", "height", "responsive", "data", "options"], outputs: ["chartClick", "chartHover"] }], directives: [{ type: i1__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i1__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
10515
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SmzDocumentChartComponent, decorators: [{
10516
+ type: i0.Component,
10517
+ args: [{
10518
+ selector: 'smz-document-chart',
10519
+ templateUrl: 'chart.component.html'
10520
+ }]
10521
+ }], ctorParameters: function () { return []; }, propDecorators: { data: [{
10522
+ type: i0.Input
10523
+ }], config: [{
10524
+ type: i0.Input
10525
+ }] } });
10526
+
10527
+ var SmzChartModule = /** @class */ (function () {
10528
+ function SmzChartModule() {
10529
+ }
10530
+ return SmzChartModule;
10531
+ }());
10532
+ SmzChartModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SmzChartModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
10533
+ SmzChartModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SmzChartModule, declarations: [SmzChartComponent], imports: [i1$1.CommonModule], exports: [SmzChartComponent] });
10534
+ SmzChartModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SmzChartModule, imports: [[i1$1.CommonModule]] });
10535
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SmzChartModule, decorators: [{
10536
+ type: i0.NgModule,
10537
+ args: [{
10538
+ imports: [i1$1.CommonModule],
10539
+ exports: [SmzChartComponent],
10540
+ declarations: [SmzChartComponent]
10541
+ }]
10542
+ }] });
10543
+
10353
10544
  var NgxSmzDocumentsModule = /** @class */ (function () {
10354
10545
  function NgxSmzDocumentsModule(injector) {
10355
10546
  GlobalInjector.instance = injector;
@@ -10367,7 +10558,8 @@
10367
10558
  SmzDocumentSubTitleComponent,
10368
10559
  SmzDocumentFieldsGroupComponent,
10369
10560
  SmzDocumentViewerComponent,
10370
- SmzDocumentTableComponent], imports: [i1$1.CommonModule,
10561
+ SmzDocumentTableComponent,
10562
+ SmzDocumentChartComponent], imports: [i1$1.CommonModule,
10371
10563
  i1.FormsModule,
10372
10564
  i6$1.BadgeModule,
10373
10565
  i2$1.OverlayPanelModule,
@@ -10380,7 +10572,8 @@
10380
10572
  NgVarModule,
10381
10573
  ClickStopPropagationModule,
10382
10574
  NgxSmzDataPipesModule,
10383
- i10.TooltipModule], exports: [SmzDocumentComponent] });
10575
+ i10.TooltipModule,
10576
+ SmzChartModule], exports: [SmzDocumentComponent] });
10384
10577
  NgxSmzDocumentsModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: NgxSmzDocumentsModule, imports: [[
10385
10578
  i1$1.CommonModule,
10386
10579
  i1.FormsModule,
@@ -10395,7 +10588,8 @@
10395
10588
  NgVarModule,
10396
10589
  ClickStopPropagationModule,
10397
10590
  NgxSmzDataPipesModule,
10398
- i10.TooltipModule
10591
+ i10.TooltipModule,
10592
+ SmzChartModule
10399
10593
  ]] });
10400
10594
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: NgxSmzDocumentsModule, decorators: [{
10401
10595
  type: i0.NgModule,
@@ -10414,7 +10608,8 @@
10414
10608
  NgVarModule,
10415
10609
  ClickStopPropagationModule,
10416
10610
  NgxSmzDataPipesModule,
10417
- i10.TooltipModule
10611
+ i10.TooltipModule,
10612
+ SmzChartModule
10418
10613
  ],
10419
10614
  exports: [SmzDocumentComponent],
10420
10615
  declarations: [
@@ -10429,6 +10624,7 @@
10429
10624
  SmzDocumentFieldsGroupComponent,
10430
10625
  SmzDocumentViewerComponent,
10431
10626
  SmzDocumentTableComponent,
10627
+ SmzDocumentChartComponent
10432
10628
  ]
10433
10629
  }]
10434
10630
  }], ctorParameters: function () { return [{ type: i0__namespace.Injector }]; } });
@@ -21242,176 +21438,6 @@
21242
21438
 
21243
21439
  // MODULES
21244
21440
 
21245
- var SmzChartComponent = /** @class */ (function () {
21246
- function SmzChartComponent(el, defaultConfig) {
21247
- this.el = el;
21248
- this.defaultConfig = defaultConfig;
21249
- this.plugins = [];
21250
- this.responsive = true;
21251
- this.chartClick = new i0.EventEmitter();
21252
- this.chartHover = new i0.EventEmitter();
21253
- this._options = {};
21254
- }
21255
- Object.defineProperty(SmzChartComponent.prototype, "data", {
21256
- get: function () {
21257
- return this._data;
21258
- },
21259
- set: function (val) {
21260
- this._data = val;
21261
- this._originalData = JSON.parse(JSON.stringify(val));
21262
- this.reinit();
21263
- },
21264
- enumerable: false,
21265
- configurable: true
21266
- });
21267
- Object.defineProperty(SmzChartComponent.prototype, "options", {
21268
- get: function () {
21269
- return this._options;
21270
- },
21271
- set: function (val) {
21272
- var _this = this;
21273
- var _a, _b;
21274
- this._options = val;
21275
- if (this._options != null) {
21276
- this.title = (_b = (_a = this._options.plugins) === null || _a === void 0 ? void 0 : _a.title) === null || _b === void 0 ? void 0 : _b.text;
21277
- // 'info' is an array of all elements in the clicked index
21278
- this._options.onClick = function (e, info) {
21279
- var _a;
21280
- var canvasPosition = helpers.getRelativePosition(e, _this.chart);
21281
- var element = _this.chart.getElementsAtEventForMode(e, 'dataset', { axis: '', intersect: true }, true);
21282
- var datasetIndex = -1;
21283
- var pointIndex = -1;
21284
- var value = null;
21285
- // TODO: tratar o clique em gráficos de barras horizontais
21286
- if (_this.chart.scales.x != null) {
21287
- // linear charts, except horizontal bar charts
21288
- if (element != null && element.length > 0) {
21289
- datasetIndex = element[0].datasetIndex;
21290
- }
21291
- pointIndex = _this.chart.scales.x.getValueForPixel(canvasPosition.x);
21292
- if (datasetIndex != -1 && pointIndex != -1) {
21293
- value = _this._originalData.datasets[datasetIndex].data[pointIndex];
21294
- }
21295
- }
21296
- else {
21297
- // radial charts
21298
- var activeElements = _this.chart.getActiveElements();
21299
- if (activeElements.length > 0) {
21300
- datasetIndex = activeElements[0].datasetIndex;
21301
- pointIndex = activeElements[0].index;
21302
- }
21303
- if (datasetIndex != -1 && pointIndex != -1 && ((_a = _this._originalData.datasets[datasetIndex].extra) === null || _a === void 0 ? void 0 : _a.length) > 0) {
21304
- value = _this._originalData.datasets[datasetIndex].extra[pointIndex];
21305
- }
21306
- }
21307
- _this.chartClick.emit({ chart: _this.chart, event: e, value: value });
21308
- };
21309
- this._options.onHover = function (e, dataset, chart) {
21310
- _this.chartHover.emit({ chart: _this.chart, event: e, value: dataset });
21311
- };
21312
- // this._options.events = ['mousemove', 'mouseout', 'click', 'touchstart', 'touchmove'];
21313
- }
21314
- this.reinit();
21315
- },
21316
- enumerable: false,
21317
- configurable: true
21318
- });
21319
- SmzChartComponent.prototype.ngAfterViewInit = function () {
21320
- this.initChart();
21321
- };
21322
- SmzChartComponent.prototype.initChart = function () {
21323
- if (this.type === 'empty')
21324
- return;
21325
- var opts = this.options || {};
21326
- opts.responsive = this.responsive;
21327
- // allows chart to resize in responsive mode
21328
- if (opts.responsive && (this.height || this.width)) {
21329
- opts.maintainAspectRatio = false;
21330
- }
21331
- this.chart = new Chart__default["default"](this.el.nativeElement.children[0].children[0], {
21332
- type: this.type,
21333
- data: this.data,
21334
- options: this.options,
21335
- plugins: this.plugins
21336
- });
21337
- };
21338
- SmzChartComponent.prototype.getCanvas = function () {
21339
- return this.el.nativeElement.children[0].children[0];
21340
- };
21341
- SmzChartComponent.prototype.getBase64Image = function () {
21342
- return this.chart.toBase64Image();
21343
- };
21344
- SmzChartComponent.prototype.generateLegend = function () {
21345
- if (this.chart) {
21346
- return this.chart.generateLegend();
21347
- }
21348
- };
21349
- SmzChartComponent.prototype.refresh = function () {
21350
- if (this.chart) {
21351
- this.chart.update();
21352
- }
21353
- };
21354
- SmzChartComponent.prototype.reinit = function () {
21355
- if (this.chart) {
21356
- this.chart.destroy();
21357
- this.initChart();
21358
- }
21359
- };
21360
- SmzChartComponent.prototype.ngOnDestroy = function () {
21361
- if (this.chart) {
21362
- this.chart.destroy();
21363
- this.chart = null;
21364
- }
21365
- };
21366
- return SmzChartComponent;
21367
- }());
21368
- SmzChartComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SmzChartComponent, deps: [{ token: i0__namespace.ElementRef }, { token: SmzDialogsConfig }], target: i0__namespace.ɵɵFactoryTarget.Component });
21369
- SmzChartComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.5", type: SmzChartComponent, selector: "smz-ui-chart", inputs: { type: "type", plugins: "plugins", width: "width", height: "height", responsive: "responsive", data: "data", options: "options" }, outputs: { chartClick: "chartClick", chartHover: "chartHover" }, ngImport: i0__namespace, template: "<div [ngClass]=\"{ 'invisible fixed': type == null || type === 'empty' }\"\n [style.width]=\"responsive && !width ? null : width\"\n [style.height]=\"responsive && !height ? null : height\">\n <canvas [attr.width]=\"responsive && !width ? null : width\"\n [attr.height]=\"responsive && !height ? null : height\">\n </canvas>\n</div>\n\n<ng-container *ngIf=\"type === 'empty'\" >\n <div class=\"relative h-full\"\n [ngStyle]=\"{ height: responsive && !height ? 'auto' : height + 'px', width: responsive && !width ? 'auto' : width + 'px'}\"\n class=\"h-full\">\n <div class=\"text-center smz-chart-title\">{{title}}</div>\n <div class=\"p-grid p-nogutter p-flex-column gap-3 p-align-center p-justify-center h-full\">\n <i class=\"far fa-chart-bar text-4xl\"></i>\n <p>{{defaultConfig.charts.emptyMessage}}</p>\n </div>\n </div>\n</ng-container>", directives: [{ type: i1__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
21370
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SmzChartComponent, decorators: [{
21371
- type: i0.Component,
21372
- args: [{
21373
- selector: 'smz-ui-chart',
21374
- templateUrl: './chart.component.html',
21375
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
21376
- encapsulation: i0.ViewEncapsulation.None
21377
- }]
21378
- }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: SmzDialogsConfig }]; }, propDecorators: { type: [{
21379
- type: i0.Input
21380
- }], plugins: [{
21381
- type: i0.Input
21382
- }], width: [{
21383
- type: i0.Input
21384
- }], height: [{
21385
- type: i0.Input
21386
- }], responsive: [{
21387
- type: i0.Input
21388
- }], chartClick: [{
21389
- type: i0.Output
21390
- }], chartHover: [{
21391
- type: i0.Output
21392
- }], data: [{
21393
- type: i0.Input
21394
- }], options: [{
21395
- type: i0.Input
21396
- }] } });
21397
-
21398
- var SmzChartModule = /** @class */ (function () {
21399
- function SmzChartModule() {
21400
- }
21401
- return SmzChartModule;
21402
- }());
21403
- SmzChartModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SmzChartModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
21404
- SmzChartModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SmzChartModule, declarations: [SmzChartComponent], imports: [i1$1.CommonModule], exports: [SmzChartComponent] });
21405
- SmzChartModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SmzChartModule, imports: [[i1$1.CommonModule]] });
21406
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SmzChartModule, decorators: [{
21407
- type: i0.NgModule,
21408
- args: [{
21409
- imports: [i1$1.CommonModule],
21410
- exports: [SmzChartComponent],
21411
- declarations: [SmzChartComponent]
21412
- }]
21413
- }] });
21414
-
21415
21441
  // MODULES
21416
21442
  // PIPES
21417
21443
  // SERVICES
@@ -24324,6 +24350,30 @@
24324
24350
  });
24325
24351
  return SmzCellTableColumnBuilder;
24326
24352
  }());
24353
+ var SmzCellChartBuilder = /** @class */ (function (_super) {
24354
+ __extends(SmzCellChartBuilder, _super);
24355
+ function SmzCellChartBuilder(_rowBuilder, _cell, _data, _documentBuilder) {
24356
+ var _this = _super.call(this, _rowBuilder, _cell, _data, _documentBuilder) || this;
24357
+ _this._rowBuilder = _rowBuilder;
24358
+ _this._cell = _cell;
24359
+ _this._data = _data;
24360
+ _this._documentBuilder = _documentBuilder;
24361
+ _this.that = _this;
24362
+ var defaultConfig = cloneDeep__default["default"](_this._documentBuilder._state.config);
24363
+ _data.container = { styles: defaultConfig.tables.container };
24364
+ _data.content = {};
24365
+ return _this;
24366
+ }
24367
+ SmzCellChartBuilder.prototype.overrideContainerStyles = function (styleClass) {
24368
+ this._data.container.styles = styleClass;
24369
+ return this.that;
24370
+ };
24371
+ SmzCellChartBuilder.prototype.setContainerBackgroundColor = function (color) {
24372
+ this._data.container.background = color;
24373
+ return this.that;
24374
+ };
24375
+ return SmzCellChartBuilder;
24376
+ }(SmzDocumentBaseCellBuilder));
24327
24377
 
24328
24378
  var SmzDocumentContentBuilder = /** @class */ (function (_super) {
24329
24379
  __extends(SmzDocumentContentBuilder, _super);
@@ -24411,6 +24461,13 @@
24411
24461
  cell.data = item;
24412
24462
  return new SmzCellTableBuilder(this, cell, item, this._documentBuilder);
24413
24463
  };
24464
+ SmzDocumentRowBuilder.prototype.chart = function (chartData) {
24465
+ var cell = { colspan: 1, rowspan: 1, height: '100%', width: 'auto', data: null };
24466
+ this._row.cells.push(cell);
24467
+ var item = { type: SmzDocumentFeatureDefinitions.CHART, content: { chartData: chartData } };
24468
+ cell.data = item;
24469
+ return new SmzCellChartBuilder(this, cell, item, this._documentBuilder);
24470
+ };
24414
24471
  Object.defineProperty(SmzDocumentRowBuilder.prototype, "content", {
24415
24472
  get: function () {
24416
24473
  var _this = this;