cronapp-framework-js 2.8.36 → 2.8.39

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 +1 @@
1
- (function(){'use strict';function a(a,b,c,d,e){function f(a){c.openURLContent(a.data)}b.getDescription=function(a){var b=a.name;return a.description&&(b=a.description,-1<b.indexOf("{{")&&-1<b.indexOf("}}")&&(b=b.replace("{{","").replace("}}",""),b=window.cronapi.i18n.translate(b,[]))),b},b.cloneElement=function(a){return angular.copy(a)},b.isVisibleParam=function(a){if("DATA_LIMIT"==a.name)return!1;return!(""!==a.value)||!(""!=a.value)};var g=d.reportName.match(/\/(.*?)(.*?)(\.jrxml|\.report)/);b.report=d,b.report.name=g[2],b.htmlParameters=e,b.onPrint=function(){b.report.reportName.endsWith(".report")?c.openStimulsoftReport(b.report.contentData,b.report.parameters,b.report.datasourcesInBand):c.getPDFAsFile(b.report).then(f)},b.onCancel=function(){a.dismiss("cancel")}}angular.module("custom.controllers").controller("ParameterController",a).filter("trusted",["$sce",function(a){return function(b){return a.trustAsHtml(b)}}]).directive("compile",["$compile","$timeout",function(a,b){return{restrict:"A",link:function(c,d){b(function(){a(d.contents())(c)})}}}]).directive("formatDate",function(){return{require:"ngModel",link:function(a,b,c,d){d.$formatters.push(function(a){return a?new Date(a):null})}}}),a.$inject=["$modalInstance","$scope","ReportService","report","htmlParameters"]})();
1
+ (function(){"use strict";function a(a,b,c,d,e){function f(a){c.openURLContent(a.data)}b.getDescription=function(a){var b=a.name;return a.description&&(b=a.description,-1<b.indexOf("{{")&&-1<b.indexOf("}}")&&(b=b.replace("{{","").replace("}}",""),b=window.cronapi.i18n.translate(b,[]))),b},b.cloneElement=function(a){return angular.copy(a)},b.isVisibleParam=function(a){if("DATA_LIMIT"==a.name)return!1;return!(""!==a.value)||!(""!=a.value)};var g=d.reportName.match(/\/(.*?)(.*?)(\.jrxml|\.report)/);b.report=d,b.report.name=g[2],b.htmlParameters=e,b.onPrint=function(){b.report.reportName.endsWith(".report")?c.openStimulsoftReport(b.report.contentData,b.report.parameters,b.report.datasourcesInBand):c.getPDFAsFile(b.report).then(f)},b.onCancel=function(){a.dismiss("cancel")}}angular.module("custom.controllers").controller("ParameterController",a).filter("trusted",["$sce",function(a){return function(b){return a.trustAsHtml(b)}}]).directive("compile",["$compile","$timeout",function(a,b){return{restrict:"A",link:function(c,d){b(function(){a(d.contents())(c)})}}}]).directive("formatDate",function(){return{require:"ngModel",link:function(a,b,c,d){d.$formatters.push(function(a){return a?new Date(a):null})}}}),a.$inject=["$modalInstance","$scope","ReportService","report","htmlParameters"]})();
package/js/directives.js CHANGED
@@ -1786,40 +1786,47 @@
1786
1786
  }
1787
1787
  return obj;
1788
1788
  },
1789
- generateToolbarButtonCall: function(toolbarButton, scope, options) {
1789
+ removeSpecialChar: function(value) {
1790
+ return value.replace(/[^a-zA-Z0-9]/g, "").toLowerCase();
1791
+ },
1792
+ generateToolbarButtonCall: function(toolbarButton, scope, options, attrs) {
1790
1793
  var buttonCall;
1791
1794
  var generateObjTemplate = function(functionToCall, title, iconClass) {
1792
1795
  var obj = {
1793
1796
  template: function() {
1794
- var buttonId = app.common.generateId();
1795
- return createTemplateButton(buttonId, functionToCall, title, iconClass);
1797
+ return createTemplateButton(functionToCall, title, iconClass);
1796
1798
  }.bind(this)
1797
1799
  };
1798
1800
  return obj;
1799
1801
  }.bind(this);
1800
1802
 
1801
- var createTemplateButton = function(buttonId, functionToCall, title, iconClass) {
1803
+ var createTemplateButton = function(functionToCall, title, iconClass) {
1802
1804
  var template = '';
1803
1805
 
1804
1806
  let security = toolbarButton.security ? `cronapp-security="${toolbarButton.security}"` : "";
1805
1807
 
1808
+ let modelName = this.removeSpecialChar(attrs.ngModel);
1809
+ let buttonType = this.removeSpecialChar(toolbarButton.type);
1810
+ let buttonDesc = toolbarButton.title ? this.removeSpecialChar(toolbarButton.title): this.removeSpecialChar(toolbarButton.iconClass);
1811
+ let buttonId = `${modelName}-${buttonType}-${buttonDesc}`;
1812
+
1806
1813
  if (toolbarButton.type == "SaveOrCancelChanges") {
1807
1814
  if (toolbarButton.saveButton)
1808
- template = '<a #SECURITY# role="button" class="saveorcancelchanges k-button k-button-icontext k-grid-save-changes" id="#BUTTONID#" href="javascript:void(0)"><span class="k-icon k-i-check"></span>#TITLE#</a>';
1815
+ template = '<a #SECURITY# role="button" class="saveorcancelchanges k-button k-button-icontext k-grid-save-changes" data-id="#BUTTONID#" href="javascript:void(0)"><span class="k-icon k-i-check"></span>#TITLE#</a>';
1809
1816
  else
1810
- template = '<a #SECURITY# role="button" class="saveorcancelchanges k-button k-button-icontext k-grid-cancel-changes" id="#BUTTONID#" href="javascript:void(0)"><span class="k-icon k-i-cancel" ></span>#TITLE#</a>';
1817
+ template = '<a #SECURITY# role="button" class="saveorcancelchanges k-button k-button-icontext k-grid-cancel-changes" data-id="#BUTTONID#" href="javascript:void(0)"><span class="k-icon k-i-cancel" ></span>#TITLE#</a>';
1811
1818
  }
1812
1819
  else if (toolbarButton.type == "Blockly" || toolbarButton.type == "Customized") {
1813
- template = '<a #SECURITY# class="k-button k-grid-custom" id="#BUTTONID#" href="javascript:void(0)"><span class="#ICONCLASS#" ></span>#TITLE#</a>';
1820
+ template = '<a #SECURITY# class="k-button k-grid-custom" data-id="#BUTTONID#" href="javascript:void(0)"><span class="#ICONCLASS#" ></span>#TITLE#</a>';
1814
1821
  }
1815
1822
  else if (toolbarButton.type == "Native" && toolbarButton.title == 'create') {
1816
- template = '<a #SECURITY# role="button" id="#BUTTONID#" class="k-button k-button-icontext k-grid-add" href="javascript:void(0)"><span class="k-icon k-i-plus"></span>{{"Add" | translate}}</a>';
1823
+ template = '<a #SECURITY# role="button" data-id="#BUTTONID#" class="k-button k-button-icontext k-grid-add" href="javascript:void(0)"><span class="k-icon k-i-plus"></span>{{"Add" | translate}}</a>';
1817
1824
  }
1818
1825
  else if (toolbarButton.type == "Native" && toolbarButton.title == 'excel') {
1819
- template = '<a #SECURITY# role="button" id="#BUTTONID#" class="k-button k-button-icontext k-grid-excel" href="javascript:void(0)"><span class="k-icon k-i-file-excel"></span>{{"exportExcel" | translate}}</a>';
1826
+ template = '<a #SECURITY# role="button" data-id="#BUTTONID#" class="k-button k-button-icontext k-grid-excel" href="javascript:void(0)"><span class="k-icon k-i-file-excel"></span>{{"exportExcel" | translate}}</a>';
1820
1827
  }
1821
1828
  else if (toolbarButton.type == "Native" && toolbarButton.title == 'pdf') {
1822
- template = '<a #SECURITY# role="button" id="#BUTTONID#" class="k-button k-button-icontext k-grid-pdf" href="javascript:void(0)"><span class="k-icon k-i-file-pdf"></span>{{"exportPDF" | translate}}</a>';
1829
+ template = '<a #SECURITY# role="button" data-id="#BUTTONID#" class="k-button k-button-icontext k-grid-pdf" href="javascript:void(0)"><span class="k-icon k-i-file-pdf"></span>{{"exportPDF" | translate}}</a>';
1823
1830
  }
1824
1831
 
1825
1832
  template = template
@@ -1832,13 +1839,14 @@
1832
1839
  var cronappDatasource = eval(options.dataSourceScreen.entityDataSource.name);
1833
1840
 
1834
1841
  var waitRender = setInterval(function() {
1835
- if ($('#' + buttonId).length > 0) {
1842
+ if ($(`[data-id=${buttonId}]`).length > 0) {
1836
1843
  scope.safeApply(function() {
1837
- var x = angular.element($('#' + buttonId ));
1844
+ var x = angular.element($(`[data-id=${buttonId}]`));
1838
1845
  $compile(x)(scope);
1846
+ $(`[data-id=${buttonId}]`).attr('id', buttonId);
1839
1847
  });
1840
1848
 
1841
- $('#' + buttonId).click(function() {
1849
+ $(`[data-id=${buttonId}]`).click(function() {
1842
1850
 
1843
1851
  var currentGrid = options.refComponent;
1844
1852
  var selectedRows = [];
@@ -2048,7 +2056,7 @@
2048
2056
  return widthDevice;
2049
2057
  },
2050
2058
 
2051
- getColumns: function(options, datasource, scope, tooltips) {
2059
+ getColumns: function(options, datasource, scope, tooltips, attrs) {
2052
2060
  var helperDirective = this;
2053
2061
 
2054
2062
  function getTemplate(column) {
@@ -2214,6 +2222,28 @@
2214
2222
 
2215
2223
  }
2216
2224
 
2225
+ function setIdCommandButton(idForCommand, command) {
2226
+ let waitRender = setInterval(() => {
2227
+ if ($(`.k-grid-${idForCommand}`).is(":visible")) {
2228
+ clearInterval(waitRender);
2229
+ var currentGrid = options.refComponent;
2230
+
2231
+ $(`.k-grid-${idForCommand}`).each((idx,elem) => {
2232
+ let $elem = $(elem);
2233
+ if (!$elem.attr('id')) {
2234
+ let item = currentGrid.dataItem($elem.closest('tr'));
2235
+
2236
+ let modelName = this.removeSpecialChar(attrs.ngModel);
2237
+ let key = item["_objectKey"];
2238
+ let id = `${modelName}-${command}-${key}`;
2239
+ $elem.attr('id', id);
2240
+ }
2241
+ });
2242
+
2243
+ }
2244
+ }, 200);
2245
+ }
2246
+
2217
2247
  function getCommandForEditButtonDatabase(opt, command) {
2218
2248
  var cmd;
2219
2249
  let idForCommand = app.common.generateId();
@@ -2254,6 +2284,7 @@
2254
2284
  text: { edit: " ", update: " ", cancel: " " },
2255
2285
  };
2256
2286
  }
2287
+ setIdCommandButton.bind(this)(idForCommand, command);
2257
2288
  return cmd;
2258
2289
  }
2259
2290
 
@@ -2285,6 +2316,7 @@
2285
2316
  template: template
2286
2317
  };
2287
2318
  }
2319
+ setIdCommandButton.bind(this)(idForCommand, command);
2288
2320
  return cmd;
2289
2321
  }
2290
2322
 
@@ -2516,6 +2548,7 @@
2516
2548
  attributes: getAttributes(column)
2517
2549
  };
2518
2550
  columns.push(addColumn);
2551
+ setIdCommandButton.bind(this)(idForCommand, column.dataType);
2519
2552
  }
2520
2553
  else if (column.dataType == "Selectable") {
2521
2554
  var checkColumn = {
@@ -2541,7 +2574,7 @@
2541
2574
 
2542
2575
  return pageable;
2543
2576
  },
2544
- getToolbar: function(options, scope) {
2577
+ getToolbar: function(options, scope, attrs) {
2545
2578
 
2546
2579
  function generateToolbarTemplate(toolbarButton) {
2547
2580
  let security = toolbarButton.security ? `cronapp-security="${toolbarButton.security}" class` : "class";
@@ -2567,7 +2600,7 @@
2567
2600
  else {
2568
2601
  toolbarButton.methodCall += "cronapi.internal.focusFormInput();"
2569
2602
  }
2570
- var button = this.generateToolbarButtonCall(toolbarButton, scope, options);
2603
+ var button = this.generateToolbarButtonCall(toolbarButton, scope, options, attrs);
2571
2604
  toolbar.push(button);
2572
2605
 
2573
2606
  if (!options.hideModalButtons) {
@@ -2575,7 +2608,7 @@
2575
2608
  }
2576
2609
  }
2577
2610
  else {
2578
- let toolbarOp = this.generateToolbarButtonCall(toolbarButton, scope, options);
2611
+ let toolbarOp = this.generateToolbarButtonCall(toolbarButton, scope, options, attrs);
2579
2612
  toolbar.push(toolbarOp);
2580
2613
  }
2581
2614
  }
@@ -2587,12 +2620,12 @@
2587
2620
  }
2588
2621
  }
2589
2622
  else if (toolbarButton.type == "Blockly" || toolbarButton.type == "Customized") {
2590
- var buttonBlockly = this.generateToolbarButtonCall(toolbarButton, scope, options);
2623
+ var buttonBlockly = this.generateToolbarButtonCall(toolbarButton, scope, options, attrs);
2591
2624
  toolbar.push(buttonBlockly);
2592
2625
  }
2593
2626
  else if (toolbarButton.type == "SaveOrCancelChanges") {
2594
2627
  if (options.editable != 'no') {
2595
- var buttonSaveOrCancel = this.generateToolbarButtonCall(toolbarButton, scope, options);
2628
+ var buttonSaveOrCancel = this.generateToolbarButtonCall(toolbarButton, scope, options, attrs);
2596
2629
  toolbar.push(buttonSaveOrCancel);
2597
2630
  }
2598
2631
  }
@@ -2816,9 +2849,9 @@
2816
2849
 
2817
2850
  var datasource = app.kendoHelper.getDataSource(options.dataSourceScreen.entityDataSource, scope, options.allowPaging, options.pageCount, options.columns, options.groupings);
2818
2851
 
2819
- var columns = this.getColumns(options, datasource, scope, tooltips);
2852
+ var columns = this.getColumns(options, datasource, scope, tooltips, attrs);
2820
2853
  var pageAble = this.getPageAble(options);
2821
- var toolbar = this.getToolbar(options, scope);
2854
+ var toolbar = this.getToolbar(options, scope, attrs);
2822
2855
  var editable = this.getEditable(options);
2823
2856
  var filterable = anyFilterableColumn(options);
2824
2857
 
@@ -2882,7 +2915,9 @@
2882
2915
  },
2883
2916
  change: function(e) {
2884
2917
  var item = this.dataItem(this.select());
2885
- setToActiveInCronappDataSource.bind(this)(item);
2918
+ if ($('[data-component="crn-enterprise-dynamic-combobox"]').length == 0) {
2919
+ setToActiveInCronappDataSource.bind(this)(item);
2920
+ }
2886
2921
  var cronappDatasource = this.dataSource.transport.options.cronappDatasource;
2887
2922
  if(options.fieldType && options.fieldType === 'key'){
2888
2923
  cronappDatasource.active = helperDirective.changeObjectField(cronappDatasource, cronappDatasource.active);
@@ -2918,6 +2953,28 @@
2918
2953
  }
2919
2954
 
2920
2955
  compileListing(e);
2956
+
2957
+ $(".k-command-cell a[class*='k-grid-']").each((idx, elem) => {
2958
+ let $elem = $(elem);
2959
+ if (!$elem.attr('id')) {
2960
+ let item = this.dataItem($elem.closest('tr'));
2961
+ let command = 'destroy';
2962
+ if ($elem.hasClass('k-grid-update')) {
2963
+ command = 'update';
2964
+ }
2965
+ else if ($elem.hasClass('k-grid-cancel')) {
2966
+ command = 'cancel';
2967
+ }
2968
+ else if ($elem.hasClass('k-grid-edit')) {
2969
+ command = 'edit';
2970
+ }
2971
+
2972
+ let modelName = helperDirective.removeSpecialChar(attrs.ngModel);
2973
+ let key = item["_objectKey"];
2974
+ let id = `${modelName}-${command}-${key}`;
2975
+ $elem.attr('id', id);
2976
+ }
2977
+ });
2921
2978
  },
2922
2979
  cancel: function(e) {
2923
2980
  var cronappDatasource = this.dataSource.transport.options.cronappDatasource;
@@ -3698,6 +3755,7 @@
3698
3755
  var found = _goTo(_scope, combobox, combobox.dataItem());
3699
3756
 
3700
3757
  if (!found) {
3758
+ combobox.isEvaluating = true;
3701
3759
  dataSourceScreen.findObj([value], false, (dataresult) => {
3702
3760
  if (Array.isArray(dataresult)) {
3703
3761
  dataresult = dataresult[0];
@@ -3707,7 +3765,8 @@
3707
3765
  _goTo(_scope, combobox, dataresult);
3708
3766
  modelSetter(_scope, value);
3709
3767
  }
3710
- });
3768
+ combobox.isEvaluating = false;
3769
+ }, () => combobox.isEvaluating = false, [combobox.options.dataValueField]);
3711
3770
  }
3712
3771
  }
3713
3772
  }
@@ -4571,79 +4630,42 @@
4571
4630
 
4572
4631
  .directive('cronDynamicMenu', ['$compile', '$translate', function ($compile, $translate) {
4573
4632
  'use strict';
4574
- const populateSubitems = (item) => {
4575
- var subitem = item.menuItems;
4576
- var templateSubitens = '';
4577
-
4578
- subitem.forEach((subitem) => {
4579
- var securitySubitem = (subitem.security && subitem.security != null) ? ' cronapp-security="' + subitem.security + '" ' : '';
4580
- var actionSubitem = (subitem.action && subitem.action != null) ? ' ng-click="' + subitem.action + '" ' : '';
4581
- var hideSubitem = (subitem.hide && subitem.hide != null) ? ' ng-hide="' + subitem.hide + '" ' : '';
4582
- var iconClassSubitem = (subitem.iconClass && subitem.iconClass != null) ? '<i class="' + subitem.iconClass + '"></i>&nbsp;' : '';
4583
- var titleSubitem = '<span></span>';
4584
- var caretSubitem = (subitem.menuItems && Array.isArray(subitem.menuItems) && (subitem.menuItems.length > 0)) ? '<span class="caret submenu"></span>' : '';
4585
-
4586
- if (subitem.title) {
4587
- titleSubitem = '<span>' + $translate.instant(subitem.title) + '</span>';
4588
- }
4589
-
4590
- if (subitem.menuItems.length > 0) {
4591
- templateSubitens = templateSubitens + '<li class="dropdown-submenu">\
4592
- <a class="dropdown-item dropdown-toggle" role="button" aria-haspopup="true" aria-expanded="false" href=""' + securitySubitem + actionSubitem + '>' + iconClassSubitem + titleSubitem + caretSubitem + '</a>\
4593
- ' + populateItems(subitem.menuItems) + '\
4594
- </li>';
4595
-
4596
- } else {
4597
- templateSubitens = templateSubitens + '<li class="dropdown-submenu">\
4598
- <a role="button" aria-haspopup="true" aria-expanded="false" href=""' + securitySubitem + actionSubitem + '>' + iconClassSubitem + titleSubitem + caretSubitem + '</a>\
4599
- </li>';
4600
- }
4601
- });
4602
-
4603
- if (templateSubitens != '') {
4604
- templateSubitens = '<ul class="dropdown-menu">' + templateSubitens + '</ul>';
4605
- }
4606
-
4607
- return templateSubitens;
4608
- };
4609
-
4610
4633
  const populateItems = (items) => {
4611
4634
  var templateItens = '';
4612
4635
 
4613
4636
  if (items && items.length > 0 && Array.isArray(items)) {
4614
4637
  items.forEach(function (item) {
4615
4638
 
4616
- var security = (item.security && item.security != null) ? ' cronapp-security="' + item.security + '" ' : '';
4617
- var action = (item.action && item.action != null) ? ' ng-click="' + item.action + '" ' : '';
4618
- var hide = (item.hide && item.hide != null) ? ' ng-hide="' + item.hide + '" ' : '';
4619
- var iconClass = (item.iconClass && item.iconClass != null) ? '<i class="' + item.iconClass + '"></i>&nbsp;' : '';
4620
- var title = '<span></span>';
4621
- var caret = (item.menuItems && Array.isArray(item.menuItems) && (item.menuItems.length > 0)) ? '<span class="caret submenu"></span>' : '';
4639
+ var security = (item.security && item.security != null) ? ` cronapp-security="${item.security }" ` : '';
4640
+ var action = (item.action && item.action != null) ? ` ng-click="${item.action}" ` : '';
4641
+ var hide = (item.hide && item.hide != null) ? ` ng-hide="${item.hide}" ` : '';
4642
+ var iconClass = (item.iconClass && item.iconClass != null) ? `<i class="${item.iconClass}" id="menu-tag-i-${item.id}"></i>&nbsp;` : '';
4643
+ var title = `<span id="menu-tag-span-${item.id}"></span>`;
4644
+ var caret = (item.menuItems && Array.isArray(item.menuItems) && (item.menuItems.length > 0)) ? `<span class="caret submenu" id="menu-tag-span-sub-${item.id}"></span>` : '';
4622
4645
 
4623
4646
  if (item.title) {
4624
- title = '<span>' + $translate.instant(item.title) + '</span>';
4647
+ title = `<span id="menu-tag-span-${item.id}">${$translate.instant(item.title)}</span>`;
4625
4648
  }
4626
4649
 
4627
4650
  if (item.menuItems.length > 0) {
4628
- templateItens = templateItens + '\
4629
- <li class="dropdown-submenu" ' + security + hide + '> \
4630
- <a href="" ' + action + ' class="dropdown-item dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">' + iconClass + title + caret + ' </a> \
4631
- ' + populateSubitems(item) + '\
4632
- </li>';
4651
+ templateItens = templateItens + `
4652
+ <li class="dropdown-submenu" ${security}${hide} id="menu-tag-li-sub-${item.id}"> \
4653
+ <a href="" ${action} id="menu-tag-a-sub-${item.id}" class="dropdown-item dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> ${iconClass} ${title} ${caret} </a> \
4654
+ ${populateItems(item.menuItems)}\
4655
+ </li>`;
4633
4656
  } else {
4634
- templateItens = templateItens + '\
4635
- <li class="dropdown-submenu" ' + security + hide + '> \
4636
- <a href="" ' + action + ' class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">' + iconClass + title + caret + ' </a> \
4637
- </li>';
4657
+ templateItens = templateItens + `
4658
+ <li class="dropdown-submenu" ${security} ${hide} id="menu-tag-li-${item.id}"> \
4659
+ <a href="" ${action} id="menu-tag-a-${item.id}" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">${iconClass} ${title} ${caret} </a>
4660
+ </li>`;
4638
4661
  }
4639
4662
 
4640
4663
  });
4641
4664
 
4642
4665
  if (templateItens != '') {
4643
- templateItens = '<ul class="dropdown-menu">' + templateItens + '</ul>';
4666
+ templateItens = `<ul class="dropdown-menu" id="menu-tag-ul-${items[0].id}">${templateItens}</ul>`;
4644
4667
  }
4645
4668
  }
4646
-
4647
4669
  return templateItens;
4648
4670
  }
4649
4671
  return {
@@ -4655,24 +4677,24 @@
4655
4677
 
4656
4678
  menuOptions.subMenuOptions.forEach(function (menu) {
4657
4679
 
4658
- var security = (menu.security && menu.security != null) ? ' cronapp-security="' + menu.security + '" ' : '';
4659
- var action = (menu.action && menu.action != null) ? ' ng-click="' + menu.action + '" ' : '';
4660
- var caret = (menu.menuItems && Array.isArray(menu.menuItems) && (menu.menuItems.length > 0)) ? '<span class="caret"></span>' : '';
4661
- var hide = (menu.hide && menu.hide != null) ? ' ng-hide="' + menu.hide + '" ' : '';
4662
- var iconClass = (menu.iconClass && menu.iconClass != null) ? '<i class="' + menu.iconClass + '"></i>&nbsp;' : '';
4663
- var title = '<span></span>'
4680
+ var security = (menu.security && menu.security != null) ? ` cronapp-security="${menu.security}" ` : '';
4681
+ var action = (menu.action && menu.action != null) ? ` ng-click="${menu.action }" ` : '';
4682
+ var caret = (menu.menuItems && Array.isArray(menu.menuItems) && (menu.menuItems.length > 0)) ? `<span class="caret" id="menu-tag-span-sub-${menu.id}"></span>` : '';
4683
+ var hide = (menu.hide && menu.hide != null) ? ` ng-hide="${menu.hide}" ` : '';
4684
+ var iconClass = (menu.iconClass && menu.iconClass != null) ? `<i class="${menu.iconClass}"></i>&nbsp;` : '';
4685
+ var title = `<span id="menu-tag-span-${menu.id}"></span>`;
4664
4686
 
4665
4687
  if (menu.title) {
4666
- title = '<span>' + $translate.instant(menu.title) + '</span>';
4688
+ title = `<span id="menu-tag-span-${menu.id}">${$translate.instant(menu.title)}</span>`;
4667
4689
  }
4668
4690
 
4669
- template = template + '\
4670
- <li class="dropdown nav-item '+ (isVertical ? 'col-md-12 padding-0' : '') + '"' + security + hide + '>\
4671
- <a href="" ' + action + ' class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">\
4672
- ' + iconClass + title + caret + '\
4673
- </a> \
4674
- ' + populateItems(menu.menuItems) + '\
4675
- </li>';
4691
+ template = template + `
4692
+ <li class="dropdown nav-item ${(isVertical ? 'col-md-12 padding-0' : '')}" ${security} ${hide} id="menu-tag-li-sub-${menu.id}">
4693
+ <a href="" ${action} id="menu-tag-a-sub-${menu.id}" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">\
4694
+ ${iconClass} ${title} ${caret}
4695
+ </a>
4696
+ ${populateItems(menu.menuItems)}
4697
+ </li>`;
4676
4698
 
4677
4699
  })
4678
4700
  }
@@ -4684,14 +4706,14 @@
4684
4706
  //Somente fica na vertical se for o menu principal da IDE (E estiver configurado para isso)
4685
4707
  let isVertical = element.closest('.crn-navigator-vertical').length;
4686
4708
 
4687
- var TEMPLATE_MAIN = '<ul class="nav navbar-nav ' + (isVertical ? 'col-md-12 padding-0' : '') + ' " style="float:left"></ul>';
4688
4709
  var options = {};
4689
4710
  try {
4690
4711
  options = JSON.parse(attrs.options);
4691
4712
  } catch (e) {
4692
4713
  console.log('CronDynamicMenu: Invalid configuration!')
4693
4714
  }
4694
-
4715
+ let baseId = options && options.subMenuOptions ? options.subMenuOptions[0].id : "first";
4716
+ var TEMPLATE_MAIN = `<ul id="menu-tag-ul-base-${baseId}" class="nav navbar-nav ${(isVertical ? 'col-md-12 padding-0' : '')}" style="float:left"></ul>`;
4695
4717
  var main = $(TEMPLATE_MAIN);
4696
4718
  main.attr('id', attrs.id);
4697
4719
 
@@ -4733,7 +4755,6 @@
4733
4755
  return false;
4734
4756
  });
4735
4757
  }
4736
-
4737
4758
  });
4738
4759
  }
4739
4760
  }
@@ -4932,7 +4953,12 @@
4932
4953
  let falseValue = attrs.ngFalseValue ? attrs.ngFalseValue.split("'").join("") : false;
4933
4954
  let trueValue = attrs.ngTrueValue ? attrs.ngTrueValue.split("'").join("") : true;
4934
4955
 
4935
- if (attrs.crnAllowNullValues == 'true') {
4956
+ let isAllowNullValues = (value) => {
4957
+ return value === 'true' || value === undefined
4958
+ || value === null || value.length == 0;
4959
+ };
4960
+
4961
+ if (isAllowNullValues(attrs.crnAllowNullValues)) {
4936
4962
  ctrl.$render = function () {
4937
4963
  let viewValue = ctrl.$viewValue;
4938
4964
  el.data('checked', viewValue);
@@ -4955,7 +4981,7 @@
4955
4981
  }
4956
4982
  setTimeout(() => ctrl.$setViewValue(viewValue));
4957
4983
  };
4958
- } else if (attrs.crnAllowNullValues == 'false') {
4984
+ } else {
4959
4985
  ctrl.$render = function () {
4960
4986
  let viewValue = ctrl.$viewValue;
4961
4987
  if (ctrl.$viewValue === undefined || ctrl.$viewValue === null) {
@@ -4963,7 +4989,7 @@
4963
4989
  viewValue = false;
4964
4990
  }
4965
4991
  if (viewValue === falseValue) {
4966
- let modelForEval = `${el.attr('ng-model')}=${attrs.ngFalseValue}`;
4992
+ let modelForEval = attrs.ngFalseValue ? `${el.attr('ng-model')}=${attrs.ngFalseValue}` : `${el.attr('ng-model')}=${falseValue}`;
4967
4993
  scope.$eval(modelForEval);
4968
4994
  }
4969
4995
  el.data('checked', viewValue);
@@ -5988,7 +6014,7 @@ app.kendoHelper = {
5988
6014
  }
5989
6015
  }
5990
6016
  if (idxSelected >-1 && !this.refComponent.selectable.options.multiple)
5991
- this.refComponent.select(this.refComponent.table.find('tr')[idxSelected]);
6017
+ this.refComponent.select(this.refComponent.table.find('tr')[idxSelected + 1]);
5992
6018
  }
5993
6019
  }
5994
6020
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cronapp-framework-js",
3
- "version": "2.8.36",
3
+ "version": "2.8.39",
4
4
  "description": "Javascript library for CronApp's projects",
5
5
  "main": "cronapp.framework.js",
6
6
  "scripts": {
@@ -1,9 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="WEB_MODULE" version="4">
3
- <component name="NewModuleRootManager" inherit-compiler-output="true">
4
- <exclude-output />
5
- <content url="file://$MODULE_DIR$" />
6
- <orderEntry type="inheritedJdk" />
7
- <orderEntry type="sourceFolder" forTests="false" />
8
- </component>
9
- </module>