cronapp-framework-js 3.0.0-SP.52 → 3.0.0-SP.54
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,13 +1,13 @@
|
|
|
1
1
|
<div class="form-group">
|
|
2
2
|
<label for="">Label</label>
|
|
3
|
-
<ui-select crn-datasource=""
|
|
3
|
+
<ui-select crn-datasource="" ng-model="datasource.active" ng-disabled="disabled" theme="bootstrap" class="crn-select" ng-required="false">
|
|
4
4
|
<ui-select-match placeholder="Select..." class="">
|
|
5
5
|
{{$select.selected}}
|
|
6
6
|
</ui-select-match>
|
|
7
7
|
<ui-select-choices repeat="rowData as rowData in datasource.data | filter : $select.search" class="" refresh="" refresh-deplay="">
|
|
8
|
-
<div
|
|
9
|
-
{{rowData
|
|
8
|
+
<div class="">
|
|
9
|
+
{{rowData}}
|
|
10
10
|
</div>
|
|
11
11
|
</ui-select-choices>
|
|
12
12
|
</ui-select>
|
|
13
|
-
</div>
|
|
13
|
+
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<cron-calendar ng-model="vars.cronCalendar${RANDOM}" options=""></cron-calendar>
|
|
1
|
+
<cron-calendar ng-model="vars.cronCalendar${RANDOM}" options=""></cron-calendar>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<div class="form-group"><label for="">Label</label><ui-select crn-datasource="" ng-model="datasource.active" ng-disabled="disabled" theme="bootstrap" class="crn-select" ng-required="false"><ui-select-match placeholder="Select..." class="">{{$select.selected}}</ui-select-match><ui-select-choices repeat="rowData as rowData in datasource.data | filter : $select.search" class="" refresh="" refresh-deplay=""><div
|
|
1
|
+
<div class="form-group"><label for="">Label</label><ui-select crn-datasource="" ng-model="datasource.active" ng-disabled="disabled" theme="bootstrap" class="crn-select" ng-required="false"><ui-select-match placeholder="Select..." class="">{{$select.selected}}</ui-select-match><ui-select-choices repeat="rowData as rowData in datasource.data | filter : $select.search" class="" refresh="" refresh-deplay=""><div class="">{{rowData}}</div></ui-select-choices></ui-select></div>
|
package/dist/js/directives.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
maskDirectiveAsDate.$inject=["$compile","$translate","$parse"],maskDirectiveMask.$inject=["$compile","$translate","$parse"],cronReportViewer.$inject=["$compile"],cronFrame.$inject=["$compile","$sce","$parse"],function($app){var _Mathfloor=Math.floor;app.common={generateId:function(){var e=_Mathfloor(65536*(1+Math.random())).toString(16).substring(1);return-1<"0123456789".indexOf(e.substr(0,1))?this.generateId():e}};var isoDate=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/,ISO_PATTERN=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/;Number.MAX_SAFE_INTEGER_32=2147483647;var patternFormat=function(e){return e?$(e).attr("format")||"DD/MM/YYYY":"DD/MM/YYYY"},parsePermission=function(e){var t={visible:{public:!0},enabled:{public:!0},render:{public:!0},notvisible:{public:!1},notenabled:{public:!1},notrender:{public:!1}};if(e)for(var n,a=e.toLowerCase().trim().split(","),o=0;o<a.length;o++)if(n=a[o].trim(),n){var d=n.split(":");if(2==d.length){var l=d[0].trim(),r=d[1].trim();if(r){for(var s,c=r.split(";"),u={},m=0;m<c.length;m++)s=c[m].trim(),s&&(u[s]=!0);t[l]=u}}}return t};app.directive("cronCalendar",["$timeout",function(){return{restrict:"E",link:async function(e,t,n,a){let i=
|
|
1
|
+
maskDirectiveAsDate.$inject=["$compile","$translate","$parse"],maskDirectiveMask.$inject=["$compile","$translate","$parse"],cronReportViewer.$inject=["$compile"],cronFrame.$inject=["$compile","$sce","$parse"],function($app){var _Mathfloor=Math.floor;app.common={generateId:function(){var e=_Mathfloor(65536*(1+Math.random())).toString(16).substring(1);return-1<"0123456789".indexOf(e.substr(0,1))?this.generateId():e}};var isoDate=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/,ISO_PATTERN=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/;Number.MAX_SAFE_INTEGER_32=2147483647;var patternFormat=function(e){return e?$(e).attr("format")||"DD/MM/YYYY":"DD/MM/YYYY"},parsePermission=function(e){var t={visible:{public:!0},enabled:{public:!0},render:{public:!0},notvisible:{public:!1},notenabled:{public:!1},notrender:{public:!1}};if(e)for(var n,a=e.toLowerCase().trim().split(","),o=0;o<a.length;o++)if(n=a[o].trim(),n){var d=n.split(":");if(2==d.length){var l=d[0].trim(),r=d[1].trim();if(r){for(var s,c=r.split(";"),u={},m=0;m<c.length;m++)s=c[m].trim(),s&&(u[s]=!0);t[l]=u}}}return t};app.directive("cronCalendar",["$timeout",function(){return{restrict:"E",link:async function(e,t,n,a){let i={};try{i=JSON.parse(n.options)}catch(t){console.error(t)}const o=$(t),d=navigator.language||navigator.userLanguage,l=i.expressionInitialDate,r=i.expressionSelectDates,s=i.expressionDisableDates,c=i.expressionMinDate,p=i.expressionMaxDate,u=i.expressionOnChange,m=i.expressionOnNavigate,g=l?await e.$eval(generateBlocklyCall(l,!0)):new Date,f=r&&i.isSelectableMultiple?await e.$eval(generateBlocklyCall(r,!0)):[],h=s?await e.$eval(generateBlocklyCall(s,!0)):null,v=c?await e.$eval(generateBlocklyCall(c,!0)):new Date(1900,0,1),b=p?await e.$eval(generateBlocklyCall(p),!0):new Date(2099,11,31);o.kendoCalendar({culture:d.startsWith("pt")?"pt-BR":"en-US",componentType:i.isClassicType?"classic":"modern",selectable:i.isSelectableSingle?"single":"multiple",weekNumber:i.showWeekNumbers,value:g,selectDates:f,disableDates:h,min:v,max:b,start:i.startView});let y=o.data("kendoCalendar");y.bind("change",function(){this.value();u&&e.$eval(generateBlocklyCall(u))}),y.bind("navigate",function(){let t=this.view(),n=this.current();u&&e.$eval(generateBlocklyCall(m))})}}}]),app.directive("justGage",["$timeout",function(e){return{restrict:"EA",scope:{id:"@",class:"@",min:"=",max:"=",title:"@",label:"@",value:"@",options:"="},template:"<div id=\"{{id}}-justgage\" class=\"{{class}}\"></div>",link:function(t){e(function(){var e={id:t.id+"-justgage",min:t.min||0,max:t.max||100,title:t.title,label:t.label||"",value:t.value};if(t.options)for(var n in t.options)e[n]=t.options[n];var a=new JustGage(e);t.$watch("max",function(e){e!==void 0&&a.refresh(t.value,e)},!0),t.$watch("value",function(e){e!==void 0&&a.refresh(e)},!0)})}}}]),app.directive("crnAnchor",["$rootScope","$location","$anchorScroll",function(e,t,n){return{restrict:"A",link:function(e,t,a){t.bind("click",function(){let e=a.crnAnchor;n(e),$("#"+e).get(0).focus()})}}}]),app.directive("input",transformText),app.directive("textarea",transformText);var generateBlocklyCall=function(e,t){var n="";if(!e)return n;if("client"==e.type){n="cronapi.client('"+e.blocklyClass+"."+e.blocklyMethod+"')";var a="";e.blocklyParams.forEach(function(e){0<a.length&&(a+=", "),a+=e.value?e.value:"null"}),n+=".run("+a+")"}else if("server"==e.type){var i=e.blocklyClass+"."+e.blocklyMethod;n="cronapi.server('"+i+"')"+(t?".toPromise()":"");var a="";e.blocklyParams.forEach(function(e){0<a.length&&(a+=", "),a+=e.value?e.value:"null"}),n+=".run("+a+")"}return n};app.directive("asDate",maskDirectiveAsDate).directive("ngDestroy",function(){return{restrict:"A",link:function(scope,element,attrs,ctrl){element.on("$destroy",function(){attrs.ngDestroy&&0<attrs.ngDestroy.length&&(-1<attrs.ngDestroy.indexOf("app.")||-1<attrs.ngDestroy.indexOf("blockly.")?scope.$eval(attrs.ngDestroy):eval(attrs.ngDestroy))})}}}).directive("dynamicImage",["$compile",function(e){return{restrict:"E",replace:!0,scope:{ngModel:"@",width:"@",height:"@",style:"@",class:"@"},require:"ngModel",template:"<div></div>",init:function(e){e.ngModel||(e.ngModel=""),e.width||(e.width="128"),e.height||(e.height="128"),e.style||(e.style=""),e.class||(e.class=""),this.containsLetter(e.width)||(e.width+="px"),this.containsLetter(e.height)||(e.height+="px")},containsLetter:function(e){for(var t,n=0;n<e.length;n++){t=!0;for(var a=0;10>a;a++)parseInt(e[n])==a&&(t=!1);if(t)break}return t},link:function(t,n,a){this.init(t);var i=t,o=a.ngRequired&&"true"==a.ngRequired?"required":"";n.append("<div class=\"form-group upload-image-component\" ngf-drop=\"\" ngf-drag-over-class=\"dragover\"> <img class=\"$class$\" style=\"$style$; height: $height$; width: $width$;\" ng-if=\"$ngModel$\" data-ng-src=\"{{$ngModel$.startsWith('http') || ($ngModel$.startsWith('/') && $ngModel$.length < 1000)? $ngModel$ : 'data:image/png;base64,' + $ngModel$}}\"> <img class=\"$class$\" style=\"$style$; height: $height$; width: $width$;\" ng-if=\"!$ngModel$\" data-ng-src=\"/plugins/cronapp-framework-js/img/selectImg.svg\" class=\"btn\" ng-if=\"!$ngModel$\" ngf-drop=\"\" ngf-select=\"\" ngf-change=\"cronapi.internal.setFile('$ngModel$', $file)\" accept=\"image/*;capture=camera\"> <button class=\"remove btn btn-danger btn-xs\" ng-if=\"$ngModel$\" ng-click=\"$ngModel$=null\"> <span class=\"glyphicon glyphicon-remove\"></span> <span class=\"sr-only\">{{\"Remove\" | translate}}</span> </button> <button class=\"btn btn-info btn-xs start-camera-button\" ng-if=\"!$ngModel$\" ng-click=\"cronapi.internal.startCamera('$ngModel$')\"> <span class=\"glyphicon glyphicon-facetime-video\"></span> <span class=\"sr-only\">{{\"Upload.camera\" | translate}}</span> </button> <input ng-if=\"!$ngModel$\" autocomplete=\"off\" tabindex=\"-1\" class=\"uiSelectRequired ui-select-offscreen\" style=\"top: inherit !important; margin-left: 85px !important;margin-top: 50px !important;\" type=text ng-model=\"$ngModel$\" $required$> </div>".split("$height$").join(i.height).split("$width$").join(i.width).split("$ngModel$").join(i.ngModel).split("$style$").join(i.style).split("$class$").join(i.class).split("$required$").join(o)),e(n)(n.scope())}}}]).directive("dynamicImage",["$compile","$translate",function(e,t){return{restrict:"A",scope:!0,require:"ngModel",link:function(n,a,i){var o=i.ngRequired&&"true"==i.ngRequired?"required":"",d=a.html();const l=i.objectFit||"unset";let r=`<div ngf-drop="" ngf-drag-over-class="dragover" style="display: flex; justify-content: center; width: 100%; height: 100%; position: relative; ">
|
|
2
2
|
<img alt="$picture$" style="width: 100%; object-fit: ${l}" ng-if="$ngModel$"
|
|
3
3
|
data-ng-src="{{$ngModel$.startsWith(\'http\') || ($ngModel$.startsWith(\'/\') && $ngModel$.length < 1000)? $ngModel$ : \'data:image/png;base64,\' + $ngModel$}}">
|
|
4
4
|
<input id="$id$" aria-label="$userHtml$" ng-if="!$ngModel$" autocomplete="off" tabindex="-1"
|
|
@@ -52,4 +52,4 @@ maskDirectiveAsDate.$inject=["$compile","$translate","$parse"],maskDirectiveMask
|
|
|
52
52
|
${s} ${c} ${l}
|
|
53
53
|
</a>
|
|
54
54
|
${n(e.menuItems)}
|
|
55
|
-
</li>`}),i},link:function(n,a,i){var o=this.populateMenu;i.$observe("options",function(d){t.onReady(()=>{let t=a.closest(".crn-navigator-vertical").length;var l={};try{l=JSON.parse(d)}catch(t){console.log("CronDynamicMenu: Invalid configuration!")}let r=l&&l.subMenuOptions&&l.subMenuOptions.length?l.subMenuOptions[0].id:"first";var s=`<ul id="menu-tag-ul-base-${r}" class="nav navbar-nav ${t?"col-md-12 padding-0":""}" ></ul>`,c=$(s);c.attr("id",i.id);var p=o(l,t);c.append(p),t&&c.append($("#navbar2 li:first").addClass("col-md-12 padding-0"));var u=angular.element(c);a.html(""),a.append(c),a.attr("id",null),e(u)(n);var m=i.multilevelAction;"hover"===m&&($(".dropdown-menu .dropdown-submenu").on("mouseover",function(){var e=$(this).children("ul.dropdown-menu");e.addClass("displayBlock")}),$(".dropdown-menu .dropdown-submenu").on("mouseout",function(){var e=$(this).children("ul.dropdown-menu");e.removeClass("displayBlock")})),"click"===m&&$(".dropdown-menu a.dropdown-toggle").on("click",function(t){$(this).next().hasClass("show")||$(this).parents(".dropdown-menu").first().find(".show").removeClass("show");var e=$(this).next(".dropdown-menu");return e.toggleClass("show"),$(this).parents("li.nav-item.dropdown").on("hidden.bs.dropdown",function(t){$(".dropdown-submenu .show").removeClass("show")}),!1}),$("#checkCollapsibleMenu").on("click",function(){var e=document.getElementById("main-view");this.checked?e.classList.remove("main-view-retratil"):e.classList.add("main-view-retratil")});let g=a.closest("nav");if(g&&g.length){let e=!g.hasClass("submenu-click"),t=g.attr("id");if(t||(t=app.common.generateId(),g.attr("id",t)),e){let e=$(`#${t} .dropdown-submenu`).data("hooked");e||($(`#${t} .dropdown-submenu`).on("mouseenter",function(t){$(this).children(".dropdown-menu").addClass("show")}).on("mouseleave",function(t){$(this).children(".dropdown-menu").removeClass("show")}),$(`#${t} .dropdown-submenu`).data("hooked",!0))}else{let e=$(`#${t} .dropdown-menu a.dropdown-toggle`).data("hooked");e||($(`#${t} .dropdown-menu a.dropdown-toggle`).on("click",function(t){$(this).next().hasClass("show")||$(this).parents(".dropdown-menu").first().find(".show").removeClass("show");var e=$(this).next(".dropdown-menu");return e.toggleClass("show"),$(this).parents("li.nav-item.dropdown.show").on("hidden.bs.dropdown",function(t){$(".dropdown-submenu .show").removeClass("show")}),!e.length&&void $(".dropdown-menu").removeClass("show")}),$(`#${t} .dropdown-menu a.dropdown-toggle`).data("hooked",!0));let n=$(`#${t} .dropdown.nav-item`).data("hooked");n||($(`#${t} .dropdown.nav-item`).on("hidden.bs.dropdown",function(t){$(".dropdown-submenu .show").removeClass("show"),$(".dropdown-menu .show").removeClass("show")}),$(`#${t} .dropdown.nav-item`).data("hooked",!0))}}else{let e=$(a).find("ul:first").attr("id"),t=$(`#${e} .dropdown-submenu`).data("hooked");t||($(`#${e} .dropdown-submenu`).on("mouseenter",function(t){$(this).children(".dropdown-menu").addClass("show")}).on("mouseleave",function(t){$(this).children(".dropdown-menu").removeClass("show")}),$(`#${e} .dropdown-submenu`).data("hooked",!0))}})})}}}]).directive("cronBreadcrumbs",["$rootScope",function(e){"use strict";return{restrict:"E",replace:!0,link:function(e,t,n){var a=n.ngInit?n.ngInit:null;const i=n.crnDelimiterIcon,o=n.typeMenu,d=n.idMenu?n.idMenu:null,l=n.id,r=n.breadcrumbIcon?n.breadcrumbIcon:null,s=[],c=async()=>{const t=a.replace("cronapi.client('js.","blockly.js.");a=t.replace("').run()",""),a=e.$eval(a),s=await a();const n=async t=>{t.item.action&&t.item.action()};$(`#${l}`).kendoBreadcrumb({items:s,delimiterIcon:i,navigational:!0,click:n})},p=e=>e?e.replace("cronapi.screen.changeView('","").replace("', [])",""):"#/home";if(a&&"idBloco"===o)c();else{var u=new MutationObserver((e,t)=>{const n=$(`#${d}`).parent(),a=n.attr("options");if(a){t.disconnect();const e=JSON.parse(a),n=document.location.hash||"home",d=(e,t,n=[])=>{for(let o=0;o<e.length;o++){var a=e[o];if(a.action=p(a.action),a.action===t)return[...n,a];if(a.menuItems){const e=d(a.menuItems,t,[...n,a]);if(e)return e}}return null},r=d(e.subMenuOptions,n);if(r){for(var o in r){const e=r[o];s.push({type:0==o?"rootitem":"item",href:e.action,text:e.title,showText:!0,showIcon:!1})}$(`#${l}`).kendoBreadcrumb({items:s,delimiterIcon:i,navigational:!0})}}});u.observe(document.body,{childList:!0})}}}}]).directive("ngInitialValue",["$parse",function(e){return{restrict:"A",require:"ngModel",link:async function(t,n,a,i){if(a.ngInitialValue){var o,d=e(a.ngModel),l=d.assign;try{if(-1!=a.ngInitialValue.indexOf("cronapi.client('js.")){let e=a.ngInitialValue.replace("cronapi.client('js.","blockly.js."),n=e.split("').names")[0];n=n.split("').attr()")[0];let i=e.split(".run")[1];o=await t.$eval(n+i)}else o=t.$eval(a.ngInitialValue)||a.ngInitialValue}catch(t){o=a.ngInitialValue}"checkbox"==n[0].type&&o&&(o="true"==(""+o).toLowerCase()),l(t,o)}}}}]).directive("crnSetIndeterminate",["$parse",function($parse){return{restrict:"A",link:function(scope,element,attrs){let value=eval(attrs.crnSetIndeterminate);null===value&&$(element).prop("indeterminate",!0)}}}]).directive("crnAllowNullValues",[function(){return{restrict:"A",require:"?ngModel",link:function(e,t,n,a){a.$formatters=[],a.$parsers=[];let i=e=>(e&&-1===e.indexOf("'")&&(e=`'${e}'`),e);n.ngFalseValue=i(n.ngFalseValue),n.ngTrueValue=i(n.ngTrueValue);let o=!!n.ngFalseValue&&n.ngFalseValue.split("'").join(""),d=!n.ngTrueValue||n.ngTrueValue.split("'").join(""),l=e=>"true"===e||void 0===e||null===e||0==e.length;a.$render=l(n.crnAllowNullValues)?function(){let e=a.$viewValue;t.data("checked",e),!0===e||e===d?(t.prop("indeterminate",!1),t.prop("checked",!0),e=d):!1===e||e===o?(t.prop("indeterminate",!1),t.prop("checked",!1),e=o):(e=null,t.prop("indeterminate",!0)),setTimeout(()=>a.$setViewValue(e))}:function(){let i=a.$viewValue;if((void 0===a.$viewValue||null===a.$viewValue)&&(a.$setViewValue(!1),i=!1),i===o){let a=n.ngFalseValue?`${t.attr("ng-model")}=${n.ngFalseValue}`:`${t.attr("ng-model")}=${o}`;e.$eval(a)}switch(t.data("checked",i),i){case!0:case d:t.prop("indeterminate",!1),t.prop("checked",!0),i=d;break;default:t.prop("indeterminate",!1),t.prop("checked",!1),i=o}setTimeout(()=>a.$setViewValue(i))},t.bind("click",function(){let i;switch(t.data("checked")){case!1:case o:i=!n.ngTrueValue||d;break;default:i=!!n.ngFalseValue&&o}a.$setViewValue(i),e.$apply(a.$render)})}}}]).directive("signaturePad",["$compile","$window",function(e,t){"use strict";var n,a,i=null;return{restrict:"E",require:"ngModel",scope:!0,replace:!0,transclude:!0,template:"<div style=\"height: 100%; width: 100%;\"> <canvas style=\"width:100%; height: 100%;\" ng-click=\"mouseup()\" ng-mouseup=\"mouseup()\"></canvas> <div class=\"component-holder ng-scope col-md-2\" style=\"bottom: 0; position: absolute; padding-left: 5px;\" data-component=\"crn-button\"> <button class=\"btn k-button btn-warning\" ng-click=\"clear()\" xattr-fullsize=\"\" xattr-theme=\"btn-warning\" xattr-disabled=\"\"> <i class=\"glyphicon glyphicon-erase\" icon-theme=\"\"></i> <span class=\"\" text-theme=\"\">{{'clear'|translate}}</span> </button> </div> </div>",scope:{dataurl:"=",ngClick:"@",ngModel:"="},controller:["$scope",function(t){let n=()=>{let e=t.signaturePad.toDataURL();return e&&(e=e.split(",")[1]),e};t.mouseup=function(a){t.signaturePad.isEmpty()||(t.ngModel=n())},t.$watch("ngModel",function(e,a){e!==a&&(n()!==e&&t.signaturePad.fromDataURL("data:image/png;base64,"+e,{ratio:1}),t.ngModel=e)},!0),t.clear=function(){t.signaturePad.clear(),t.ngModel=null}}],link:function(a,i,o,d,l){n=i.find("canvas")[0],a.onResize=function(){var e=Math.max(t.devicePixelRatio||1,1),n=i.find("canvas")[0],a=document.createElement("canvas");a.width=n.width,a.height=n.height;var o=a.getContext("2d");o.drawImage(n,0,0),n.width=n.offsetWidth*e,n.height=n.offsetHeight*e,n.getContext("2d").drawImage(a,0,0),n.getContext("2d").scale(e,e)},a.onResize(),a.signaturePad=new SignaturePad(n),angular.element(t).on("resize",function(){a.onResize()}),e(i)(i.scope());let r=!1;$(n).on("pointerdown",t=>{1===t.which&&(r=!0),t.preventDefault()}),$(n).on("pointerup",t=>{1===t.which&&r&&(r=!1,l(()=>angular.element(n).triggerHandler("mouseup")))})}}}]).directive("cronChat",["$compile","$translate",function(e,t){return{restrict:"E",replace:!0,link:function(e,t,n,a){var i=JSON.parse(n.options||"{}");if(i.token&&i.urlCronchat){var o=i.urlCronchat.endsWith("/")?i.urlCronchat:i.urlCronchat+"/",d=i.token,l=$(`<script src="${o}get-chat?token=${d}" type="text/javascript"></script>`);t.html(l)}}}}]).directive("updateLanguage",["$rootScope",function(e){return{link:function(t,n){var a=function(e,t){var a="en",i=t.language;"pt_br"===i?i="pt-br":i.startsWith("en")&&(i="en"),n.attr("lang",i||"en")};e.$on("$translateChangeSuccess",a)}}}]).directive("cronFrame",cronFrame).directive("crnComponent",cronFrame).directive("fromGrid",["$compile",e=>({restrict:"A",priority:-999999,exist:e=>{let t=e.attr("id");return $(`#${t}`).length},isFromGrid:e=>"true"===e.fromGrid,isCompiled:e=>e.data("alreadycompiled"),getDateAs:function(e,t,n){let a=e.data("mask"),i=e.data("useUTC");return formatWithMomentAs(a,i,t,n)},prepareValue:function(e,t){let n=e.data("column-type")||"";return n.startsWith("date")&&(t=this.getDateAs(e,t,"date")),t},formatComponent:function(e,t){let n=e.data("kendoDropDownList")||e.data("kendoSlider"),a=e.data("column-type")||"";a.startsWith("date")?e.val(this.getDateAs(e,t,"string")):n&&n.value(t)},compileGridListing:function(t,n){let a=t.data("ref-component");if(a&&a.tbody&&a.tbody.length&&!$(a.tbody).find(".k-grid-edit-row").length){var i=a.tbody;setTimeout(()=>{n.safeApply(()=>{var t=$(i),a=angular.element(t);e(a)(n)})})}},link:function(e,t,n){e.$watch(n.ngModel,a=>{this.isFromGrid(n)&&this.exist(t)&&this.isCompiled(t)&&(a=this.prepareValue(t,a),this.formatComponent(t,a),this.compileGridListing(t,e),call=t.data("change-grid-model"),call&&call(a))})}})]).directive("cronOrderedList",["$compile","$sce","$parse",function(e,t,n){"use strict";return{restrict:"EA",replace:!0,link:function(t,n,a,i){let o=a.attributeValue,d=a.orderedAttributeValue,l=a.listType,r=n[0].children[0].children;r=$(r);let s="",c="";$.each(r,function(e,t){c+=t.outerHTML});"numbered-list"===l?s=`<ol style="list-style-type: ${o}">${c}</ol>`:"ordered-list"===l?s=`<ul style="list-style-type: ${d}">${c}</ul>`:void 0;s=$(s),$(n).replaceWith(s),e(s)(t)}}}]).directive("crnInfiniteScroll",["$compile",function(e){"use strict";return{restrict:"EA",link:function(e,t,n){var a=e.$eval(n.crnInfiniteScroll||n.crnDatasource);if(a){let n={isVisible:!1,isLoading:!1,checkVisibility:function(){var e=t.offset().top,n=t.offset().top+t.outerHeight(),a=$(window).scrollTop()+$(window).innerHeight(),i=$(window).scrollTop();return a>e&&i<n},loadNextPage:function(){!n.isLoading&&a.loaded&&a.loadedFinish&&(n.isLoading=!0,a.nextPage().finally(()=>{n.isLoading=!1}))},eventScroll:function(){let e=n.checkVisibility();e&&n.loadNextPage()}};$(window).on("scroll",n.eventScroll),$(window).ready(n.eventScroll),e.$on("$destroy",function(){$(window).off("scroll",n.eventScroll)})}else console.error("DataSource n\xE3o foi definido ou n\xE3o est\xE1 acess\xEDvel.")}}}])}(app);function maskDirectiveAsDate(e,t,n){return maskDirective(e,t,n,"as-date")}function maskDirectiveMask(e,t,n){return maskDirective(e,t,n,"mask")}function maskDirective(e,t,n,a){return{restrict:"A",require:"?ngModel",link:function(i,o,d,l){if("as-date"!=a||void 0===d.mask){var r=n(d.ngModel),s=r.assign,c=$(o);if(!c.data("alreadycompiled")){c.data("alreadycompiled",!0),c.data("$compile",e);var p=c.attr("type");if("checkbox"!=p&&"password"!=p&&"url"!=p){if("color"==p||"range"==p)return c[0].classList.remove("form-control"),void c[0].classList.remove("k-textbox");c.data("type",p),c.attr("type","text"),l&&(l.$formatters=[],l.$parsers=[]),void 0!==d.asDate&&"text"==p&&(p="date");var u=!0,m=!1,g=d.mask||d.format;g=g?parseMaskType(g,t):parseMaskType(p,t),g.endsWith(";0")&&(m=!0);var f=g.replace(";1","").replace(";0","").trim();if(null!=f&&0!=f.length)if("date"==p||"datetime"==p||"datetime-local"==p||"month"==p||"time"==p||"time-local"==p||"week"==p){var h={format:f,locale:t.use(),showTodayButton:!0,useStrict:!0,tooltips:{today:t.instant("DatePicker.today"),clear:t.instant("DatePicker.clear"),close:t.instant("DatePicker.close"),selectMonth:t.instant("DatePicker.selectMonth"),prevMonth:t.instant("DatePicker.prevMonth"),nextMonth:t.instant("DatePicker.nextMonth"),selectYear:t.instant("DatePicker.selectYear"),prevYear:t.instant("DatePicker.prevYear"),nextYear:t.instant("DatePicker.nextYear"),selectDecade:t.instant("DatePicker.selectDecade"),prevDecade:t.instant("DatePicker.prevDecade"),nextDecade:t.instant("DatePicker.nextDecade"),prevCentury:t.instant("DatePicker.prevCentury"),nextCentury:t.instant("DatePicker.nextCentury")}};"DD/MM/YYYY"!=f&&"MM/DD/YYYY"!=f&&(h.sideBySide=!0);var v="date"==p||"datetime"==p||"time"==p;if(window.fixedTimeZone||(v=!1),c.data("mask",f),c.data("useUTC",v),c.attr("from-grid")){var b=function(){var e=$(this).offset(),t=!0,n=$(this).parent().find(".bootstrap-datetimepicker-widget.dropdown-menu.usetwentyfour.bottom");if(n.length||(t=!1,n=$(this).parent().find(".bootstrap-datetimepicker-widget.dropdown-menu.usetwentyfour.top")),$(n).offset()){var a=$(n).offset().left,i=$("body");n.appendTo(i);var o=0;o=t?e.top+35:e.top-($(n).height()+15),n.css("top",o),n.css("bottom","auto"),n.css("left",a),n.css("z-index",999999)}};if(c.on("click",b),c.on("focus",function(){setTimeout(b.bind(this),100)}),c.on("dp.change",function(){i.safeApply(function(){var e=null;e=v?moment(c.val(),f).utcOffset(window.timeZoneOffset,!0):moment(c.val(),f),("time"==p||"time-local"==p)&&(e=e.year(1970).dayOfYear(1).month(0)),e.isValid()&&l&&s(i,e.toDate())})}),c.data("initial-value")){var y=c.data("initial-value"),k=null;k=v?moment(y).utcOffset(window.timeZoneOffset):moment(y),c.val(k.format(f)),c.data("initial-value",null)}}else c.wrap("<div style=\"position:relative\"></div>");c.datetimepicker(h),"true"!==d.fromGrid&&c.on("dp.change",function(){$(this).is(":visible")&&($(this).trigger("change"),i.safeApply(function(){var e=c.val(),t=null;t=v?moment(e,f).utcOffset(window.timeZoneOffset,!0):moment(e,f),("time"==p||"time-local"==p)&&(t=t.year(1970).dayOfYear(1).month(0)),t.isValid()&&l&&s(i,t.toDate())}))}),l&&(l.$formatters.push(function(e){if(e)return formatWithMomentAs(f,v,e,"string");if(null===e){var t=c.datetimepicker(h).data("DateTimePicker");t.date(null)}return null}),l.$parsers.push(function(e){if(e){if(e instanceof Date)return e;var t=null;if(t=v?moment(e,f).utcOffset(window.timeZoneOffset,!0):moment(e,f),("time"==p||"time-local"==p)&&(t=t.year(1970).dayOfYear(1).month(0)),"string"==typeof e&&e.length<f.length){let t=formatWithMomentAs(f,v,e,"string");t.startsWith(e)&&e.length<t.length&&(isNaN(t[e.length])||" "===t[e.length])&&l.$$element.val(t.substring(0,e.length+1))}return t.toDate()}return null}))}else if("number"==p||"money"==p||"integer"==p||"money-decimal"==p){m=!0;var C=f.trim().replace(/\./g,"").replace(/\,/g,"").replace(/#/g,"").replace(/0/g,"").replace(/9/g,""),w="",S="",D="",T=",",x=0;f.startsWith(C)?w=C:f.endsWith(C)&&(S=C);var M=f.trim().replace(w,"").replace(S,"").trim();M.startsWith("#.")?D=".":M.startsWith("#,")&&(D=",");var I=null;if(-1==M.indexOf(",0")?-1!=M.indexOf(".0")&&(T=".",I=".0"):(T=",",I=",0"),null!=I){var E=M.substring(M.indexOf(I)+1);x=E.length}var A="numeric";0==x&&(A="integer"),"money-decimal"==p&&(A="currency");var F={rightAlign:"money"==p||"money-decimal"==p,unmaskAsNumber:!0,allowMinus:!0,prefix:w,suffix:S,radixPoint:T,digits:x,numericInput:"money-decimal"==p};D&&(F.autoGroup=!0,F.groupSeparator=D),$(o).inputmask(A,F),useInputMaskPlugin(o,l,i,s,f)}else if("text"==p||"tel"==p||"string"==p){let e=["D","M","Y","H","m","s"],t=t=>(e.forEach(e=>t=t.replaceAll(e,"9")),t);f=t(f),d.maskPlaceholder?(h={},h.placeholder=d.maskPlaceholder,$(o).inputmask(f,h),m&&useInputMaskPlugin(o,l,i,s,f)):(c.mask(f),useMaskPlugin(o,l,i,s,m))}}}}}}}function useInputMaskPlugin(e,t,n,a,i){var o=$(e),d=function(){$(this).data("rawvalue",$(this).inputmask("unmaskedvalue"))};$(e).on("keydown",d).on("keyup",d),t&&(t.$formatters.push(function(e){return null!=e&&null!=e&&""!==e?format(i,e):null}),t.$parsers.push(function(e){if(e!=null&&null!=e&&""!==e){var t=o.inputmask("unmaskedvalue");if(""!==t)return t}return null}))}function useMaskPlugin(e,t,n,a,i){var o=$(e),d=function(){i&&$(this).data("rawvalue",$(this).cleanVal())};$(e).on("keydown",d).on("keyup",d),i&&t&&(t.$formatters.push(function(e){return e?o.masked(e):null}),t.$parsers.push(function(e){return e?o.cleanVal():null}))}function parseMaskType(e,t){return"datetime"==e||"datetime-local"==e?(e=t.instant("Format.DateTime"),"Format.DateTime"==e&&(e="DD/MM/YYYY HH:mm:ss")):"date"==e?(e=t.instant("Format.Date"),"Format.Date"==e&&(e="DD/MM/YYYY")):"time"==e||"time-local"==e?(e=t.instant("Format.Hour"),"Format.Hour"==e&&(e="HH:mm:ss")):"month"==e?e="MMMM":"number"==e?(e=t.instant("Format.Decimal"),"Format.Decimal"==e&&(e="#.#00,00")):"money"==e||"money-decimal"==e?(e=t.instant("Format.Money"),"Format.Money"==e&&(e="#.#00,00")):"integer"==e?(e=t.instant("Format.Integer"),"Format.Integer"==e&&(e="#,##0.####")):"week"==e?e="dddd":"tel"==e?e="(00) 00000-0000;0":"text"==e?e="":"string"==e&&(e=""),e}function transformText(){return{restrict:"E",require:"?ngModel",link:function(e,t,n,a){var i=function(e,t){if(e){if(t!==void 0&&null!==t){if("uppercase"===e.css("text-transform"))return t.toUpperCase();if("lowercase"===e.css("text-transform"))return t.toLowerCase()}return t}};a&&(a.$formatters.push(function(e){return i(t,e)}),a.$parsers.push(function(e){return i(t,e)}))}}}app.kendoHelper={getCorrectlyDS:(e,t)=>{if(t[e]&&t[e].apiVersion)return t[e];else{let n=t.$parent[e];return t[e]=n,n}},getCorrectlyDSPromise:async(e,t)=>new Promise((n,a)=>{let i=()=>{let o=null;if(t[e]&&t[e].apiVersion)o=t[e];else{let n=t.$parent[e];t[e]=n,o=n}o?n(o):$(`datasource[name="${e}"]`).length?setTimeout(()=>i(),100):a(null)};i()}),receivePushData:e=>!e||!e.dataSource||(e.dataSource.transport.options.refComponent=e),getSchema:function(e){var t=[{kendoType:"string",entityType:["string","character","uuid","guid"]},{kendoType:"number",entityType:["integer","long","double","int","float","bigdecimal","single","int32","int64","decimal","byte"]},{kendoType:"date",entityType:["date","time","datetime"]},{kendoType:"boolean",entityType:["boolean"]}],n=function(e){for(var n=0;n<t.length;n++)if(t[n].entityType.includes(e.toLocaleLowerCase()))return t[n].kendoType;return"string"},a={model:{id:"__$id",fields:{}}};return e&&e.schemaFields&&(e.schemaFields.forEach(function(e){a.model.fields[e.name]={type:n(e.type),editable:!0,nullable:e.nullable,validation:{required:!e.nullable}}}),a.model.fields.__$id={type:"string",editable:!0,nullable:!0,validation:{required:!1}}),a},getDataSource:function(t,n,a,i,o,d){var l=Number.MAX_SAFE_INTEGER_32;function r(t){if(t.response&&t.response.d){var e=null;e=t.response.d.results?t.response.d.results:[t.response.d],this.group().length?o.forEach(function(t){if("Database"==t.dataType){var n="datetime-local"==t.type||"month"==t.type||"time-local"==t.type||"week"==t.type;if(n)for(var a,o=0;o<e.length;o++)a=e[o],t.field==a.Member&&(a.Key=a.Key.replace(/\d+/,function(e){return parseInt(e)+g})),s.bind(this)(a.Items)}}):s.bind(this)(e)}}function s(e){for(var t=0;t<e.length;t++)o&&o.forEach(function(n){if("Database"==n.dataType){var a="datetime-local"==n.type||"month"==n.type||"time-local"==n.type||"week"==n.type;a&&e[t][n.field]&&(e[t][n.field]=e[t][n.field].replace(/\d+/,function(e){return parseInt(e)+g}))}})}function c(e){var t=[];return e&&e.forEach(function(e){e.aggregates&&e.aggregates.forEach(function(n){t.push({field:e.field,aggregate:n.type})})}),t}var p=this.getSchema(t);o&&o.forEach(function(e){for(var t in p.model.fields)if("Database"==e.dataType&&e.field==t){if(p.model.fields[t].nullable=!e.required,p.model.fields[t].validation.required=e.required,"999.999.999-99;0"===e.format||"99.999.999/9999-99;0"===e.format){let n="999.999.999-99;0"===e.format?"cpf":"cnpj",a={cpf:CPF,cnpj:CNPJ},i=t.toLocaleLowerCase()+"validation";p.model.fields[t].validation[i]=function(e){return!(e.is("[name='"+t+"']")&&""!=e.val())||a[n].isValid(e.val())}}break}});var u=function(e){for(var t in e)if(p.model.fields.hasOwnProperty(t)){var n=p.model.fields[t];"string"==n.type&&null!=e[t]?e[t]+="":"number"==n.type&&null!=e[t]?e[t]=parseFloat(e[t]):"date"==n.type&&null!=e[t]?e[t]="/Date("+e[t].getTime()+")/":"boolean"==n.type&&(null==e[t]?e[t]=!1:e[t]="true"==e[t].toString().toLowerCase()),p.model.id==t&&null!=e[t]&&0==e[t].toString().length&&delete e[t]}return e},m=10;app.kendoHelper.getCorrectlyDS(t.name,n)&&(m=app.kendoHelper.getCorrectlyDS(t.name,n).rowsPerPage);var g=6e4*new Date().getTimezoneOffset(),f=app.common.generateId(),h={transport:{setActiveAndPost:function(t){var e=this.options.cronappDatasource;n.safeApply(e.updateActive(u(t.data))),e.active.__sender=f,e.postSilent(function(e){this.options.enableAndSelect(t),t.success(e),this.options.refComponent.dataSource._pristineTotal=this.options.refComponent.dataSource._pristineData.push(e)}.bind(this),function(e){this.options.enableAndSelect(t),t.error(e,e,e)}.bind(this))},pushAction:function(e,t){return n=>{let a=["read","memorydelete","overRideRefresh"];if(this.options.isComponentInDocument(this.options.refComponent)){let a=this.options.getCurrentCallbackForPush(t,this.options.refComponent),i=a[e];i?i(n):(this.options.fromRead="read"===e,this.options.cronappDatasource.reloadedFromCronapi&&(this.options.fromRead=!1,delete this.options.cronappDatasource.reloadedFromCronapi),"overRideRefresh"===e&&(this.options.refComponent.dataSource._page=1,this.options.refComponent.dataSource._skip=0),this.options.refComponent.dataSource.read())}else a.includes(e)||this.options.cronappDatasource.removeDataSourceEvents(this.options.dataSourceEventsPush)}},push:function(e){!this.options.dataSourceEventsPush&&this.options.cronappDatasource&&(this.options.dataSourceEventsPush={create:this.pushAction.bind(this)("pushUpdate",e),update:this.pushAction.bind(this)("pushUpdate",e),delete:this.pushAction.bind(this)("pushDestroy",e),overRideRefresh:this.pushAction.bind(this)("overRideRefresh",e),read:this.pushAction.bind(this)("read",e),memorycreate:this.pushAction.bind(this)("pushUpdate",e),memoryupdate:this.pushAction.bind(this)("pushUpdate",e),memorydelete:this.pushAction.bind(this)("pushDestroy",e)},"combobox"==this.origin&&delete this.options.dataSourceEventsPush.overRideRefresh,this.options.cronappDatasource.addDataSourceEvents(this.options.dataSourceEventsPush))},read:function(n){var e=!1;try{var a=this.options.cronappDatasource;this.options.kendoCallback?this.options.fromRead?this.options.kendoCallback.success(a.data):e=!0:(this.options.kendoCallback=n,e=!0)}finally{this.options.fromRead=!1}if(e){for(key in n.data)null==n.data[key]&&delete n.data[key];var i=kendo.data.transports.odata.parameterMap(n.data,"read"),o="";this.options.refComponent&&this.options.refComponent.dataSource.group().forEach(function(e){o+=e.field+" "+e.dir+","}),0<o.length&&(o=o.substr(0,o.length-1),i.$orderby=i.$orderby?o+","+i.$orderby:o);var a=this.options.cronappDatasource;if(a.rowsPerPage=n.data.pageSize,a.offset=n.data.page-1,!n.data.pageSize&&(a.rowsPerPage=l,a.offset=void 0,i.$skip=0,this.options.refComponent&&1!=this.options.refComponent.dataSource.page()))return this.options.refComponent.dataSource.page(1),void n.error("canceled","canceled","canceled");var d={params:i},r=!1;t.append&&(r=t.append);var s={};"button"===a.loadDataStrategy&&0<a.data.length&&(s.origin=a.loadDataStrategy),a.append=r,a.fetch(d,{success:function(e){n.success(e)},canceled:function(e){n.error("canceled","canceled","canceled")},error:function(e){n.error("canceled","canceled","canceled")}},r,s)}},update:function(t){this.setActiveAndPost(t)},create:function(t){this.setActiveAndPost(t)},destroy:function(t){cronappDatasource=this.options.cronappDatasource,cronappDatasource.removeSilent(t.data,function(e){t.success(e)},function(e){t.error("canceled","canceled","canceled")})},batch:function(t){},options:{fromRead:!1,disableAndSelect:function(t){this.isComponentInDocument(this.refComponent)&&(this.refComponent.select(t.container),this.refComponent.options.selectable=!1,this.refComponent.selectable&&this.refComponent.selectable.element&&(this.refComponent.selectable.destroy(),this.refComponent.selectable=null))},enableAndSelect:function(t){this.isComponentInDocument(this.refComponent)&&(this.refComponent.options.selectable=this.refComponent.options.originalSelectable,this.refComponent._selectable(),this.refComponent.select(t.container))},selectActiveInGrid:function(e){if(this.isComponentInDocument(this.refComponent)&&this.refComponent.selectable&&0<this.refComponent.dataItems().length&&this.cronappDatasource.active&&this.cronappDatasource.active.__$id){for(var t=this.refComponent.dataItems(),n=-1,a=0;a<t.length;a++)if(this.cronappDatasource.active.__$id==t[a].__$id){n=a;break}-1<n&&!this.refComponent.selectable.options.multiple&&this.refComponent.select(this.refComponent.table.find("tr")[n+1])}},isComponentInDocument:function(e){return!!e&&$(document).has(e.element[0]).length},getCurrentCallbackForPush:function(e,t){return e?e:t},cronappDatasource:app.kendoHelper.getCorrectlyDS(t.name,n)}},pageSize:m,serverPaging:!0,serverFiltering:!0,serverSorting:!0,batch:!1,schema:p,requestEnd:r};return h.aggregate=c(o),h.schema.total=function(){return h.transport.options.cronappDatasource.getRowsCount()},d&&(h.group=[],d.forEach(function(e){var t={field:e.field,aggregates:h.aggregate};h.group.push(t)})),h},getEventReadCombo:function(t){var e=this.options.cronappDatasource;if(!e)return void t.error("canceled","canceled","canceled");this.options.kendoCallback||(this.options.kendoCallback=t);var n;if(this.options.combobox&&this.options.combobox.options.readData)return t.success(this.options.combobox.options.readData),this.options.combobox.options.readData=null,void(this.options.alreadyLoaded=!0);this.options.combobox?n=!this.options.alreadyLoaded:e.__ignoreFirstFetch?(n=!0,delete e.__ignoreFirstFetch):n=!1,this.options.alreadyLoaded=!0;var a=!0;if(n&&(a=!1,e.lazy?t.success([{}]):t.success([])),(this.options.fromRead||this.options.combobox&&void 0===this.options.combobox.options.firstLazyRead)&&(this.options.fromRead=!1,this.options.kendoCallback.success(e.data),a=!1),a){for(key in t.data)null==t.data[key]&&delete t.data[key];var i=kendo.data.transports.odata.parameterMap(t.data,"read");e.rowsPerPage=t.data.pageSize,e.offset=t.data.page-1;var o=this,d=!0,l={};l.params=i,o.options.combobox&&(o.options.combobox.options.fromCombo=!0),e.fetch(l,{success:function(e){if(t.success&&(o.options.combobox&&(o.options.combobox.options.expanded=!0),t.success(e),o?.options?.combobox?.span&&o.options.$compile(o.options.combobox.span)(o.options.scope),o.options.kendoCallback=t,o.options&&o.options.combobox&&o.options.combobox.element[0].id)){var n=" .k-animation-container",a=angular.element($(" .k-animation-container"));o.options.$compile(a)(o.options.scope)}},canceled:function(e){o.options.combobox&&(o.options.combobox.options.fromCombo=!1),t.success&&t.error("canceled","canceled","canceled")},error:function(e){o.options.combobox&&(o.options.combobox.options.fromCombo=!1),t.success&&t.error("error","error","error")}},!1,{ignoreAtive:!0})}},parseOptionsCronToConfigKendo:function(e,t,n){let a=!1;e.dynamic&&"false"!=e.dynamic?e.dataSourceScreen&&e.dataSourceScreen.entityDataSource&&(e.dataSourceScreen.entityDataSource.append=!0,t=app.kendoHelper.getDataSource(e.dataSourceScreen.entityDataSource,n,!0,e.dataSourceScreen.rowsPerPage),t.transport.read=app.kendoHelper.getEventReadCombo,a=!0):(a=!0,e.dataValueField=e.dataValueField||"value",e.dataTextField=e.dataTextField||"key"),e.dataValueField&&""!=e.dataValueField.trim()||(e.dataValueField=null==e.dataTextField?void 0:e.dataTextField);var i=function(t){var n=e.dataSourceScreen.entityDataSource.schemaFields;for(count=0;count<n.length;count++)if(t==n[count].name){return n[count].type.toLowerCase();break}return null},o=function(e){var t=["date","time","datetime"];return-1<t.indexOf(e)?e:null};!e.customTemplate&&e.dataSourceScreen&&e.dataSourceScreen.entityDataSource&&e.dataSourceScreen.entityDataSource.schemaFields&&(e.format||o(i(e.dataTextField)))&&(e.template="#= useMask("+e.dataTextField+",'"+e.format+"','"+i(e.dataTextField)+"') #",e.valueTemplate="#= useMask("+e.dataTextField+",'"+e.format+"','"+i(e.dataTextField)+"') #");var d={dataTextField:null==e.dataTextField?void 0:e.dataTextField,dataValueField:null==e.dataValueField?void 0:e.dataValueField,dataSource:t,headerTemplate:null==e.headerTemplate?void 0:e.headerTemplate,template:null==e.template?void 0:e.template,tagTemplate:null==e.tagTemplate?void 0:e.tagTemplate,placeholder:null==e.placeholder?void 0:e.placeholder,footerTemplate:null==e.footerTemplate?void 0:e.footerTemplate,filter:null==e.filter?void 0:e.filter,valuePrimitive:a,valueTemplate:null==e.valueTemplate?void 0:e.valueTemplate,suggest:!0};return e.optionLabel&&(e.optionLabelText=e.optionLabel,e.optionLabelValue=""),d.optionLabel={},d.optionLabel[d.dataTextField]=void 0===e.optionLabelText?"":e.optionLabelText,d.optionLabel[d.dataValueField]=void 0===e.optionLabelValue?null:e.optionLabelValue,d},getConfigComboboxSync:function(e,t){var n={};if(e){if(!e.dynamic||"false"==e.dynamic){n.data=null==e.staticDataSource?void 0:e.staticDataSource;for(let a=0;a<n.data.length;a++)try{n.data[a].key&&n.data[a].key.startsWith("cronapi.server(")&&(n.data[a].key=n.data[a].key.replace(".run(",".notAsync().run("));let e=t.$eval(n.data[a].key);n.data[a].key=void 0!==e&&null!==e?e:n.data[a].key}catch(t){n.data[a].key=n.data[a].key}}return config=this.parseOptionsCronToConfigKendo(e,n,t),config}return{}},getConfigCombobox:async function(e,t){var n={};if(e){if(!e.dynamic||"false"==e.dynamic){n.data=null==e.staticDataSource?void 0:e.staticDataSource;for(let a=0;a<n.data.length;a++)try{n.data[a].key&&n.data[a].key.startsWith("cronapi.server(")&&(n.data[a].key=n.data[a].key.replace(".run(",".toPromise().run("));let e=await t.$eval(n.data[a].key);n.data[a].key=void 0!==e&&null!==e?e:n.data[a].key}catch(t){n.data[a].key=n.data[a].key}}return config=this.parseOptionsCronToConfigKendo(e,n,t),config}return{}},getConfigDate:function(e,t){var n={};if(n){var a=function(e){e=e.replace(/_/gm,"-");var t=e.split("-");return t[t.length-1]=t[t.length-1].toUpperCase(),t.join("-")},i=function(e){return e&&(e=e.replace(/:MM/gm,":mm"),e=e.replace(/:M/gm,":m"),e=e.replace(/S/gm,"s"),e=e.replace(/D/gm,"d"),e=e.replace(/Y/gm,"y")),e},o=function(t,n){return null==n&&(n=parseMaskType(t,e)),n},d={};if(t.animation)try{d=JSON.parse(t.animation)}catch(e){console.log("DateAnimation invalid configuration! "+e)}var l=o(t.type,t.format),r=i(l),s=i(t.timeFormat),c=a(e.use());n={value:null,format:r,timeFormat:s,momentFormat:l,culture:c,type:null==t.type?void 0:t.type,weekNumber:null==t.weekNumber?void 0:t.weekNumber,dateInput:null==t.dateInput?void 0:t.dateInput,animation:d,footer:null==t.footer?void 0:t.footer,start:null==t.start?void 0:t.start,depth:null==t.start?void 0:t.start}}return n},buildKendoMomentPicker:function(e,t,n,a){var i="date"==t.type||"datetime"==t.type||"time"==t.type;window.fixedTimeZone||(i=!1),e.data("mask",t.momentFormat),e.data("useUTC",i);var o=function(){var n=e.val();if(!n||""==n.trim())a&&a.$setViewValue("");else{var o=formatWithMomentAs(t.momentFormat,i,n,"date");a&&(a.$setViewValue(o),e.data("changed",!0))}};return(t.change=n?function(){n.$apply(function(){o()})}:o,"date"==t.type)?e.kendoDatePicker(t).data("kendoDatePicker"):"datetime"==t.type||"datetime-local"==t.type?e.kendoDateTimePicker(t).data("kendoDateTimePicker"):"time"==t.type||"time-local"==t.type?e.kendoTimePicker(t).data("kendoTimePicker"):void 0},getConfigSlider:function(e){e=e||{};var t={increaseButtonTitle:e.increaseButtonTitle,decreaseButtonTitle:e.decreaseButtonTitle,dragHandleTitle:e.dragHandleTitle};try{t.min=e.min?parseInt(e.min):1,t.max=e.max?parseInt(e.max):1,t.smallStep=e.smallStep?parseInt(e.smallStep):1,t.largeStep=e.largeStep?parseInt(e.largeStep):1}catch(e){console.log("Slider invalid configuration! "+e)}return t},getConfigSwitch:function(e){e=e||{};var t={onLabel:null==e.onLabel?void 0:e.onLabel,offLabel:null==e.offLabel?void 0:e.offLabel};return t},getConfigBarcode:function(e){var t={type:null==e.type?void 0:e.type,width:null==e.width?void 0:parseInt(e.width),height:null==e.height?void 0:parseInt(e.height)};return t.type||(t.type="EAN8"),t},getConfigQrcode:function(e){var t={errorCorrection:null==e.errorCorrection?void 0:e.errorCorrection,size:null==e.size?void 0:parseInt(e.size),color:null==e.color?void 0:e.color};return(e.borderColor||e.borderSize)&&(t.border={size:null==e.size?void 0:parseInt(e.size),color:null==e.color?void 0:e.color}),t}},window.showTreatedValue=function(e){return e||!1===e?e:""},window.useMask=function(e,t,n){var a="";t="null"==t||"undefined"==t?void 0:t;var i=e,o=t||n;if(null!=e&&e!=null){if(e instanceof Date){var d=moment(e).utcOffset(window.timeZoneOffset);i="\""+d.format()+"\""}else i="number"==typeof e?e:"\""+e+"\"";a="{{ "+i+" | mask:\""+o+"\":\""+n+"\"}}"}return a},window.formatWithMomentAs=function(e,t,n,a){if(!n)return;let i=null;return i=n instanceof Date||n.startsWith("/Date")?t?moment(n).utcOffset(window.timeZoneOffset):moment(n):t?moment(n,e).utcOffset(window.timeZoneOffset,!0):moment(n,e),"string"===a?i.format(e):i.toDate()};function cronFrame($compile,$sce,$parse){"use strict";return{restrict:"AE",link:function(scope,element,attrs,ngModelCtrl){scope.fragment=scope.fragment||{};var framentMap=scope.fragment[element.parent.id]||{};scope.$watch(function(){return attrs.origin},function(newVal){let template="",style=attrs.style||"",clazz=attrs.class||"";if(attrs.origin)if(attrs.type||(attrs.type="include"),"include"==attrs.type){let str=`<div style="${style}" class="${clazz}" ng-include="'${attrs.origin}'" ng-if="true"></div>`;if(template=$(str),attrs.params)try{let params=eval(attrs.params);for(let e in params){let t=params[e];"expression"==t.type?scope.$watch(t.value,function(e){framentMap[t.key]=e;var n=$(str);n.attr("onload",`params = ${JSON.stringify(framentMap)}`);var a=$compile(n)(scope);element.html(a)}):framentMap[t.key]=t.value}template.attr("onload",`params = ${JSON.stringify(framentMap)}`)}catch(e){console.error(e)}}else if("frame"==attrs.type){var url=$sce.trustAsResourceUrl(attrs.origin);template=$(`<iframe style="${style}" class="${clazz}" ng-src="${url}" width="100%" height="100%" loading="lazy"></iframe>`)}element.html(template),$compile(template)(scope)})}}}function cronReportViewer(e){return{restrict:"E",replace:!0,require:"ngModel",link:function(e,t,n,a){function i(n){var a=JSON.parse(n),i={element:t};e.$eval(a.reportCommand||a.dashboardCommand,i)}i(n.options);let o=t[0].parentElement;for(;o;)if("BODY"===o.tagName)o=null;else if(o.classList.contains("tab-pane"))break;else o=o.parentElement;if(o&&!o.classList.contains("active")){let e=new MutationObserver(function(e,t){for(let a of e)if("class"===a.attributeName&&a.target.classList.contains("active")){i(n.options),t.disconnect();break}});e.observe(o,{attributes:!0})}var d=null;e.$watch(function(){return n.options},function(e,t){e!==t&&(d&&(clearInterval(d),d=null),d=setTimeout(function(){i(e)}.bind(this),500))})}}}
|
|
55
|
+
</li>`}),i},link:function(n,a,i){var o=this.populateMenu;i.$observe("options",function(d){t.onReady(()=>{let t=a.closest(".crn-navigator-vertical").length;var l={};try{l=JSON.parse(d)}catch(t){console.log("CronDynamicMenu: Invalid configuration!")}let r=l&&l.subMenuOptions&&l.subMenuOptions.length?l.subMenuOptions[0].id:"first";var s=`<ul id="menu-tag-ul-base-${r}" class="nav navbar-nav ${t?"col-md-12 padding-0":""}" ></ul>`,c=$(s);c.attr("id",i.id);var p=o(l,t);c.append(p),t&&c.append($("#navbar2 li:first").addClass("col-md-12 padding-0"));var u=angular.element(c);a.html(""),a.append(c),a.attr("id",null),e(u)(n);var m=i.multilevelAction;"hover"===m&&($(".dropdown-menu .dropdown-submenu").on("mouseover",function(){var e=$(this).children("ul.dropdown-menu");e.addClass("displayBlock")}),$(".dropdown-menu .dropdown-submenu").on("mouseout",function(){var e=$(this).children("ul.dropdown-menu");e.removeClass("displayBlock")})),"click"===m&&$(".dropdown-menu a.dropdown-toggle").on("click",function(t){$(this).next().hasClass("show")||$(this).parents(".dropdown-menu").first().find(".show").removeClass("show");var e=$(this).next(".dropdown-menu");return e.toggleClass("show"),$(this).parents("li.nav-item.dropdown").on("hidden.bs.dropdown",function(t){$(".dropdown-submenu .show").removeClass("show")}),!1}),$("#checkCollapsibleMenu").on("click",function(){var e=document.getElementById("main-view");this.checked?e.classList.remove("main-view-retratil"):e.classList.add("main-view-retratil")});let g=a.closest("nav");if(g&&g.length){let e=!g.hasClass("submenu-click"),t=g.attr("id");if(t||(t=app.common.generateId(),g.attr("id",t)),e){let e=$(`#${t} .dropdown-submenu`).data("hooked");e||($(`#${t} .dropdown-submenu`).on("mouseenter",function(t){$(this).children(".dropdown-menu").addClass("show")}).on("mouseleave",function(t){$(this).children(".dropdown-menu").removeClass("show")}),$(`#${t} .dropdown-submenu`).data("hooked",!0))}else{let e=$(`#${t} .dropdown-menu a.dropdown-toggle`).data("hooked");e||($(`#${t} .dropdown-menu a.dropdown-toggle`).on("click",function(t){$(this).next().hasClass("show")||$(this).parents(".dropdown-menu").first().find(".show").removeClass("show");var e=$(this).next(".dropdown-menu");return e.toggleClass("show"),$(this).parents("li.nav-item.dropdown.show").on("hidden.bs.dropdown",function(t){$(".dropdown-submenu .show").removeClass("show")}),!e.length&&void $(".dropdown-menu").removeClass("show")}),$(`#${t} .dropdown-menu a.dropdown-toggle`).data("hooked",!0));let n=$(`#${t} .dropdown.nav-item`).data("hooked");n||($(`#${t} .dropdown.nav-item`).on("hidden.bs.dropdown",function(t){$(".dropdown-submenu .show").removeClass("show"),$(".dropdown-menu .show").removeClass("show")}),$(`#${t} .dropdown.nav-item`).data("hooked",!0))}}else{let e=$(a).find("ul:first").attr("id"),t=$(`#${e} .dropdown-submenu`).data("hooked");t||($(`#${e} .dropdown-submenu`).on("mouseenter",function(t){$(this).children(".dropdown-menu").addClass("show")}).on("mouseleave",function(t){$(this).children(".dropdown-menu").removeClass("show")}),$(`#${e} .dropdown-submenu`).data("hooked",!0))}})})}}}]).directive("cronBreadcrumbs",["$rootScope",function(e){"use strict";return{restrict:"E",replace:!0,link:function(e,t,n){var a=n.ngInit?n.ngInit:null;const i=n.crnDelimiterIcon,o=n.typeMenu,d=n.idMenu?n.idMenu:null,l=n.id,r=n.breadcrumbIcon?n.breadcrumbIcon:null,s=[],c=async()=>{const t=a.replace("cronapi.client('js.","blockly.js.");a=t.replace("').run()",""),a=e.$eval(a),s=await a();const n=async t=>{t.item.action&&t.item.action()};$(`#${l}`).kendoBreadcrumb({items:s,delimiterIcon:i,navigational:!0,click:n})},p=e=>e?e.replace("cronapi.screen.changeView('","").replace("', [])",""):"#/home";if(a&&"idBloco"===o)c();else{var u=new MutationObserver((e,t)=>{const n=$(`#${d}`).parent(),a=n.attr("options");if(a){t.disconnect();const e=JSON.parse(a),n=document.location.hash||"home",d=(e,t,n=[])=>{for(let o=0;o<e.length;o++){var a=e[o];if(a.action=p(a.action),a.action===t)return[...n,a];if(a.menuItems){const e=d(a.menuItems,t,[...n,a]);if(e)return e}}return null},r=d(e.subMenuOptions,n);if(r){for(var o in r){const e=r[o];s.push({type:0==o?"rootitem":"item",href:e.action,text:e.title,showText:!0,showIcon:!1})}$(`#${l}`).kendoBreadcrumb({items:s,delimiterIcon:i,navigational:!0})}}});u.observe(document.body,{childList:!0})}}}}]).directive("ngInitialValue",["$parse",function(e){return{restrict:"A",require:"ngModel",link:async function(t,n,a,i){if(a.ngInitialValue){var o,d=e(a.ngModel),l=d.assign;try{if(-1!=a.ngInitialValue.indexOf("cronapi.client('js.")){let e=a.ngInitialValue.replace("cronapi.client('js.","blockly.js."),n=e.split("').names")[0];n=n.split("').attr()")[0];let i=e.split(".run")[1];o=await t.$eval(n+i)}else o=t.$eval(a.ngInitialValue)||a.ngInitialValue}catch(t){o=a.ngInitialValue}"checkbox"==n[0].type&&o&&(o="true"==(""+o).toLowerCase()),l(t,o)}}}}]).directive("crnSetIndeterminate",["$parse",function($parse){return{restrict:"A",link:function(scope,element,attrs){let value=eval(attrs.crnSetIndeterminate);null===value&&$(element).prop("indeterminate",!0)}}}]).directive("crnAllowNullValues",[function(){return{restrict:"A",require:"?ngModel",link:function(e,t,n,a){a.$formatters=[],a.$parsers=[];let i=e=>(e&&-1===e.indexOf("'")&&(e=`'${e}'`),e);n.ngFalseValue=i(n.ngFalseValue),n.ngTrueValue=i(n.ngTrueValue);let o=!!n.ngFalseValue&&n.ngFalseValue.split("'").join(""),d=!n.ngTrueValue||n.ngTrueValue.split("'").join(""),l=e=>"true"===e||void 0===e||null===e||0==e.length;a.$render=l(n.crnAllowNullValues)?function(){let e=a.$viewValue;t.data("checked",e),!0===e||e===d?(t.prop("indeterminate",!1),t.prop("checked",!0),e=d):!1===e||e===o?(t.prop("indeterminate",!1),t.prop("checked",!1),e=o):(e=null,t.prop("indeterminate",!0)),setTimeout(()=>a.$setViewValue(e))}:function(){let i=a.$viewValue;if((void 0===a.$viewValue||null===a.$viewValue)&&(a.$setViewValue(!1),i=!1),i===o){let a=n.ngFalseValue?`${t.attr("ng-model")}=${n.ngFalseValue}`:`${t.attr("ng-model")}=${o}`;e.$eval(a)}switch(t.data("checked",i),i){case!0:case d:t.prop("indeterminate",!1),t.prop("checked",!0),i=d;break;default:t.prop("indeterminate",!1),t.prop("checked",!1),i=o}setTimeout(()=>a.$setViewValue(i))},t.bind("click",function(){let i;switch(t.data("checked")){case!1:case o:i=!n.ngTrueValue||d;break;default:i=!!n.ngFalseValue&&o}a.$setViewValue(i),e.$apply(a.$render)})}}}]).directive("signaturePad",["$compile","$window",function(e,t){"use strict";var n,a,i=null;return{restrict:"E",require:"ngModel",scope:!0,replace:!0,transclude:!0,template:"<div style=\"height: 100%; width: 100%;\"> <canvas style=\"width:100%; height: 100%;\" ng-click=\"mouseup()\" ng-mouseup=\"mouseup()\"></canvas> <div class=\"component-holder ng-scope col-md-2\" style=\"bottom: 0; position: absolute; padding-left: 5px;\" data-component=\"crn-button\"> <button class=\"btn k-button btn-warning\" ng-click=\"clear()\" xattr-fullsize=\"\" xattr-theme=\"btn-warning\" xattr-disabled=\"\"> <i class=\"glyphicon glyphicon-erase\" icon-theme=\"\"></i> <span class=\"\" text-theme=\"\">{{'clear'|translate}}</span> </button> </div> </div>",scope:{dataurl:"=",ngClick:"@",ngModel:"="},controller:["$scope",function(t){let n=()=>{let e=t.signaturePad.toDataURL();return e&&(e=e.split(",")[1]),e};t.mouseup=function(a){t.signaturePad.isEmpty()||(t.ngModel=n())},t.$watch("ngModel",function(e,a){e!==a&&(n()!==e&&t.signaturePad.fromDataURL("data:image/png;base64,"+e,{ratio:1}),t.ngModel=e)},!0),t.clear=function(){t.signaturePad.clear(),t.ngModel=null}}],link:function(a,i,o,d,l){n=i.find("canvas")[0],a.onResize=function(){var e=Math.max(t.devicePixelRatio||1,1),n=i.find("canvas")[0],a=document.createElement("canvas");a.width=n.width,a.height=n.height;var o=a.getContext("2d");o.drawImage(n,0,0),n.width=n.offsetWidth*e,n.height=n.offsetHeight*e,n.getContext("2d").drawImage(a,0,0),n.getContext("2d").scale(e,e)},a.onResize(),a.signaturePad=new SignaturePad(n),angular.element(t).on("resize",function(){a.onResize()}),e(i)(i.scope());let r=!1;$(n).on("pointerdown",t=>{1===t.which&&(r=!0),t.preventDefault()}),$(n).on("pointerup",t=>{1===t.which&&r&&(r=!1,l(()=>angular.element(n).triggerHandler("mouseup")))})}}}]).directive("cronChat",["$compile","$translate",function(e,t){return{restrict:"E",replace:!0,link:function(e,t,n,a){var i=JSON.parse(n.options||"{}");if(i.token&&i.urlCronchat){var o=i.urlCronchat.endsWith("/")?i.urlCronchat:i.urlCronchat+"/",d=i.token,l=$(`<script src="${o}get-chat?token=${d}" type="text/javascript"></script>`);t.html(l)}}}}]).directive("updateLanguage",["$rootScope",function(e){return{link:function(t,n){var a=function(e,t){var a="en",i=t.language;"pt_br"===i?i="pt-br":i.startsWith("en")&&(i="en"),n.attr("lang",i||"en")};e.$on("$translateChangeSuccess",a)}}}]).directive("cronFrame",cronFrame).directive("crnComponent",cronFrame).directive("fromGrid",["$compile",e=>({restrict:"A",priority:-999999,exist:e=>{let t=e.attr("id");return $(`#${t}`).length},isFromGrid:e=>"true"===e.fromGrid,isCompiled:e=>e.data("alreadycompiled"),getDateAs:function(e,t,n){let a=e.data("mask"),i=e.data("useUTC");return formatWithMomentAs(a,i,t,n)},prepareValue:function(e,t){let n=e.data("column-type")||"";return n.startsWith("date")&&(t=this.getDateAs(e,t,"date")),t},formatComponent:function(e,t){let n=e.data("kendoDropDownList")||e.data("kendoSlider"),a=e.data("column-type")||"";a.startsWith("date")?e.val(this.getDateAs(e,t,"string")):n&&n.value(t)},compileGridListing:function(t,n){let a=t.data("ref-component");if(a&&a.tbody&&a.tbody.length&&!$(a.tbody).find(".k-grid-edit-row").length){var i=a.tbody;setTimeout(()=>{n.safeApply(()=>{var t=$(i),a=angular.element(t);e(a)(n)})})}},link:function(e,t,n){e.$watch(n.ngModel,a=>{this.isFromGrid(n)&&this.exist(t)&&this.isCompiled(t)&&(a=this.prepareValue(t,a),this.formatComponent(t,a),this.compileGridListing(t,e),call=t.data("change-grid-model"),call&&call(a))})}})]).directive("cronOrderedList",["$compile","$sce","$parse",function(e,t,n){"use strict";return{restrict:"EA",replace:!0,link:function(t,n,a,i){let o=a.attributeValue,d=a.orderedAttributeValue,l=a.listType,r=n[0].children[0].children;r=$(r);let s="",c="";$.each(r,function(e,t){c+=t.outerHTML});"numbered-list"===l?s=`<ol style="list-style-type: ${o}">${c}</ol>`:"ordered-list"===l?s=`<ul style="list-style-type: ${d}">${c}</ul>`:void 0;s=$(s),$(n).replaceWith(s),e(s)(t)}}}]).directive("crnInfiniteScroll",["$compile",function($compile){"use strict";return{restrict:"EA",link:function(scope,element,attrs){var dataSource=attrs.crnInfiniteScroll?eval(attrs.crnInfiniteScroll):attrs.crnDatasource?eval(attrs.crnDatasource):void 0;if(dataSource){let e={isVisible:!1,checkVisibility:function(t){if(e.isVisible!==t&&(e.isVisible=t,e.isVisible))if(dataSource.loaded&&dataSource.loadedFinish)dataSource.nextPage();else{let e=setInterval(function(){dataSource.loaded&&dataSource.loadedFinish&&(dataSource.nextPage(),clearInterval(e))},250)}},eventScroll:function(){var t=element.offset().top,n=element.offset().top+element.outerHeight(),a=$(window).scrollTop()+$(window).innerHeight(),i=$(window).scrollTop();e.checkVisibility(a>t&&i<n)}};$(window).scroll(e.eventScroll),$(window).ready(e.eventScroll)}}}}])}(app);function maskDirectiveAsDate(e,t,n){return maskDirective(e,t,n,"as-date")}function maskDirectiveMask(e,t,n){return maskDirective(e,t,n,"mask")}function maskDirective(e,t,n,a){return{restrict:"A",require:"?ngModel",link:function(i,o,d,l){if("as-date"!=a||void 0===d.mask){var r=n(d.ngModel),s=r.assign,c=$(o);if(!c.data("alreadycompiled")){c.data("alreadycompiled",!0),c.data("$compile",e);var p=c.attr("type");if("checkbox"!=p&&"password"!=p&&"url"!=p){if("color"==p||"range"==p)return c[0].classList.remove("form-control"),void c[0].classList.remove("k-textbox");c.data("type",p),c.attr("type","text"),l&&(l.$formatters=[],l.$parsers=[]),void 0!==d.asDate&&"text"==p&&(p="date");var u=!0,m=!1,g=d.mask||d.format;g=g?parseMaskType(g,t):parseMaskType(p,t),g.endsWith(";0")&&(m=!0);var f=g.replace(";1","").replace(";0","").trim();if(null!=f&&0!=f.length)if("date"==p||"datetime"==p||"datetime-local"==p||"month"==p||"time"==p||"time-local"==p||"week"==p){var h={format:f,locale:t.use(),showTodayButton:!0,useStrict:!0,tooltips:{today:t.instant("DatePicker.today"),clear:t.instant("DatePicker.clear"),close:t.instant("DatePicker.close"),selectMonth:t.instant("DatePicker.selectMonth"),prevMonth:t.instant("DatePicker.prevMonth"),nextMonth:t.instant("DatePicker.nextMonth"),selectYear:t.instant("DatePicker.selectYear"),prevYear:t.instant("DatePicker.prevYear"),nextYear:t.instant("DatePicker.nextYear"),selectDecade:t.instant("DatePicker.selectDecade"),prevDecade:t.instant("DatePicker.prevDecade"),nextDecade:t.instant("DatePicker.nextDecade"),prevCentury:t.instant("DatePicker.prevCentury"),nextCentury:t.instant("DatePicker.nextCentury")}};"DD/MM/YYYY"!=f&&"MM/DD/YYYY"!=f&&(h.sideBySide=!0);var v="date"==p||"datetime"==p||"time"==p;if(window.fixedTimeZone||(v=!1),c.data("mask",f),c.data("useUTC",v),c.attr("from-grid")){var b=function(){var e=$(this).offset(),t=!0,n=$(this).parent().find(".bootstrap-datetimepicker-widget.dropdown-menu.usetwentyfour.bottom");if(n.length||(t=!1,n=$(this).parent().find(".bootstrap-datetimepicker-widget.dropdown-menu.usetwentyfour.top")),$(n).offset()){var a=$(n).offset().left,i=$("body");n.appendTo(i);var o=0;o=t?e.top+35:e.top-($(n).height()+15),n.css("top",o),n.css("bottom","auto"),n.css("left",a),n.css("z-index",999999)}};if(c.on("click",b),c.on("focus",function(){setTimeout(b.bind(this),100)}),c.on("dp.change",function(){i.safeApply(function(){var e=null;e=v?moment(c.val(),f).utcOffset(window.timeZoneOffset,!0):moment(c.val(),f),("time"==p||"time-local"==p)&&(e=e.year(1970).dayOfYear(1).month(0)),e.isValid()&&l&&s(i,e.toDate())})}),c.data("initial-value")){var y=c.data("initial-value"),k=null;k=v?moment(y).utcOffset(window.timeZoneOffset):moment(y),c.val(k.format(f)),c.data("initial-value",null)}}else c.wrap("<div style=\"position:relative\"></div>");c.datetimepicker(h),"true"!==d.fromGrid&&c.on("dp.change",function(){$(this).is(":visible")&&($(this).trigger("change"),i.safeApply(function(){var e=c.val(),t=null;t=v?moment(e,f).utcOffset(window.timeZoneOffset,!0):moment(e,f),("time"==p||"time-local"==p)&&(t=t.year(1970).dayOfYear(1).month(0)),t.isValid()&&l&&s(i,t.toDate())}))}),l&&(l.$formatters.push(function(e){if(e)return formatWithMomentAs(f,v,e,"string");if(null===e){var t=c.datetimepicker(h).data("DateTimePicker");t.date(null)}return null}),l.$parsers.push(function(e){if(e){if(e instanceof Date)return e;var t=null;if(t=v?moment(e,f).utcOffset(window.timeZoneOffset,!0):moment(e,f),("time"==p||"time-local"==p)&&(t=t.year(1970).dayOfYear(1).month(0)),"string"==typeof e&&e.length<f.length){let t=formatWithMomentAs(f,v,e,"string");t.startsWith(e)&&e.length<t.length&&(isNaN(t[e.length])||" "===t[e.length])&&l.$$element.val(t.substring(0,e.length+1))}return t.toDate()}return null}))}else if("number"==p||"money"==p||"integer"==p||"money-decimal"==p){m=!0;var C=f.trim().replace(/\./g,"").replace(/\,/g,"").replace(/#/g,"").replace(/0/g,"").replace(/9/g,""),w="",S="",D="",T=",",x=0;f.startsWith(C)?w=C:f.endsWith(C)&&(S=C);var M=f.trim().replace(w,"").replace(S,"").trim();M.startsWith("#.")?D=".":M.startsWith("#,")&&(D=",");var I=null;if(-1==M.indexOf(",0")?-1!=M.indexOf(".0")&&(T=".",I=".0"):(T=",",I=",0"),null!=I){var E=M.substring(M.indexOf(I)+1);x=E.length}var A="numeric";0==x&&(A="integer"),"money-decimal"==p&&(A="currency");var F={rightAlign:"money"==p||"money-decimal"==p,unmaskAsNumber:!0,allowMinus:!0,prefix:w,suffix:S,radixPoint:T,digits:x,numericInput:"money-decimal"==p};D&&(F.autoGroup=!0,F.groupSeparator=D),$(o).inputmask(A,F),useInputMaskPlugin(o,l,i,s,f)}else if("text"==p||"tel"==p||"string"==p){let e=["D","M","Y","H","m","s"],t=t=>(e.forEach(e=>t=t.replaceAll(e,"9")),t);f=t(f),d.maskPlaceholder?(h={},h.placeholder=d.maskPlaceholder,$(o).inputmask(f,h),m&&useInputMaskPlugin(o,l,i,s,f)):(c.mask(f),useMaskPlugin(o,l,i,s,m))}}}}}}}function useInputMaskPlugin(e,t,n,a,i){var o=$(e),d=function(){$(this).data("rawvalue",$(this).inputmask("unmaskedvalue"))};$(e).on("keydown",d).on("keyup",d),t&&(t.$formatters.push(function(e){return null!=e&&null!=e&&""!==e?format(i,e):null}),t.$parsers.push(function(e){if(e!=null&&null!=e&&""!==e){var t=o.inputmask("unmaskedvalue");if(""!==t)return t}return null}))}function useMaskPlugin(e,t,n,a,i){var o=$(e),d=function(){i&&$(this).data("rawvalue",$(this).cleanVal())};$(e).on("keydown",d).on("keyup",d),i&&t&&(t.$formatters.push(function(e){return e?o.masked(e):null}),t.$parsers.push(function(e){return e?o.cleanVal():null}))}function parseMaskType(e,t){return"datetime"==e||"datetime-local"==e?(e=t.instant("Format.DateTime"),"Format.DateTime"==e&&(e="DD/MM/YYYY HH:mm:ss")):"date"==e?(e=t.instant("Format.Date"),"Format.Date"==e&&(e="DD/MM/YYYY")):"time"==e||"time-local"==e?(e=t.instant("Format.Hour"),"Format.Hour"==e&&(e="HH:mm:ss")):"month"==e?e="MMMM":"number"==e?(e=t.instant("Format.Decimal"),"Format.Decimal"==e&&(e="#.#00,00")):"money"==e||"money-decimal"==e?(e=t.instant("Format.Money"),"Format.Money"==e&&(e="#.#00,00")):"integer"==e?(e=t.instant("Format.Integer"),"Format.Integer"==e&&(e="#,##0.####")):"week"==e?e="dddd":"tel"==e?e="(00) 00000-0000;0":"text"==e?e="":"string"==e&&(e=""),e}function transformText(){return{restrict:"E",require:"?ngModel",link:function(e,t,n,a){var i=function(e,t){if(e){if(t!==void 0&&null!==t){if("uppercase"===e.css("text-transform"))return t.toUpperCase();if("lowercase"===e.css("text-transform"))return t.toLowerCase()}return t}};a&&(a.$formatters.push(function(e){return i(t,e)}),a.$parsers.push(function(e){return i(t,e)}))}}}app.kendoHelper={getCorrectlyDS:(e,t)=>{if(t[e]&&t[e].apiVersion)return t[e];else{let n=t.$parent[e];return t[e]=n,n}},getCorrectlyDSPromise:async(e,t)=>new Promise((n,a)=>{let i=()=>{let o=null;if(t[e]&&t[e].apiVersion)o=t[e];else{let n=t.$parent[e];t[e]=n,o=n}o?n(o):$(`datasource[name="${e}"]`).length?setTimeout(()=>i(),100):a(null)};i()}),receivePushData:e=>!e||!e.dataSource||(e.dataSource.transport.options.refComponent=e),getSchema:function(e){var t=[{kendoType:"string",entityType:["string","character","uuid","guid"]},{kendoType:"number",entityType:["integer","long","double","int","float","bigdecimal","single","int32","int64","decimal","byte"]},{kendoType:"date",entityType:["date","time","datetime"]},{kendoType:"boolean",entityType:["boolean"]}],n=function(e){for(var n=0;n<t.length;n++)if(t[n].entityType.includes(e.toLocaleLowerCase()))return t[n].kendoType;return"string"},a={model:{id:"__$id",fields:{}}};return e&&e.schemaFields&&(e.schemaFields.forEach(function(e){a.model.fields[e.name]={type:n(e.type),editable:!0,nullable:e.nullable,validation:{required:!e.nullable}}}),a.model.fields.__$id={type:"string",editable:!0,nullable:!0,validation:{required:!1}}),a},getDataSource:function(t,n,a,i,o,d){var l=Number.MAX_SAFE_INTEGER_32;function r(t){if(t.response&&t.response.d){var e=null;e=t.response.d.results?t.response.d.results:[t.response.d],this.group().length?o.forEach(function(t){if("Database"==t.dataType){var n="datetime-local"==t.type||"month"==t.type||"time-local"==t.type||"week"==t.type;if(n)for(var a,o=0;o<e.length;o++)a=e[o],t.field==a.Member&&(a.Key=a.Key.replace(/\d+/,function(e){return parseInt(e)+g})),s.bind(this)(a.Items)}}):s.bind(this)(e)}}function s(e){for(var t=0;t<e.length;t++)o&&o.forEach(function(n){if("Database"==n.dataType){var a="datetime-local"==n.type||"month"==n.type||"time-local"==n.type||"week"==n.type;a&&e[t][n.field]&&(e[t][n.field]=e[t][n.field].replace(/\d+/,function(e){return parseInt(e)+g}))}})}function c(e){var t=[];return e&&e.forEach(function(e){e.aggregates&&e.aggregates.forEach(function(n){t.push({field:e.field,aggregate:n.type})})}),t}var p=this.getSchema(t);o&&o.forEach(function(e){for(var t in p.model.fields)if("Database"==e.dataType&&e.field==t){if(p.model.fields[t].nullable=!e.required,p.model.fields[t].validation.required=e.required,"999.999.999-99;0"===e.format||"99.999.999/9999-99;0"===e.format){let n="999.999.999-99;0"===e.format?"cpf":"cnpj",a={cpf:CPF,cnpj:CNPJ},i=t.toLocaleLowerCase()+"validation";p.model.fields[t].validation[i]=function(e){return!(e.is("[name='"+t+"']")&&""!=e.val())||a[n].isValid(e.val())}}break}});var u=function(e){for(var t in e)if(p.model.fields.hasOwnProperty(t)){var n=p.model.fields[t];"string"==n.type&&null!=e[t]?e[t]+="":"number"==n.type&&null!=e[t]?e[t]=parseFloat(e[t]):"date"==n.type&&null!=e[t]?e[t]="/Date("+e[t].getTime()+")/":"boolean"==n.type&&(null==e[t]?e[t]=!1:e[t]="true"==e[t].toString().toLowerCase()),p.model.id==t&&null!=e[t]&&0==e[t].toString().length&&delete e[t]}return e},m=10;app.kendoHelper.getCorrectlyDS(t.name,n)&&(m=app.kendoHelper.getCorrectlyDS(t.name,n).rowsPerPage);var g=6e4*new Date().getTimezoneOffset(),f=app.common.generateId(),h={transport:{setActiveAndPost:function(t){var e=this.options.cronappDatasource;n.safeApply(e.updateActive(u(t.data))),e.active.__sender=f,e.postSilent(function(e){this.options.enableAndSelect(t),t.success(e),this.options.refComponent.dataSource._pristineTotal=this.options.refComponent.dataSource._pristineData.push(e)}.bind(this),function(e){this.options.enableAndSelect(t),t.error(e,e,e)}.bind(this))},pushAction:function(e,t){return n=>{let a=["read","memorydelete","overRideRefresh"];if(this.options.isComponentInDocument(this.options.refComponent)){let a=this.options.getCurrentCallbackForPush(t,this.options.refComponent),i=a[e];i?i(n):(this.options.fromRead="read"===e,this.options.cronappDatasource.reloadedFromCronapi&&(this.options.fromRead=!1,delete this.options.cronappDatasource.reloadedFromCronapi),"overRideRefresh"===e&&(this.options.refComponent.dataSource._page=1,this.options.refComponent.dataSource._skip=0),this.options.refComponent.dataSource.read())}else a.includes(e)||this.options.cronappDatasource.removeDataSourceEvents(this.options.dataSourceEventsPush)}},push:function(e){!this.options.dataSourceEventsPush&&this.options.cronappDatasource&&(this.options.dataSourceEventsPush={create:this.pushAction.bind(this)("pushUpdate",e),update:this.pushAction.bind(this)("pushUpdate",e),delete:this.pushAction.bind(this)("pushDestroy",e),overRideRefresh:this.pushAction.bind(this)("overRideRefresh",e),read:this.pushAction.bind(this)("read",e),memorycreate:this.pushAction.bind(this)("pushUpdate",e),memoryupdate:this.pushAction.bind(this)("pushUpdate",e),memorydelete:this.pushAction.bind(this)("pushDestroy",e)},"combobox"==this.origin&&delete this.options.dataSourceEventsPush.overRideRefresh,this.options.cronappDatasource.addDataSourceEvents(this.options.dataSourceEventsPush))},read:function(n){var e=!1;try{var a=this.options.cronappDatasource;this.options.kendoCallback?this.options.fromRead?this.options.kendoCallback.success(a.data):e=!0:(this.options.kendoCallback=n,e=!0)}finally{this.options.fromRead=!1}if(e){for(key in n.data)null==n.data[key]&&delete n.data[key];var i=kendo.data.transports.odata.parameterMap(n.data,"read"),o="";this.options.refComponent&&this.options.refComponent.dataSource.group().forEach(function(e){o+=e.field+" "+e.dir+","}),0<o.length&&(o=o.substr(0,o.length-1),i.$orderby=i.$orderby?o+","+i.$orderby:o);var a=this.options.cronappDatasource;if(a.rowsPerPage=n.data.pageSize,a.offset=n.data.page-1,!n.data.pageSize&&(a.rowsPerPage=l,a.offset=void 0,i.$skip=0,this.options.refComponent&&1!=this.options.refComponent.dataSource.page()))return this.options.refComponent.dataSource.page(1),void n.error("canceled","canceled","canceled");var d={params:i},r=!1;t.append&&(r=t.append);var s={};"button"===a.loadDataStrategy&&0<a.data.length&&(s.origin=a.loadDataStrategy),a.append=r,a.fetch(d,{success:function(e){n.success(e)},canceled:function(e){n.error("canceled","canceled","canceled")},error:function(e){n.error("canceled","canceled","canceled")}},r,s)}},update:function(t){this.setActiveAndPost(t)},create:function(t){this.setActiveAndPost(t)},destroy:function(t){cronappDatasource=this.options.cronappDatasource,cronappDatasource.removeSilent(t.data,function(e){t.success(e)},function(e){t.error("canceled","canceled","canceled")})},batch:function(t){},options:{fromRead:!1,disableAndSelect:function(t){this.isComponentInDocument(this.refComponent)&&(this.refComponent.select(t.container),this.refComponent.options.selectable=!1,this.refComponent.selectable&&this.refComponent.selectable.element&&(this.refComponent.selectable.destroy(),this.refComponent.selectable=null))},enableAndSelect:function(t){this.isComponentInDocument(this.refComponent)&&(this.refComponent.options.selectable=this.refComponent.options.originalSelectable,this.refComponent._selectable(),this.refComponent.select(t.container))},selectActiveInGrid:function(e){if(this.isComponentInDocument(this.refComponent)&&this.refComponent.selectable&&0<this.refComponent.dataItems().length&&this.cronappDatasource.active&&this.cronappDatasource.active.__$id){for(var t=this.refComponent.dataItems(),n=-1,a=0;a<t.length;a++)if(this.cronappDatasource.active.__$id==t[a].__$id){n=a;break}-1<n&&!this.refComponent.selectable.options.multiple&&this.refComponent.select(this.refComponent.table.find("tr")[n+1])}},isComponentInDocument:function(e){return!!e&&$(document).has(e.element[0]).length},getCurrentCallbackForPush:function(e,t){return e?e:t},cronappDatasource:app.kendoHelper.getCorrectlyDS(t.name,n)}},pageSize:m,serverPaging:!0,serverFiltering:!0,serverSorting:!0,batch:!1,schema:p,requestEnd:r};return h.aggregate=c(o),h.schema.total=function(){return h.transport.options.cronappDatasource.getRowsCount()},d&&(h.group=[],d.forEach(function(e){var t={field:e.field,aggregates:h.aggregate};h.group.push(t)})),h},getEventReadCombo:function(t){var e=this.options.cronappDatasource;if(!e)return void t.error("canceled","canceled","canceled");this.options.kendoCallback||(this.options.kendoCallback=t);var n;if(this.options.combobox&&this.options.combobox.options.readData)return t.success(this.options.combobox.options.readData),this.options.combobox.options.readData=null,void(this.options.alreadyLoaded=!0);this.options.combobox?n=!this.options.alreadyLoaded:e.__ignoreFirstFetch?(n=!0,delete e.__ignoreFirstFetch):n=!1,this.options.alreadyLoaded=!0;var a=!0;if(n&&(a=!1,e.lazy?t.success([{}]):t.success([])),(this.options.fromRead||this.options.combobox&&void 0===this.options.combobox.options.firstLazyRead)&&(this.options.fromRead=!1,this.options.kendoCallback.success(e.data),a=!1),a){for(key in t.data)null==t.data[key]&&delete t.data[key];var i=kendo.data.transports.odata.parameterMap(t.data,"read");e.rowsPerPage=t.data.pageSize,e.offset=t.data.page-1;var o=this,d=!0,l={};l.params=i,o.options.combobox&&(o.options.combobox.options.fromCombo=!0),e.fetch(l,{success:function(e){if(t.success&&(o.options.combobox&&(o.options.combobox.options.expanded=!0),t.success(e),o?.options?.combobox?.span&&o.options.$compile(o.options.combobox.span)(o.options.scope),o.options.kendoCallback=t,o.options&&o.options.combobox&&o.options.combobox.element[0].id)){var n=" .k-animation-container",a=angular.element($(" .k-animation-container"));o.options.$compile(a)(o.options.scope)}},canceled:function(e){o.options.combobox&&(o.options.combobox.options.fromCombo=!1),t.success&&t.error("canceled","canceled","canceled")},error:function(e){o.options.combobox&&(o.options.combobox.options.fromCombo=!1),t.success&&t.error("error","error","error")}},!1,{ignoreAtive:!0})}},parseOptionsCronToConfigKendo:function(e,t,n){let a=!1;e.dynamic&&"false"!=e.dynamic?e.dataSourceScreen&&e.dataSourceScreen.entityDataSource&&(e.dataSourceScreen.entityDataSource.append=!0,t=app.kendoHelper.getDataSource(e.dataSourceScreen.entityDataSource,n,!0,e.dataSourceScreen.rowsPerPage),t.transport.read=app.kendoHelper.getEventReadCombo,a=!0):(a=!0,e.dataValueField=e.dataValueField||"value",e.dataTextField=e.dataTextField||"key"),e.dataValueField&&""!=e.dataValueField.trim()||(e.dataValueField=null==e.dataTextField?void 0:e.dataTextField);var i=function(t){var n=e.dataSourceScreen.entityDataSource.schemaFields;for(count=0;count<n.length;count++)if(t==n[count].name){return n[count].type.toLowerCase();break}return null},o=function(e){var t=["date","time","datetime"];return-1<t.indexOf(e)?e:null};!e.customTemplate&&e.dataSourceScreen&&e.dataSourceScreen.entityDataSource&&e.dataSourceScreen.entityDataSource.schemaFields&&(e.format||o(i(e.dataTextField)))&&(e.template="#= useMask("+e.dataTextField+",'"+e.format+"','"+i(e.dataTextField)+"') #",e.valueTemplate="#= useMask("+e.dataTextField+",'"+e.format+"','"+i(e.dataTextField)+"') #");var d={dataTextField:null==e.dataTextField?void 0:e.dataTextField,dataValueField:null==e.dataValueField?void 0:e.dataValueField,dataSource:t,headerTemplate:null==e.headerTemplate?void 0:e.headerTemplate,template:null==e.template?void 0:e.template,tagTemplate:null==e.tagTemplate?void 0:e.tagTemplate,placeholder:null==e.placeholder?void 0:e.placeholder,footerTemplate:null==e.footerTemplate?void 0:e.footerTemplate,filter:null==e.filter?void 0:e.filter,valuePrimitive:a,valueTemplate:null==e.valueTemplate?void 0:e.valueTemplate,suggest:!0};return e.optionLabel&&(e.optionLabelText=e.optionLabel,e.optionLabelValue=""),d.optionLabel={},d.optionLabel[d.dataTextField]=void 0===e.optionLabelText?"":e.optionLabelText,d.optionLabel[d.dataValueField]=void 0===e.optionLabelValue?null:e.optionLabelValue,d},getConfigComboboxSync:function(e,t){var n={};if(e){if(!e.dynamic||"false"==e.dynamic){n.data=null==e.staticDataSource?void 0:e.staticDataSource;for(let a=0;a<n.data.length;a++)try{n.data[a].key&&n.data[a].key.startsWith("cronapi.server(")&&(n.data[a].key=n.data[a].key.replace(".run(",".notAsync().run("));let e=t.$eval(n.data[a].key);n.data[a].key=void 0!==e&&null!==e?e:n.data[a].key}catch(t){n.data[a].key=n.data[a].key}}return config=this.parseOptionsCronToConfigKendo(e,n,t),config}return{}},getConfigCombobox:async function(e,t){var n={};if(e){if(!e.dynamic||"false"==e.dynamic){n.data=null==e.staticDataSource?void 0:e.staticDataSource;for(let a=0;a<n.data.length;a++)try{n.data[a].key&&n.data[a].key.startsWith("cronapi.server(")&&(n.data[a].key=n.data[a].key.replace(".run(",".toPromise().run("));let e=await t.$eval(n.data[a].key);n.data[a].key=void 0!==e&&null!==e?e:n.data[a].key}catch(t){n.data[a].key=n.data[a].key}}return config=this.parseOptionsCronToConfigKendo(e,n,t),config}return{}},getConfigDate:function(e,t){var n={};if(n){var a=function(e){e=e.replace(/_/gm,"-");var t=e.split("-");return t[t.length-1]=t[t.length-1].toUpperCase(),t.join("-")},i=function(e){return e&&(e=e.replace(/:MM/gm,":mm"),e=e.replace(/:M/gm,":m"),e=e.replace(/S/gm,"s"),e=e.replace(/D/gm,"d"),e=e.replace(/Y/gm,"y")),e},o=function(t,n){return null==n&&(n=parseMaskType(t,e)),n},d={};if(t.animation)try{d=JSON.parse(t.animation)}catch(e){console.log("DateAnimation invalid configuration! "+e)}var l=o(t.type,t.format),r=i(l),s=i(t.timeFormat),c=a(e.use());n={value:null,format:r,timeFormat:s,momentFormat:l,culture:c,type:null==t.type?void 0:t.type,weekNumber:null==t.weekNumber?void 0:t.weekNumber,dateInput:null==t.dateInput?void 0:t.dateInput,animation:d,footer:null==t.footer?void 0:t.footer,start:null==t.start?void 0:t.start,depth:null==t.start?void 0:t.start}}return n},buildKendoMomentPicker:function(e,t,n,a){var i="date"==t.type||"datetime"==t.type||"time"==t.type;window.fixedTimeZone||(i=!1),e.data("mask",t.momentFormat),e.data("useUTC",i);var o=function(){var n=e.val();if(!n||""==n.trim())a&&a.$setViewValue("");else{var o=formatWithMomentAs(t.momentFormat,i,n,"date");a&&(a.$setViewValue(o),e.data("changed",!0))}};return(t.change=n?function(){n.$apply(function(){o()})}:o,"date"==t.type)?e.kendoDatePicker(t).data("kendoDatePicker"):"datetime"==t.type||"datetime-local"==t.type?e.kendoDateTimePicker(t).data("kendoDateTimePicker"):"time"==t.type||"time-local"==t.type?e.kendoTimePicker(t).data("kendoTimePicker"):void 0},getConfigSlider:function(e){e=e||{};var t={increaseButtonTitle:e.increaseButtonTitle,decreaseButtonTitle:e.decreaseButtonTitle,dragHandleTitle:e.dragHandleTitle};try{t.min=e.min?parseInt(e.min):1,t.max=e.max?parseInt(e.max):1,t.smallStep=e.smallStep?parseInt(e.smallStep):1,t.largeStep=e.largeStep?parseInt(e.largeStep):1}catch(e){console.log("Slider invalid configuration! "+e)}return t},getConfigSwitch:function(e){e=e||{};var t={onLabel:null==e.onLabel?void 0:e.onLabel,offLabel:null==e.offLabel?void 0:e.offLabel};return t},getConfigBarcode:function(e){var t={type:null==e.type?void 0:e.type,width:null==e.width?void 0:parseInt(e.width),height:null==e.height?void 0:parseInt(e.height)};return t.type||(t.type="EAN8"),t},getConfigQrcode:function(e){var t={errorCorrection:null==e.errorCorrection?void 0:e.errorCorrection,size:null==e.size?void 0:parseInt(e.size),color:null==e.color?void 0:e.color};return(e.borderColor||e.borderSize)&&(t.border={size:null==e.size?void 0:parseInt(e.size),color:null==e.color?void 0:e.color}),t}},window.showTreatedValue=function(e){return e||!1===e?e:""},window.useMask=function(e,t,n){var a="";t="null"==t||"undefined"==t?void 0:t;var i=e,o=t||n;if(null!=e&&e!=null){if(e instanceof Date){var d=moment(e).utcOffset(window.timeZoneOffset);i="\""+d.format()+"\""}else i="number"==typeof e?e:"\""+e+"\"";a="{{ "+i+" | mask:\""+o+"\":\""+n+"\"}}"}return a},window.formatWithMomentAs=function(e,t,n,a){if(!n)return;let i=null;return i=n instanceof Date||n.startsWith("/Date")?t?moment(n).utcOffset(window.timeZoneOffset):moment(n):t?moment(n,e).utcOffset(window.timeZoneOffset,!0):moment(n,e),"string"===a?i.format(e):i.toDate()};function cronFrame($compile,$sce,$parse){"use strict";return{restrict:"AE",link:function(scope,element,attrs,ngModelCtrl){scope.fragment=scope.fragment||{};var framentMap=scope.fragment[element.parent.id]||{};scope.$watch(function(){return attrs.origin},function(newVal){let template="",style=attrs.style||"",clazz=attrs.class||"";if(attrs.origin)if(attrs.type||(attrs.type="include"),"include"==attrs.type){let str=`<div style="${style}" class="${clazz}" ng-include="'${attrs.origin}'" ng-if="true"></div>`;if(template=$(str),attrs.params)try{let params=eval(attrs.params);for(let e in params){let t=params[e];"expression"==t.type?scope.$watch(t.value,function(e){framentMap[t.key]=e;var n=$(str);n.attr("onload",`params = ${JSON.stringify(framentMap)}`);var a=$compile(n)(scope);element.html(a)}):framentMap[t.key]=t.value}template.attr("onload",`params = ${JSON.stringify(framentMap)}`)}catch(e){console.error(e)}}else if("frame"==attrs.type){var url=$sce.trustAsResourceUrl(attrs.origin);template=$(`<iframe style="${style}" class="${clazz}" ng-src="${url}" width="100%" height="100%" loading="lazy"></iframe>`)}element.html(template),$compile(template)(scope)})}}}function cronReportViewer(e){return{restrict:"E",replace:!0,require:"ngModel",link:function(e,t,n,a){function i(n){var a=JSON.parse(n),i={element:t};e.$eval(a.reportCommand||a.dashboardCommand,i)}i(n.options);let o=t[0].parentElement;for(;o;)if("BODY"===o.tagName)o=null;else if(o.classList.contains("tab-pane"))break;else o=o.parentElement;if(o&&!o.classList.contains("active")){let e=new MutationObserver(function(e,t){for(let a of e)if("class"===a.attributeName&&a.target.classList.contains("active")){i(n.options),t.disconnect();break}});e.observe(o,{attributes:!0})}var d=null;e.$watch(function(){return n.options},function(e,t){e!==t&&(d&&(clearInterval(d),d=null),d=setTimeout(function(){i(e)}.bind(this),500))})}}}
|
package/js/directives.js
CHANGED
|
@@ -83,8 +83,14 @@
|
|
|
83
83
|
return {
|
|
84
84
|
restrict: 'E',
|
|
85
85
|
link: async function (scope, element, attrs, ngModelCtrl) {
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
let options = {};
|
|
87
|
+
|
|
88
|
+
try {
|
|
89
|
+
options = JSON.parse(attrs.options);
|
|
90
|
+
} catch (e) {
|
|
91
|
+
console.error(e);
|
|
92
|
+
}
|
|
93
|
+
|
|
88
94
|
const cronCalendarElement = $(element);
|
|
89
95
|
|
|
90
96
|
const culture = navigator.language || navigator.userLanguage;
|
|
@@ -5971,56 +5977,47 @@
|
|
|
5971
5977
|
}
|
|
5972
5978
|
})
|
|
5973
5979
|
|
|
5974
|
-
|
|
5975
|
-
|
|
5976
|
-
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
|
|
5980
|
-
|
|
5981
|
-
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
|
|
5987
|
-
|
|
5988
|
-
|
|
5989
|
-
|
|
5990
|
-
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
if (!nextPageInfinite.isLoading && dataSource.loaded && dataSource.loadedFinish) {
|
|
5997
|
-
nextPageInfinite.isLoading = true;
|
|
5998
|
-
dataSource.nextPage().finally(() => {
|
|
5999
|
-
nextPageInfinite.isLoading = false;
|
|
6000
|
-
});
|
|
6001
|
-
}
|
|
6002
|
-
},
|
|
6003
|
-
|
|
6004
|
-
eventScroll: function() {
|
|
6005
|
-
let visible = nextPageInfinite.checkVisibility();
|
|
6006
|
-
if (visible) {
|
|
6007
|
-
nextPageInfinite.loadNextPage();
|
|
5980
|
+
.directive('crnInfiniteScroll', ['$compile', function($compile){
|
|
5981
|
+
'use strict';
|
|
5982
|
+
return {
|
|
5983
|
+
restrict: 'EA',
|
|
5984
|
+
link: function(scope, element, attrs) {
|
|
5985
|
+
var dataSource = attrs.crnInfiniteScroll ? eval(attrs.crnInfiniteScroll) : attrs.crnDatasource ? eval(attrs.crnDatasource): undefined;
|
|
5986
|
+
if (dataSource) {
|
|
5987
|
+
let nextPageInfinite = {
|
|
5988
|
+
isVisible: false,
|
|
5989
|
+
checkVisibility: function(visible) {
|
|
5990
|
+
if (nextPageInfinite.isVisible !== visible) {
|
|
5991
|
+
nextPageInfinite.isVisible = visible;
|
|
5992
|
+
if (nextPageInfinite.isVisible) {
|
|
5993
|
+
if (dataSource.loaded && dataSource.loadedFinish) {
|
|
5994
|
+
dataSource.nextPage();
|
|
5995
|
+
} else {
|
|
5996
|
+
let intervalNextPage = setInterval(function() {
|
|
5997
|
+
if (dataSource.loaded && dataSource.loadedFinish) {
|
|
5998
|
+
dataSource.nextPage();
|
|
5999
|
+
clearInterval(intervalNextPage);
|
|
6000
|
+
}
|
|
6001
|
+
}, 250);
|
|
6008
6002
|
}
|
|
6009
6003
|
}
|
|
6010
|
-
}
|
|
6011
|
-
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
$(window).
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
console.error('DataSource não foi definido ou não está acessível.');
|
|
6004
|
+
}
|
|
6005
|
+
},
|
|
6006
|
+
eventScroll: function() {
|
|
6007
|
+
var topElem = element.offset().top;
|
|
6008
|
+
var botElem = element.offset().top + element.outerHeight();
|
|
6009
|
+
var botScrn = $(window).scrollTop() + $(window).innerHeight();
|
|
6010
|
+
var topScrn = $(window).scrollTop();
|
|
6011
|
+
nextPageInfinite.checkVisibility((botScrn > topElem) && (topScrn < botElem));
|
|
6019
6012
|
}
|
|
6020
|
-
}
|
|
6021
|
-
|
|
6013
|
+
};
|
|
6014
|
+
$(window).scroll(nextPageInfinite.eventScroll);
|
|
6015
|
+
$(window).ready(nextPageInfinite.eventScroll);
|
|
6016
|
+
}
|
|
6022
6017
|
}
|
|
6023
|
-
|
|
6018
|
+
}
|
|
6019
|
+
}])
|
|
6020
|
+
|
|
6024
6021
|
}(app));
|
|
6025
6022
|
|
|
6026
6023
|
function maskDirectiveAsDate($compile, $translate, $parse) {
|