cronapp-framework-js 2.9.3 → 2.9.4-SP.1

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 (80) hide show
  1. package/components/crn-datepicker.components.json +5 -0
  2. package/components/crn-datetimepicker.components.json +5 -0
  3. package/components/crn-enterprise-combobox.components.json +19 -2
  4. package/components/crn-infinite-scroll.components.json +29 -0
  5. package/components/crn-navbar.components.json +33 -1
  6. package/components/crn-textinputicon.components.json +0 -26
  7. package/components/templates/date.template.html +2 -2
  8. package/components/templates/textinputicon.template.html +1 -1
  9. package/components/upload/upload.html +1 -1
  10. package/css/app.css +4 -0
  11. package/css/themes/custom/aquamarine/custom-aquamarine.css +2 -20
  12. package/css/themes/custom/cerulean/custom-cerulean.css +1 -28
  13. package/css/themes/custom/cosmo/custom-cosmo.css +0 -27
  14. package/css/themes/custom/cyborg/custom-cyborg.css +0 -27
  15. package/css/themes/custom/cyborg/navbar-cyborg.css +6 -0
  16. package/css/themes/custom/darkly/custom-darkly.css +0 -25
  17. package/css/themes/custom/dsgov/form-dsgov.css +0 -19
  18. package/css/themes/custom/flatly/custom-flatly.css +2 -22
  19. package/css/themes/custom/fuse/custom-fuse.css +6 -33
  20. package/css/themes/custom/journal/custom-journal.css +2 -28
  21. package/css/themes/custom/lumen/custom-lumen.css +0 -43
  22. package/css/themes/custom/lumen/navbar-lumen.css +9 -0
  23. package/css/themes/custom/material/grid-material.css +1 -0
  24. package/css/themes/custom/navigator/custom-navigator.css +9 -0
  25. package/css/themes/custom/paper/custom-paper.css +0 -30
  26. package/css/themes/custom/paper/navbar-paper.css +11 -0
  27. package/css/themes/custom/readable/custom-readable.css +0 -27
  28. package/css/themes/custom/sandstone/custom-sandstone.css +0 -26
  29. package/css/themes/custom/simplex/custom-simplex.css +0 -27
  30. package/css/themes/custom/slate/custom-slate.css +33 -33
  31. package/css/themes/custom/spacelab/custom-spacelab.css +0 -27
  32. package/css/themes/custom/superhero/custom-superhero.css +0 -27
  33. package/css/themes/custom/theme-general/forms.css +7 -42
  34. package/css/themes/custom/theme-general/menu-vertical-retratil.css +130 -0
  35. package/css/themes/custom/theme-general/theme-general.css +1 -0
  36. package/css/themes/custom/united/custom-united.css +0 -22
  37. package/css/themes/custom/united/navbar-united.css +9 -0
  38. package/css/themes/custom/yeti/custom-yeti.css +0 -28
  39. package/css/themes/custom/yeti/navbar-yeti.css +9 -0
  40. package/dist/components/templates/date.template.html +1 -1
  41. package/dist/components/templates/textinputicon.template.html +1 -1
  42. package/dist/css/app.css +1 -1
  43. package/dist/css/themes/custom/aquamarine/custom-aquamarine.css +1 -1
  44. package/dist/css/themes/custom/cerulean/custom-cerulean.css +1 -1
  45. package/dist/css/themes/custom/cosmo/custom-cosmo.css +1 -1
  46. package/dist/css/themes/custom/cyborg/custom-cyborg.css +1 -1
  47. package/dist/css/themes/custom/cyborg/navbar-cyborg.css +1 -1
  48. package/dist/css/themes/custom/darkly/custom-darkly.css +1 -1
  49. package/dist/css/themes/custom/dsgov/form-dsgov.css +1 -1
  50. package/dist/css/themes/custom/flatly/custom-flatly.css +1 -1
  51. package/dist/css/themes/custom/fuse/custom-fuse.css +1 -1
  52. package/dist/css/themes/custom/journal/custom-journal.css +1 -1
  53. package/dist/css/themes/custom/lumen/custom-lumen.css +1 -1
  54. package/dist/css/themes/custom/lumen/navbar-lumen.css +1 -1
  55. package/dist/css/themes/custom/material/grid-material.css +1 -1
  56. package/dist/css/themes/custom/navigator/custom-navigator.css +1 -1
  57. package/dist/css/themes/custom/paper/custom-paper.css +1 -1
  58. package/dist/css/themes/custom/paper/navbar-paper.css +1 -1
  59. package/dist/css/themes/custom/readable/custom-readable.css +1 -1
  60. package/dist/css/themes/custom/sandstone/custom-sandstone.css +1 -1
  61. package/dist/css/themes/custom/simplex/custom-simplex.css +1 -1
  62. package/dist/css/themes/custom/slate/custom-slate.css +1 -1
  63. package/dist/css/themes/custom/spacelab/custom-spacelab.css +1 -1
  64. package/dist/css/themes/custom/superhero/custom-superhero.css +1 -1
  65. package/dist/css/themes/custom/theme-general/forms.css +1 -1
  66. package/dist/css/themes/custom/theme-general/menu-vertical-retratil.css +1 -0
  67. package/dist/css/themes/custom/theme-general/theme-general.css +1 -1
  68. package/dist/css/themes/custom/united/custom-united.css +1 -1
  69. package/dist/css/themes/custom/united/navbar-united.css +1 -1
  70. package/dist/css/themes/custom/yeti/custom-yeti.css +1 -1
  71. package/dist/css/themes/custom/yeti/navbar-yeti.css +1 -1
  72. package/dist/img/cron-icon/crn-infinite-scroll.svg +1 -0
  73. package/dist/js/app.js +1 -1
  74. package/dist/js/controllers.js +1 -1
  75. package/dist/js/directives.js +18 -2
  76. package/img/cron-icon/crn-infinite-scroll.svg +1 -0
  77. package/js/app.js +2 -1
  78. package/js/controllers.js +2 -2
  79. package/js/directives.js +188 -19
  80. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ <svg id="Camada_1" data-name="Camada 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.cls-1{fill:#c9c9c9;}</style></defs><path class="cls-1" d="M20,0H4A4,4,0,0,0,0,4V20a4,4,0,0,0,4,4H20a4,4,0,0,0,4-4V4A4,4,0,0,0,20,0Zm.67,16.67a1.33,1.33,0,0,1,.94,2.27h0l-2.67,2.67h0a1.33,1.33,0,0,1-1.88,0h0l-2.67-2.67h0a1.33,1.33,0,0,1,.94-2.27H16V7.33h-.67a1.33,1.33,0,0,1-.94-2.27h0l2.67-2.67h0a1.33,1.33,0,0,1,1.88,0h0l2.67,2.67h0a1.33,1.33,0,0,1-.94,2.27H20v9.34Z"/></svg>
package/js/app.js CHANGED
@@ -19,7 +19,8 @@ var cronappModules = [
19
19
  'upload.services',
20
20
  'ui.tinymce',
21
21
  'ngCookies',
22
- 'kendo.directives'
22
+ 'kendo.directives',
23
+ 'sync.service'
23
24
  ];
24
25
 
25
26
  if (window.customModules) {
package/js/controllers.js CHANGED
@@ -78,7 +78,7 @@
78
78
 
79
79
  });
80
80
 
81
- app.controller('LoginController', function($controller, $scope, $http, $rootScope, $window, $state, $translate, Notification, ReportService, UploadService, $location, $stateParams, $timeout, $cookies, $templateCache, DashboardService) {
81
+ app.controller('LoginController', function($controller, $scope, $http, $rootScope, $window, $state, $translate, Notification, ReportService, UploadService, $location, $stateParams, $timeout, $cookies, $templateCache, DashboardService, SyncService) {
82
82
 
83
83
  $http.get(window.NotificationProviderOptions.templateUrl, {cache: true})
84
84
  .then((response) => $templateCache.put(window.NotificationProviderOptions.templateUrl, response.data));
@@ -259,7 +259,7 @@
259
259
 
260
260
  });
261
261
 
262
- app.controller('HomeController', function($controller, $scope, $http, $rootScope, $state, $translate, Notification, ReportService, UploadService, $location, $stateParams, $timeout, DashboardService) {
262
+ app.controller('HomeController', function($controller, $scope, $http, $rootScope, $state, $translate, Notification, ReportService, UploadService, $location, $stateParams, $timeout, DashboardService, SyncService) {
263
263
 
264
264
  $scope.$http = $http;
265
265
  $scope.params = $stateParams;
package/js/directives.js CHANGED
@@ -1552,9 +1552,86 @@
1552
1552
  getSchedulerProperties: function(options, datasource, scope) {
1553
1553
  let schedulerStartDate = (options.initialDateStrategy === 'Expression' ? scope.$eval(generateBlocklyCall(options.initialDateBlocklyInfo)) : options.initialDate);
1554
1554
  let lastSearchedPeriod = {start: null, end: null};
1555
+
1555
1556
  let needsToFetchData = function(searchablePeriod) {
1556
1557
  return !angular.equals(lastSearchedPeriod, searchablePeriod);
1557
1558
  };
1559
+
1560
+ let customDaysOfWeek = (e) => {
1561
+ let view = e.sender.view();
1562
+ let alreadyChanged = e.sender.element.find('.k-scheduler-header.k-state-default.changed').length;
1563
+ if (view.name === 'month' && !alreadyChanged && options.useCustomDaysOfWeek) {
1564
+ e.sender.element.find('.k-scheduler-header.k-state-default').html(`<div class="k-scheduler-header k-state-default">
1565
+ <div class="k-scheduler-header-wrap">
1566
+ <table class="k-scheduler-table">
1567
+ <tbody>
1568
+ <tr>
1569
+ <th colspan="1" class="">${options.daysOfWeek.sunday}</th>
1570
+ <th colspan="1" class="">${options.daysOfWeek.monday}</th>
1571
+ <th colspan="1" class="">${options.daysOfWeek.tuesday}</th>
1572
+ <th colspan="1" class="">${options.daysOfWeek.wednesday}</th>
1573
+ <th colspan="1" class="">${options.daysOfWeek.thursday}</th>
1574
+ <th colspan="1" class="">${options.daysOfWeek.friday}</th>
1575
+ <th colspan="1" class="">${options.daysOfWeek.saturday}</th>
1576
+ </tr>
1577
+ </tbody>
1578
+ </table>
1579
+ </div>
1580
+ </div>`);
1581
+ e.sender.element.find('.k-scheduler-header.k-state-default').addClass('changed');
1582
+ }
1583
+ };
1584
+
1585
+ let hookSeeAllEventsClick = (e) => {
1586
+ let alreadyHooked = e.sender.element.find('.k-more-events.k-button.hooked').length;
1587
+
1588
+ if (!alreadyHooked) {
1589
+ let view = e.sender.view();
1590
+ let optionView = options.views.find(v => v.type === view.name);
1591
+ let randomId = app.common.generateId();
1592
+ e.sender.element.find('.k-more-events.k-button').attr('data-id', randomId);
1593
+ let blocklyCall = generateBlocklyCall(optionView.moreEventsBlockly);
1594
+ if (blocklyCall) {
1595
+ handleBlockAfterRender(randomId, (e) => {
1596
+
1597
+ let lastEvent = $(e.currentTarget).prev();
1598
+ let uid = lastEvent.data('uid');
1599
+ let dataLastEvent = options.refComponent.dataItems().find((f) => { return f.uid == uid });
1600
+
1601
+ let contextVars = {
1602
+ scheduleData: {
1603
+ type: 'seeAll',
1604
+ selectedDate: dataLastEvent.start
1605
+ }
1606
+ };
1607
+ scope.$eval(blocklyCall, contextVars);
1608
+ });
1609
+ }
1610
+ e.sender.element.find('.k-more-events.k-button').addClass('hooked');
1611
+ }
1612
+ }
1613
+
1614
+ let handleBlockAfterRender = (randomId, func) => {
1615
+ return new Promise((resolve) => {
1616
+ let waitRender = setInterval(() => {
1617
+ let $objClick = $(`[data-id="${randomId}"]`);
1618
+ if ($objClick.length) {
1619
+ clearInterval(waitRender);
1620
+ let eventHook = 'click';
1621
+ if ($('.km-pane-wrapper').length) {
1622
+ eventHook = 'touchstart';
1623
+ }
1624
+ $objClick.off(eventHook);
1625
+ $objClick.on(eventHook, (e) => {
1626
+ func(e);
1627
+ e.stopImmediatePropagation();
1628
+ });
1629
+ resolve();
1630
+ }
1631
+ }, 100);
1632
+ });
1633
+ };
1634
+
1558
1635
  let visibleViews = [];
1559
1636
  if(options.views) {
1560
1637
  for(let viewIndex in options.views) {
@@ -1584,7 +1661,6 @@
1584
1661
  }
1585
1662
  }
1586
1663
 
1587
-
1588
1664
  let cronSchedulerProperties = {
1589
1665
  dateHeaderTemplate: kendo.template(`#=kendo.toString(date, ${kendo.culture().name.toLowerCase().includes('pt')?'\'ddd dd/M\'':'\'ddd M/dd\''})#`),
1590
1666
  showWorkHours: options.showWorkHours,
@@ -1621,7 +1697,40 @@
1621
1697
  // An endDate method which returns the end date of the view.
1622
1698
 
1623
1699
  //kendo.format("view:: start: {0:d}; end: {1:d};", view.startDate(), view.endDate())
1624
- },
1700
+ customDaysOfWeek(e);
1701
+ hookSeeAllEventsClick(e);
1702
+ },
1703
+ eventTemplate: (data) => {
1704
+ let contextVars = { scheduleData: data };
1705
+ let getDescriptionContent = (withIfen) => {
1706
+ if (!data.description) return '';
1707
+ return (withIfen? ' - ' : '') + data.description;
1708
+ }
1709
+
1710
+ let randomId = app.common.generateId();
1711
+ let currentView = options.refComponent.view().name;
1712
+ let view = options.views.find(v => v.type === currentView);
1713
+
1714
+ let result = [];
1715
+ result.push(`<div class='k-event-template' data-id='${randomId}'>`);
1716
+
1717
+ if (currentView !== 'agenda') {
1718
+ result.push(`<div class='k-event-title'>${data.title}${view.showDescription? getDescriptionContent(true) :''} </div>`);
1719
+ }
1720
+ else {
1721
+ result.push(`<div class='k-event-title'>${data.title}</div>`);
1722
+ !view.showDescription || result.push(`<div class='k-event-description'>${getDescriptionContent(false)}</div>`);
1723
+ }
1724
+ result.push('</div>');
1725
+
1726
+ let blocklyCall = generateBlocklyCall(view.blockly);
1727
+ if (blocklyCall) {
1728
+ handleBlockAfterRender(randomId, () => {
1729
+ scope.$eval(blocklyCall, contextVars);
1730
+ });
1731
+ }
1732
+ return result.join('');
1733
+ },
1625
1734
  change: (e) => {
1626
1735
  if (e && e.events && e.events.length) {
1627
1736
  this.setDatasourceActiveItem(datasource, e.events[0], 'id');
@@ -1634,7 +1743,7 @@
1634
1743
  if (options && options.allowCustomAction) {
1635
1744
  let container = e.container;
1636
1745
 
1637
- let btnLabel = options.customActionLabel ? options.customActionLabel : $translate.instant(Details);
1746
+ let btnLabel = options.customActionLabel ? options.customActionLabel : $translate.instant('Details');
1638
1747
  /* ACTION: ADD custom button */
1639
1748
  let detailButton = $('<a class="k-button">' + btnLabel + '</a>');
1640
1749
 
@@ -3642,12 +3751,41 @@
3642
3751
  options.close = attrs.ngClose ? function (){scope.$eval(attrs.ngClose)}: undefined;
3643
3752
  options.dataBound = attrs.ngDataBound ? function (){scope.$eval(attrs.ngDataBound)}: undefined;
3644
3753
  options.filtering = attrs.ngFiltering ? function (){scope.$eval(attrs.ngFiltering)}: undefined;
3645
- options.select = attrs.ngSelect ? function (){scope.$eval(attrs.ngSelect);}: undefined;
3646
- options.change = function() {
3647
- _scope.$apply(function () {
3648
- _ngModelCtrl.$setViewValue(this.value());
3649
- }.bind(combobox));
3650
- }
3754
+
3755
+ options.select = attrs.ngSelect ? function (e) {
3756
+ scope.safeApply(() => {
3757
+ var contextVars = {
3758
+ 'selected' : e.dataItem,
3759
+ 'selectedKey' : e.dataItem[options.dataValueField],
3760
+ 'selectedValue' : e.dataItem[options.dataTextField]
3761
+ };
3762
+ scope.$eval(attrs.ngSelect, contextVars);
3763
+ });
3764
+ }: undefined;
3765
+ options.change = attrs.ngChange ? function(e) {
3766
+ var dataItem = this.dataItem();
3767
+ scope.safeApply(() => {
3768
+ if (attrs['ngModel']) {
3769
+ _ngModelCtrl.$$parse(attrs['ngModel']).assign(scope, this.value(), attrs['ngModel'].split("."));
3770
+ }
3771
+ var contextVars = {
3772
+ 'selected' : dataItem,
3773
+ 'selectedKey' : dataItem[options.dataValueField],
3774
+ 'selectedValue' : dataItem[options.dataTextField]
3775
+ };
3776
+ scope.$eval(attrs.ngChange, contextVars);
3777
+ });
3778
+ }: function(e) {
3779
+ scope.safeApply(() => {
3780
+ if (attrs['ngModel']) {
3781
+ _ngModelCtrl.$$parse(attrs['ngModel']).assign(scope, this.value(), attrs['ngModel'].split("."));
3782
+ }
3783
+ });
3784
+ };
3785
+
3786
+ options.messages = {
3787
+ noData: attrs.noResultsMessage ? attrs.noResultsMessage : "NO DATA FOUND"
3788
+ };
3651
3789
 
3652
3790
  var combobox;
3653
3791
  if (select.dontAllowOutsideList === true) {
@@ -3696,23 +3834,13 @@
3696
3834
  var _scope = scope;
3697
3835
  var _ngModelCtrl = ngModelCtrl;
3698
3836
 
3699
- var initializing = true;
3700
3837
  if (ngModelCtrl) {
3701
3838
  ngModelCtrl.$formatters.push(function (value) {
3702
3839
  var result = '';
3703
-
3704
3840
  if ((typeof value === 'boolean') || (value)) {
3705
3841
  result = value;
3706
3842
  }
3707
3843
  combobox.value(result);
3708
-
3709
- if (!initializing) {
3710
- if (attrs.ngChange) scope.$eval(attrs.ngChange);
3711
- }
3712
-
3713
-
3714
- initializing = false;
3715
- combobox.value(result);
3716
3844
  return result;
3717
3845
  });
3718
3846
  ngModelCtrl.$parsers.push(function (value) {
@@ -5662,6 +5790,47 @@
5662
5790
  }
5663
5791
  })
5664
5792
 
5793
+ .directive('crnInfiniteScroll', ['$compile', function($compile){
5794
+ 'use strict';
5795
+ return {
5796
+ restrict: 'EA',
5797
+ link: function(scope, element, attrs) {
5798
+ var dataSource = attrs.crnInfiniteScroll ? eval(attrs.crnInfiniteScroll) : attrs.crnDatasource ? eval(attrs.crnDatasource): undefined;
5799
+ if (dataSource) {
5800
+ let nextPageInfinite = {
5801
+ isVisible: false,
5802
+ checkVisibility: function(visible) {
5803
+ if (nextPageInfinite.isVisible !== visible) {
5804
+ nextPageInfinite.isVisible = visible;
5805
+ if (nextPageInfinite.isVisible) {
5806
+ if (dataSource.loaded && dataSource.loadedFinish) {
5807
+ dataSource.nextPage();
5808
+ } else {
5809
+ let intervalNextPage = setInterval(function() {
5810
+ if (dataSource.loaded && dataSource.loadedFinish) {
5811
+ dataSource.nextPage();
5812
+ clearInterval(intervalNextPage);
5813
+ }
5814
+ }, 250);
5815
+ }
5816
+ }
5817
+ }
5818
+ },
5819
+ eventScroll: function() {
5820
+ var topElem = element.offset().top;
5821
+ var botElem = element.offset().top + element.outerHeight();
5822
+ var botScrn = $(window).scrollTop() + $(window).innerHeight();
5823
+ var topScrn = $(window).scrollTop();
5824
+ nextPageInfinite.checkVisibility((botScrn > topElem) && (topScrn < botElem));
5825
+ }
5826
+ };
5827
+ $(window).scroll(nextPageInfinite.eventScroll);
5828
+ $(window).ready(nextPageInfinite.eventScroll);
5829
+ }
5830
+ }
5831
+ }
5832
+ }])
5833
+
5665
5834
  }(app));
5666
5835
 
5667
5836
  function maskDirectiveAsDate($compile, $translate, $parse) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cronapp-framework-js",
3
- "version": "2.9.3",
3
+ "version": "2.9.4-SP.1",
4
4
  "description": "Javascript library for CronApp's projects",
5
5
  "main": "cronapp.framework.js",
6
6
  "scripts": {