cronapp-framework-js 2.9.6-SP.5 → 2.9.6-SP.50

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.
Files changed (51) hide show
  1. package/components/crn-calendar.components.json +1 -0
  2. package/components/crn-dynamic-image.components.json +8 -0
  3. package/components/crn-dynamic-menu.components.json +0 -21
  4. package/components/crn-enterprise-combobox-multiple.components.json +13 -0
  5. package/components/crn-navbar.components.json +2 -21
  6. package/components/templates/cron-combobox-multiple.template.html +1 -1
  7. package/components/templates/navbar.template.html +8 -7
  8. package/css/app.css +4 -0
  9. package/css/themes/custom/krypton/custom-krypton.css +827 -223
  10. package/css/themes/custom/krypton/grid-krypton.css +243 -66
  11. package/css/themes/custom/krypton/navbar-krypton.css +13 -11
  12. package/css/themes/custom/krypton/panel-krypton.css +14 -11
  13. package/css/themes/custom/material/navbar-material.css +2 -0
  14. package/css/themes/custom/material-round/custom-material-round.css +1062 -47
  15. package/css/themes/custom/material-round/grid-material-round.css +307 -12
  16. package/css/themes/custom/material-round/navbar-material-round.css +15 -5
  17. package/css/themes/custom/material-round/panel-material-round.css +4 -4
  18. package/css/themes/custom/navigator/custom-navigator.css +47 -20
  19. package/css/themes/custom/theme-general/menu-vertical-retratil.css +34 -21
  20. package/css/themes/custom/theme-general/theme-general.css +1 -1
  21. package/dist/components/templates/cron-combobox-multiple.template.html +1 -1
  22. package/dist/components/templates/navbar.template.html +1 -1
  23. package/dist/css/app.css +1 -1
  24. package/dist/css/themes/custom/krypton/custom-krypton.css +1 -1
  25. package/dist/css/themes/custom/krypton/grid-krypton.css +1 -1
  26. package/dist/css/themes/custom/krypton/navbar-krypton.css +1 -1
  27. package/dist/css/themes/custom/krypton/panel-krypton.css +1 -1
  28. package/dist/css/themes/custom/material/navbar-material.css +1 -1
  29. package/dist/css/themes/custom/material-round/custom-material-round.css +1 -1
  30. package/dist/css/themes/custom/material-round/grid-material-round.css +1 -1
  31. package/dist/css/themes/custom/material-round/navbar-material-round.css +1 -1
  32. package/dist/css/themes/custom/material-round/panel-material-round.css +1 -1
  33. package/dist/css/themes/custom/navigator/custom-navigator.css +1 -1
  34. package/dist/css/themes/custom/theme-general/menu-vertical-retratil.css +1 -1
  35. package/dist/css/themes/custom/theme-general/theme-general.css +1 -1
  36. package/dist/i18n/locale_en_us.json +3 -1
  37. package/dist/i18n/locale_pt_br.json +3 -1
  38. package/dist/js/app.js +1 -1
  39. package/dist/js/controllers.js +1 -1
  40. package/dist/js/directives.js +10 -10
  41. package/dist/js/reports/reports.service.js +1 -1
  42. package/dist/js/upload.service.js +1 -1
  43. package/i18n/locale_en_us.json +3 -1
  44. package/i18n/locale_pt_br.json +3 -1
  45. package/js/app.js +10 -5
  46. package/js/controllers.js +40 -19
  47. package/js/directives.js +156 -174
  48. package/js/reports/reports.service.js +5 -5
  49. package/js/upload.service.js +7 -4
  50. package/package.json +9 -4
  51. package/postupdate.json +14 -0
package/js/directives.js CHANGED
@@ -102,11 +102,11 @@
102
102
  const expressionOnChange = options.expressionOnChange;
103
103
  const expressionOnNavigate = options.expressionOnNavigate;
104
104
 
105
- const initialDate = expressionInitialDate ? await scope.$eval(generateBlocklyCall(expressionInitialDate)) : new Date();
106
- const selectDates = (expressionSelectDates && options.isSelectableMultiple) ? await scope.$eval(generateBlocklyCall(expressionSelectDates)) : [];
107
- const disableDates = expressionDisableDates ? await scope.$eval(generateBlocklyCall(expressionDisableDates)) : null;
108
- const min = expressionMinDate ? await scope.$eval(generateBlocklyCall(expressionMinDate)) : new Date(1900, 0, 1);
109
- const max = expressionMaxDate ? await scope.$eval(generateBlocklyCall(expressionMaxDate)) : new Date(2099, 11, 31);
105
+ const initialDate = expressionInitialDate ? await scope.$eval(generateBlocklyCall(expressionInitialDate, true)) : new Date();
106
+ const selectDates = (expressionSelectDates && options.isSelectableMultiple) ? await scope.$eval(generateBlocklyCall(expressionSelectDates, true)) : [];
107
+ const disableDates = expressionDisableDates ? await scope.$eval(generateBlocklyCall(expressionDisableDates, true)) : null;
108
+ const min = expressionMinDate ? await scope.$eval(generateBlocklyCall(expressionMinDate, true)) : new Date(1900, 0, 1);
109
+ const max = expressionMaxDate ? await scope.$eval(generateBlocklyCall(expressionMaxDate), true) : new Date(2099, 11, 31);
110
110
 
111
111
  cronCalendarElement.kendoCalendar({
112
112
  culture: culture.startsWith('pt') ? 'pt-BR' : 'en-US',
@@ -221,7 +221,7 @@
221
221
 
222
222
  app.directive('textarea', transformText);
223
223
 
224
- var generateBlocklyCall = function(blocklyInfo) {
224
+ var generateBlocklyCall = function(blocklyInfo, hasToPromise) {
225
225
  var call = "";
226
226
  if (!blocklyInfo) return call;
227
227
 
@@ -238,7 +238,7 @@
238
238
  }
239
239
  else if (blocklyInfo.type == "server") {
240
240
  var blocklyName = blocklyInfo.blocklyClass + '.' + blocklyInfo.blocklyMethod;
241
- call = "cronapi.server('"+blocklyName+"')";
241
+ call = "cronapi.server('"+blocklyName+"')" + (hasToPromise ? '.toPromise()' : '');
242
242
 
243
243
  var params = "";
244
244
  blocklyInfo.blocklyParams.forEach(function(p) {
@@ -355,7 +355,7 @@
355
355
  var required = (attr.ngRequired && attr.ngRequired == "true"?"required":"");
356
356
  var content = element.html();
357
357
  const objectFit = attr.objectFit || 'unset';
358
- let templateDyn =`<div ngf-drop="" ngf-drag-over-class="dragover" style="display: flex; justify-content: center; width: 100%; height: 100%; ">
358
+ let templateDyn =`<div ngf-drop="" ngf-drag-over-class="dragover" style="display: flex; justify-content: center; width: 100%; height: 100%; position: relative; ">
359
359
  <img alt="$picture$" style="width: 100%; object-fit: ${objectFit}" ng-if="$ngModel$"
360
360
  data-ng-src="{{$ngModel$.startsWith(\'http\') || ($ngModel$.startsWith(\'/\') && $ngModel$.length < 1000)? $ngModel$ : \'data:image/png;base64,\' + $ngModel$}}">
361
361
  <input id="$id$" aria-label="$userHtml$" ng-if="!$ngModel$" autocomplete="off" tabindex="-1"
@@ -394,6 +394,12 @@
394
394
  .split('$picture$').join($translate.instant(imgAltText))
395
395
  );
396
396
 
397
+ var readOnly = attr.readOnly == 'true';
398
+ if (readOnly) {
399
+ templateDyn.find('.remove-image-button').remove();
400
+ templateDyn.find('.start-camera-button-attribute').remove();
401
+ }
402
+
397
403
  element.html(templateDyn);
398
404
  $compile(templateDyn)(element.scope());
399
405
  }
@@ -650,7 +656,12 @@
650
656
  $element.hide();
651
657
  }
652
658
  if (!enabled) {
653
- $element.find('*').addBack().attr('disabled', true).off('click').on('click', e => e.preventDefault());
659
+ $element.find('*')
660
+ .addBack()
661
+ .css('pointer-events', 'none')
662
+ .attr('disabled', true)
663
+ .off('click')
664
+ .on('click', e => e.preventDefault());
654
665
  }
655
666
  if (!render) {
656
667
  $element.remove();
@@ -1288,7 +1299,7 @@
1288
1299
  var tinyMCEOptions = {
1289
1300
  menubar: false,
1290
1301
  statusbar: false,
1291
- plugins: "bdesk_photo advlist anchor autolink autoresize autosave charmap code colorpicker contextmenu directionality emoticons fullpage fullscreen hr image imagetools importcss insertdatetime legacyoutput link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace tabfocus table template toc visualblocks visualchars wordcount tiny_mce_wiris",
1302
+ plugins: "bdesk_photo advlist anchor autolink autoresize autosave charmap code colorpicker contextmenu directionality emoticons fullpage fullscreen hr image imagetools importcss insertdatetime legacyoutput link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace tabfocus table template toc visualblocks visualchars wordcount tiny_mce_wiris colorpicker textcolor",
1292
1303
  toolbar: "",
1293
1304
  content_style: ""
1294
1305
  };
@@ -1299,6 +1310,8 @@
1299
1310
  tinyMCEOptions.toolbar += " " + toolbarGroup[key];
1300
1311
  }
1301
1312
  }
1313
+
1314
+ tinyMCEOptions.toolbar += " forecolor backcolor ";
1302
1315
  tinyMCEOptions.menubar = optionsSelected.showMenuBar;
1303
1316
  tinyMCEOptions.statusbar = optionsSelected.showStatusBar;
1304
1317
  tinyMCEOptions.content_style = optionsSelected.contentStyle;
@@ -1550,8 +1563,8 @@
1550
1563
  return datasource.active;
1551
1564
  }
1552
1565
  },
1553
- getSchedulerProperties: function(options, datasource, scope) {
1554
- let schedulerStartDate = (options.initialDateStrategy === 'Expression' ? scope.$eval(generateBlocklyCall(options.initialDateBlocklyInfo)) : options.initialDate);
1566
+ getSchedulerProperties: async function(options, datasource, scope) {
1567
+ let schedulerStartDate = (options.initialDateStrategy === 'Expression' ? await scope.$eval(generateBlocklyCall(options.initialDateBlocklyInfo, true)) : options.initialDate);
1555
1568
  let lastSearchedPeriod = {start: null, end: null};
1556
1569
 
1557
1570
  let needsToFetchData = function(searchablePeriod) {
@@ -1988,11 +2001,11 @@
1988
2001
 
1989
2002
  this.initCulture();
1990
2003
 
1991
- $.getScript(baseUrl, function() {
2004
+ $.getScript(baseUrl, async function() {
1992
2005
 
1993
2006
  let kendoDatasource = app.kendoHelper.getDataSource(options.dataSourceScreen.entityDataSource, scope, true, options.dataSourceScreen.rowsPerPage);
1994
2007
 
1995
- let schedulerProperties = this.getSchedulerProperties(options, datasource, scope);
2008
+ let schedulerProperties = await this.getSchedulerProperties(options, datasource, scope);
1996
2009
 
1997
2010
  schedulerElement.kendoScheduler(schedulerProperties);
1998
2011
 
@@ -2824,9 +2837,7 @@
2824
2837
  'selectedRows': selectedRowsKeyOrObj
2825
2838
  };
2826
2839
 
2827
- if (this.element.find('input[type=checkbox]').length === 0) {
2828
- cronappDatasource.goTo(itemAsObj);
2829
- }
2840
+ cronappDatasource.goTo(itemAsObj);
2830
2841
  scope.$eval(call, contextVars);
2831
2842
  return;
2832
2843
  }
@@ -2976,7 +2987,11 @@
2976
2987
  var cronappDatasource = this.dataSource.transport.options.cronappDatasource;
2977
2988
  if (!(cronappDatasource.inserting || cronappDatasource.editing)) {
2978
2989
  if (this.selectable) {
2990
+ setToActiveInCronappDataSource.bind(this)(e.data);
2979
2991
  this.select(e.masterRow);
2992
+ if (options.columns.find(c => c.dataType == 'Selectable') !== undefined) {
2993
+ collapseAllExcecptCurrent(this, e.detailRow, e.masterRow);
2994
+ }
2980
2995
  }
2981
2996
  else {
2982
2997
  setToActiveInCronappDataSource.bind(this)(e.data);
@@ -3204,14 +3219,19 @@
3204
3219
  },
3205
3220
  change: function(e) {
3206
3221
  var item = this.dataItem(this.select());
3207
- setToActiveInCronappDataSource.bind(this)(item);
3208
3222
  var cronappDatasource = this.dataSource.transport.options.cronappDatasource;
3209
3223
  if(options.fieldType && options.fieldType === 'key'){
3210
3224
  cronappDatasource.active = helperDirective.changeObjectField(cronappDatasource, cronappDatasource.active);
3211
3225
  }
3226
+
3227
+ let trDetails = this.select().next();
3228
+ let trMasters = this.select();
3229
+
3212
3230
  if (ngModelCtrl) {
3213
3231
  if ("multiple" === options.allowSelectionRowType) {
3214
3232
  let selecteds = [];
3233
+ trDetails = [];
3234
+ trMasters = [];
3215
3235
  this.select().each((i, row)=> {
3216
3236
  let item = this.dataItem(row);
3217
3237
  let objInDs = cronappDatasource.findObjInDs(item, false);
@@ -3221,6 +3241,10 @@
3221
3241
  if (objInDs !== null){
3222
3242
  selecteds.push(objInDs);
3223
3243
  }
3244
+ if (item["_objectKey"] === cronappDatasource.active["_objectKey"]) {
3245
+ trMasters.push(this.select()[i]);
3246
+ trDetails.push(this.select().next()[i]);
3247
+ }
3224
3248
  });
3225
3249
  ngModelCtrl.$setViewValue(selecteds);
3226
3250
  }
@@ -3233,7 +3257,7 @@
3233
3257
  }
3234
3258
  }
3235
3259
  }
3236
- collapseAllExcecptCurrent(this, this.select().next(), this.select());
3260
+ collapseAllExcecptCurrent(this, trDetails, trMasters);
3237
3261
 
3238
3262
  if (attrs && attrs.ngChange) {
3239
3263
  scope.$eval(attrs.ngChange);
@@ -3256,8 +3280,8 @@
3256
3280
  command = 'edit';
3257
3281
  }
3258
3282
 
3259
- let modelName = helperDirective.getModelName(attrs);
3260
- if (item && item["_objectKey"]) {
3283
+ let modelName = helperDirective.getModelName(attrs);
3284
+ if (item && item["_objectKey"]) {
3261
3285
  let key = item["_objectKey"];
3262
3286
  let id = `${modelName}-${command}-${key}`;
3263
3287
  $elem.attr('id', id);
@@ -3470,6 +3494,10 @@
3470
3494
  }
3471
3495
 
3472
3496
  $element = $(element);
3497
+ let $grid = $element.find('[data-role="grid"]');
3498
+ if ($grid.length) {
3499
+ $element = $grid;
3500
+ }
3473
3501
  let style = $element.attr("style")||"";
3474
3502
  if (style) {
3475
3503
  style += ", ";
@@ -3514,8 +3542,8 @@
3514
3542
  getAllParent(cronappDatasource, itemResult.d.results[0], ids, resolve, reject);
3515
3543
  },
3516
3544
  beforeSend: (xhr) => {
3517
- if (window.uToken) {
3518
- xhr.setRequestHeader ("X-AUTH-TOKEN", window.uToken);
3545
+ if (!window.isUsingCookie()) {
3546
+ xhr.setRequestHeader ("X-AUTH-TOKEN", cronapi.util.getUserToken());
3519
3547
  }
3520
3548
  },
3521
3549
  error: () => reject(),
@@ -3656,8 +3684,8 @@
3656
3684
  resolve();
3657
3685
  },
3658
3686
  beforeSend: (xhr) => {
3659
- if (window.uToken) {
3660
- xhr.setRequestHeader ("X-AUTH-TOKEN", window.uToken);
3687
+ if (!window.isUsingCookie()) {
3688
+ xhr.setRequestHeader ("X-AUTH-TOKEN", cronapi.util.getUserToken());
3661
3689
  }
3662
3690
  },
3663
3691
  error: () => reject(),
@@ -4216,7 +4244,13 @@
4216
4244
  value = null;
4217
4245
  }
4218
4246
 
4219
- await combobox.value(value);
4247
+ let comboValue = combobox.value();
4248
+ comboValue = comboValue !== undefined && comboValue !== null ? comboValue.trim() : comboValue;
4249
+ let valueToCheck = value !== undefined && value !== null ? ('' + value).trim() : value;
4250
+
4251
+ if (valueToCheck !== comboValue) {
4252
+ await combobox.value(value);
4253
+ }
4220
4254
 
4221
4255
  if (select.changeCursor) {
4222
4256
  scope.safeApply(() => {
@@ -4580,11 +4614,21 @@
4580
4614
 
4581
4615
  }.bind(relactionDS);
4582
4616
 
4617
+ var hideSelectedItem = attrs.crnHideSelectedItem == 'true';
4618
+ var onSelectedItem = () => {
4619
+ if (hideSelectedItem) {
4620
+ if (combobox.list && combobox.list.length > 0) {
4621
+ combobox.list.find('.k-item').show();
4622
+ combobox.list.find('.k-item.k-state-selected').hide();
4623
+ }
4624
+ }
4625
+ }
4626
+
4583
4627
  options['change'] = attrs.ngChange ? function (){_scope.$eval(attrs.ngChange)}: undefined;
4584
4628
  options['close'] = attrs.ngClose ? function (){_scope.$eval(attrs.ngClose)}: undefined;
4585
4629
  options['dataBound'] = attrs.ngDatabound ? function (){_scope.$eval(attrs.ngDatabound)}: undefined;
4586
4630
  options['filtering'] = attrs.ngFiltering ? function (){_scope.$eval(attrs.ngFiltering)}: undefined;
4587
- options['open'] = attrs.ngOpen ? function (){_scope.$eval(attrs.ngOpen)}: undefined;
4631
+ options['open'] = attrs.ngOpen ? function (){_scope.$eval(attrs.ngOpen); onSelectedItem();}: onSelectedItem;
4588
4632
  options['cascade'] = attrs.ngCascade ? function (){_scope.$eval(attrs.ngCascade)}: undefined;
4589
4633
  evtSelect = attrs.ngSelect ? function (){_scope.$eval(attrs.ngSelect)}: undefined;
4590
4634
  deselect = attrs.ngDeselect ? function (){_scope.$eval(attrs.ngDeselect)}: undefined;
@@ -5108,7 +5152,7 @@
5108
5152
  items.forEach(function (item) {
5109
5153
 
5110
5154
  var security = (item.security && item.security != null) ? ` cronapp-security="${item.security }" ` : '';
5111
- var action = (item.action && item.action != null) ? ` ng-click="${item.action}" ` : '';
5155
+ var action = (item.action && item.action != null) ? ` ng-click="cronapi.internal.lastCronappMenuClick('${item.id}');${item.action}" ` : '';
5112
5156
  var hide = (item.hide && item.hide != null) ? ` ng-hide="${item.hide}" ` : '';
5113
5157
  var iconClass = (item.iconClass && item.iconClass != null) ? `<i class="${item.iconClass}" id="menu-tag-i-${item.id}"></i>&nbsp;` : '';
5114
5158
  var title = `<span id="menu-tag-span-${item.id}"></span>`;
@@ -5229,174 +5273,112 @@
5229
5273
  return false;
5230
5274
  });
5231
5275
  }
5276
+ $('#checkCollapsibleMenu').on('click', function() {
5277
+ var mainView = document.getElementById("main-view");
5278
+ if (this.checked) {
5279
+ mainView.classList.remove("main-view-retratil");
5280
+ } else {
5281
+ mainView.classList.add("main-view-retratil");
5282
+ }
5283
+ });
5232
5284
  });
5233
5285
  });
5234
5286
  }
5235
5287
  };
5236
5288
  }])
5237
5289
 
5238
- .directive('cronBreadcrumbs', function () {
5290
+ .directive('cronBreadcrumbs', function ($rootScope) {
5239
5291
  'use strict';
5240
5292
  return {
5241
5293
  restrict: 'E',
5242
5294
  replace: true,
5243
5295
  link: function (scope, element, attrs) {
5244
5296
 
5245
- let crnDelimiterIcon = attrs.crnDelimiterIcon;
5246
- let crnTypeMenu = attrs.typeMenu;
5247
- let idMenu = attrs.idMenu ? attrs.idMenu : null;
5248
- let breadcrumb = [];
5249
- let actionBlockly = attrs.ngInit ? attrs.ngInit : null;
5250
- let idBreadcrumb = attrs.id;
5251
- let arrayPaiBreadcrumb = [];
5252
-
5253
- let iconRoot = attrs.breadcrumbIcon ? attrs.breadcrumbIcon : null;
5297
+ var bcAction = attrs.ngInit ? attrs.ngInit : null;
5298
+ const bcDelimiterIcon = attrs.crnDelimiterIcon;
5299
+ const bcTypeMenu = attrs.typeMenu;
5300
+ const bcMenuId = attrs.idMenu ? attrs.idMenu : null;
5301
+ const bcId = attrs.id;
5302
+ const bcIconRoot = attrs.breadcrumbIcon ? attrs.breadcrumbIcon : null;
5303
+ const bcList = [];
5254
5304
 
5255
- async function functionActionBlockly() {
5256
- let shortVersion = actionBlockly.replace("cronapi.client('js.", 'blockly.js.');
5257
- actionBlockly = shortVersion.replace("').run()", '');
5258
- actionBlockly = scope.$eval(actionBlockly);
5259
- breadcrumb = await actionBlockly();
5305
+ const fillAction = async () => {
5306
+ const shortVersion = bcAction.replace("cronapi.client('js.", 'blockly.js.');
5307
+ bcAction = shortVersion.replace("').run()", '');
5308
+ bcAction = scope.$eval(bcAction);
5309
+ bcList = await bcAction();
5260
5310
 
5261
- var onclick = async (e) => {
5262
- if (e.item.action) {
5263
- e.item.action();
5264
- }
5265
- };
5311
+ const onclick = async (e) => {
5312
+ if (e.item.action) {
5313
+ e.item.action();
5314
+ }
5315
+ };
5266
5316
 
5267
- $(`#${idBreadcrumb}`).kendoBreadcrumb({
5268
- items: breadcrumb,
5269
- delimiterIcon: crnDelimiterIcon,
5270
- navigational: true,
5271
- click : onclick
5272
- });
5317
+ $(`#${bcId}`).kendoBreadcrumb({
5318
+ items: bcList,
5319
+ delimiterIcon: bcDelimiterIcon,
5320
+ navigational: true,
5321
+ click : onclick
5322
+ });
5273
5323
  }
5274
5324
 
5325
+ const clearAction = (action) => {
5326
+ if (action) {
5327
+ return action.replace("cronapi.screen.changeView('", '').replace("', [])", '');
5328
+ }
5329
+ return "#/home";
5330
+ }
5275
5331
 
5276
- if (actionBlockly && crnTypeMenu === "idBloco") {
5277
- functionActionBlockly()
5278
-
5332
+ if (bcAction && bcTypeMenu === "idBloco") {
5333
+ fillAction();
5279
5334
  } else {
5280
- setTimeout(() => {
5281
- // Capturar o json do menu
5282
- let menuOptions = $(`#${idMenu}`)[0].parentElement.attributes['options'];
5283
- menuOptions = JSON.parse(menuOptions.value);
5284
- let subMenuOptions = menuOptions.subMenuOptions;
5285
-
5286
- // Capturar a url da pagina
5287
- let page = document.location.hash;
5288
- if (page === "") {
5289
- page = "home"
5290
- } else {
5291
- page = page.split("/");
5292
- }
5293
-
5294
- inicio(subMenuOptions);
5295
-
5296
- function inicio(items) {
5297
- let x = false;
5298
-
5299
- for (let i in items) {
5300
-
5301
- let action = items[i].action;
5302
- if (action && action != "") {
5303
- action = action.replace("cronapi.screen.changeView('", '');
5304
- action = action.replace("', [])", '')
5305
- action = action.split("/");
5306
- } else {
5307
- action = null
5308
- }
5309
-
5310
- if (items[i].level === 1) {
5311
- arrayPaiBreadcrumb = [];
5312
- }
5313
-
5314
- if (arrayPaiBreadcrumb.length != 0 && items[i].level === arrayPaiBreadcrumb[arrayPaiBreadcrumb.length - 1].level) {
5315
- if (!action) {
5316
- arrayPaiBreadcrumb[arrayPaiBreadcrumb.length - 1] = {
5317
- level: items[i].level,
5318
- title: items[i].title,
5319
- href: '#'
5320
- };
5321
-
5322
- } else if (action) {
5323
- arrayPaiBreadcrumb[arrayPaiBreadcrumb.length - 1] = {
5324
- level: items[i].level,
5325
- title: items[i].title,
5326
- href: document.location.origin + '/' + action.join("/")
5327
- };
5328
-
5329
- }
5330
-
5331
- } else {
5332
- if (!action) {
5333
- arrayPaiBreadcrumb.push({
5334
- level: items[i].level,
5335
- title: items[i].title,
5336
- href: '#'
5337
- });
5338
- } else if (action) {
5339
- arrayPaiBreadcrumb.push({
5340
- level: items[i].level,
5341
- title: items[i].title,
5342
- href: document.location.origin + '/' + action.join("/")
5343
- });
5344
- }
5345
- }
5346
-
5347
- if (items[i].menuItems.length > 0) {
5348
- inicio(items[i].menuItems);
5349
-
5350
- } else {
5351
- if (action) {
5352
- if (action[action.length - 1] === page[page.length - 1] || action[action.length - 1] === page) {
5353
- x = true;
5335
+ var observer = new MutationObserver((mutation, observer) => {
5336
+ const $parent = $(`#${bcMenuId}`).parent();
5337
+ const attrOptions = $parent.attr('options');
5338
+ if (attrOptions) {
5339
+ observer.disconnect(); // stop observing
5340
+
5341
+ const options = JSON.parse(attrOptions);
5342
+ const page = document.location.hash || 'home';
5343
+
5344
+ const findTrace = (array, action, path = []) => {
5345
+ for (let i = 0; i < array.length; i++) {
5346
+ var item = array[i];
5347
+ item.action = clearAction(item.action);
5348
+ if (item.action === action) {
5349
+ return [...path, item];
5350
+ }
5351
+ if (item.menuItems) {
5352
+ const result = findTrace(item.menuItems, action, [...path, item]);
5353
+ if (result) {
5354
+ return result;
5355
+ }
5356
+ }
5354
5357
  }
5358
+ return null;
5355
5359
  }
5356
- }
5357
5360
 
5358
- if (x) {
5359
- for (let y in arrayPaiBreadcrumb) {
5360
-
5361
- if (y == 0 && arrayPaiBreadcrumb[y].level == 1) {
5362
- breadcrumb.push({
5363
- type: "rootitem",
5364
- href: arrayPaiBreadcrumb[y].href,
5365
- text: arrayPaiBreadcrumb[y].title,
5366
- showText: true,
5367
- showIcon: false
5368
- })
5369
- } else if (y == 0 && arrayPaiBreadcrumb[y].level != 1) {
5370
- breadcrumb.push({
5371
- type: "rootitem",
5372
- href: arrayPaiBreadcrumb[y].href,
5373
- text: arrayPaiBreadcrumb[y].title,
5374
- showText: true,
5375
- showIcon: false
5376
- })
5377
- } else {
5378
- breadcrumb.push({
5379
- type: "item",
5380
- href: arrayPaiBreadcrumb[y].href,
5381
- text: arrayPaiBreadcrumb[y].title,
5382
- showText: true,
5383
- showIcon: false
5384
- })
5385
- }
5361
+ const trace = findTrace(options.subMenuOptions, page);
5362
+ if (trace) {
5363
+ for (var index in trace) {
5364
+ const item = trace[index];
5365
+ bcList.push({
5366
+ type: index == 0 ? 'rootitem' : 'item',
5367
+ href: item.action,
5368
+ text: item.title,
5369
+ showText: true,
5370
+ showIcon: false
5371
+ });
5372
+ }
5373
+ $(`#${bcId}`).kendoBreadcrumb({
5374
+ items: bcList,
5375
+ delimiterIcon: bcDelimiterIcon,
5376
+ navigational: true
5377
+ });
5386
5378
  }
5387
-
5388
- return breadcrumb
5389
- }
5390
5379
  }
5391
- }
5392
-
5393
- $(`#${idBreadcrumb}`).kendoBreadcrumb({
5394
- items: breadcrumb,
5395
- delimiterIcon: crnDelimiterIcon,
5396
- navigational: true
5397
- });
5398
-
5399
- }, 800);
5380
+ });
5381
+ observer.observe(document.body, { childList : true});
5400
5382
  }
5401
5383
  }
5402
5384
  }
@@ -5420,7 +5402,7 @@
5420
5402
  let blocklyParams = shortVersion.split('.run')[1];
5421
5403
  evaluated = await scope.$eval(blocklyPackage + blocklyParams);
5422
5404
  } else {
5423
- evaluated = scope.$eval(attrs.ngInitialValue);
5405
+ evaluated = scope.$eval(attrs.ngInitialValue) || attrs.ngInitialValue;
5424
5406
  }
5425
5407
  } catch (e) {
5426
5408
  evaluated = attrs.ngInitialValue;
@@ -7313,4 +7295,4 @@ function cronReportViewer($compile) {
7313
7295
 
7314
7296
  }
7315
7297
  };
7316
- }
7298
+ }
@@ -14,7 +14,7 @@
14
14
  // data
15
15
  this.getReport = function(reportName) {
16
16
  var req = {
17
- url : 'api/rest/report',
17
+ url : window.hostApp + 'api/rest/report',
18
18
  method : 'POST',
19
19
  data : angular.toJson({
20
20
  'reportName' : reportName
@@ -26,7 +26,7 @@
26
26
  // bytes[]
27
27
  this.getPDF = function(report) {
28
28
  var req = {
29
- url : 'api/rest/report/pdf',
29
+ url : window.hostApp + 'api/rest/report/pdf',
30
30
  method : 'POST',
31
31
  responseType : 'arraybuffer',
32
32
  data : angular.toJson(report)
@@ -37,7 +37,7 @@
37
37
  // file
38
38
  this.getPDFAsFile = function(report) {
39
39
  var req = {
40
- url : 'api/rest/report/pdfasfile',
40
+ url : window.hostApp + 'api/rest/report/pdfasfile',
41
41
  method : 'POST',
42
42
  data : angular.toJson(report)
43
43
  };
@@ -46,7 +46,7 @@
46
46
 
47
47
  this.getContentAsString = function(report) {
48
48
  var req = {
49
- url : 'api/rest/report/contentasstring',
49
+ url : window.hostApp + 'api/rest/report/contentasstring',
50
50
  method : 'POST',
51
51
  data : angular.toJson(report)
52
52
  };
@@ -55,7 +55,7 @@
55
55
 
56
56
  this.getDataSourcesParams = function(datasourcesInBand) {
57
57
  var req = {
58
- url : 'api/rest/report/getdatasourcesparams',
58
+ url : window.hostApp + 'api/rest/report/getdatasourcesparams',
59
59
  method : 'POST',
60
60
  data : angular.toJson(datasourcesInBand)
61
61
  };
@@ -80,14 +80,17 @@
80
80
  console.log(files[i].$valid);
81
81
  }
82
82
  var _u = JSON.parse(localStorage.getItem('_u'));
83
+ let headerValues = window.isUsingCookie() ? {
84
+ 'Content-Type' : undefined
85
+ } : {
86
+ 'Content-Type' : undefined,
87
+ 'X-AUTH-TOKEN' : (_u ?_u.token : '')
88
+ };
83
89
  this.$promise = $http({
84
90
  method: 'POST',
85
91
  url: (window.hostApp || "") + uploadUrl,
86
92
  data: formData,
87
- headers: {
88
- 'Content-Type': undefined,
89
- 'X-AUTH-TOKEN': (_u ?_u.token : '')
90
- },
93
+ headers: headerValues,
91
94
  onProgress: function(event) {
92
95
  this.safeApply(function() {
93
96
  if (event.lengthComputable) {
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "cronapp-framework-js",
3
- "version": "2.9.6-SP.5",
3
+ "version": "2.9.6-SP.50",
4
4
  "description": "Javascript library for CronApp's projects",
5
5
  "main": "cronapp.framework.js",
6
6
  "scripts": {
7
7
  "build": "npm i && gulp",
8
- "test": "echo \"Error: no test specified\" && exit 1"
8
+ "test": "echo \"Error: no test specified\" && exit 1",
9
+ "preinstall": "npx force-resolutions"
9
10
  },
10
11
  "repository": {
11
12
  "type": "git",
@@ -63,14 +64,18 @@
63
64
  "angular-ui-notification": "0.3.6",
64
65
  "ui-select": "0.18.1",
65
66
  "bootstrap": "3.4.1",
66
- "chart.js": "2.7.0",
67
+ "chart.js": "2.9.4",
67
68
  "cpf_cnpj": "0.2.0",
68
69
  "font-awesome": "4.4.0",
69
70
  "jquery": "3.5.1",
70
71
  "justgage": "1.3.5",
71
- "moment": "2.29.1",
72
+ "moment": "2.29.4",
72
73
  "moment-timezone": "0.5.33",
73
74
  "ng-file-upload": "12.2.13",
74
75
  "signature_pad": "^3.0.0-beta.4"
76
+ },
77
+ "resolutions": {
78
+ "chart.js": "2.9.4",
79
+ "moment": "2.29.4"
75
80
  }
76
81
  }