cronapp-framework-js 2.9.1 → 2.9.2-SP.10
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/components/crn-accordion.components.json +1 -1
- package/components/crn-button-filter.components.json +23 -12
- package/components/crn-button.components.json +22 -11
- package/components/crn-enterprise-autocomplete.components.json +1 -1
- package/components/crn-enterprise-checkbox.components.json +20 -10
- package/components/crn-enterprise-combobox-multiple.components.json +20 -10
- package/components/crn-panel.components.json +20 -10
- package/components/crn-radiogroup.components.json +20 -10
- package/components/crn-signature-pad.components.json +1 -1
- package/components/crn-upload-file.components.json +25 -14
- package/components/crn-upload.components.json +27 -15
- package/components/templates/accordion.template.html +2 -2
- package/components/templates/cron-autocomplete.designtime.html +4 -38
- package/components/templates/cron-calendar.designtime.html +74 -169
- package/components/templates/cron-dashboard-viewer.designtime.html +4 -2
- package/components/templates/cron-grid.designtime.html +4 -2
- package/css/animate.css +2 -2
- package/css/app.css +9 -0
- package/css/themes/custom/aquamarine/button-aquamarine.css +35 -10
- package/css/themes/custom/aquamarine/custom-aquamarine.css +112 -51
- package/css/themes/custom/cerulean/button-cerulean.css +20 -1
- package/css/themes/custom/cerulean/custom-cerulean.css +87 -12
- package/css/themes/custom/cosmo/custom-cosmo.css +124 -5
- package/css/themes/custom/cosmo/panel-cosmo.css +7 -8
- package/css/themes/custom/cyborg/custom-cyborg.css +79 -1
- package/css/themes/custom/cyborg/panel-cyborg.css +11 -8
- package/css/themes/custom/darkly/custom-darkly.css +113 -10
- package/css/themes/custom/darkly/panel-darkly.css +3 -7
- package/css/themes/custom/dsgov/button-dsgov.css +11 -1
- package/css/themes/custom/dsgov/custom-dsgov.css +75 -14
- package/css/themes/custom/dsgov/form-dsgov.css +2 -2
- package/css/themes/custom/flatly/custom-flatly.css +70 -0
- package/css/themes/custom/flatly/panel-flatly.css +11 -16
- package/css/themes/custom/fuse/custom-fuse.css +169 -9
- package/css/themes/custom/fuse/panel-fuse.css +5 -5
- package/css/themes/custom/journal/custom-journal.css +70 -0
- package/css/themes/custom/journal/panel-journal.css +3 -6
- package/css/themes/custom/material/custom-material.css +132 -28
- package/css/themes/custom/theme-general/button.css +20 -0
- package/css/themes/custom/theme-general/forms.css +6 -1
- package/css/themes/custom/theme-general/notification.css +16 -0
- package/css/themes/custom/theme-general/scheduler.css +17 -25
- package/css/themes/custom/theme-general/table-grid.css +6 -8
- package/css/themes/custom/theme-general/theme-general.css +7 -6
- package/css/themes/deprecated/custom/aquamarine/font/fonts.css +162 -0
- package/deprecated/css/app.css +6 -0
- package/dist/components/js/jquery.inputmask.bundle.js +1 -1
- package/dist/components/js/jquery.mask.min.js +1 -1
- package/dist/components/js/qrcode.js +1 -1
- package/dist/components/templates/accordion.template.html +1 -1
- package/dist/components/templates/cron-autocomplete.designtime.html +1 -26
- package/dist/components/templates/cron-calendar.designtime.html +1 -1
- package/dist/components/templates/cron-dashboard-viewer.designtime.html +1 -1
- package/dist/components/templates/cron-grid.designtime.html +1 -1
- package/dist/css/animate.css +1 -1
- package/dist/css/app.css +1 -1
- package/dist/css/themes/custom/aquamarine/button-aquamarine.css +1 -1
- package/dist/css/themes/custom/aquamarine/custom-aquamarine.css +1 -1
- package/dist/css/themes/custom/cerulean/button-cerulean.css +1 -1
- package/dist/css/themes/custom/cerulean/custom-cerulean.css +1 -1
- package/dist/css/themes/custom/cosmo/custom-cosmo.css +1 -1
- package/dist/css/themes/custom/cosmo/panel-cosmo.css +1 -1
- package/dist/css/themes/custom/cyborg/custom-cyborg.css +1 -1
- package/dist/css/themes/custom/cyborg/panel-cyborg.css +1 -1
- package/dist/css/themes/custom/darkly/custom-darkly.css +1 -1
- package/dist/css/themes/custom/darkly/panel-darkly.css +1 -1
- package/dist/css/themes/custom/dsgov/button-dsgov.css +1 -1
- package/dist/css/themes/custom/dsgov/custom-dsgov.css +1 -1
- package/dist/css/themes/custom/dsgov/form-dsgov.css +1 -1
- package/dist/css/themes/custom/flatly/custom-flatly.css +1 -1
- package/dist/css/themes/custom/flatly/panel-flatly.css +1 -1
- package/dist/css/themes/custom/fuse/custom-fuse.css +1 -1
- package/dist/css/themes/custom/fuse/panel-fuse.css +1 -1
- package/dist/css/themes/custom/journal/custom-journal.css +1 -1
- package/dist/css/themes/custom/journal/panel-journal.css +1 -1
- package/dist/css/themes/custom/material/custom-material.css +1 -1
- package/dist/css/themes/custom/theme-general/button.css +1 -1
- package/dist/css/themes/custom/theme-general/forms.css +1 -1
- package/dist/css/themes/custom/theme-general/notification.css +1 -1
- package/dist/css/themes/custom/theme-general/scheduler.css +1 -1
- package/dist/css/themes/custom/theme-general/table-grid.css +1 -1
- package/dist/css/themes/custom/theme-general/theme-general.css +1 -1
- package/dist/css/themes/deprecated/custom/aquamarine/font/fonts.css +1 -0
- package/dist/js/app.js +1 -1
- package/dist/js/dashboard/dashboard.service.js +1 -1
- package/dist/js/directives.js +2 -2
- package/dist/js/reports/reports.service.js +1 -1
- package/js/app.js +7 -4
- package/js/dashboard/dashboard.service.js +2 -0
- package/js/directives.js +123 -87
- package/js/reports/reports.service.js +14 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){angular.module("report.services",[]).service("ReportService",["$http","$compile","$modal","$translate","$window","$rootScope",function(a,b,c,d,e,f){function g(){return navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/Windows Phone/i)}function h(a){window.open(a,"_blank")}var i=$("body"),j=angular.element(i.get(0)).scope(),k=["node_modules/cronapp-lib-js/dist/js/stimulsoft/stimulsoft.vendor.css","node_modules/cronapp-lib-js/dist/js/stimulsoft/stimulsoft.vendor.js","node_modules/cronapp-lib-js/dist/js/stimulsoft/stimulsoft-helper.js"],l=[];this.getReport=function(b){var c={url:"api/rest/report",method:"POST",data:angular.toJson({reportName:b})};return a(c)},this.getPDF=function(b){var c={url:"api/rest/report/pdf",method:"POST",responseType:"arraybuffer",data:angular.toJson(b)};return a(c)},this.getPDFAsFile=function(b){var c={url:"api/rest/report/pdfasfile",method:"POST",data:angular.toJson(b)};return a(c)},this.getContentAsString=function(b){var c={url:"api/rest/report/contentasstring",method:"POST",data:angular.toJson(b)};return a(c)},this.getDataSourcesParams=function(b){var c={url:"api/rest/report/getdatasourcesparams",method:"POST",data:angular.toJson(b)};return a(c)},this.openURLContent=function(a){if(a&&g())return void h(a);var c=$("#reportViewContext");c.get(0)||(console.log("include[#reportViewContext]"),i.append("<div id=\"reportViewContext\" ng-include=\"'node_modules/cronapp-framework-js/components/reports/reports.view.html'\"></div>"),b(i)(j),c=$("#reportViewContext"));var d=function(){var b=$("<iframe/>");b.attr("frameborder",0);var e=parseInt($(window).height());b.attr("height",e-200),b.attr("width","100%"),b.attr("src",a+"?download=false");var f=$("#reportView .modal-body");f.get(0)?(f.html(b),$("#reportViewContext .modal-dialog").css("width","95%"),setTimeout(function(){console.log("open[#reportViewContext]"),$("body").append(c),$("#reportView").modal()},100)):(console.log("wait[#reportViewContext]"),setTimeout(d,200))};setTimeout(d,200)},this.initializeStimulsoft=function(a){if(!Stimulsoft.Base.StiLicense.Key){stimulsoftHelper.setLanguage(a);var b=stimulsoftHelper.getLocalization();Stimulsoft.Base.Localization.StiLocalization.loadLocalization(b.xml),Stimulsoft.Base.Localization.StiLocalization.cultureName=b.cultureName,Stimulsoft.Base.StiLicense.Key=stimulsoftHelper.getKey()}},this.openStimulsoftReport=function(a,c,d,e){var k=$("#reportViewContext");k.get(0)||(i.append("<div id=\"reportViewContext\" ng-include=\"'node_modules/cronapp-framework-js/components/reports/reports.view.html'\"></div>"),b(i)(j),k=$("#reportViewContext"));var l=parseInt($(window).height()),m=l-200+"px",n="StiViewer"+app.common.generateId(),o=new Stimulsoft.Report.StiReport;f.reportTitle=a.ReportAlias,o.load(a),d||(d=stimulsoftHelper.getDatasourcesInBand(o)),c&&c.forEach(function(a){d.datasources.forEach(function(b){for(var c=0;c<b.fieldParams.length;c++)if(b.fieldParams[c].param==a.originalName){b.fieldParams[c].value=a.value;break}})}),stimulsoftHelper.setParamsInFilter(o.dictionary.dataSources,d.datasources);var p=()=>{var a=new Stimulsoft.Viewer.StiViewerOptions;a.toolbar.showAboutButton=!1,e?(a.toolbar.visible=e.showToolbar,a.appearance.scrollbarsMode=e.showScrollbar,null!=e.height&&(a.height=e.height+"px")):(a.appearance.scrollbarsMode=!0,a.height=m);var b=new Stimulsoft.Viewer.StiViewer(a,n,!1);return b.report=o,Stimulsoft.Viewer.StiJsViewer.prototype.IsTouchDevice()&&(b.options.appearance.interfaceType=Stimulsoft.Viewer.StiInterfaceType.Touch),b};if(e&&e.$element)p(e).renderHtml(e.$element[0]);else{function b(){var a,b,c,d,e,f=setInterval(function(){var g=$("#"+n);g.length?!a&&(a=g.parent(),b=a.parent(),c=b.parent(),d=c.parent(),e=d.parent()):(console.log("cleared interval: "+n),clearInterval(f))},100)}function d(c){if(c&&g())return void h(c);var d=setInterval(function(){var f=$("<div/>");f.attr("id","contentReport"),f.attr("width","100%");var g=$("#reportView .modal-body");g.get(0)&&(g.html(f),$("#reportViewContext .modal-dialog").css("width","95%"),setTimeout(function(){console.log("open[#reportViewContext]"),$("body").append(k),cronapi.screen.showModal("reportView"),a.reportConfig&&"HTML"===a.reportConfig.renderType?p(e).renderHtml("contentReport"):$("#contentReport").html("<iframe src=\""+c+"\" width=\"100%\" height=\""+m+"\"></iframe>"),setTimeout(function(){b()},100)},100),clearInterval(d))},200)}if(!a.reportConfig||"PDFSERVER"===a.reportConfig.renderType)this.getPDF({reportName:a.reportName,parameters:c}).then(function(a){var b=new Blob([new Uint8Array(a.data)],{type:"application/pdf"}),c=URL.createObjectURL(b);d(c)}.bind(this));else{var q=new Stimulsoft.Report.Export.StiPdfExportSettings,r=new Stimulsoft.Report.Export.StiPdfExportService,s=new Stimulsoft.System.IO.MemoryStream;o.renderAsync(function(){a.reportConfig&&"PDF"!==a.reportConfig.renderType&&a.reportConfig.renderType!==void 0?d(null):r.exportToAsync(function(){var a=s.toArray(),b=new Blob([new Uint8Array(a)],{type:"application/pdf"}),c=URL.createObjectURL(b);d(c)},o,s,q)},!1)}}$(`#${n}`).find("img").attr("alt",""),$(`#${n}`).find("input").attr("aria-label",n)},this.showParameters=function(a){var b=a.parameters,d=[],e=0,f=function(a){return a.replace(/([.*+?^=!:()|\[\]\/\\])/g,"\\$1")},g=function(a,b,c){return a.replace(new RegExp(f(b),"g"),c)},h=function(){if(e<b.length){var f=b[e++];$.get("node_modules/cronapp-framework-js/components/reports/"+f.type+".parameter.html").done(function(a){d.push(g(a,"_field_",f.name)),h()})}else 0<d.length&&c.open({templateUrl:"node_modules/cronapp-framework-js/components/reports/reports.parameters.html",controller:"ParameterController",resolve:{report:function(){return JSON.parse(JSON.stringify(a))},htmlParameters:function(){return JSON.parse(JSON.stringify(d))}}})}.bind(this);h()},this.mergeParam=function(a,b){var c=function(a,b){for(var c in Object.keys(b)){var
|
|
1
|
+
(function(){angular.module("report.services",[]).service("ReportService",["$http","$compile","$modal","$translate","$window","$rootScope",function(a,b,c,d,e,f){function g(){return navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/Windows Phone/i)}function h(a){window.open(a,"_blank")}var i=$("body"),j=angular.element(i.get(0)).scope(),k=["node_modules/cronapp-lib-js/dist/js/stimulsoft/stimulsoft.vendor.css","node_modules/cronapp-lib-js/dist/js/stimulsoft/stimulsoft.vendor.js","node_modules/cronapp-lib-js/dist/js/stimulsoft/stimulsoft-helper.js"],l=[];this.getReport=function(b){var c={url:"api/rest/report",method:"POST",data:angular.toJson({reportName:b})};return a(c)},this.getPDF=function(b){var c={url:"api/rest/report/pdf",method:"POST",responseType:"arraybuffer",data:angular.toJson(b)};return a(c)},this.getPDFAsFile=function(b){var c={url:"api/rest/report/pdfasfile",method:"POST",data:angular.toJson(b)};return a(c)},this.getContentAsString=function(b){var c={url:"api/rest/report/contentasstring",method:"POST",data:angular.toJson(b)};return a(c)},this.getDataSourcesParams=function(b){var c={url:"api/rest/report/getdatasourcesparams",method:"POST",data:angular.toJson(b)};return a(c)},this.openURLContent=function(a){if(a&&g())return void h(a);var c=$("#reportViewContext");c.get(0)||(console.log("include[#reportViewContext]"),i.append("<div id=\"reportViewContext\" ng-include=\"'node_modules/cronapp-framework-js/components/reports/reports.view.html'\"></div>"),b(i)(j),c=$("#reportViewContext"));var d=function(){var b=$("<iframe/>");b.attr("frameborder",0);var e=parseInt($(window).height());b.attr("height",e-200),b.attr("width","100%"),b.attr("src",a+"?download=false");var f=$("#reportView .modal-body");f.get(0)?(f.html(b),$("#reportViewContext .modal-dialog").css("width","95%"),setTimeout(function(){console.log("open[#reportViewContext]"),$("body").append(c),$("#reportView").modal()},100)):(console.log("wait[#reportViewContext]"),setTimeout(d,200))};setTimeout(d,200)},this.initializeStimulsoft=function(a){if(!Stimulsoft.Base.StiLicense.Key){stimulsoftHelper.setLanguage(a);var b=stimulsoftHelper.getLocalization();Stimulsoft.Base.Localization.StiLocalization.loadLocalization(b.xml),Stimulsoft.Base.Localization.StiLocalization.cultureName=b.cultureName,Stimulsoft.Base.StiLicense.Key=stimulsoftHelper.getKey()}},this.openStimulsoftReport=function(a,c,d,e){var k=$("#reportViewContext");k.get(0)||(i.append("<div id=\"reportViewContext\" ng-include=\"'node_modules/cronapp-framework-js/components/reports/reports.view.html'\"></div>"),b(i)(j),k=$("#reportViewContext"));var l=parseInt($(window).height()),m=l-200+"px",n="StiViewer"+app.common.generateId(),o=new Stimulsoft.Report.StiReport;f.reportTitle=a.ReportAlias,o.load(a),d||(d=stimulsoftHelper.getDatasourcesInBand(o)),c&&c.forEach(function(a){d.datasources.forEach(function(b){for(var c=0;c<b.fieldParams.length;c++)if(b.fieldParams[c].param==a.originalName){b.fieldParams[c].value=a.value;break}})}),stimulsoftHelper.setParamsInFilter(o.dictionary.dataSources,d.datasources);var p=()=>{var a=new Stimulsoft.Viewer.StiViewerOptions;a.toolbar.showAboutButton=!1,e?(a.toolbar.visible=e.showToolbar,a.appearance.scrollbarsMode=e.showScrollbar,null!=e.height&&(a.height=e.height+"px")):(a.appearance.scrollbarsMode=!0,a.height=m);var b=new Stimulsoft.Viewer.StiViewer(a,n,!1);return b.report=o,Stimulsoft.Viewer.StiJsViewer.prototype.IsTouchDevice()&&(b.options.appearance.interfaceType=Stimulsoft.Viewer.StiInterfaceType.Touch),b};if(e&&e.$element)p(e).renderHtml(e.$element[0]);else{function b(){var a,b,c,d,e,f=setInterval(function(){var g=$("#"+n);g.length?!a&&(a=g.parent(),b=a.parent(),c=b.parent(),d=c.parent(),e=d.parent()):(console.log("cleared interval: "+n),clearInterval(f))},100)}function d(c){if(c&&g())return void h(c);var d=setInterval(function(){var f=$("<div/>");f.attr("id","contentReport"),f.attr("width","100%");var g=$("#reportView .modal-body");g.get(0)&&(g.html(f),$("#reportViewContext .modal-dialog").css("width","95%"),setTimeout(function(){console.log("open[#reportViewContext]"),$("body").append(k),cronapi.screen.showModal("reportView"),a.reportConfig&&"HTML"===a.reportConfig.renderType?p(e).renderHtml("contentReport"):$("#contentReport").html("<iframe src=\""+c+"\" width=\"100%\" height=\""+m+"\"></iframe>"),setTimeout(function(){b()},100)},100),clearInterval(d))},200)}if(!a.reportConfig||"PDFSERVER"===a.reportConfig.renderType)this.getPDF({reportName:a.reportName,parameters:c}).then(function(a){var b=new Blob([new Uint8Array(a.data)],{type:"application/pdf"}),c=URL.createObjectURL(b);d(c)}.bind(this));else{var q=new Stimulsoft.Report.Export.StiPdfExportSettings,r=new Stimulsoft.Report.Export.StiPdfExportService,s=new Stimulsoft.System.IO.MemoryStream;o.renderAsync(function(){a.reportConfig&&"PDF"!==a.reportConfig.renderType&&a.reportConfig.renderType!==void 0?d(null):r.exportToAsync(function(){var a=s.toArray(),b=new Blob([new Uint8Array(a)],{type:"application/pdf"}),c=URL.createObjectURL(b);d(c)},o,s,q)},!1)}}$(`#${n}`).find("img").attr("alt",""),$(`#${n}`).find("input").attr("aria-label",n)},this.showParameters=function(a){var b=a.parameters,d=[],e=0,f=function(a){return a.replace(/([.*+?^=!:()|\[\]\/\\])/g,"\\$1")},g=function(a,b,c){return a.replace(new RegExp(f(b),"g"),c)},h=function(){if(e<b.length){var f=b[e++];$.get("node_modules/cronapp-framework-js/components/reports/"+f.type+".parameter.html").done(function(a){d.push(g(a,"_field_",f.name)),h()})}else 0<d.length&&c.open({templateUrl:"node_modules/cronapp-framework-js/components/reports/reports.parameters.html",controller:"ParameterController",resolve:{report:function(){return JSON.parse(JSON.stringify(a))},htmlParameters:function(){return JSON.parse(JSON.stringify(d))}}})}.bind(this);h()},this.mergeParam=function(a,b){var c=function(a,b){for(var c in Object.keys(b))if(d(b[c])){var e=Object.keys(b[c])[0];if(a==e)return Object.values(b[c])[0]}};let d=a=>{let b={}.constructor;return a&&b===a.constructor};for(var e in Object.keys(a)){var f=a[e].name,g=a[e].value,h=c(f,b);h?a[e].value=h:Array.isArray(b)&&!d(b[e])&&(a[e].value=b[e])}return a},this.setVariablesBasedOnParams=function(a,b){for(var c in b){var d=Object.keys(b[c])[0],e=b[c][d];for(var f in a)if(a[f]&&a[f].Name&&a[f].Name===d){a[f].Value=e;break}}},this.hasParameterWithOutValue=function(a){var b=!1;for(var c in Object.keys(a))if(!a[c].value)return!0;return!1},this.getDatasourcesInBand=function(a){var b=new Stimulsoft.Report.StiReport;b.load(a);var c=stimulsoftHelper.getDatasourcesInBand(b);return c},this.loadSriptsStimulsoft=function(a){var b=!0,c=k.length,d=0;Pace.options.initialRate=.7,Pace.options.minTime=1750,Pace.options.maxProgressPerFrame=1,Pace.options.ghostTime=12e4;let e=setInterval(()=>Pace.restart(),2500);k.forEach(function(f,g){this.loadScript(f,function(f){d++,f||(b=!1),d==c&&(clearInterval(e),Pace.options.initialRate=.03,Pace.options.minTime=250,Pace.options.maxProgressPerFrame=20,Pace.options.ghostTime=10,Pace.stop(),a(b))})}.bind(this))},this.loadScript=function(a,b){if(0<=$.inArray(a,l))return void(b&&b(!0));if(-1!=a.indexOf(".css")){var c=document.createElement("link");c.rel="stylesheet",c.type="text/css",c.href=a,c.media="all",c.onload=function(){l.push(a),b&&b(!0)},c.onerror=function(){b&&b(!1)};try{document.getElementsByTagName("head")[0].appendChild(c)}catch(a){console.log(a)}}else{var d=document.createElement("script");d.type="text/javascript",d.readyState?d.onreadystatechange=function(){("loaded"==d.readyState||"complete"==d.readyState)&&(d.onreadystatechange=null,l.push(a),b&&b(!0))}:d.onload=function(){l.push(a),b&&b(!0)},d.src=a,document.getElementsByTagName("head")[0].appendChild(d)}},this.openReport=function(a,b,c){this.getReport(a).then(function(a){a&&a.data&&(a.data.reportName.endsWith(".report")?this.loadSriptsStimulsoft(function(e){e?(this.initializeStimulsoft(d.use()),this.getContentAsString(a.data).then(function(e){var f=this.getDatasourcesInBand(e.data);this.getDataSourcesParams(f).then(function(g){f=g.data,a.data.parameters=stimulsoftHelper.parseToGroupedParam(f.datasources),a.data.contentData=e.data,a.data.datasourcesInBand=f,b&&(a.data.parameters=this.mergeParam(a.data.parameters,b),a.data.contentData.Dictionary=a.data.contentData.Dictionary||{},this.setVariablesBasedOnParams(a.data.contentData.Dictionary.Variables,b)),this.hasParameterWithOutValue(a.data.parameters)&&!c?(a.data.parameters.forEach(function(a){a.name=d.instant(a.name)}),this.showParameters(JSON.parse(JSON.stringify(a.data)))):this.openStimulsoftReport(e.data,a.data.parameters,a.data.datasourcesInBand,c)}.bind(this))}.bind(this),function(a){var b=cronapi.internal.getErrorMessage(a,a.statusText);j.Notification.error(b)}.bind(this))):j.Notification.error("Error loading report script")}.bind(this)):0==a.data.parameters.length||1==a.data.parameters.length&&"DATA_LIMIT"==a.data.parameters[0].name?this.getPDFAsFile(a.data.reportName).then(function(a){this.openURLContent(a.data)}.bind(this),function(a){var b=cronapi.internal.getErrorMessage(a,a.statusText);j.Notification.error(b)}.bind(this)):(b&&(a.data.parameters=this.mergeParam(a.data.parameters,b)),this.hasParameterWithOutValue(a.data.parameters)?this.showParameters(JSON.parse(JSON.stringify(a.data))):this.getPDFAsFile(a.data).then(function(a){this.openURLContent(a.data)}.bind(this))))}.bind(this))}}])})(app);
|
package/js/app.js
CHANGED
|
@@ -308,12 +308,15 @@ var app = (function() {
|
|
|
308
308
|
pageName = currentRoute.name
|
|
309
309
|
}
|
|
310
310
|
|
|
311
|
+
let isCrud = $('form[crn-datasource]').length;
|
|
311
312
|
let prettyPageName = window.camelCaseToSentenceCase(window.toCamelCase(pageName.split('?')[0].replace("/", "")));
|
|
312
313
|
// Get the H1 or H2 text to concat with the App name to set the title page
|
|
313
|
-
if (
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
314
|
+
if (isCrud) {
|
|
315
|
+
if ($('h1.title').length){
|
|
316
|
+
prettyPageName = $('h1.title').text();
|
|
317
|
+
} else if ($('h2.title').length){
|
|
318
|
+
prettyPageName = $('h2.title').text();
|
|
319
|
+
}
|
|
317
320
|
}
|
|
318
321
|
|
|
319
322
|
let title = '';
|
|
@@ -97,6 +97,8 @@
|
|
|
97
97
|
options.toolbar.showAboutButton = false;
|
|
98
98
|
options.appearance.showTooltipsHelp = false;
|
|
99
99
|
if (config) {
|
|
100
|
+
options.toolbar.showOpenButton = false;
|
|
101
|
+
options.exports.showExportToDocument = false;
|
|
100
102
|
options.toolbar.visible = config.showToolbar;
|
|
101
103
|
options.appearance.scrollbarsMode = config.showScrollbar;
|
|
102
104
|
if (config.height != undefined)
|
package/js/directives.js
CHANGED
|
@@ -38,11 +38,17 @@
|
|
|
38
38
|
enabled: {
|
|
39
39
|
public: true
|
|
40
40
|
},
|
|
41
|
+
render: {
|
|
42
|
+
public: true
|
|
43
|
+
},
|
|
41
44
|
notvisible: {
|
|
42
45
|
public: false
|
|
43
46
|
},
|
|
44
47
|
notenabled: {
|
|
45
48
|
public: false
|
|
49
|
+
},
|
|
50
|
+
notrender: {
|
|
51
|
+
public: false
|
|
46
52
|
}
|
|
47
53
|
}
|
|
48
54
|
|
|
@@ -588,6 +594,9 @@
|
|
|
588
594
|
restrict: 'A',
|
|
589
595
|
priority: Number.MIN_SAFE_INTEGER,
|
|
590
596
|
link: function(scope, element, attrs) {
|
|
597
|
+
if (attrs.cronappSecurity == '' || attrs.cronappSecurity == undefined || attrs.cronappSecurity == null) {
|
|
598
|
+
return;
|
|
599
|
+
}
|
|
591
600
|
var roles = [];
|
|
592
601
|
var user = JSON.parse(localStorage.getItem('_u'))
|
|
593
602
|
if (user && user.roles) {
|
|
@@ -597,6 +606,7 @@
|
|
|
597
606
|
var perms = parsePermission(attrs.cronappSecurity);
|
|
598
607
|
var show = false;
|
|
599
608
|
var enabled = false;
|
|
609
|
+
var render = false;
|
|
600
610
|
for (var i=0;i<roles.length;i++) {
|
|
601
611
|
var role = roles[i].trim();
|
|
602
612
|
if (role) {
|
|
@@ -606,6 +616,9 @@
|
|
|
606
616
|
if (perms.enabled[role]) {
|
|
607
617
|
enabled = true;
|
|
608
618
|
}
|
|
619
|
+
if (perms.render[role]) {
|
|
620
|
+
render = true;
|
|
621
|
+
}
|
|
609
622
|
}
|
|
610
623
|
}
|
|
611
624
|
|
|
@@ -618,6 +631,9 @@
|
|
|
618
631
|
if (perms.notenabled[role]) {
|
|
619
632
|
enabled = false;
|
|
620
633
|
}
|
|
634
|
+
if (perms.notrender[role]) {
|
|
635
|
+
render = false;
|
|
636
|
+
}
|
|
621
637
|
}
|
|
622
638
|
}
|
|
623
639
|
|
|
@@ -629,6 +645,9 @@
|
|
|
629
645
|
if (!enabled) {
|
|
630
646
|
$element.find('*').addBack().attr('disabled', true).off('click').on('click', e => e.preventDefault());
|
|
631
647
|
}
|
|
648
|
+
if (!render) {
|
|
649
|
+
$element.remove();
|
|
650
|
+
}
|
|
632
651
|
};
|
|
633
652
|
|
|
634
653
|
let wait = setInterval(()=>{
|
|
@@ -3047,7 +3066,7 @@
|
|
|
3047
3066
|
row.cells[cellIndex].format = "dd/mm/yyyy hh:mm:ss;@";
|
|
3048
3067
|
}
|
|
3049
3068
|
|
|
3050
|
-
if (row.type === "footer") {
|
|
3069
|
+
if (row.type === "footer" || row.type === "group-footer") {
|
|
3051
3070
|
if (row.cells[cellIndex].value) {
|
|
3052
3071
|
let rawValue = row.cells[cellIndex].value;
|
|
3053
3072
|
let content = $(rawValue)[0].innerHTML;
|
|
@@ -3133,10 +3152,7 @@
|
|
|
3133
3152
|
},
|
|
3134
3153
|
change: function(e) {
|
|
3135
3154
|
var item = this.dataItem(this.select());
|
|
3136
|
-
|
|
3137
|
-
if (!manyHiddenSelect) {
|
|
3138
|
-
setToActiveInCronappDataSource.bind(this)(item);
|
|
3139
|
-
}
|
|
3155
|
+
setToActiveInCronappDataSource.bind(this)(item);
|
|
3140
3156
|
var cronappDatasource = this.dataSource.transport.options.cronappDatasource;
|
|
3141
3157
|
if(options.fieldType && options.fieldType === 'key'){
|
|
3142
3158
|
cronappDatasource.active = helperDirective.changeObjectField(cronappDatasource, cronappDatasource.active);
|
|
@@ -3680,7 +3696,6 @@
|
|
|
3680
3696
|
var parent = element.parent();
|
|
3681
3697
|
$(parent).append('<input style="width: 100%;" '+ id + name + ' class="cronSelect"/>');
|
|
3682
3698
|
var $element = $(parent).find('input.cronSelect');
|
|
3683
|
-
var cronDisabled = attrs.cronDisabled;
|
|
3684
3699
|
var options = await app.kendoHelper.getConfigCombobox(select, scope);
|
|
3685
3700
|
options.close = attrs.ngClose ? function (){scope.$eval(attrs.ngClose)}: undefined;
|
|
3686
3701
|
options.dataBound = attrs.ngDataBound ? function (){scope.$eval(attrs.ngDataBound)}: undefined;
|
|
@@ -3732,11 +3747,9 @@
|
|
|
3732
3747
|
}
|
|
3733
3748
|
};
|
|
3734
3749
|
initializeAttrAndEvents();
|
|
3735
|
-
|
|
3736
|
-
combobox.enable(
|
|
3737
|
-
}
|
|
3738
|
-
combobox.enable(true);
|
|
3739
|
-
}
|
|
3750
|
+
scope.$watch(attrs.cronDisabled, function(newValue) {
|
|
3751
|
+
combobox.enable(!newValue);
|
|
3752
|
+
});
|
|
3740
3753
|
|
|
3741
3754
|
var _scope = scope;
|
|
3742
3755
|
var _ngModelCtrl = ngModelCtrl;
|
|
@@ -3902,7 +3915,6 @@
|
|
|
3902
3915
|
var self = this;
|
|
3903
3916
|
var parentDS = {};
|
|
3904
3917
|
var textField = null;
|
|
3905
|
-
var cronDisabled = attrs.cronDisabled;
|
|
3906
3918
|
try {
|
|
3907
3919
|
select = JSON.parse(attrs.options);
|
|
3908
3920
|
parentDS = this.getActive(attrs.ngModel);
|
|
@@ -4129,16 +4141,25 @@
|
|
|
4129
4141
|
}
|
|
4130
4142
|
}
|
|
4131
4143
|
|
|
4144
|
+
let returnTypedValue = (value) => {
|
|
4145
|
+
if (dataSourceScreen.schema) {
|
|
4146
|
+
let fieldInfo = dataSourceScreen.schema.find(s=> s.name === options.dataValueField);
|
|
4147
|
+
if (fieldInfo && fieldInfo.type !== 'String') {
|
|
4148
|
+
value = parseFloat(value) || value;
|
|
4149
|
+
}
|
|
4150
|
+
}
|
|
4151
|
+
return value;
|
|
4152
|
+
};
|
|
4153
|
+
|
|
4132
4154
|
/**
|
|
4133
4155
|
* Observa o read do datasource para setar o primeiro valor ou valor inicial.
|
|
4134
4156
|
*/
|
|
4135
|
-
|
|
4136
4157
|
var defineInitialValue = function() {
|
|
4137
4158
|
if (combobox.definingInitialValue) {
|
|
4138
4159
|
return;
|
|
4139
4160
|
}
|
|
4140
4161
|
if (!combobox.isEvaluating) {
|
|
4141
|
-
var currentValue = combobox.value();
|
|
4162
|
+
var currentValue = returnTypedValue(combobox.value());
|
|
4142
4163
|
var nextValue = null;
|
|
4143
4164
|
|
|
4144
4165
|
var found = dataSourceScreen.goTo(currentValue);
|
|
@@ -4325,11 +4346,9 @@
|
|
|
4325
4346
|
|
|
4326
4347
|
$(element).remove();
|
|
4327
4348
|
|
|
4328
|
-
|
|
4329
|
-
combobox.enable(
|
|
4330
|
-
}
|
|
4331
|
-
combobox.enable(true);
|
|
4332
|
-
}
|
|
4349
|
+
scope.$watch(attrs.cronDisabled, function(newValue) {
|
|
4350
|
+
combobox.enable(!newValue);
|
|
4351
|
+
});
|
|
4333
4352
|
|
|
4334
4353
|
$("[aria-owns='" + `${attrs.id}_listbox` + "']").attr('aria-label', $translate.instant('template.crud.search'));
|
|
4335
4354
|
}
|
|
@@ -4344,7 +4363,6 @@
|
|
|
4344
4363
|
var modelGetter = $parse(attrs['ngModel']);
|
|
4345
4364
|
var modelSetter = modelGetter.assign;
|
|
4346
4365
|
var model = attrs['ngModel'];
|
|
4347
|
-
var cronDisabled = attrs.cronDisabled;
|
|
4348
4366
|
|
|
4349
4367
|
var _self = this;
|
|
4350
4368
|
var select = {};
|
|
@@ -4481,11 +4499,9 @@
|
|
|
4481
4499
|
deselect = attrs.ngDeselect ? function (){_scope.$eval(attrs.ngDeselect)}: undefined;
|
|
4482
4500
|
|
|
4483
4501
|
var combobox = $element.kendoMultiSelect(options).data('kendoMultiSelect');
|
|
4484
|
-
|
|
4485
|
-
combobox.enable(
|
|
4486
|
-
}
|
|
4487
|
-
combobox.enable(true);
|
|
4488
|
-
}
|
|
4502
|
+
scope.$watch(attrs.cronDisabled, function(newValue) {
|
|
4503
|
+
combobox.enable(!newValue);
|
|
4504
|
+
});
|
|
4489
4505
|
app.kendoHelper.receivePushData(combobox);
|
|
4490
4506
|
|
|
4491
4507
|
$("[aria-describedby='" + `${attrs.id}_taglist` + "']").attr('id', `${attrs.id}-container`);
|
|
@@ -4555,7 +4571,6 @@
|
|
|
4555
4571
|
options.select = attrs.ngSelect ? function (){scope.$eval(attrs.ngSelect);}: undefined;
|
|
4556
4572
|
var parent = element.parent();
|
|
4557
4573
|
var id = attrs.id ? ' id="' + attrs.id + '"' : '';
|
|
4558
|
-
var cronDisabled = attrs.cronDisabled;
|
|
4559
4574
|
var name = attrs.name ? ' name="' + attrs.name + '"' : '';
|
|
4560
4575
|
var validationmessage = attrs.validationmessage ? ' validationmessage="' + attrs.validationmessage + '"' : '';
|
|
4561
4576
|
var required = '';
|
|
@@ -4588,11 +4603,9 @@
|
|
|
4588
4603
|
|
|
4589
4604
|
var autoComplete = $element.kendoAutoComplete(options).data('kendoAutoComplete');
|
|
4590
4605
|
|
|
4591
|
-
|
|
4592
|
-
autoComplete.enable(
|
|
4593
|
-
}
|
|
4594
|
-
autoComplete.enable(true);
|
|
4595
|
-
}
|
|
4606
|
+
scope.$watch(attrs.cronDisabled, function(newValue) {
|
|
4607
|
+
autoComplete.enable(!newValue);
|
|
4608
|
+
});
|
|
4596
4609
|
|
|
4597
4610
|
if (ngModelCtrl) {
|
|
4598
4611
|
ngModelCtrl.$formatters.push(function (value) {
|
|
@@ -5181,7 +5194,11 @@
|
|
|
5181
5194
|
|
|
5182
5195
|
// Capturar a url da pagina
|
|
5183
5196
|
let page = document.location.hash;
|
|
5184
|
-
page
|
|
5197
|
+
if (page === "") {
|
|
5198
|
+
page = "home"
|
|
5199
|
+
} else {
|
|
5200
|
+
page = page.split("/");
|
|
5201
|
+
}
|
|
5185
5202
|
|
|
5186
5203
|
inicio(subMenuOptions);
|
|
5187
5204
|
|
|
@@ -5241,7 +5258,7 @@
|
|
|
5241
5258
|
|
|
5242
5259
|
} else {
|
|
5243
5260
|
if (action) {
|
|
5244
|
-
if (action[action.length - 1] === page[page.length - 1]) {
|
|
5261
|
+
if (action[action.length - 1] === page[page.length - 1] || action[action.length - 1] === page) {
|
|
5245
5262
|
x = true;
|
|
5246
5263
|
}
|
|
5247
5264
|
}
|
|
@@ -5349,6 +5366,16 @@
|
|
|
5349
5366
|
ctrl.$formatters = [];
|
|
5350
5367
|
ctrl.$parsers = [];
|
|
5351
5368
|
|
|
5369
|
+
let rawValueToAngularPattern = (value) => {
|
|
5370
|
+
if (value && value.indexOf("'") === -1) {
|
|
5371
|
+
value = `'${value}'`;
|
|
5372
|
+
}
|
|
5373
|
+
return value;
|
|
5374
|
+
}
|
|
5375
|
+
|
|
5376
|
+
attrs.ngFalseValue = rawValueToAngularPattern(attrs.ngFalseValue);
|
|
5377
|
+
attrs.ngTrueValue = rawValueToAngularPattern(attrs.ngTrueValue);
|
|
5378
|
+
|
|
5352
5379
|
let falseValue = attrs.ngFalseValue ? attrs.ngFalseValue.split("'").join("") : false;
|
|
5353
5380
|
let trueValue = attrs.ngTrueValue ? attrs.ngTrueValue.split("'").join("") : true;
|
|
5354
5381
|
|
|
@@ -5452,74 +5479,83 @@
|
|
|
5452
5479
|
'$scope',
|
|
5453
5480
|
function($scope) {
|
|
5454
5481
|
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
|
|
5458
|
-
|
|
5459
|
-
|
|
5460
|
-
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
} else {
|
|
5464
|
-
signature.dataUrl = EMPTY_IMAGE;
|
|
5465
|
-
signature.isEmpty = true;
|
|
5466
|
-
}
|
|
5482
|
+
let getBinaryFromSignature = () => {
|
|
5483
|
+
let binary = $scope.signaturePad.toDataURL();
|
|
5484
|
+
if (binary) {
|
|
5485
|
+
binary = binary.split(',')[1];
|
|
5486
|
+
}
|
|
5487
|
+
return binary;
|
|
5488
|
+
}
|
|
5467
5489
|
|
|
5468
|
-
|
|
5469
|
-
|
|
5470
|
-
|
|
5471
|
-
|
|
5472
|
-
|
|
5473
|
-
};
|
|
5490
|
+
$scope.mouseup = function(e) {
|
|
5491
|
+
if (!$scope.signaturePad.isEmpty()) {
|
|
5492
|
+
$scope.ngModel = getBinaryFromSignature();
|
|
5493
|
+
}
|
|
5494
|
+
};
|
|
5474
5495
|
|
|
5475
|
-
|
|
5496
|
+
$scope.$watch('ngModel', function(value, old) {
|
|
5497
|
+
if (value !== old) {
|
|
5498
|
+
if (getBinaryFromSignature() !== value) {
|
|
5499
|
+
$scope.signaturePad.fromDataURL("data:image/png;base64," + value, {
|
|
5500
|
+
ratio: 1
|
|
5501
|
+
});
|
|
5502
|
+
}
|
|
5503
|
+
$scope.ngModel = value;
|
|
5504
|
+
}
|
|
5505
|
+
}, true);
|
|
5476
5506
|
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5507
|
+
$scope.clear = function() {
|
|
5508
|
+
$scope.signaturePad.clear();
|
|
5509
|
+
$scope.ngModel = null;
|
|
5510
|
+
};
|
|
5511
|
+
}
|
|
5512
|
+
],
|
|
5513
|
+
link: function(scope, element, attrs, ngModelCtrl, $timeout) {
|
|
5514
|
+
canvas = element.find('canvas')[0];
|
|
5484
5515
|
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
};
|
|
5516
|
+
scope.onResize = function() {
|
|
5517
|
+
var ratio = Math.max($window.devicePixelRatio || 1, 1);
|
|
5518
|
+
var canvas = element.find('canvas')[0];
|
|
5489
5519
|
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5520
|
+
var refCanvas = document.createElement('canvas');
|
|
5521
|
+
refCanvas.width = canvas.width;
|
|
5522
|
+
refCanvas.height = canvas.height;
|
|
5523
|
+
var refCtx = refCanvas.getContext('2d');
|
|
5524
|
+
refCtx.drawImage(canvas, 0, 0);
|
|
5494
5525
|
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5526
|
+
canvas.width = canvas.offsetWidth * ratio;
|
|
5527
|
+
canvas.height = canvas.offsetHeight * ratio;
|
|
5528
|
+
canvas.getContext("2d").drawImage(refCanvas, 0, 0);
|
|
5529
|
+
canvas.getContext("2d").scale(ratio, ratio);
|
|
5530
|
+
};
|
|
5498
5531
|
|
|
5499
|
-
|
|
5500
|
-
refCanvas.width = canvas.width;
|
|
5501
|
-
refCanvas.height = canvas.height;
|
|
5502
|
-
var refCtx = refCanvas.getContext('2d');
|
|
5503
|
-
refCtx.drawImage(canvas, 0, 0);
|
|
5532
|
+
scope.onResize();
|
|
5504
5533
|
|
|
5505
|
-
|
|
5506
|
-
canvas.height = canvas.offsetHeight * ratio;
|
|
5507
|
-
canvas.getContext("2d").drawImage(refCanvas, 0, 0);
|
|
5508
|
-
canvas.getContext("2d").scale(ratio, ratio);
|
|
5509
|
-
}
|
|
5534
|
+
scope.signaturePad = new SignaturePad(canvas);
|
|
5510
5535
|
|
|
5511
|
-
|
|
5536
|
+
angular.element($window).on('resize', function() {
|
|
5537
|
+
scope.onResize();
|
|
5538
|
+
});
|
|
5512
5539
|
|
|
5513
|
-
|
|
5540
|
+
$compile(element)(element.scope());
|
|
5514
5541
|
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5542
|
+
let mouseButtonDown = false;
|
|
5543
|
+
$(canvas).on('pointerdown',(e) => {
|
|
5544
|
+
if (e.which === 1) {
|
|
5545
|
+
mouseButtonDown = true;
|
|
5546
|
+
}
|
|
5547
|
+
e.preventDefault();
|
|
5548
|
+
});
|
|
5549
|
+
$(canvas).on('pointerup',(e) => {
|
|
5550
|
+
if (e.which === 1 && mouseButtonDown) {
|
|
5551
|
+
mouseButtonDown = false;
|
|
5552
|
+
$timeout(() => angular.element(canvas).triggerHandler('mouseup'));
|
|
5553
|
+
}
|
|
5554
|
+
});
|
|
5518
5555
|
|
|
5519
|
-
$compile(element)(element.scope());
|
|
5520
5556
|
}
|
|
5521
5557
|
};
|
|
5522
|
-
|
|
5558
|
+
})
|
|
5523
5559
|
|
|
5524
5560
|
.directive('cronChat', ['$compile', '$translate', function($compile, $translate) {
|
|
5525
5561
|
return {
|
|
@@ -307,17 +307,28 @@
|
|
|
307
307
|
this.mergeParam = function(parameters, params) {
|
|
308
308
|
var getValue = function(key, json) {
|
|
309
309
|
for (var i in Object.keys(json)) {
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
310
|
+
if (isJsonContent(json[i])) {
|
|
311
|
+
var k = Object.keys(json[i])[0];
|
|
312
|
+
if (key == k)
|
|
313
|
+
return Object.values(json[i])[0];
|
|
314
|
+
}
|
|
313
315
|
}
|
|
314
316
|
};
|
|
317
|
+
let isJsonContent = (content) => {
|
|
318
|
+
let jsonConstructor = ({}).constructor;
|
|
319
|
+
return (content && jsonConstructor === content.constructor);
|
|
320
|
+
};
|
|
321
|
+
|
|
315
322
|
for (var i in Object.keys(parameters)) {
|
|
316
323
|
var k = parameters[i].name;
|
|
317
324
|
var v = parameters[i].value;
|
|
318
325
|
var valueParam = getValue(k, params);
|
|
319
326
|
if (valueParam) {
|
|
320
327
|
parameters[i].value = valueParam;
|
|
328
|
+
} else {
|
|
329
|
+
if (Array.isArray(params) && !isJsonContent(params[i])) {
|
|
330
|
+
parameters[i].value = params[i];
|
|
331
|
+
}
|
|
321
332
|
}
|
|
322
333
|
}
|
|
323
334
|
return parameters;
|