cronapp-framework-js 3.0.0-SP.31 → 3.0.0-SP.33
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/templates/cron-grid.designtime.html +5 -4
- package/css/themes/custom/cosmo/custom-cosmo.css +16 -17
- package/css/themes/custom/cosmo/panel-cosmo.css +1 -1
- package/css/themes/custom/cyborg/button-cyborg.css +61 -1
- package/css/themes/custom/cyborg/custom-cyborg.css +226 -39
- package/css/themes/custom/cyborg/navbar-cyborg.css +4 -4
- package/css/themes/custom/cyborg/panel-cyborg.css +2 -2
- package/css/themes/custom/krypton/custom-krypton.css +8 -41
- package/dist/components/js/format.min.js +1 -1
- package/dist/components/js/jquery.inputmask.bundle.js +1 -1
- package/dist/components/templates/cron-grid.designtime.html +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/krypton/custom-krypton.css +1 -1
- package/dist/js/directives.js +7 -2
- package/js/directives.js +166 -62
- package/package.json +1 -1
package/js/directives.js
CHANGED
|
@@ -2688,6 +2688,67 @@
|
|
|
2688
2688
|
return attributes;
|
|
2689
2689
|
}
|
|
2690
2690
|
|
|
2691
|
+
function commandClick(e, column) {
|
|
2692
|
+
e.preventDefault();
|
|
2693
|
+
let tr = $(e.target).closest("tr");
|
|
2694
|
+
let grid = tr.closest('table');
|
|
2695
|
+
let itemAsObj = this.dataItem(tr);
|
|
2696
|
+
let item = this.dataItem(tr);
|
|
2697
|
+
let index = $(grid.find('tbody')[0]).children().index(tr);
|
|
2698
|
+
let call = undefined;
|
|
2699
|
+
if (column.dataType == "Customized" || column.dataType == "CustomizedLink" || column.dataType == "GroupedButtons")
|
|
2700
|
+
call = column.execute;
|
|
2701
|
+
else
|
|
2702
|
+
call = generateBlocklyCall(column.blocklyInfo);
|
|
2703
|
+
let cronappDatasource = this.dataSource.transport.options.cronappDatasource;
|
|
2704
|
+
let currentGrid = options.refComponent;
|
|
2705
|
+
let selectedRows = [];
|
|
2706
|
+
currentGrid.select().each(function() {
|
|
2707
|
+
let gridRow = currentGrid.dataItem(this);
|
|
2708
|
+
cronappDatasource.data.forEach(function(dsRow) {
|
|
2709
|
+
if (dsRow.__$id == gridRow.__$id)
|
|
2710
|
+
selectedRows.push(dsRow);
|
|
2711
|
+
});
|
|
2712
|
+
});
|
|
2713
|
+
|
|
2714
|
+
if (!(cronappDatasource.inserting || cronappDatasource.editing)) {
|
|
2715
|
+
let tr = e.currentTarget.parentElement.parentElement;
|
|
2716
|
+
this.select(tr);
|
|
2717
|
+
}
|
|
2718
|
+
|
|
2719
|
+
let selectedRowsKeyOrObj = [];
|
|
2720
|
+
if (options.fieldType && options.fieldType === 'key') {
|
|
2721
|
+
item = helperDirective.changeObjectField(cronappDatasource, cronappDatasource.findObjInDs(item));
|
|
2722
|
+
selectedRows.forEach(row => {
|
|
2723
|
+
selectedRowsKeyOrObj.push(helperDirective.changeObjectField(cronappDatasource, cronappDatasource.findObjInDs(row)));
|
|
2724
|
+
});
|
|
2725
|
+
}
|
|
2726
|
+
else {
|
|
2727
|
+
selectedRowsKeyOrObj = selectedRows;
|
|
2728
|
+
}
|
|
2729
|
+
|
|
2730
|
+
let consolidated = {
|
|
2731
|
+
item: item,
|
|
2732
|
+
index: index
|
|
2733
|
+
}
|
|
2734
|
+
|
|
2735
|
+
let contextVars = {
|
|
2736
|
+
'currentData': cronappDatasource.data,
|
|
2737
|
+
'datasource': cronappDatasource.copyWithoutAngularObj(),
|
|
2738
|
+
'selectedIndex': index,
|
|
2739
|
+
'index': index,
|
|
2740
|
+
'selectedRow': item,
|
|
2741
|
+
'consolidated': consolidated,
|
|
2742
|
+
'item': item,
|
|
2743
|
+
'selectedKeys': cronappDatasource.getKeyValues(cronappDatasource.findObjInDs(itemAsObj), true),
|
|
2744
|
+
'selectedRows': selectedRowsKeyOrObj
|
|
2745
|
+
};
|
|
2746
|
+
|
|
2747
|
+
cronappDatasource.goTo(itemAsObj);
|
|
2748
|
+
scope.$eval(call, contextVars);
|
|
2749
|
+
return;
|
|
2750
|
+
};
|
|
2751
|
+
|
|
2691
2752
|
var columns = [];
|
|
2692
2753
|
if (options.columns) {
|
|
2693
2754
|
options.columns.forEach(function(column) {
|
|
@@ -2778,68 +2839,7 @@
|
|
|
2778
2839
|
name: idForCommand,
|
|
2779
2840
|
template: template,
|
|
2780
2841
|
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
|
-
cronappDatasource.goTo(itemAsObj);
|
|
2841
|
-
scope.$eval(call, contextVars);
|
|
2842
|
-
return;
|
|
2842
|
+
commandClick.bind(this)(e, column);
|
|
2843
2843
|
}
|
|
2844
2844
|
}],
|
|
2845
2845
|
width: widthDevice.width,
|
|
@@ -2850,6 +2850,57 @@
|
|
|
2850
2850
|
columns.push(addColumn);
|
|
2851
2851
|
setIdCommandButton.bind(this)(idForCommand, column.dataType);
|
|
2852
2852
|
}
|
|
2853
|
+
else if (column.dataType == "GroupedButtons") {
|
|
2854
|
+
|
|
2855
|
+
if (column.buttonColumns && column.buttonColumns.length) {
|
|
2856
|
+
|
|
2857
|
+
let commands = [];
|
|
2858
|
+
|
|
2859
|
+
column.buttonColumns.forEach(function(buttonColumn) {
|
|
2860
|
+
let label = buttonColumn.label == undefined ? '': buttonColumn.label;
|
|
2861
|
+
if (buttonColumn.iconClass && label)
|
|
2862
|
+
label = ' ' + label;
|
|
2863
|
+
|
|
2864
|
+
let className = 'k-custom-command' + (label ? ' k-button-with-label' : '');
|
|
2865
|
+
if (buttonColumn.theme)
|
|
2866
|
+
className += ' ' + buttonColumn.theme;
|
|
2867
|
+
|
|
2868
|
+
let tooltip = '';
|
|
2869
|
+
if (buttonColumn.tooltip && buttonColumn.tooltip.length)
|
|
2870
|
+
tooltip = buttonColumn.tooltip;
|
|
2871
|
+
|
|
2872
|
+
if (tooltip) {
|
|
2873
|
+
let classForTooltip = app.common.generateId();
|
|
2874
|
+
tooltips[classForTooltip] = tooltip;
|
|
2875
|
+
className += ' ' + classForTooltip;
|
|
2876
|
+
}
|
|
2877
|
+
|
|
2878
|
+
let idForCommand = app.common.generateId();
|
|
2879
|
+
let ariaLabel = tooltip || label || idForCommand;
|
|
2880
|
+
let template = `<a href class='k-button ${className} k-grid-${idForCommand}' aria-label='${ariaLabel}'><span class='${buttonColumn.iconClass}'></span>${label}</a>`;
|
|
2881
|
+
|
|
2882
|
+
let command = {
|
|
2883
|
+
name: idForCommand,
|
|
2884
|
+
template: template,
|
|
2885
|
+
click: function(e) {
|
|
2886
|
+
buttonColumn.dataType = column.dataType;
|
|
2887
|
+
commandClick.bind(this)(e, buttonColumn);
|
|
2888
|
+
}
|
|
2889
|
+
};
|
|
2890
|
+
commands.push(command);
|
|
2891
|
+
});
|
|
2892
|
+
|
|
2893
|
+
var addColumn = {
|
|
2894
|
+
command: commands,
|
|
2895
|
+
width: widthDevice.width,
|
|
2896
|
+
title: column.headerText ? column.headerText: '',
|
|
2897
|
+
hidden: !widthDevice.visible,
|
|
2898
|
+
attributes: getAttributes(column)
|
|
2899
|
+
};
|
|
2900
|
+
columns.push(addColumn);
|
|
2901
|
+
setIdCommandButton.bind(this)(app.common.generateId(), column.dataType);
|
|
2902
|
+
}
|
|
2903
|
+
}
|
|
2853
2904
|
else if (column.dataType == "Selectable") {
|
|
2854
2905
|
var checkColumn = {
|
|
2855
2906
|
selectable: true,
|
|
@@ -3459,11 +3510,63 @@
|
|
|
3459
3510
|
}
|
|
3460
3511
|
});
|
|
3461
3512
|
|
|
3513
|
+
grid.selectable.userEvents.unbind("select");
|
|
3514
|
+
|
|
3462
3515
|
});
|
|
3463
3516
|
|
|
3517
|
+
let contextMenuId = app.common.generateId();
|
|
3518
|
+
let contextMenuValue = app.common.generateId();
|
|
3519
|
+
let contextMenuClose = app.common.generateId();
|
|
3520
|
+
let contextMenuHtml = $(`<ul id="${contextMenuId}">
|
|
3521
|
+
<li id="copyText">
|
|
3522
|
+
<input id="${contextMenuValue}">
|
|
3523
|
+
<span id="${contextMenuClose}" class="k-icon k-i-close" style="margin-left: 5px;"></span>
|
|
3524
|
+
</li>
|
|
3525
|
+
</ul>`);
|
|
3464
3526
|
element.html($templateDyn);
|
|
3527
|
+
element.append(contextMenuHtml);
|
|
3465
3528
|
$compile($templateDyn)(element.scope());
|
|
3466
3529
|
|
|
3530
|
+
let contextMenu = $(`#${contextMenuId}`).kendoContextMenu({
|
|
3531
|
+
target: $templateDyn,
|
|
3532
|
+
filter: "td",
|
|
3533
|
+
close: (e) => {
|
|
3534
|
+
if (!closeContextMenu) {
|
|
3535
|
+
e.preventDefault();
|
|
3536
|
+
}
|
|
3537
|
+
},
|
|
3538
|
+
open: (e) => {
|
|
3539
|
+
let cell = e.target;
|
|
3540
|
+
let row = $(cell).parent()[0];
|
|
3541
|
+
let grid = $templateDyn.data("kendoGrid");
|
|
3542
|
+
let itemId = e.item.id;
|
|
3543
|
+
|
|
3544
|
+
let cellText = cell.innerText;
|
|
3545
|
+
if (cellText.length && cellText !== '') {
|
|
3546
|
+
$(e.item).find(`#${contextMenuValue}`).val(cellText);
|
|
3547
|
+
closeContextMenu = false;
|
|
3548
|
+
}
|
|
3549
|
+
else {
|
|
3550
|
+
let menuRejected = () => {
|
|
3551
|
+
return new Promise((resolve, reject) => {
|
|
3552
|
+
let waiting = setInterval(() => {
|
|
3553
|
+
if ($(`#${contextMenuId}`).is(':visible')) {
|
|
3554
|
+
clearInterval(waiting);
|
|
3555
|
+
$(`#${contextMenuId}`).hide();
|
|
3556
|
+
}
|
|
3557
|
+
});
|
|
3558
|
+
});
|
|
3559
|
+
}
|
|
3560
|
+
menuRejected();
|
|
3561
|
+
}
|
|
3562
|
+
}
|
|
3563
|
+
}).data("kendoContextMenu");
|
|
3564
|
+
|
|
3565
|
+
$(`#${contextMenuClose}`).on("click", (e) => {
|
|
3566
|
+
closeContextMenu = true;
|
|
3567
|
+
contextMenu.close();
|
|
3568
|
+
});
|
|
3569
|
+
|
|
3467
3570
|
}
|
|
3468
3571
|
};
|
|
3469
3572
|
}])
|
|
@@ -7338,3 +7441,4 @@ function cronReportViewer($compile) {
|
|
|
7338
7441
|
}
|
|
7339
7442
|
};
|
|
7340
7443
|
}
|
|
7444
|
+
|