cronapp-framework-js 3.0.0-SP.9 → 3.1.0-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.
- package/components/crn-dynamic-file.components.json +65 -34
- package/components/crn-dynamic-menu.components.json +0 -21
- package/components/crn-enterprise-combobox-multiple.components.json +6 -0
- package/components/crn-navbar.components.json +26 -1
- package/components/crn-start.components.json +3 -0
- package/components/cron-breadcrumbs.components.json +7 -3
- package/components/templates/Component_Container/crn-eight-four-container.template.html +2 -2
- package/components/templates/Component_Container/crn-four-eight-container.template.html +2 -2
- package/components/templates/Component_Container/crn-one-container.template.html +1 -1
- package/components/templates/Component_Container/crn-three-container.template.html +3 -3
- package/components/templates/Component_Container/crn-three-six-three-container.template.html +3 -3
- package/components/templates/Component_Container/crn-two-container.template.html +2 -2
- package/components/templates/cron-autocomplete.designtime.html +2 -2
- package/components/templates/cron-combobox-multiple.template.html +1 -1
- package/components/templates/cron-grid.designtime.html +5 -4
- package/components/templates/dynamicfile.designtime.html +5 -0
- package/components/templates/dynamicfile.template.html +20 -3
- package/css/app.css +5 -0
- package/css/fonts/nunito/nunito.css +270 -0
- package/css/themes/custom/aquamarine/custom-aquamarine.css +24 -10
- package/css/themes/custom/cerulean/custom-cerulean.css +1 -0
- package/css/themes/custom/cosmo/custom-cosmo.css +16 -16
- package/css/themes/custom/cosmo/panel-cosmo.css +1 -1
- package/css/themes/custom/cyborg/button-cyborg.css +67 -3
- package/css/themes/custom/cyborg/custom-cyborg.css +250 -69
- package/css/themes/custom/cyborg/navbar-cyborg.css +4 -4
- package/css/themes/custom/cyborg/panel-cyborg.css +6 -7
- package/css/themes/custom/darkly/custom-darkly.css +1 -8
- package/css/themes/custom/dsgov/button-dsgov.css +0 -1
- package/css/themes/custom/dsgov/custom-dsgov.css +12 -1
- package/css/themes/custom/dsgov/table-grid-dsgov.css +14 -9
- package/css/themes/custom/flatly/custom-flatly.css +1 -0
- package/css/themes/custom/fuse/custom-fuse.css +15 -19
- package/css/themes/custom/journal/custom-journal.css +1 -0
- package/css/themes/custom/krypton/custom-krypton.css +991 -236
- package/css/themes/custom/krypton/grid-krypton.css +253 -66
- package/css/themes/custom/krypton/navbar-krypton.css +13 -12
- package/css/themes/custom/krypton/panel-krypton.css +29 -26
- package/css/themes/custom/lumen/button-lumen.css +8 -8
- package/css/themes/custom/lumen/custom-lumen.css +46 -34
- package/css/themes/custom/lumen/navbar-lumen.css +1 -1
- package/css/themes/custom/lumen/panel-lumen.css +17 -13
- package/css/themes/custom/material/custom-material.css +12 -1
- package/css/themes/custom/material/grid-material.css +1 -1
- package/css/themes/custom/material/navbar-material.css +13 -0
- package/css/themes/custom/material-round/custom-material-round.css +187 -34
- package/css/themes/custom/material-round/grid-material-round.css +174 -18
- package/css/themes/custom/materialui/custom-materialui.css +1 -0
- package/css/themes/custom/nature/custom-nature.css +2131 -0
- package/css/themes/custom/nature/grid-nature.css +396 -0
- package/css/themes/custom/nature/navbar-nature.css +98 -0
- package/css/themes/custom/nature/panel-nature.css +72 -0
- package/css/themes/custom/navigator/custom-navigator.css +80 -21
- package/css/themes/custom/paper/custom-paper.css +284 -27
- package/css/themes/custom/readable/button-readable.css +61 -1
- package/css/themes/custom/readable/custom-readable.css +242 -26
- package/css/themes/custom/readable/navbar-readable.css +1 -2
- package/css/themes/custom/readable/panel-readable.css +6 -8
- package/css/themes/custom/sandstone/button-sandstone.css +12 -0
- package/css/themes/custom/sandstone/custom-sandstone.css +1 -0
- package/css/themes/custom/simplex/custom-simplex.css +1 -0
- package/css/themes/custom/slate/custom-slate.css +4 -3
- package/css/themes/custom/spacelab/custom-spacelab.css +1 -0
- package/css/themes/custom/superhero/button-superhero.css +1 -1
- package/css/themes/custom/superhero/custom-superhero.css +348 -45
- package/css/themes/custom/superhero/navbar-superhero.css +5 -1
- package/css/themes/custom/superhero/panel-superhero.css +4 -5
- package/css/themes/custom/superhero/tabs-superhero.css +1 -1
- package/css/themes/custom/theme-general/button.css +4 -0
- package/css/themes/custom/theme-general/menu-vertical-retratil.css +35 -23
- package/css/themes/custom/theme-general/menu.css +10 -2
- package/css/themes/custom/theme-general/table-grid.css +14 -2
- package/css/themes/custom/theme-general/theme-general.css +30 -0
- package/css/themes/custom/united/custom-united.css +1 -0
- package/css/themes/custom/yeti/custom-yeti.css +1 -0
- package/css/themes/nature.min.css +9 -0
- package/dist/components/js/format.min.js +1 -1
- package/dist/components/js/jquery.inputmask.bundle.js +1 -1
- package/dist/components/js/jquery.mask.min.js +1 -1
- package/dist/components/templates/Component_Container/crn-eight-four-container.template.html +1 -1
- package/dist/components/templates/Component_Container/crn-four-eight-container.template.html +1 -1
- package/dist/components/templates/Component_Container/crn-one-container.template.html +1 -1
- package/dist/components/templates/Component_Container/crn-three-container.template.html +1 -1
- package/dist/components/templates/Component_Container/crn-three-six-three-container.template.html +1 -1
- package/dist/components/templates/Component_Container/crn-two-container.template.html +1 -1
- package/dist/components/templates/cron-autocomplete.designtime.html +1 -1
- package/dist/components/templates/cron-combobox-multiple.template.html +1 -1
- package/dist/components/templates/cron-grid.designtime.html +1 -1
- package/dist/components/templates/dynamicfile.designtime.html +1 -0
- package/dist/components/templates/dynamicfile.template.html +1 -1
- package/dist/css/app.css +1 -1
- package/dist/css/themes/custom/aquamarine/custom-aquamarine.css +1 -1
- package/dist/css/themes/custom/cerulean/custom-cerulean.css +1 -1
- package/dist/css/themes/custom/cosmo/custom-cosmo.css +1 -1
- package/dist/css/themes/custom/cosmo/panel-cosmo.css +1 -1
- package/dist/css/themes/custom/cyborg/button-cyborg.css +1 -1
- package/dist/css/themes/custom/cyborg/custom-cyborg.css +1 -1
- package/dist/css/themes/custom/cyborg/navbar-cyborg.css +1 -1
- package/dist/css/themes/custom/cyborg/panel-cyborg.css +1 -1
- package/dist/css/themes/custom/darkly/custom-darkly.css +1 -1
- package/dist/css/themes/custom/dsgov/button-dsgov.css +1 -1
- package/dist/css/themes/custom/dsgov/custom-dsgov.css +1 -1
- package/dist/css/themes/custom/dsgov/table-grid-dsgov.css +1 -1
- package/dist/css/themes/custom/flatly/custom-flatly.css +1 -1
- package/dist/css/themes/custom/fuse/custom-fuse.css +1 -1
- package/dist/css/themes/custom/journal/custom-journal.css +1 -1
- package/dist/css/themes/custom/krypton/custom-krypton.css +1 -1
- package/dist/css/themes/custom/krypton/grid-krypton.css +1 -1
- package/dist/css/themes/custom/krypton/navbar-krypton.css +1 -1
- package/dist/css/themes/custom/krypton/panel-krypton.css +1 -1
- package/dist/css/themes/custom/lumen/button-lumen.css +1 -1
- package/dist/css/themes/custom/lumen/custom-lumen.css +1 -1
- package/dist/css/themes/custom/lumen/navbar-lumen.css +1 -1
- package/dist/css/themes/custom/lumen/panel-lumen.css +1 -1
- package/dist/css/themes/custom/material/custom-material.css +1 -1
- package/dist/css/themes/custom/material/grid-material.css +1 -1
- package/dist/css/themes/custom/material/navbar-material.css +1 -1
- package/dist/css/themes/custom/material-round/custom-material-round.css +1 -1
- package/dist/css/themes/custom/material-round/grid-material-round.css +1 -1
- package/dist/css/themes/custom/materialui/custom-materialui.css +1 -1
- package/dist/css/themes/custom/nature/custom-nature.css +1 -0
- package/dist/css/themes/custom/nature/grid-nature.css +1 -0
- package/dist/css/themes/custom/nature/navbar-nature.css +1 -0
- package/dist/css/themes/custom/nature/panel-nature.css +1 -0
- package/dist/css/themes/custom/navigator/custom-navigator.css +1 -1
- package/dist/css/themes/custom/paper/custom-paper.css +1 -1
- package/dist/css/themes/custom/readable/button-readable.css +1 -1
- package/dist/css/themes/custom/readable/custom-readable.css +1 -1
- package/dist/css/themes/custom/readable/navbar-readable.css +1 -1
- package/dist/css/themes/custom/readable/panel-readable.css +1 -1
- package/dist/css/themes/custom/sandstone/button-sandstone.css +1 -1
- package/dist/css/themes/custom/sandstone/custom-sandstone.css +1 -1
- package/dist/css/themes/custom/simplex/custom-simplex.css +1 -1
- package/dist/css/themes/custom/slate/custom-slate.css +1 -1
- package/dist/css/themes/custom/spacelab/custom-spacelab.css +1 -1
- package/dist/css/themes/custom/superhero/button-superhero.css +1 -1
- package/dist/css/themes/custom/superhero/custom-superhero.css +1 -1
- package/dist/css/themes/custom/superhero/navbar-superhero.css +1 -1
- package/dist/css/themes/custom/superhero/panel-superhero.css +1 -1
- package/dist/css/themes/custom/superhero/tabs-superhero.css +1 -1
- package/dist/css/themes/custom/theme-general/button.css +1 -1
- package/dist/css/themes/custom/theme-general/menu-vertical-retratil.css +1 -1
- package/dist/css/themes/custom/theme-general/menu.css +1 -1
- package/dist/css/themes/custom/theme-general/table-grid.css +1 -1
- package/dist/css/themes/custom/theme-general/theme-general.css +1 -1
- package/dist/css/themes/custom/united/custom-united.css +1 -1
- package/dist/css/themes/custom/yeti/custom-yeti.css +1 -1
- package/dist/css/themes/nature.min.css +1 -0
- package/dist/js/app.js +1 -1
- package/dist/js/controllers.js +1 -1
- package/dist/js/directives.js +13 -8
- package/dist/js/reports/reports.service.js +1 -1
- package/dist/js/upload.service.js +1 -1
- package/js/app.js +5 -4
- package/js/controllers.js +43 -25
- package/js/directives.js +541 -275
- package/js/reports/reports.service.js +5 -5
- package/js/upload.service.js +7 -4
- package/package.json +1 -1
- package/postupdate.json +6 -0
package/js/directives.js
CHANGED
|
@@ -925,6 +925,37 @@
|
|
|
925
925
|
}
|
|
926
926
|
}])
|
|
927
927
|
|
|
928
|
+
.directive('screenVariables', [function() {
|
|
929
|
+
'use strict';
|
|
930
|
+
return {
|
|
931
|
+
link: async function(scope, elem, attrs, ctrl) {
|
|
932
|
+
let screenVariables = eval(attrs.screenVariables);
|
|
933
|
+
if (screenVariables && screenVariables.length) {
|
|
934
|
+
screenVariables.forEach(async (screenVariables) => {
|
|
935
|
+
if (scope.vars && !scope.vars[screenVariables.key]) {
|
|
936
|
+
let value = screenVariables.value || '';
|
|
937
|
+
if (screenVariables.type === 'blockly') {
|
|
938
|
+
value = await scope.$eval(value.replace('.run(','.toPromise().run('));
|
|
939
|
+
}
|
|
940
|
+
else if (screenVariables.type === 'expression') {
|
|
941
|
+
if (value.startsWith('params')) {
|
|
942
|
+
value = scope.params[value.replace('params.','')];
|
|
943
|
+
}
|
|
944
|
+
else if (value.startsWith('vars')) {
|
|
945
|
+
value = scope.vars[value.replace('vars.','')];
|
|
946
|
+
}
|
|
947
|
+
else {
|
|
948
|
+
value = await scope.$eval(value);
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
scope.vars[screenVariables.key] = value;
|
|
952
|
+
}
|
|
953
|
+
});
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
}])
|
|
958
|
+
|
|
928
959
|
.directive('mask', maskDirectiveMask)
|
|
929
960
|
|
|
930
961
|
.directive('cronappFilter', function($compile) {
|
|
@@ -2688,6 +2719,67 @@
|
|
|
2688
2719
|
return attributes;
|
|
2689
2720
|
}
|
|
2690
2721
|
|
|
2722
|
+
function commandClick(e, column) {
|
|
2723
|
+
e.preventDefault();
|
|
2724
|
+
let tr = $(e.target).closest("tr");
|
|
2725
|
+
let grid = tr.closest('table');
|
|
2726
|
+
let itemAsObj = this.dataItem(tr);
|
|
2727
|
+
let item = this.dataItem(tr);
|
|
2728
|
+
let index = $(grid.find('tbody')[0]).children().index(tr);
|
|
2729
|
+
let call = undefined;
|
|
2730
|
+
if (column.dataType == "Customized" || column.dataType == "CustomizedLink" || column.dataType == "GroupedButtons")
|
|
2731
|
+
call = column.execute;
|
|
2732
|
+
else
|
|
2733
|
+
call = generateBlocklyCall(column.blocklyInfo);
|
|
2734
|
+
let cronappDatasource = this.dataSource.transport.options.cronappDatasource;
|
|
2735
|
+
let currentGrid = options.refComponent;
|
|
2736
|
+
let selectedRows = [];
|
|
2737
|
+
currentGrid.select().each(function() {
|
|
2738
|
+
let gridRow = currentGrid.dataItem(this);
|
|
2739
|
+
cronappDatasource.data.forEach(function(dsRow) {
|
|
2740
|
+
if (dsRow.__$id == gridRow.__$id)
|
|
2741
|
+
selectedRows.push(dsRow);
|
|
2742
|
+
});
|
|
2743
|
+
});
|
|
2744
|
+
|
|
2745
|
+
if (!(cronappDatasource.inserting || cronappDatasource.editing)) {
|
|
2746
|
+
let tr = e.currentTarget.parentElement.parentElement;
|
|
2747
|
+
this.select(tr);
|
|
2748
|
+
}
|
|
2749
|
+
|
|
2750
|
+
let selectedRowsKeyOrObj = [];
|
|
2751
|
+
if (options.fieldType && options.fieldType === 'key') {
|
|
2752
|
+
item = helperDirective.changeObjectField(cronappDatasource, cronappDatasource.findObjInDs(item));
|
|
2753
|
+
selectedRows.forEach(row => {
|
|
2754
|
+
selectedRowsKeyOrObj.push(helperDirective.changeObjectField(cronappDatasource, cronappDatasource.findObjInDs(row)));
|
|
2755
|
+
});
|
|
2756
|
+
}
|
|
2757
|
+
else {
|
|
2758
|
+
selectedRowsKeyOrObj = selectedRows;
|
|
2759
|
+
}
|
|
2760
|
+
|
|
2761
|
+
let consolidated = {
|
|
2762
|
+
item: item,
|
|
2763
|
+
index: index
|
|
2764
|
+
}
|
|
2765
|
+
|
|
2766
|
+
let contextVars = {
|
|
2767
|
+
'currentData': cronappDatasource.data,
|
|
2768
|
+
'datasource': cronappDatasource.copyWithoutAngularObj(),
|
|
2769
|
+
'selectedIndex': index,
|
|
2770
|
+
'index': index,
|
|
2771
|
+
'selectedRow': item,
|
|
2772
|
+
'consolidated': consolidated,
|
|
2773
|
+
'item': item,
|
|
2774
|
+
'selectedKeys': cronappDatasource.getKeyValues(cronappDatasource.findObjInDs(itemAsObj), true),
|
|
2775
|
+
'selectedRows': selectedRowsKeyOrObj
|
|
2776
|
+
};
|
|
2777
|
+
|
|
2778
|
+
cronappDatasource.goTo(itemAsObj);
|
|
2779
|
+
scope.$eval(call, contextVars);
|
|
2780
|
+
return;
|
|
2781
|
+
};
|
|
2782
|
+
|
|
2691
2783
|
var columns = [];
|
|
2692
2784
|
if (options.columns) {
|
|
2693
2785
|
options.columns.forEach(function(column) {
|
|
@@ -2757,7 +2849,7 @@
|
|
|
2757
2849
|
className = 'k-custom-command' + (label ? ' k-button-with-label' : '');
|
|
2758
2850
|
}
|
|
2759
2851
|
if (column.theme)
|
|
2760
|
-
className += ' ' + column.theme;
|
|
2852
|
+
className += ' btn ' + column.theme;
|
|
2761
2853
|
|
|
2762
2854
|
var tooltip = '';
|
|
2763
2855
|
if (column.tooltip && column.tooltip.length)
|
|
@@ -2769,79 +2861,21 @@
|
|
|
2769
2861
|
className += ' ' + classForTooltip;
|
|
2770
2862
|
}
|
|
2771
2863
|
|
|
2864
|
+
let width = column.width;
|
|
2865
|
+
if (width) {
|
|
2866
|
+
width += 'px';
|
|
2867
|
+
}
|
|
2868
|
+
|
|
2772
2869
|
let idForCommand = app.common.generateId();
|
|
2773
2870
|
let ariaLabel = tooltip || label || idForCommand;
|
|
2774
|
-
let template = `<a href class='k-button ${className} k-grid-${idForCommand}' aria-label='${ariaLabel}'><span class='${column.iconClass}'></span>${label}</a>`;
|
|
2871
|
+
let template = `<a href class='k-button ${className} k-grid-${idForCommand}' aria-label='${ariaLabel}' style='width:${width}'><span class='${column.iconClass}'></span>${label}</a>`;
|
|
2775
2872
|
|
|
2776
2873
|
var addColumn = {
|
|
2777
2874
|
command: [{
|
|
2778
2875
|
name: idForCommand,
|
|
2779
2876
|
template: template,
|
|
2780
2877
|
click: function(e) {
|
|
2781
|
-
|
|
2782
|
-
var tr = $(e.target).closest("tr");
|
|
2783
|
-
var grid = tr.closest('table');
|
|
2784
|
-
|
|
2785
|
-
var itemAsObj = this.dataItem(tr);
|
|
2786
|
-
var item = this.dataItem(tr);
|
|
2787
|
-
var index = $(grid.find('tbody')[0]).children().index(tr)
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
var call = undefined;
|
|
2791
|
-
if (column.dataType == "Customized" || column.dataType == "CustomizedLink")
|
|
2792
|
-
call = column.execute;
|
|
2793
|
-
else
|
|
2794
|
-
call = generateBlocklyCall(column.blocklyInfo);
|
|
2795
|
-
|
|
2796
|
-
var cronappDatasource = this.dataSource.transport.options.cronappDatasource;
|
|
2797
|
-
var currentGrid = options.refComponent;
|
|
2798
|
-
var selectedRows = [];
|
|
2799
|
-
currentGrid.select().each(function() {
|
|
2800
|
-
var gridRow = currentGrid.dataItem(this);
|
|
2801
|
-
cronappDatasource.data.forEach(function(dsRow) {
|
|
2802
|
-
if (dsRow.__$id == gridRow.__$id)
|
|
2803
|
-
selectedRows.push(dsRow);
|
|
2804
|
-
});
|
|
2805
|
-
});
|
|
2806
|
-
|
|
2807
|
-
if (!(cronappDatasource.inserting || cronappDatasource.editing)) {
|
|
2808
|
-
var tr = e.currentTarget.parentElement.parentElement;
|
|
2809
|
-
this.select(tr);
|
|
2810
|
-
}
|
|
2811
|
-
|
|
2812
|
-
let selectedRowsKeyOrObj = [];
|
|
2813
|
-
if(options.fieldType && options.fieldType === 'key') {
|
|
2814
|
-
item = helperDirective.changeObjectField(cronappDatasource, cronappDatasource.findObjInDs(item));
|
|
2815
|
-
selectedRows.forEach(row => {
|
|
2816
|
-
selectedRowsKeyOrObj.push(helperDirective.changeObjectField(cronappDatasource, cronappDatasource.findObjInDs(row)));
|
|
2817
|
-
});
|
|
2818
|
-
}
|
|
2819
|
-
else {
|
|
2820
|
-
selectedRowsKeyOrObj = selectedRows;
|
|
2821
|
-
}
|
|
2822
|
-
|
|
2823
|
-
var consolidated = {
|
|
2824
|
-
item: item,
|
|
2825
|
-
index: index
|
|
2826
|
-
}
|
|
2827
|
-
|
|
2828
|
-
var contextVars = {
|
|
2829
|
-
'currentData': cronappDatasource.data,
|
|
2830
|
-
'datasource': cronappDatasource.copyWithoutAngularObj(),
|
|
2831
|
-
'selectedIndex': index,
|
|
2832
|
-
'index': index,
|
|
2833
|
-
'selectedRow': item,
|
|
2834
|
-
'consolidated': consolidated,
|
|
2835
|
-
'item': item,
|
|
2836
|
-
'selectedKeys': cronappDatasource.getKeyValues(cronappDatasource.findObjInDs(itemAsObj), true),
|
|
2837
|
-
'selectedRows': selectedRowsKeyOrObj
|
|
2838
|
-
};
|
|
2839
|
-
|
|
2840
|
-
if (this.element.find('input[type=checkbox]').length === 0) {
|
|
2841
|
-
cronappDatasource.goTo(itemAsObj);
|
|
2842
|
-
}
|
|
2843
|
-
scope.$eval(call, contextVars);
|
|
2844
|
-
return;
|
|
2878
|
+
commandClick.bind(this)(e, column);
|
|
2845
2879
|
}
|
|
2846
2880
|
}],
|
|
2847
2881
|
width: widthDevice.width,
|
|
@@ -2852,6 +2886,62 @@
|
|
|
2852
2886
|
columns.push(addColumn);
|
|
2853
2887
|
setIdCommandButton.bind(this)(idForCommand, column.dataType);
|
|
2854
2888
|
}
|
|
2889
|
+
else if (column.dataType == "GroupedButtons") {
|
|
2890
|
+
|
|
2891
|
+
if (column.buttonColumns && column.buttonColumns.length) {
|
|
2892
|
+
|
|
2893
|
+
let commands = [];
|
|
2894
|
+
|
|
2895
|
+
column.buttonColumns.forEach(function(buttonColumn) {
|
|
2896
|
+
let label = buttonColumn.label == undefined ? '': buttonColumn.label;
|
|
2897
|
+
if (buttonColumn.iconClass && label)
|
|
2898
|
+
label = ' ' + label;
|
|
2899
|
+
|
|
2900
|
+
let className = 'k-custom-command' + (label ? ' k-button-with-label' : '');
|
|
2901
|
+
if (buttonColumn.theme)
|
|
2902
|
+
className += ' btn ' + buttonColumn.theme;
|
|
2903
|
+
|
|
2904
|
+
let tooltip = '';
|
|
2905
|
+
if (buttonColumn.tooltip && buttonColumn.tooltip.length)
|
|
2906
|
+
tooltip = buttonColumn.tooltip;
|
|
2907
|
+
|
|
2908
|
+
if (tooltip) {
|
|
2909
|
+
let classForTooltip = app.common.generateId();
|
|
2910
|
+
tooltips[classForTooltip] = tooltip;
|
|
2911
|
+
className += ' ' + classForTooltip;
|
|
2912
|
+
}
|
|
2913
|
+
|
|
2914
|
+
let width = buttonColumn.width;
|
|
2915
|
+
if (width) {
|
|
2916
|
+
width += 'px';
|
|
2917
|
+
}
|
|
2918
|
+
|
|
2919
|
+
let idForCommand = app.common.generateId();
|
|
2920
|
+
let ariaLabel = tooltip || label || idForCommand;
|
|
2921
|
+
let template = `<a href class='k-button ${className} k-grid-${idForCommand}' aria-label='${ariaLabel}' style='width:${width}'><span class='${buttonColumn.iconClass}'></span>${label}</a>`;
|
|
2922
|
+
|
|
2923
|
+
let command = {
|
|
2924
|
+
name: idForCommand,
|
|
2925
|
+
template: template,
|
|
2926
|
+
click: function(e) {
|
|
2927
|
+
buttonColumn.dataType = column.dataType;
|
|
2928
|
+
commandClick.bind(this)(e, buttonColumn);
|
|
2929
|
+
}
|
|
2930
|
+
};
|
|
2931
|
+
commands.push(command);
|
|
2932
|
+
});
|
|
2933
|
+
|
|
2934
|
+
var addColumn = {
|
|
2935
|
+
command: commands,
|
|
2936
|
+
width: widthDevice.width,
|
|
2937
|
+
title: column.headerText ? column.headerText: '',
|
|
2938
|
+
hidden: !widthDevice.visible,
|
|
2939
|
+
attributes: getAttributes(column)
|
|
2940
|
+
};
|
|
2941
|
+
columns.push(addColumn);
|
|
2942
|
+
setIdCommandButton.bind(this)(app.common.generateId(), column.dataType);
|
|
2943
|
+
}
|
|
2944
|
+
}
|
|
2855
2945
|
else if (column.dataType == "Selectable") {
|
|
2856
2946
|
var checkColumn = {
|
|
2857
2947
|
selectable: true,
|
|
@@ -2989,7 +3079,11 @@
|
|
|
2989
3079
|
var cronappDatasource = this.dataSource.transport.options.cronappDatasource;
|
|
2990
3080
|
if (!(cronappDatasource.inserting || cronappDatasource.editing)) {
|
|
2991
3081
|
if (this.selectable) {
|
|
3082
|
+
setToActiveInCronappDataSource.bind(this)(e.data);
|
|
2992
3083
|
this.select(e.masterRow);
|
|
3084
|
+
if (options.columns.find(c => c.dataType == 'Selectable') !== undefined) {
|
|
3085
|
+
collapseAllExcecptCurrent(this, e.detailRow, e.masterRow);
|
|
3086
|
+
}
|
|
2993
3087
|
}
|
|
2994
3088
|
else {
|
|
2995
3089
|
setToActiveInCronappDataSource.bind(this)(e.data);
|
|
@@ -3217,14 +3311,22 @@
|
|
|
3217
3311
|
},
|
|
3218
3312
|
change: function(e) {
|
|
3219
3313
|
var item = this.dataItem(this.select());
|
|
3220
|
-
|
|
3314
|
+
if ((options.details && options.details.length == 0) || (!cronapi.internal.hasMethodInCallStack('detailInit'))) {
|
|
3315
|
+
setToActiveInCronappDataSource.bind(this)(item);
|
|
3316
|
+
}
|
|
3221
3317
|
var cronappDatasource = this.dataSource.transport.options.cronappDatasource;
|
|
3222
3318
|
if(options.fieldType && options.fieldType === 'key'){
|
|
3223
3319
|
cronappDatasource.active = helperDirective.changeObjectField(cronappDatasource, cronappDatasource.active);
|
|
3224
3320
|
}
|
|
3321
|
+
|
|
3322
|
+
let trDetails = this.select().next();
|
|
3323
|
+
let trMasters = this.select();
|
|
3324
|
+
|
|
3225
3325
|
if (ngModelCtrl) {
|
|
3226
3326
|
if ("multiple" === options.allowSelectionRowType) {
|
|
3227
3327
|
let selecteds = [];
|
|
3328
|
+
trDetails = [];
|
|
3329
|
+
trMasters = [];
|
|
3228
3330
|
this.select().each((i, row)=> {
|
|
3229
3331
|
let item = this.dataItem(row);
|
|
3230
3332
|
let objInDs = cronappDatasource.findObjInDs(item, false);
|
|
@@ -3234,6 +3336,10 @@
|
|
|
3234
3336
|
if (objInDs !== null){
|
|
3235
3337
|
selecteds.push(objInDs);
|
|
3236
3338
|
}
|
|
3339
|
+
if (item["_objectKey"] === cronappDatasource.active["_objectKey"]) {
|
|
3340
|
+
trMasters.push(this.select()[i]);
|
|
3341
|
+
trDetails.push(this.select().next()[i]);
|
|
3342
|
+
}
|
|
3237
3343
|
});
|
|
3238
3344
|
ngModelCtrl.$setViewValue(selecteds);
|
|
3239
3345
|
}
|
|
@@ -3246,7 +3352,7 @@
|
|
|
3246
3352
|
}
|
|
3247
3353
|
}
|
|
3248
3354
|
}
|
|
3249
|
-
collapseAllExcecptCurrent(this,
|
|
3355
|
+
collapseAllExcecptCurrent(this, trDetails, trMasters);
|
|
3250
3356
|
|
|
3251
3357
|
if (attrs && attrs.ngChange) {
|
|
3252
3358
|
scope.$eval(attrs.ngChange);
|
|
@@ -3269,8 +3375,8 @@
|
|
|
3269
3375
|
command = 'edit';
|
|
3270
3376
|
}
|
|
3271
3377
|
|
|
3272
|
-
|
|
3273
|
-
|
|
3378
|
+
let modelName = helperDirective.getModelName(attrs);
|
|
3379
|
+
if (item && item["_objectKey"]) {
|
|
3274
3380
|
let key = item["_objectKey"];
|
|
3275
3381
|
let id = `${modelName}-${command}-${key}`;
|
|
3276
3382
|
$elem.attr('id', id);
|
|
@@ -3445,11 +3551,63 @@
|
|
|
3445
3551
|
}
|
|
3446
3552
|
});
|
|
3447
3553
|
|
|
3554
|
+
grid.selectable.userEvents.unbind("select");
|
|
3555
|
+
|
|
3448
3556
|
});
|
|
3449
3557
|
|
|
3558
|
+
let contextMenuId = app.common.generateId();
|
|
3559
|
+
let contextMenuValue = app.common.generateId();
|
|
3560
|
+
let contextMenuClose = app.common.generateId();
|
|
3561
|
+
let contextMenuHtml = $(`<ul id="${contextMenuId}">
|
|
3562
|
+
<li id="copyText">
|
|
3563
|
+
<input id="${contextMenuValue}">
|
|
3564
|
+
<span id="${contextMenuClose}" class="k-icon k-i-close" style="margin-left: 5px;"></span>
|
|
3565
|
+
</li>
|
|
3566
|
+
</ul>`);
|
|
3450
3567
|
element.html($templateDyn);
|
|
3568
|
+
element.append(contextMenuHtml);
|
|
3451
3569
|
$compile($templateDyn)(element.scope());
|
|
3452
3570
|
|
|
3571
|
+
let contextMenu = $(`#${contextMenuId}`).kendoContextMenu({
|
|
3572
|
+
target: $templateDyn,
|
|
3573
|
+
filter: "td",
|
|
3574
|
+
close: (e) => {
|
|
3575
|
+
if (!closeContextMenu) {
|
|
3576
|
+
e.preventDefault();
|
|
3577
|
+
}
|
|
3578
|
+
},
|
|
3579
|
+
open: (e) => {
|
|
3580
|
+
let cell = e.target;
|
|
3581
|
+
let row = $(cell).parent()[0];
|
|
3582
|
+
let grid = $templateDyn.data("kendoGrid");
|
|
3583
|
+
let itemId = e.item.id;
|
|
3584
|
+
|
|
3585
|
+
let cellText = cell.innerText;
|
|
3586
|
+
if (cellText.length && cellText !== '') {
|
|
3587
|
+
$(e.item).find(`#${contextMenuValue}`).val(cellText);
|
|
3588
|
+
closeContextMenu = false;
|
|
3589
|
+
}
|
|
3590
|
+
else {
|
|
3591
|
+
let menuRejected = () => {
|
|
3592
|
+
return new Promise((resolve, reject) => {
|
|
3593
|
+
let waiting = setInterval(() => {
|
|
3594
|
+
if ($(`#${contextMenuId}`).is(':visible')) {
|
|
3595
|
+
clearInterval(waiting);
|
|
3596
|
+
$(`#${contextMenuId}`).hide();
|
|
3597
|
+
}
|
|
3598
|
+
});
|
|
3599
|
+
});
|
|
3600
|
+
}
|
|
3601
|
+
menuRejected();
|
|
3602
|
+
}
|
|
3603
|
+
}
|
|
3604
|
+
}).data("kendoContextMenu");
|
|
3605
|
+
|
|
3606
|
+
$(`#${contextMenuClose}`).on("click", (e) => {
|
|
3607
|
+
closeContextMenu = true;
|
|
3608
|
+
contextMenu.close();
|
|
3609
|
+
});
|
|
3610
|
+
|
|
3453
3611
|
}
|
|
3454
3612
|
};
|
|
3455
3613
|
}])
|
|
@@ -3531,8 +3689,8 @@
|
|
|
3531
3689
|
getAllParent(cronappDatasource, itemResult.d.results[0], ids, resolve, reject);
|
|
3532
3690
|
},
|
|
3533
3691
|
beforeSend: (xhr) => {
|
|
3534
|
-
if (window.
|
|
3535
|
-
xhr.setRequestHeader ("X-AUTH-TOKEN",
|
|
3692
|
+
if (!window.isUsingCookie()) {
|
|
3693
|
+
xhr.setRequestHeader ("X-AUTH-TOKEN", cronapi.util.getUserToken());
|
|
3536
3694
|
}
|
|
3537
3695
|
},
|
|
3538
3696
|
error: () => reject(),
|
|
@@ -3673,8 +3831,8 @@
|
|
|
3673
3831
|
resolve();
|
|
3674
3832
|
},
|
|
3675
3833
|
beforeSend: (xhr) => {
|
|
3676
|
-
if (window.
|
|
3677
|
-
xhr.setRequestHeader ("X-AUTH-TOKEN",
|
|
3834
|
+
if (!window.isUsingCookie()) {
|
|
3835
|
+
xhr.setRequestHeader ("X-AUTH-TOKEN", cronapi.util.getUserToken());
|
|
3678
3836
|
}
|
|
3679
3837
|
},
|
|
3680
3838
|
error: () => reject(),
|
|
@@ -3874,7 +4032,7 @@
|
|
|
3874
4032
|
}
|
|
3875
4033
|
};
|
|
3876
4034
|
})
|
|
3877
|
-
|
|
4035
|
+
|
|
3878
4036
|
.directive('cronDynamicSelect', function ($compile, $timeout, $parse, $translate, $log) {
|
|
3879
4037
|
return {
|
|
3880
4038
|
restrict: 'E',
|
|
@@ -4062,97 +4220,28 @@
|
|
|
4062
4220
|
});
|
|
4063
4221
|
}
|
|
4064
4222
|
|
|
4065
|
-
options.virtual.valueMapper = async function(options) {
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
return;
|
|
4081
|
-
}
|
|
4082
|
-
|
|
4083
|
-
if (options.value || options.value === "") {
|
|
4084
|
-
if(_combobox.options.optionLabel[_combobox.options.dataValueField] !== null && options.value === ""){
|
|
4085
|
-
options.completed = true;
|
|
4086
|
-
$log.debug("valueMapper.success | " + attrs['id'] + " | NULL");
|
|
4087
|
-
options.success(null);
|
|
4088
|
-
}
|
|
4089
|
-
else{
|
|
4090
|
-
_combobox.isEvaluating = true;
|
|
4091
|
-
var _dataSource = _options.dataSource.transport.options.cronappDatasource;
|
|
4092
|
-
if (options.value === undefined || options.value === null || options.value === "") {
|
|
4093
|
-
options.completed = true;
|
|
4094
|
-
$log.debug("valueMapper.success | " + attrs['id'] + " | NULL");
|
|
4095
|
-
options.success(null);
|
|
4096
|
-
_combobox.isEvaluating = false;
|
|
4097
|
-
} else {
|
|
4098
|
-
$log.debug("valueMapper.findObj | " + attrs['id'] + " | " + options.value);
|
|
4099
|
-
_dataSource.findObj([options.value], false, function(data) {
|
|
4100
|
-
options.completed = true;
|
|
4101
|
-
|
|
4102
|
-
if (options.canceled) {
|
|
4103
|
-
$log.debug("valueMapper CANCELED | " + options.value);
|
|
4104
|
-
_combobox.isEvaluating = false;
|
|
4105
|
-
return;
|
|
4106
|
-
}
|
|
4107
|
-
if (Array.isArray(data)) {
|
|
4108
|
-
data = data[0];
|
|
4109
|
-
}
|
|
4110
|
-
$log.debug("valueMapper.success | " + attrs['id'] + " | " + data);
|
|
4111
|
-
options.success(data);
|
|
4112
|
-
_combobox.isEvaluating = false;
|
|
4113
|
-
|
|
4114
|
-
if (select.changeCursor) {
|
|
4115
|
-
scope.safeApply(function() {
|
|
4116
|
-
if (options.canceled) {
|
|
4117
|
-
$log.debug("valueMapper CANCELED | " + options.value);
|
|
4118
|
-
return;
|
|
4119
|
-
}
|
|
4120
|
-
if (data != null) {
|
|
4121
|
-
var found = _goTo(_scope, _combobox, data);
|
|
4122
|
-
if (!found) {
|
|
4123
|
-
_dataSource.data.push(data);
|
|
4124
|
-
found = _goTo(_scope, _combobox, data);
|
|
4125
|
-
}
|
|
4126
|
-
if (found) {
|
|
4127
|
-
modelSetter(_scope, found[select.dataValueField]);
|
|
4128
|
-
}
|
|
4129
|
-
} else {
|
|
4130
|
-
modelSetter(_scope, null);
|
|
4131
|
-
}
|
|
4132
|
-
});
|
|
4133
|
-
} else {
|
|
4134
|
-
if (data == null) {
|
|
4135
|
-
modelSetter(_scope, null);
|
|
4136
|
-
}
|
|
4137
|
-
}
|
|
4138
|
-
}, function() {
|
|
4139
|
-
options.completed = true;
|
|
4140
|
-
if (options.canceled) {
|
|
4141
|
-
$log.debug("valueMapper CANCELED | " + options.value);
|
|
4142
|
-
_combobox.isEvaluating = false;
|
|
4143
|
-
return;
|
|
4144
|
-
}
|
|
4145
|
-
$log.debug("valueMapper.success | " + attrs['id'] + " | NULL");
|
|
4146
|
-
options.success(null);
|
|
4147
|
-
_combobox.isEvaluating = false;
|
|
4148
|
-
}, [combobox.options.dataValueField]);
|
|
4149
|
-
}
|
|
4223
|
+
options.virtual.valueMapper = async function (options) {
|
|
4224
|
+
if (!combobox || combobox.isEvaluating) return;
|
|
4225
|
+
combobox.isEvaluating = true;
|
|
4226
|
+
|
|
4227
|
+
var _dataSource = _options.dataSource.transport.options.cronappDatasource;
|
|
4228
|
+
$log.debug("valueMapper.findObj | " + attrs['id'] + " | " + options.value);
|
|
4229
|
+
|
|
4230
|
+
try {
|
|
4231
|
+
let currentValue = combobox.value();
|
|
4232
|
+
|
|
4233
|
+
let data = await _dataSource.findObj([options.value], false);
|
|
4234
|
+
if (Array.isArray(data)) data = data[0];
|
|
4235
|
+
|
|
4236
|
+
if (currentValue === combobox.value()) {
|
|
4237
|
+
options.success(data);
|
|
4150
4238
|
}
|
|
4151
|
-
}
|
|
4152
|
-
$log.debug("valueMapper.success | " + attrs['id'] + " | NULL");
|
|
4239
|
+
} catch (e) {
|
|
4153
4240
|
options.success(null);
|
|
4241
|
+
} finally {
|
|
4242
|
+
combobox.isEvaluating = false;
|
|
4154
4243
|
}
|
|
4155
|
-
};
|
|
4244
|
+
};
|
|
4156
4245
|
}
|
|
4157
4246
|
|
|
4158
4247
|
options.messages = {
|
|
@@ -4164,23 +4253,42 @@
|
|
|
4164
4253
|
scope.safeApply(() => {
|
|
4165
4254
|
var contextVars = {
|
|
4166
4255
|
'selected' : dataItem,
|
|
4167
|
-
'selectedKey' : dataItem[options.dataValueField],
|
|
4168
|
-
'selectedValue' : dataItem[options.dataTextField]
|
|
4256
|
+
'selectedKey' : dataItem ? dataItem[options.dataValueField] : "",
|
|
4257
|
+
'selectedValue' : dataItem ? dataItem[options.dataTextField] : ""
|
|
4169
4258
|
};
|
|
4170
|
-
scope.$eval(attrs.ngChange, contextVars);
|
|
4259
|
+
scope.$eval(attrs.ngChange, contextVars);
|
|
4171
4260
|
});
|
|
4172
4261
|
} : undefined;
|
|
4173
4262
|
|
|
4174
|
-
|
|
4175
|
-
options.
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4263
|
+
|
|
4264
|
+
options.close = attrs.ngClose ? function () {
|
|
4265
|
+
scope.$eval(attrs.ngClose);
|
|
4266
|
+
} : undefined;
|
|
4267
|
+
|
|
4268
|
+
options.dataBound = function () {
|
|
4269
|
+
if (!scope.$$phase && !scope.$root.$$phase) {
|
|
4270
|
+
_compileAngular(scope, combobox.element[0]);
|
|
4271
|
+
}
|
|
4272
|
+
};
|
|
4273
|
+
|
|
4274
|
+
|
|
4275
|
+
options.filtering = attrs.ngFiltering ? function () {
|
|
4276
|
+
scope.$eval(attrs.ngFiltering);
|
|
4277
|
+
} : undefined;
|
|
4278
|
+
|
|
4279
|
+
options.open = function (e) {
|
|
4280
|
+
if (!dataSourceScreen.fetched || (dataSourceScreen.lastLoadedTime !== combobox.dataSource.lastLoadedTime)) {
|
|
4179
4281
|
combobox.options.firstLazyRead = true;
|
|
4180
4282
|
combobox.dataSource.read();
|
|
4283
|
+
combobox.dataSource.lastLoadedTime = dataSourceScreen.lastLoadedTime;
|
|
4284
|
+
}
|
|
4285
|
+
|
|
4286
|
+
let emptyOption = { [combobox.options.dataValueField]: "", [combobox.options.dataTextField]: "" };
|
|
4287
|
+
if (!combobox.dataSource.data().some(item => item[combobox.options.dataValueField] === "")) {
|
|
4288
|
+
combobox.dataSource.add(emptyOption);
|
|
4181
4289
|
}
|
|
4182
4290
|
};
|
|
4183
|
-
|
|
4291
|
+
|
|
4184
4292
|
options.select = attrs.ngSelect ? function (e) {
|
|
4185
4293
|
scope.safeApply(() => {
|
|
4186
4294
|
var contextVars = {
|
|
@@ -4211,6 +4319,49 @@
|
|
|
4211
4319
|
dataSourceScreen.__ignoreFirstFetch = true;
|
|
4212
4320
|
}
|
|
4213
4321
|
var combobox = $element.kendoDropDownList(options).data('kendoDropDownList');
|
|
4322
|
+
combobox.isEvaluating = false;
|
|
4323
|
+
|
|
4324
|
+
function forceEmptyLineSelected() {
|
|
4325
|
+
var optionLabel = combobox.list.find('.k-list-optionlabel');
|
|
4326
|
+
|
|
4327
|
+
if (optionLabel && optionLabel.length) {
|
|
4328
|
+
optionLabel.addClass("k-state-selected k-state-focused");
|
|
4329
|
+
}
|
|
4330
|
+
$log.debug("Linha vazia marcada como ativa:", optionLabel);
|
|
4331
|
+
}
|
|
4332
|
+
|
|
4333
|
+
var scrolling = false;
|
|
4334
|
+
|
|
4335
|
+
combobox.bind("open", function () {
|
|
4336
|
+
if (scrolling) return;
|
|
4337
|
+
scrolling = true;
|
|
4338
|
+
|
|
4339
|
+
setTimeout(() => {
|
|
4340
|
+
scrolling = false;
|
|
4341
|
+
}, 300);
|
|
4342
|
+
});
|
|
4343
|
+
|
|
4344
|
+
combobox.bind("change", function () {
|
|
4345
|
+
if (combobox.isEvaluating) return;
|
|
4346
|
+
combobox.isEvaluating = true;
|
|
4347
|
+
|
|
4348
|
+
try {
|
|
4349
|
+
let selectedItem = combobox.dataItem();
|
|
4350
|
+
|
|
4351
|
+
if (selectedItem && selectedItem[options.dataValueField] === "") {
|
|
4352
|
+
modelSetter(scope, "");
|
|
4353
|
+
modelTextFieldSetter(scope, "");
|
|
4354
|
+
} else {
|
|
4355
|
+
modelSetter(scope, selectedItem[options.dataValueField]);
|
|
4356
|
+
modelTextFieldSetter(scope, selectedItem[options.dataTextField]);
|
|
4357
|
+
}
|
|
4358
|
+
|
|
4359
|
+
forceEmptyLineSelected();
|
|
4360
|
+
} finally {
|
|
4361
|
+
combobox.isEvaluating = false;
|
|
4362
|
+
}
|
|
4363
|
+
});
|
|
4364
|
+
|
|
4214
4365
|
options.combobox = combobox;
|
|
4215
4366
|
$(combobox.element[0]).attr('tabindex','-1');
|
|
4216
4367
|
if (dataSourceScreen != null && dataSourceScreen != undefined) {
|
|
@@ -4225,6 +4376,13 @@
|
|
|
4225
4376
|
|
|
4226
4377
|
this.toComboType(attrs, parent, select, combobox);
|
|
4227
4378
|
|
|
4379
|
+
let forcedRefreshModelAt;
|
|
4380
|
+
let canRefresh = () => {
|
|
4381
|
+
let check = performance.now();
|
|
4382
|
+
if (!forcedRefreshModelAt) return true;
|
|
4383
|
+
return check - forcedRefreshModelAt > 2000;
|
|
4384
|
+
};
|
|
4385
|
+
|
|
4228
4386
|
var forceChangeModel = async function(value) {
|
|
4229
4387
|
|
|
4230
4388
|
$log.debug("forceChangeModel | " + attrs['id'] + " | " + value);
|
|
@@ -4268,70 +4426,29 @@
|
|
|
4268
4426
|
/**
|
|
4269
4427
|
* Observa o read do datasource para setar o primeiro valor ou valor inicial.
|
|
4270
4428
|
*/
|
|
4271
|
-
var defineInitialValue = function() {
|
|
4429
|
+
var defineInitialValue = function () {
|
|
4272
4430
|
if (combobox.definingInitialValue) {
|
|
4273
4431
|
return;
|
|
4274
4432
|
}
|
|
4275
4433
|
if (!combobox.isEvaluating) {
|
|
4276
|
-
var currentValue =
|
|
4434
|
+
var currentValue = combobox.value();
|
|
4277
4435
|
var nextValue = null;
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
combobox.options.lazyFirstInitialValue = false;
|
|
4284
|
-
found = dataSourceScreen.goTo(select.initValue);
|
|
4285
|
-
if (found) {
|
|
4286
|
-
nextValue = select.initValue;
|
|
4287
|
-
}
|
|
4288
|
-
}
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
if (nextValue == null && select.firstValue) {
|
|
4292
|
-
if (dataSourceScreen) {
|
|
4293
|
-
combobox.definingInitialValue = true;
|
|
4294
|
-
dataSourceScreen.fetch({
|
|
4295
|
-
params: {
|
|
4296
|
-
$top: 1
|
|
4297
|
-
}
|
|
4298
|
-
}, {
|
|
4299
|
-
success: function(data) {
|
|
4300
|
-
if (data.length) {
|
|
4301
|
-
dataSourceScreen.data.push(data[0]);
|
|
4302
|
-
nextValue = data[0][select.dataValueField];
|
|
4303
|
-
}
|
|
4304
|
-
modelSetter(_scope, nextValue);
|
|
4305
|
-
forceChangeModel(nextValue);
|
|
4306
|
-
combobox.definingInitialValue = false;
|
|
4307
|
-
},
|
|
4308
|
-
error: function() {
|
|
4309
|
-
combobox.definingInitialValue = false;
|
|
4310
|
-
},
|
|
4311
|
-
canceled: function() {
|
|
4312
|
-
combobox.definingInitialValue = false;
|
|
4313
|
-
}
|
|
4314
|
-
}, undefined, {lookup : true});
|
|
4315
|
-
}
|
|
4316
|
-
} else {
|
|
4317
|
-
modelSetter(_scope, nextValue);
|
|
4318
|
-
forceChangeModel(nextValue);
|
|
4319
|
-
combobox.definingInitialValue = false;
|
|
4320
|
-
}
|
|
4436
|
+
|
|
4437
|
+
if (!currentValue || currentValue === "") {
|
|
4438
|
+
nextValue = "";
|
|
4439
|
+
modelSetter(scope, nextValue);
|
|
4440
|
+
forceEmptyLineSelected();
|
|
4321
4441
|
}
|
|
4322
4442
|
}
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
}
|
|
4326
|
-
}
|
|
4327
|
-
|
|
4443
|
+
};
|
|
4444
|
+
|
|
4328
4445
|
var _ngModelCtrl = ngModelCtrl;
|
|
4329
4446
|
if (dataSourceScreen != null && dataSourceScreen != undefined) {
|
|
4330
4447
|
dataSourceScreen.addDataSourceEvents({
|
|
4331
4448
|
overRideRefresh: function() {
|
|
4332
4449
|
dataSourceScreen.fetched = false;
|
|
4333
4450
|
dataSourceScreen.cleanup();
|
|
4334
|
-
defineInitialValue();
|
|
4451
|
+
canRefresh() && defineInitialValue();
|
|
4335
4452
|
}
|
|
4336
4453
|
});
|
|
4337
4454
|
}
|
|
@@ -4347,47 +4464,46 @@
|
|
|
4347
4464
|
return;
|
|
4348
4465
|
}
|
|
4349
4466
|
_scope.$apply(function() {
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
if(select.
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
_scope.$eval(select.changeValueBasedOnLabel + '=' + '"' + comboLabelValue + '"')
|
|
4360
|
-
}catch (e) {
|
|
4361
|
-
console.error("Não foi possível atribuir o texto do combobox ", comboLabelValue, " no compo informado ", select.changeValueBasedOnLabel);
|
|
4362
|
-
}
|
|
4363
|
-
}
|
|
4467
|
+
let selectedItem = combobox.dataItem();
|
|
4468
|
+
|
|
4469
|
+
if (!selectedItem || selectedItem[select.dataValueField] === "") {
|
|
4470
|
+
combobox.value("");
|
|
4471
|
+
modelSetter(_scope, "");
|
|
4472
|
+
modelTextFieldSetter(_scope, "");
|
|
4473
|
+
} else {
|
|
4474
|
+
modelSetter(_scope, selectedItem[select.dataValueField]);
|
|
4475
|
+
modelTextFieldSetter(_scope, selectedItem[select.dataTextField]);
|
|
4364
4476
|
}
|
|
4365
|
-
|
|
4477
|
+
|
|
4366
4478
|
_compileAngular(scope, options.combobox.element[0]);
|
|
4479
|
+
if (options?.combobox?.span) {
|
|
4480
|
+
_compileAngular(scope, options.combobox.span);
|
|
4481
|
+
}
|
|
4367
4482
|
});
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4483
|
+
};
|
|
4484
|
+
|
|
4371
4485
|
applyChange();
|
|
4372
|
-
|
|
4373
4486
|
});
|
|
4374
|
-
|
|
4487
|
+
|
|
4375
4488
|
/**
|
|
4376
4489
|
* Observando model do DropdownList.
|
|
4377
4490
|
*/
|
|
4378
4491
|
if (ngModelCtrl) {
|
|
4379
4492
|
ngModelCtrl.$formatters.push(function (value) {
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
value = null;
|
|
4384
|
-
modelSetter(_scope, value);
|
|
4493
|
+
if (value === undefined || value === "") {
|
|
4494
|
+
value = "";
|
|
4495
|
+
modelSetter(scope, value);
|
|
4385
4496
|
}
|
|
4386
|
-
forceChangeModel(value);
|
|
4387
|
-
|
|
4388
4497
|
return value;
|
|
4389
4498
|
});
|
|
4390
|
-
|
|
4499
|
+
|
|
4500
|
+
ngModelCtrl.$parsers.push(function (value) {
|
|
4501
|
+
if (!value || value === "") {
|
|
4502
|
+
return "";
|
|
4503
|
+
}
|
|
4504
|
+
return value;
|
|
4505
|
+
});
|
|
4506
|
+
|
|
4391
4507
|
ngModelCtrl.$parsers.push(function (value) {
|
|
4392
4508
|
$log.debug("$parsers | " + attrs['id'] + " | " + value);
|
|
4393
4509
|
if ((typeof value === 'boolean') || value) {
|
|
@@ -4422,9 +4538,11 @@
|
|
|
4422
4538
|
select.initValue = null;
|
|
4423
4539
|
}
|
|
4424
4540
|
|
|
4425
|
-
if (select.initValue
|
|
4426
|
-
|
|
4541
|
+
if (select.initValue === null || select.initValue === "" || !select.initValue) {
|
|
4542
|
+
combobox.value("");
|
|
4543
|
+
modelSetter(_scope, "");
|
|
4427
4544
|
}
|
|
4545
|
+
|
|
4428
4546
|
|
|
4429
4547
|
if (combobox.dataSource.transport && combobox.dataSource.transport.options) {
|
|
4430
4548
|
combobox.dataSource.transport.options.combobox = combobox;
|
|
@@ -4465,10 +4583,14 @@
|
|
|
4465
4583
|
});
|
|
4466
4584
|
|
|
4467
4585
|
$("[aria-owns='" + `${attrs.id}_listbox` + "']").attr('aria-label', $translate.instant('template.crud.search'));
|
|
4586
|
+
if (ngModelCtrl.$modelValue) {
|
|
4587
|
+
_scope.cronapi.internal.forceRefreshNgModel(attrs.ngModel, ngModelCtrl.$modelValue);
|
|
4588
|
+
forcedRefreshModelAt = performance.now();
|
|
4589
|
+
}
|
|
4468
4590
|
}
|
|
4469
4591
|
};
|
|
4470
4592
|
})
|
|
4471
|
-
|
|
4593
|
+
|
|
4472
4594
|
.directive('cronMultiSelect', function ($compile, $parse) {
|
|
4473
4595
|
return {
|
|
4474
4596
|
restrict: 'E',
|
|
@@ -4478,6 +4600,15 @@
|
|
|
4478
4600
|
var modelSetter = modelGetter.assign;
|
|
4479
4601
|
var model = attrs['ngModel'];
|
|
4480
4602
|
|
|
4603
|
+
let jumpThread = () => {
|
|
4604
|
+
return new Promise((resolve) => {
|
|
4605
|
+
let jumpWait = setInterval(() => {
|
|
4606
|
+
clearInterval(jumpWait);
|
|
4607
|
+
resolve();
|
|
4608
|
+
});
|
|
4609
|
+
});
|
|
4610
|
+
};
|
|
4611
|
+
|
|
4481
4612
|
var _self = this;
|
|
4482
4613
|
var select = {};
|
|
4483
4614
|
try {
|
|
@@ -4489,12 +4620,29 @@
|
|
|
4489
4620
|
var _scope = scope;
|
|
4490
4621
|
var _ngModelCtrl = ngModelCtrl;
|
|
4491
4622
|
|
|
4623
|
+
if (select.relationDataSource != null) {
|
|
4624
|
+
try {
|
|
4625
|
+
eval(select.relationDataSource.name);
|
|
4626
|
+
}
|
|
4627
|
+
catch (e) {
|
|
4628
|
+
await jumpThread();
|
|
4629
|
+
}
|
|
4630
|
+
}
|
|
4492
4631
|
var relactionDS = {
|
|
4493
4632
|
relationDataSource: (select.relationDataSource != null ? eval(select.relationDataSource.name) : null),
|
|
4494
4633
|
relationField: (select.relationField != null ? select.relationField : '')
|
|
4495
4634
|
}
|
|
4496
4635
|
|
|
4497
|
-
var options =
|
|
4636
|
+
var options = undefined;
|
|
4637
|
+
try {
|
|
4638
|
+
eval(select.dataSourceScreen.name);
|
|
4639
|
+
options = await app.kendoHelper.getConfigCombobox(select, scope);
|
|
4640
|
+
}
|
|
4641
|
+
catch (e) {
|
|
4642
|
+
await jumpThread();
|
|
4643
|
+
options = await app.kendoHelper.getConfigCombobox(select, scope);
|
|
4644
|
+
}
|
|
4645
|
+
|
|
4498
4646
|
|
|
4499
4647
|
try {
|
|
4500
4648
|
delete options.dataSource.schema.model.id;
|
|
@@ -5262,6 +5410,87 @@
|
|
|
5262
5410
|
return false;
|
|
5263
5411
|
});
|
|
5264
5412
|
}
|
|
5413
|
+
$('#checkCollapsibleMenu').on('click', function() {
|
|
5414
|
+
var mainView = document.getElementById("main-view");
|
|
5415
|
+
if (this.checked) {
|
|
5416
|
+
mainView.classList.remove("main-view-retratil");
|
|
5417
|
+
} else {
|
|
5418
|
+
mainView.classList.add("main-view-retratil");
|
|
5419
|
+
}
|
|
5420
|
+
});
|
|
5421
|
+
|
|
5422
|
+
let baseNav = element.closest('nav');
|
|
5423
|
+
if (baseNav && baseNav.length) {
|
|
5424
|
+
|
|
5425
|
+
let subMenuOnHover = !baseNav.hasClass('submenu-click');
|
|
5426
|
+
let baseNavId = baseNav.attr('id');
|
|
5427
|
+
|
|
5428
|
+
if (!baseNavId) {
|
|
5429
|
+
baseNavId = app.common.generateId();
|
|
5430
|
+
baseNav.attr('id', baseNavId);
|
|
5431
|
+
}
|
|
5432
|
+
|
|
5433
|
+
if (subMenuOnHover) {
|
|
5434
|
+
let alreadyHooked = $(`#${baseNavId} .dropdown-submenu`).data('hooked');
|
|
5435
|
+
if (!alreadyHooked) {
|
|
5436
|
+
$(`#${baseNavId} .dropdown-submenu`).on('mouseenter', function (e) {
|
|
5437
|
+
$(this).children('.dropdown-menu').addClass('show');
|
|
5438
|
+
}).on('mouseleave', function (e) {
|
|
5439
|
+
$(this).children('.dropdown-menu').removeClass('show');
|
|
5440
|
+
});
|
|
5441
|
+
$(`#${baseNavId} .dropdown-submenu`).data('hooked', true);
|
|
5442
|
+
}
|
|
5443
|
+
|
|
5444
|
+
}
|
|
5445
|
+
else {
|
|
5446
|
+
let alreayHooked = $(`#${baseNavId} .dropdown-menu a.dropdown-toggle`).data('hooked');
|
|
5447
|
+
if (!alreayHooked) {
|
|
5448
|
+
$(`#${baseNavId} .dropdown-menu a.dropdown-toggle`).on('click', function(e) {
|
|
5449
|
+
if (!$(this).next().hasClass('show')) {
|
|
5450
|
+
$(this).parents('.dropdown-menu').first().find('.show').removeClass('show');
|
|
5451
|
+
}
|
|
5452
|
+
var $subMenu = $(this).next('.dropdown-menu');
|
|
5453
|
+
$subMenu.toggleClass('show');
|
|
5454
|
+
|
|
5455
|
+
$(this).parents('li.nav-item.dropdown.show').on('hidden.bs.dropdown', function(e) {
|
|
5456
|
+
$('.dropdown-submenu .show').removeClass('show');
|
|
5457
|
+
});
|
|
5458
|
+
|
|
5459
|
+
if ($subMenu.length) {
|
|
5460
|
+
return false;
|
|
5461
|
+
}
|
|
5462
|
+
else {
|
|
5463
|
+
$('.dropdown-menu').removeClass('show');
|
|
5464
|
+
}
|
|
5465
|
+
});
|
|
5466
|
+
$(`#${baseNavId} .dropdown-menu a.dropdown-toggle`).data('hooked', true);
|
|
5467
|
+
}
|
|
5468
|
+
|
|
5469
|
+
let alreadyHookedBs = $(`#${baseNavId} .dropdown.nav-item`).data('hooked');
|
|
5470
|
+
if (!alreadyHookedBs) {
|
|
5471
|
+
$(`#${baseNavId} .dropdown.nav-item`).on('hidden.bs.dropdown', function (e) {
|
|
5472
|
+
$('.dropdown-submenu .show').removeClass("show");
|
|
5473
|
+
$('.dropdown-menu .show').removeClass('show');
|
|
5474
|
+
});
|
|
5475
|
+
$(`#${baseNavId} .dropdown.nav-item`).data('hooked', true);
|
|
5476
|
+
}
|
|
5477
|
+
|
|
5478
|
+
}
|
|
5479
|
+
|
|
5480
|
+
}
|
|
5481
|
+
else {
|
|
5482
|
+
let menuWihtoutNavBar_id = $(element).find('ul:first').attr('id')
|
|
5483
|
+
let alreadyHooked = $(`#${menuWihtoutNavBar_id} .dropdown-submenu`).data('hooked');
|
|
5484
|
+
if (!alreadyHooked) {
|
|
5485
|
+
$(`#${menuWihtoutNavBar_id} .dropdown-submenu`).on('mouseenter', function (e) {
|
|
5486
|
+
$(this).children('.dropdown-menu').addClass('show');
|
|
5487
|
+
}).on('mouseleave', function (e) {
|
|
5488
|
+
$(this).children('.dropdown-menu').removeClass('show');
|
|
5489
|
+
});
|
|
5490
|
+
$(`#${menuWihtoutNavBar_id} .dropdown-submenu`).data('hooked', true);
|
|
5491
|
+
}
|
|
5492
|
+
}
|
|
5493
|
+
|
|
5265
5494
|
});
|
|
5266
5495
|
});
|
|
5267
5496
|
}
|
|
@@ -5754,16 +5983,16 @@
|
|
|
5754
5983
|
}
|
|
5755
5984
|
})
|
|
5756
5985
|
|
|
5757
|
-
.directive('crnInfiniteScroll', ['$compile', function($compile){
|
|
5986
|
+
.directive('crnInfiniteScroll', ['$compile', function($compile) {
|
|
5758
5987
|
'use strict';
|
|
5759
5988
|
return {
|
|
5760
5989
|
restrict: 'EA',
|
|
5761
5990
|
link: function(scope, element, attrs) {
|
|
5762
|
-
|
|
5763
|
-
|
|
5764
|
-
|
|
5765
|
-
|
|
5766
|
-
|
|
5991
|
+
let nextPageInfinite = {
|
|
5992
|
+
isVisible: false,
|
|
5993
|
+
checkVisibility: function(visible) {
|
|
5994
|
+
var dataSource = attrs.crnInfiniteScroll ? scope.$eval(attrs.crnInfiniteScroll) : attrs.crnDatasource ? scope.$eval(attrs.crnDatasource): undefined;
|
|
5995
|
+
if (dataSource) {
|
|
5767
5996
|
if (nextPageInfinite.isVisible !== visible) {
|
|
5768
5997
|
nextPageInfinite.isVisible = visible;
|
|
5769
5998
|
if (nextPageInfinite.isVisible) {
|
|
@@ -5779,21 +6008,21 @@
|
|
|
5779
6008
|
}
|
|
5780
6009
|
}
|
|
5781
6010
|
}
|
|
5782
|
-
},
|
|
5783
|
-
eventScroll: function() {
|
|
5784
|
-
var topElem = element.offset().top;
|
|
5785
|
-
var botElem = element.offset().top + element.outerHeight();
|
|
5786
|
-
var botScrn = $(window).scrollTop() + $(window).innerHeight();
|
|
5787
|
-
var topScrn = $(window).scrollTop();
|
|
5788
|
-
nextPageInfinite.checkVisibility((botScrn > topElem) && (topScrn < botElem));
|
|
5789
6011
|
}
|
|
5790
|
-
}
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
6012
|
+
},
|
|
6013
|
+
eventScroll: function() {
|
|
6014
|
+
var topElem = element.offset().top;
|
|
6015
|
+
var botElem = element.offset().top + element.outerHeight();
|
|
6016
|
+
var botScrn = $(window).scrollTop() + $(window).innerHeight();
|
|
6017
|
+
var topScrn = $(window).scrollTop();
|
|
6018
|
+
nextPageInfinite.checkVisibility((botScrn > topElem) && (topScrn < botElem));
|
|
6019
|
+
}
|
|
6020
|
+
};
|
|
6021
|
+
$(window).scroll(nextPageInfinite.eventScroll);
|
|
6022
|
+
$(window).ready(nextPageInfinite.eventScroll);
|
|
5794
6023
|
}
|
|
5795
|
-
}
|
|
5796
|
-
}])
|
|
6024
|
+
};
|
|
6025
|
+
}]);
|
|
5797
6026
|
|
|
5798
6027
|
}(app));
|
|
5799
6028
|
|
|
@@ -6022,6 +6251,12 @@ function maskDirective($compile, $translate, $parse, attrName) {
|
|
|
6022
6251
|
if (type == 'time' || type == 'time-local') {
|
|
6023
6252
|
momentDate = momentDate.year(1970).dayOfYear(1).month(0);
|
|
6024
6253
|
}
|
|
6254
|
+
if (typeof value === "string" && (value.length < mask.length)) {
|
|
6255
|
+
let tempValue = formatWithMomentAs(mask, useUTC, value, "string");
|
|
6256
|
+
if (tempValue.startsWith(value) && (value.length < tempValue.length) && (isNaN(tempValue[value.length]) || tempValue[value.length] === " ")) {
|
|
6257
|
+
ngModelCtrl.$$element.val(tempValue.substring(0, value.length + 1));
|
|
6258
|
+
}
|
|
6259
|
+
}
|
|
6025
6260
|
return momentDate.toDate();
|
|
6026
6261
|
}
|
|
6027
6262
|
|
|
@@ -6797,6 +7032,9 @@ app.kendoHelper = {
|
|
|
6797
7032
|
self.options.combobox.options.expanded = true;
|
|
6798
7033
|
}
|
|
6799
7034
|
e.success(data);
|
|
7035
|
+
if (self?.options?.combobox?.span) {
|
|
7036
|
+
self.options.$compile(self.options.combobox.span)(self.options.scope);
|
|
7037
|
+
}
|
|
6800
7038
|
self.options.kendoCallback = e;
|
|
6801
7039
|
if (self.options && self.options.combobox && self.options.combobox.element[0].id) {
|
|
6802
7040
|
var expToFind = " .k-animation-container";
|
|
@@ -7258,6 +7496,33 @@ function cronReportViewer($compile) {
|
|
|
7258
7496
|
|
|
7259
7497
|
executeReport(attrs.options);
|
|
7260
7498
|
|
|
7499
|
+
// Não inicia em em Tab não ativa
|
|
7500
|
+
// Verifica se esta dentro de um tab
|
|
7501
|
+
let elementTab = element[0].parentElement;
|
|
7502
|
+
while (elementTab) {
|
|
7503
|
+
if (elementTab.tagName === "BODY") {
|
|
7504
|
+
elementTab = null;
|
|
7505
|
+
} else if (elementTab.classList.contains("tab-pane")) {
|
|
7506
|
+
break;
|
|
7507
|
+
} else {
|
|
7508
|
+
elementTab = elementTab.parentElement;
|
|
7509
|
+
}
|
|
7510
|
+
}
|
|
7511
|
+
// Se estiver dentro de um tab e esta não estiver ativa, inclui observador para ler o relatorio ao ativar a tab
|
|
7512
|
+
if (elementTab && !elementTab.classList.contains("active")) {
|
|
7513
|
+
let observerClassChange = new MutationObserver(function(mutationsList, observer) {
|
|
7514
|
+
for (let mutation of mutationsList) {
|
|
7515
|
+
if (mutation.attributeName === "class" && mutation.target.classList.contains("active")) {
|
|
7516
|
+
executeReport(attrs.options);
|
|
7517
|
+
// Desconecta observador, pois só precisa ser executado uma vez.
|
|
7518
|
+
observer.disconnect();
|
|
7519
|
+
break;
|
|
7520
|
+
}
|
|
7521
|
+
}
|
|
7522
|
+
});
|
|
7523
|
+
observerClassChange.observe(elementTab, { attributes: true });
|
|
7524
|
+
}
|
|
7525
|
+
|
|
7261
7526
|
var filterTimeout = null;
|
|
7262
7527
|
scope.$watch(function(){ return attrs.options }, function(value, old){
|
|
7263
7528
|
if (value !== old) {
|
|
@@ -7276,4 +7541,5 @@ function cronReportViewer($compile) {
|
|
|
7276
7541
|
|
|
7277
7542
|
}
|
|
7278
7543
|
};
|
|
7279
|
-
}
|
|
7544
|
+
}
|
|
7545
|
+
|