cronapp-framework-mobile-js 2.8.11 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/crn-button-bar.components.json +1 -1
- package/components/crn-checkbox.components.json +2 -1
- package/components/crn-dynamic-image.components.json +9 -0
- package/components/crn-input-floating.components.json +1 -1
- package/components/crn-ion-footer-bar.components.json +2 -2
- package/components/crn-ion-segment-item.components.json +4 -1
- package/components/crn-ion-segment.components.json +1 -1
- package/components/crn-item-swipe.components.json +1 -1
- package/components/crn-multiselect.components.json +1 -1
- package/components/crn-range.components.json +1 -1
- package/components/crn-signature-pad.components.json +36 -0
- package/components/templates/checkbox.template.html +6 -7
- package/components/templates/crn-ion-segment-item.template.html +1 -1
- package/components/templates/crn-ion-segment.template.html +4 -4
- package/components/templates/crn-signature-pad.designtime.html +31 -0
- package/components/templates/crn-signature-pad.template.html +1 -0
- package/css/app.css +10 -0
- package/css/signup.css +13 -0
- package/dist/components/templates/checkbox.template.html +1 -1
- package/dist/components/templates/crn-ion-segment-item.template.html +1 -1
- package/dist/components/templates/crn-ion-segment.template.html +1 -1
- package/dist/components/templates/crn-signature-pad.designtime.html +22 -0
- package/dist/components/templates/crn-signature-pad.template.html +1 -0
- package/dist/css/app.css +1 -1
- package/dist/css/signup.css +1 -0
- package/dist/i18n/locale_en_us.json +3 -1
- package/dist/i18n/locale_pt_br.json +4 -1
- package/dist/img/cron-icon/crn-signature-pad.svg +1 -0
- package/dist/js/app.authentication.js +1 -1
- package/dist/js/controllers.authentication.js +1 -1
- package/dist/js/directives.js +2 -2
- package/dist/js/reports/reports.service.js +1 -1
- package/i18n/locale_en_us.json +3 -1
- package/i18n/locale_pt_br.json +4 -1
- package/img/cron-icon/crn-signature-pad.svg +27 -0
- package/js/app.authentication.js +8 -1
- package/js/controllers.authentication.js +50 -0
- package/js/directives.js +198 -105
- package/js/reports/reports.service.js +6 -26
- package/package.json +4 -2
- package/postupdate.json +11 -0
package/js/directives.js
CHANGED
|
@@ -615,87 +615,85 @@ window.addEventListener('message', function(event) {
|
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
};
|
|
698
|
-
}])
|
|
618
|
+
})
|
|
619
|
+
|
|
620
|
+
.directive('crnAllowNullValues', [function () {
|
|
621
|
+
return {
|
|
622
|
+
restrict: 'A',
|
|
623
|
+
require: '?ngModel',
|
|
624
|
+
link: function (scope, el, attrs, ctrl) {
|
|
625
|
+
ctrl.$formatters = [];
|
|
626
|
+
ctrl.$parsers = [];
|
|
627
|
+
let falseValue = attrs.ngFalseValue ? attrs.ngFalseValue.split("'").join("") : false;
|
|
628
|
+
let trueValue = attrs.ngTrueValue ? attrs.ngTrueValue.split("'").join("") : true;
|
|
629
|
+
|
|
630
|
+
if (attrs.crnAllowNullValues == 'false') {
|
|
631
|
+
ctrl.$render = function () {
|
|
632
|
+
let viewValue = ctrl.$viewValue;
|
|
633
|
+
if (ctrl.$viewValue === undefined || ctrl.$viewValue === null) {
|
|
634
|
+
ctrl.$setViewValue(false);
|
|
635
|
+
viewValue = false;
|
|
636
|
+
}
|
|
637
|
+
if (viewValue === falseValue) {
|
|
638
|
+
let modelForEval = `${el.attr('ng-model')}=${attrs.ngFalseValue}`;
|
|
639
|
+
scope.$eval(modelForEval);
|
|
640
|
+
}
|
|
641
|
+
el.data('checked', viewValue);
|
|
642
|
+
switch (viewValue) {
|
|
643
|
+
case true:
|
|
644
|
+
case trueValue:
|
|
645
|
+
el.removeAttr('indeterminate');
|
|
646
|
+
el.prop('checked', true);
|
|
647
|
+
viewValue = trueValue;
|
|
648
|
+
break;
|
|
649
|
+
default:
|
|
650
|
+
el.removeAttr('indeterminate');
|
|
651
|
+
el.prop('checked', false);
|
|
652
|
+
viewValue = falseValue;
|
|
653
|
+
break;
|
|
654
|
+
}
|
|
655
|
+
setTimeout(() => ctrl.$setViewValue(viewValue));
|
|
656
|
+
};
|
|
657
|
+
} else { // true é o padrão
|
|
658
|
+
ctrl.$render = function () {
|
|
659
|
+
let viewValue = ctrl.$viewValue;
|
|
660
|
+
el.data('checked', viewValue);
|
|
661
|
+
switch (viewValue) {
|
|
662
|
+
case true:
|
|
663
|
+
case trueValue:
|
|
664
|
+
el.removeAttr('indeterminate');
|
|
665
|
+
el.prop('checked', true);
|
|
666
|
+
viewValue = trueValue;
|
|
667
|
+
break;
|
|
668
|
+
case false:
|
|
669
|
+
case falseValue:
|
|
670
|
+
el.removeAttr('indeterminate');
|
|
671
|
+
el.prop('checked', false);
|
|
672
|
+
viewValue = falseValue;
|
|
673
|
+
break;
|
|
674
|
+
default:
|
|
675
|
+
viewValue = null;
|
|
676
|
+
el.attr('indeterminate', true);
|
|
677
|
+
}
|
|
678
|
+
setTimeout(() => ctrl.$setViewValue(viewValue));
|
|
679
|
+
};
|
|
680
|
+
}
|
|
681
|
+
el.bind('click', function () {
|
|
682
|
+
let checked;
|
|
683
|
+
switch (el.data('checked')) {
|
|
684
|
+
case false:
|
|
685
|
+
case falseValue:
|
|
686
|
+
checked = attrs.ngTrueValue ? trueValue : true;
|
|
687
|
+
break;
|
|
688
|
+
default:
|
|
689
|
+
checked = attrs.ngFalseValue ? falseValue : false;
|
|
690
|
+
}
|
|
691
|
+
ctrl.$setViewValue(checked);
|
|
692
|
+
scope.$apply(ctrl.$render);
|
|
693
|
+
});
|
|
694
|
+
}
|
|
695
|
+
};
|
|
696
|
+
}])
|
|
699
697
|
|
|
700
698
|
.directive('cronappFilter', function($compile) {
|
|
701
699
|
var setFilterInButton = function($element, bindedFilter, operator) {
|
|
@@ -1736,34 +1734,129 @@ window.addEventListener('message', function(event) {
|
|
|
1736
1734
|
|
|
1737
1735
|
element.html($templateDyn);
|
|
1738
1736
|
$compile($templateDyn)(element.scope());
|
|
1739
|
-
}
|
|
1740
1737
|
}
|
|
1741
|
-
}
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1738
|
+
}
|
|
1739
|
+
})
|
|
1740
|
+
|
|
1741
|
+
.directive('signaturePad', function($compile, $window) {
|
|
1742
|
+
'use strict';
|
|
1743
|
+
|
|
1744
|
+
var signaturePad, canvas, element, EMPTY_IMAGE = null;
|
|
1745
|
+
return {
|
|
1746
|
+
restrict: 'E',
|
|
1747
|
+
require: "ngModel",
|
|
1748
|
+
scope: true,
|
|
1746
1749
|
replace: true,
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1750
|
+
template: '<div>' +
|
|
1751
|
+
'<canvas style="width:100%" ng-click="mouseup()" ng-mouseup="mouseup()"></canvas>' +
|
|
1752
|
+
'<div>' +
|
|
1753
|
+
'<button type="button" style="margin-right:5px;margin-bottom:5px;" ng-click="clear()">{{"clear"|translate}}</button>' +
|
|
1754
|
+
'</div>' +
|
|
1755
|
+
'</div>',
|
|
1756
|
+
scope: {
|
|
1757
|
+
clear: '=',
|
|
1758
|
+
dataurl: '=',
|
|
1759
|
+
height: '@',
|
|
1760
|
+
width: '@',
|
|
1761
|
+
ngClick: '@',
|
|
1762
|
+
ngModel: '='
|
|
1763
|
+
},
|
|
1764
|
+
controller: [
|
|
1765
|
+
'$scope',
|
|
1766
|
+
function($scope) {
|
|
1767
|
+
|
|
1768
|
+
$scope.mouseup = function() {
|
|
1769
|
+
|
|
1770
|
+
var signature = {};
|
|
1771
|
+
|
|
1772
|
+
if (!$scope.signaturePad.isEmpty()) {
|
|
1773
|
+
signature.dataUrl = $scope.signaturePad.toDataURL();
|
|
1774
|
+
signature.isEmpty = false;
|
|
1775
|
+
|
|
1776
|
+
} else {
|
|
1777
|
+
signature.dataUrl = EMPTY_IMAGE;
|
|
1778
|
+
signature.isEmpty = true;
|
|
1779
|
+
}
|
|
1780
|
+
|
|
1781
|
+
if (signature.dataUrl == null) {
|
|
1782
|
+
return;
|
|
1783
|
+
}
|
|
1784
|
+
var binary = signature.dataUrl.split(',')[1];
|
|
1785
|
+
$scope.ngModel = binary;
|
|
1786
|
+
};
|
|
1787
|
+
|
|
1788
|
+
$scope.$watch('ngModel', function(value, old) {
|
|
1789
|
+
|
|
1790
|
+
var signature = $scope.signaturePad;
|
|
1791
|
+
var data = $scope.ngModel;
|
|
1792
|
+
|
|
1793
|
+
if (value !== old) {
|
|
1794
|
+
|
|
1795
|
+
signature.fromDataURL("data:image/png;base64," + value, {
|
|
1796
|
+
ratio: 1
|
|
1797
|
+
});
|
|
1798
|
+
$scope.ngModel = value;
|
|
1799
|
+
signature.clear();
|
|
1800
|
+
}
|
|
1801
|
+
}, true);
|
|
1802
|
+
|
|
1803
|
+
$scope.clear = function() {
|
|
1804
|
+
$scope.signaturePad.clear();
|
|
1805
|
+
$scope.ngModel = null;
|
|
1806
|
+
};
|
|
1807
|
+
|
|
1808
|
+
}
|
|
1809
|
+
],
|
|
1810
|
+
link: function(scope, element, attrs, ngModelCtrl) {
|
|
1811
|
+
|
|
1812
|
+
canvas = element.find('canvas')[0];
|
|
1813
|
+
|
|
1814
|
+
scope.onResize = function() {
|
|
1815
|
+
|
|
1816
|
+
var canvas = element.find('canvas')[0];
|
|
1817
|
+
var ratio = Math.max($window.devicePixelRatio || 1, 1);
|
|
1818
|
+
canvas.width = canvas.offsetWidth * ratio;
|
|
1819
|
+
canvas.height = canvas.offsetHeight * ratio;
|
|
1820
|
+
canvas.getContext("2d").scale(ratio, ratio);
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1823
|
+
scope.onResize();
|
|
1824
|
+
|
|
1825
|
+
scope.signaturePad = new SignaturePad(canvas);
|
|
1826
|
+
|
|
1827
|
+
angular.element($window).bind('resize', function() {
|
|
1828
|
+
scope.onResize();
|
|
1829
|
+
});
|
|
1830
|
+
|
|
1831
|
+
$compile(element)(element.scope());
|
|
1764
1832
|
}
|
|
1833
|
+
};
|
|
1834
|
+
})
|
|
1835
|
+
|
|
1836
|
+
.directive('cronVideo', function ($compile) {
|
|
1837
|
+
return {
|
|
1838
|
+
restrict: 'AE',
|
|
1839
|
+
replace: true,
|
|
1840
|
+
link: function (scope, element, attrs) {
|
|
1841
|
+
|
|
1842
|
+
var component = element.find('.cronVideo')[0];
|
|
1843
|
+
$compile(component)(element.scope());
|
|
1844
|
+
|
|
1845
|
+
var componentOptions = element.find('.cronVideoIframe')[0];
|
|
1846
|
+
$compile(componentOptions)(element.scope());
|
|
1847
|
+
|
|
1848
|
+
var $templateDyn = "";
|
|
1849
|
+
var src = attrs.src;
|
|
1850
|
+
var width = attrs.width;
|
|
1851
|
+
var height = attrs.height;
|
|
1852
|
+
var title = attrs.title;
|
|
1853
|
+
$templateDyn = `<iframe class="cronVideoIframe" src="${src}" width="${width}" height="${height}" title="${title}" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen> </iframe>`;
|
|
1854
|
+
|
|
1855
|
+
element.html($templateDyn);
|
|
1856
|
+
$compile($templateDyn)(element.scope());
|
|
1765
1857
|
}
|
|
1766
|
-
}
|
|
1858
|
+
}
|
|
1859
|
+
});
|
|
1767
1860
|
|
|
1768
1861
|
app.directive("kendoChat", function ($compile, $timeout) {
|
|
1769
1862
|
return {
|
|
@@ -50,31 +50,7 @@
|
|
|
50
50
|
|
|
51
51
|
// open report
|
|
52
52
|
this.openURLContent = function(url) {
|
|
53
|
-
|
|
54
|
-
var frame = $('<iframe/>');
|
|
55
|
-
frame.attr('frameborder', 0);
|
|
56
|
-
var h = parseInt($(window).height());
|
|
57
|
-
|
|
58
|
-
frame.attr('height', h - 200);
|
|
59
|
-
frame.attr('width', '100%');
|
|
60
|
-
frame.attr('src', url + "?download=false");
|
|
61
|
-
var m = $('#reportView .modal-body');
|
|
62
|
-
if(m.get(0)) {
|
|
63
|
-
m.html(frame);
|
|
64
|
-
$('#reportViewContext .modal-dialog').css('width', '95%');
|
|
65
|
-
setTimeout(function() {
|
|
66
|
-
console.log('open[#reportViewContext]');
|
|
67
|
-
$('body').append(context);
|
|
68
|
-
$('#reportView').modal();
|
|
69
|
-
}, 100);
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
console.log('wait[#reportViewContext]');
|
|
73
|
-
setTimeout(include, 200);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
setTimeout(include, 200);
|
|
53
|
+
openReportOnMobile(url)
|
|
78
54
|
};
|
|
79
55
|
|
|
80
56
|
this.initializeStimulsoft = function(language) {
|
|
@@ -461,6 +437,10 @@
|
|
|
461
437
|
}
|
|
462
438
|
}.bind(this));
|
|
463
439
|
};
|
|
464
|
-
|
|
440
|
+
|
|
441
|
+
function openReportOnMobile(url) {
|
|
442
|
+
window.open(url, '_system');
|
|
443
|
+
}
|
|
444
|
+
|
|
465
445
|
});
|
|
466
446
|
}(app));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cronapp-framework-mobile-js",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"description": "Javascript library for CronApp's projects",
|
|
5
5
|
"main": "cronapp.framework.mobile.js",
|
|
6
6
|
"scripts": {
|
|
@@ -57,6 +57,8 @@
|
|
|
57
57
|
"ng-file-upload": "12.2.13",
|
|
58
58
|
"angular-moment": "1.2.0",
|
|
59
59
|
"pace": "HubSpot/pace#v1.0.2",
|
|
60
|
-
"moment": "2.24.0"
|
|
60
|
+
"moment": "2.24.0",
|
|
61
|
+
"cronapp-ion-tab-badge": "1.0.0",
|
|
62
|
+
"signature_pad": "^3.0.0-beta.4"
|
|
61
63
|
}
|
|
62
64
|
}
|
package/postupdate.json
CHANGED
|
@@ -171,6 +171,11 @@
|
|
|
171
171
|
"file": "index.html",
|
|
172
172
|
"script": "node_modules/cronapp-framework-mobile-js/js/reports/reports.service.js",
|
|
173
173
|
"type": "script"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"file": "index.html",
|
|
177
|
+
"script": "node_modules/cronapp-ion-tab-badge/dist/index.js",
|
|
178
|
+
"type": "script"
|
|
174
179
|
}
|
|
175
180
|
],
|
|
176
181
|
"removes": [
|
|
@@ -208,6 +213,12 @@
|
|
|
208
213
|
"file": "index.html",
|
|
209
214
|
"script": "plugins/angular-translate/angular-translate.min.js",
|
|
210
215
|
"type": "script"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"file": "index.html",
|
|
219
|
+
"script": "node_modules/signature_pad/dist/signature_pad.umd.min.js",
|
|
220
|
+
"type": "script",
|
|
221
|
+
"onTop": true
|
|
211
222
|
}
|
|
212
223
|
],
|
|
213
224
|
"replaces": [
|