cronapp-framework-js 2.8.37 → 2.8.40
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/navbar.template.html +1 -2
- 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/js/qrcode.js +1 -1
- package/dist/components/templates/navbar.template.html +1 -1
- package/dist/js/LanguageSelectDirective.js +1 -1
- package/dist/js/LocaleService.js +1 -1
- package/dist/js/directives.js +14 -1
- package/dist/js/reports/parameters.controller.js +1 -1
- package/js/directives.js +151 -104
- package/package.json +1 -1
- package/cronapp-framework-js.iml +0 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){
|
|
1
|
+
(function(){"use strict";function a(a,b,c,d,e){function f(a){c.openURLContent(a.data)}b.getDescription=function(a){var b=a.name;return a.description&&(b=a.description,-1<b.indexOf("{{")&&-1<b.indexOf("}}")&&(b=b.replace("{{","").replace("}}",""),b=window.cronapi.i18n.translate(b,[]))),b},b.cloneElement=function(a){return angular.copy(a)},b.isVisibleParam=function(a){if("DATA_LIMIT"==a.name)return!1;return!(""!==a.value)||!(""!=a.value)};var g=d.reportName.match(/\/(.*?)(.*?)(\.jrxml|\.report)/);b.report=d,b.report.name=g[2],b.htmlParameters=e,b.onPrint=function(){b.report.reportName.endsWith(".report")?c.openStimulsoftReport(b.report.contentData,b.report.parameters,b.report.datasourcesInBand):c.getPDFAsFile(b.report).then(f)},b.onCancel=function(){a.dismiss("cancel")}}angular.module("custom.controllers").controller("ParameterController",a).filter("trusted",["$sce",function(a){return function(b){return a.trustAsHtml(b)}}]).directive("compile",["$compile","$timeout",function(a,b){return{restrict:"A",link:function(c,d){b(function(){a(d.contents())(c)})}}}]).directive("formatDate",function(){return{require:"ngModel",link:function(a,b,c,d){d.$formatters.push(function(a){return a?new Date(a):null})}}}),a.$inject=["$modalInstance","$scope","ReportService","report","htmlParameters"]})();
|
package/js/directives.js
CHANGED
|
@@ -1786,40 +1786,47 @@
|
|
|
1786
1786
|
}
|
|
1787
1787
|
return obj;
|
|
1788
1788
|
},
|
|
1789
|
-
|
|
1789
|
+
removeSpecialChar: function(value) {
|
|
1790
|
+
return value.replace(/[^a-zA-Z0-9]/g, "").toLowerCase();
|
|
1791
|
+
},
|
|
1792
|
+
generateToolbarButtonCall: function(toolbarButton, scope, options, attrs) {
|
|
1790
1793
|
var buttonCall;
|
|
1791
1794
|
var generateObjTemplate = function(functionToCall, title, iconClass) {
|
|
1792
1795
|
var obj = {
|
|
1793
1796
|
template: function() {
|
|
1794
|
-
|
|
1795
|
-
return createTemplateButton(buttonId, functionToCall, title, iconClass);
|
|
1797
|
+
return createTemplateButton(functionToCall, title, iconClass);
|
|
1796
1798
|
}.bind(this)
|
|
1797
1799
|
};
|
|
1798
1800
|
return obj;
|
|
1799
1801
|
}.bind(this);
|
|
1800
1802
|
|
|
1801
|
-
var createTemplateButton = function(
|
|
1803
|
+
var createTemplateButton = function(functionToCall, title, iconClass) {
|
|
1802
1804
|
var template = '';
|
|
1803
1805
|
|
|
1804
1806
|
let security = toolbarButton.security ? `cronapp-security="${toolbarButton.security}"` : "";
|
|
1805
1807
|
|
|
1808
|
+
let modelName = this.removeSpecialChar(attrs.ngModel);
|
|
1809
|
+
let buttonType = this.removeSpecialChar(toolbarButton.type);
|
|
1810
|
+
let buttonDesc = toolbarButton.title ? this.removeSpecialChar(toolbarButton.title): this.removeSpecialChar(toolbarButton.iconClass);
|
|
1811
|
+
let buttonId = `${modelName}-${buttonType}-${buttonDesc}`;
|
|
1812
|
+
|
|
1806
1813
|
if (toolbarButton.type == "SaveOrCancelChanges") {
|
|
1807
1814
|
if (toolbarButton.saveButton)
|
|
1808
|
-
template = '<a #SECURITY# role="button" class="saveorcancelchanges k-button k-button-icontext k-grid-save-changes" id="#BUTTONID#" href="javascript:void(0)"><span class="k-icon k-i-check"></span>#TITLE#</a>';
|
|
1815
|
+
template = '<a #SECURITY# role="button" class="saveorcancelchanges k-button k-button-icontext k-grid-save-changes" data-id="#BUTTONID#" href="javascript:void(0)"><span class="k-icon k-i-check"></span>#TITLE#</a>';
|
|
1809
1816
|
else
|
|
1810
|
-
template = '<a #SECURITY# role="button" class="saveorcancelchanges k-button k-button-icontext k-grid-cancel-changes" id="#BUTTONID#" href="javascript:void(0)"><span class="k-icon k-i-cancel" ></span>#TITLE#</a>';
|
|
1817
|
+
template = '<a #SECURITY# role="button" class="saveorcancelchanges k-button k-button-icontext k-grid-cancel-changes" data-id="#BUTTONID#" href="javascript:void(0)"><span class="k-icon k-i-cancel" ></span>#TITLE#</a>';
|
|
1811
1818
|
}
|
|
1812
1819
|
else if (toolbarButton.type == "Blockly" || toolbarButton.type == "Customized") {
|
|
1813
|
-
template = '<a #SECURITY# class="k-button k-grid-custom" id="#BUTTONID#" href="javascript:void(0)"><span class="#ICONCLASS#" ></span>#TITLE#</a>';
|
|
1820
|
+
template = '<a #SECURITY# class="k-button k-grid-custom" data-id="#BUTTONID#" href="javascript:void(0)"><span class="#ICONCLASS#" ></span>#TITLE#</a>';
|
|
1814
1821
|
}
|
|
1815
1822
|
else if (toolbarButton.type == "Native" && toolbarButton.title == 'create') {
|
|
1816
|
-
template = '<a #SECURITY# role="button" id="#BUTTONID#" class="k-button k-button-icontext k-grid-add" href="javascript:void(0)"><span class="k-icon k-i-plus"></span>{{"Add" | translate}}</a>';
|
|
1823
|
+
template = '<a #SECURITY# role="button" data-id="#BUTTONID#" class="k-button k-button-icontext k-grid-add" href="javascript:void(0)"><span class="k-icon k-i-plus"></span>{{"Add" | translate}}</a>';
|
|
1817
1824
|
}
|
|
1818
1825
|
else if (toolbarButton.type == "Native" && toolbarButton.title == 'excel') {
|
|
1819
|
-
template = '<a #SECURITY# role="button" id="#BUTTONID#" class="k-button k-button-icontext k-grid-excel" href="javascript:void(0)"><span class="k-icon k-i-file-excel"></span>{{"exportExcel" | translate}}</a>';
|
|
1826
|
+
template = '<a #SECURITY# role="button" data-id="#BUTTONID#" class="k-button k-button-icontext k-grid-excel" href="javascript:void(0)"><span class="k-icon k-i-file-excel"></span>{{"exportExcel" | translate}}</a>';
|
|
1820
1827
|
}
|
|
1821
1828
|
else if (toolbarButton.type == "Native" && toolbarButton.title == 'pdf') {
|
|
1822
|
-
template = '<a #SECURITY# role="button" id="#BUTTONID#" class="k-button k-button-icontext k-grid-pdf" href="javascript:void(0)"><span class="k-icon k-i-file-pdf"></span>{{"exportPDF" | translate}}</a>';
|
|
1829
|
+
template = '<a #SECURITY# role="button" data-id="#BUTTONID#" class="k-button k-button-icontext k-grid-pdf" href="javascript:void(0)"><span class="k-icon k-i-file-pdf"></span>{{"exportPDF" | translate}}</a>';
|
|
1823
1830
|
}
|
|
1824
1831
|
|
|
1825
1832
|
template = template
|
|
@@ -1832,13 +1839,14 @@
|
|
|
1832
1839
|
var cronappDatasource = eval(options.dataSourceScreen.entityDataSource.name);
|
|
1833
1840
|
|
|
1834
1841
|
var waitRender = setInterval(function() {
|
|
1835
|
-
if ($(
|
|
1842
|
+
if ($(`[data-id=${buttonId}]`).length > 0) {
|
|
1836
1843
|
scope.safeApply(function() {
|
|
1837
|
-
var x = angular.element($(
|
|
1844
|
+
var x = angular.element($(`[data-id=${buttonId}]`));
|
|
1838
1845
|
$compile(x)(scope);
|
|
1846
|
+
$(`[data-id=${buttonId}]`).attr('id', buttonId);
|
|
1839
1847
|
});
|
|
1840
1848
|
|
|
1841
|
-
$(
|
|
1849
|
+
$(`[data-id=${buttonId}]`).click(function() {
|
|
1842
1850
|
|
|
1843
1851
|
var currentGrid = options.refComponent;
|
|
1844
1852
|
var selectedRows = [];
|
|
@@ -2048,7 +2056,7 @@
|
|
|
2048
2056
|
return widthDevice;
|
|
2049
2057
|
},
|
|
2050
2058
|
|
|
2051
|
-
getColumns: function(options, datasource, scope, tooltips) {
|
|
2059
|
+
getColumns: function(options, datasource, scope, tooltips, attrs) {
|
|
2052
2060
|
var helperDirective = this;
|
|
2053
2061
|
|
|
2054
2062
|
function getTemplate(column) {
|
|
@@ -2214,6 +2222,28 @@
|
|
|
2214
2222
|
|
|
2215
2223
|
}
|
|
2216
2224
|
|
|
2225
|
+
function setIdCommandButton(idForCommand, command) {
|
|
2226
|
+
let waitRender = setInterval(() => {
|
|
2227
|
+
if ($(`.k-grid-${idForCommand}`).is(":visible")) {
|
|
2228
|
+
clearInterval(waitRender);
|
|
2229
|
+
var currentGrid = options.refComponent;
|
|
2230
|
+
|
|
2231
|
+
$(`.k-grid-${idForCommand}`).each((idx,elem) => {
|
|
2232
|
+
let $elem = $(elem);
|
|
2233
|
+
if (!$elem.attr('id')) {
|
|
2234
|
+
let item = currentGrid.dataItem($elem.closest('tr'));
|
|
2235
|
+
|
|
2236
|
+
let modelName = this.removeSpecialChar(attrs.ngModel);
|
|
2237
|
+
let key = item["_objectKey"];
|
|
2238
|
+
let id = `${modelName}-${command}-${key}`;
|
|
2239
|
+
$elem.attr('id', id);
|
|
2240
|
+
}
|
|
2241
|
+
});
|
|
2242
|
+
|
|
2243
|
+
}
|
|
2244
|
+
}, 200);
|
|
2245
|
+
}
|
|
2246
|
+
|
|
2217
2247
|
function getCommandForEditButtonDatabase(opt, command) {
|
|
2218
2248
|
var cmd;
|
|
2219
2249
|
let idForCommand = app.common.generateId();
|
|
@@ -2254,6 +2284,7 @@
|
|
|
2254
2284
|
text: { edit: " ", update: " ", cancel: " " },
|
|
2255
2285
|
};
|
|
2256
2286
|
}
|
|
2287
|
+
setIdCommandButton.bind(this)(idForCommand, command);
|
|
2257
2288
|
return cmd;
|
|
2258
2289
|
}
|
|
2259
2290
|
|
|
@@ -2285,6 +2316,7 @@
|
|
|
2285
2316
|
template: template
|
|
2286
2317
|
};
|
|
2287
2318
|
}
|
|
2319
|
+
setIdCommandButton.bind(this)(idForCommand, command);
|
|
2288
2320
|
return cmd;
|
|
2289
2321
|
}
|
|
2290
2322
|
|
|
@@ -2516,6 +2548,7 @@
|
|
|
2516
2548
|
attributes: getAttributes(column)
|
|
2517
2549
|
};
|
|
2518
2550
|
columns.push(addColumn);
|
|
2551
|
+
setIdCommandButton.bind(this)(idForCommand, column.dataType);
|
|
2519
2552
|
}
|
|
2520
2553
|
else if (column.dataType == "Selectable") {
|
|
2521
2554
|
var checkColumn = {
|
|
@@ -2541,7 +2574,7 @@
|
|
|
2541
2574
|
|
|
2542
2575
|
return pageable;
|
|
2543
2576
|
},
|
|
2544
|
-
getToolbar: function(options, scope) {
|
|
2577
|
+
getToolbar: function(options, scope, attrs) {
|
|
2545
2578
|
|
|
2546
2579
|
function generateToolbarTemplate(toolbarButton) {
|
|
2547
2580
|
let security = toolbarButton.security ? `cronapp-security="${toolbarButton.security}" class` : "class";
|
|
@@ -2567,7 +2600,7 @@
|
|
|
2567
2600
|
else {
|
|
2568
2601
|
toolbarButton.methodCall += "cronapi.internal.focusFormInput();"
|
|
2569
2602
|
}
|
|
2570
|
-
var button = this.generateToolbarButtonCall(toolbarButton, scope, options);
|
|
2603
|
+
var button = this.generateToolbarButtonCall(toolbarButton, scope, options, attrs);
|
|
2571
2604
|
toolbar.push(button);
|
|
2572
2605
|
|
|
2573
2606
|
if (!options.hideModalButtons) {
|
|
@@ -2575,7 +2608,7 @@
|
|
|
2575
2608
|
}
|
|
2576
2609
|
}
|
|
2577
2610
|
else {
|
|
2578
|
-
let toolbarOp = this.generateToolbarButtonCall(toolbarButton, scope, options);
|
|
2611
|
+
let toolbarOp = this.generateToolbarButtonCall(toolbarButton, scope, options, attrs);
|
|
2579
2612
|
toolbar.push(toolbarOp);
|
|
2580
2613
|
}
|
|
2581
2614
|
}
|
|
@@ -2587,12 +2620,12 @@
|
|
|
2587
2620
|
}
|
|
2588
2621
|
}
|
|
2589
2622
|
else if (toolbarButton.type == "Blockly" || toolbarButton.type == "Customized") {
|
|
2590
|
-
var buttonBlockly = this.generateToolbarButtonCall(toolbarButton, scope, options);
|
|
2623
|
+
var buttonBlockly = this.generateToolbarButtonCall(toolbarButton, scope, options, attrs);
|
|
2591
2624
|
toolbar.push(buttonBlockly);
|
|
2592
2625
|
}
|
|
2593
2626
|
else if (toolbarButton.type == "SaveOrCancelChanges") {
|
|
2594
2627
|
if (options.editable != 'no') {
|
|
2595
|
-
var buttonSaveOrCancel = this.generateToolbarButtonCall(toolbarButton, scope, options);
|
|
2628
|
+
var buttonSaveOrCancel = this.generateToolbarButtonCall(toolbarButton, scope, options, attrs);
|
|
2596
2629
|
toolbar.push(buttonSaveOrCancel);
|
|
2597
2630
|
}
|
|
2598
2631
|
}
|
|
@@ -2816,9 +2849,9 @@
|
|
|
2816
2849
|
|
|
2817
2850
|
var datasource = app.kendoHelper.getDataSource(options.dataSourceScreen.entityDataSource, scope, options.allowPaging, options.pageCount, options.columns, options.groupings);
|
|
2818
2851
|
|
|
2819
|
-
var columns = this.getColumns(options, datasource, scope, tooltips);
|
|
2852
|
+
var columns = this.getColumns(options, datasource, scope, tooltips, attrs);
|
|
2820
2853
|
var pageAble = this.getPageAble(options);
|
|
2821
|
-
var toolbar = this.getToolbar(options, scope);
|
|
2854
|
+
var toolbar = this.getToolbar(options, scope, attrs);
|
|
2822
2855
|
var editable = this.getEditable(options);
|
|
2823
2856
|
var filterable = anyFilterableColumn(options);
|
|
2824
2857
|
|
|
@@ -2882,7 +2915,9 @@
|
|
|
2882
2915
|
},
|
|
2883
2916
|
change: function(e) {
|
|
2884
2917
|
var item = this.dataItem(this.select());
|
|
2885
|
-
|
|
2918
|
+
if ($('[data-component="crn-enterprise-dynamic-combobox"]').length == 0) {
|
|
2919
|
+
setToActiveInCronappDataSource.bind(this)(item);
|
|
2920
|
+
}
|
|
2886
2921
|
var cronappDatasource = this.dataSource.transport.options.cronappDatasource;
|
|
2887
2922
|
if(options.fieldType && options.fieldType === 'key'){
|
|
2888
2923
|
cronappDatasource.active = helperDirective.changeObjectField(cronappDatasource, cronappDatasource.active);
|
|
@@ -2918,6 +2953,28 @@
|
|
|
2918
2953
|
}
|
|
2919
2954
|
|
|
2920
2955
|
compileListing(e);
|
|
2956
|
+
|
|
2957
|
+
$(".k-command-cell a[class*='k-grid-']").each((idx, elem) => {
|
|
2958
|
+
let $elem = $(elem);
|
|
2959
|
+
if (!$elem.attr('id')) {
|
|
2960
|
+
let item = this.dataItem($elem.closest('tr'));
|
|
2961
|
+
let command = 'destroy';
|
|
2962
|
+
if ($elem.hasClass('k-grid-update')) {
|
|
2963
|
+
command = 'update';
|
|
2964
|
+
}
|
|
2965
|
+
else if ($elem.hasClass('k-grid-cancel')) {
|
|
2966
|
+
command = 'cancel';
|
|
2967
|
+
}
|
|
2968
|
+
else if ($elem.hasClass('k-grid-edit')) {
|
|
2969
|
+
command = 'edit';
|
|
2970
|
+
}
|
|
2971
|
+
|
|
2972
|
+
let modelName = helperDirective.removeSpecialChar(attrs.ngModel);
|
|
2973
|
+
let key = item["_objectKey"];
|
|
2974
|
+
let id = `${modelName}-${command}-${key}`;
|
|
2975
|
+
$elem.attr('id', id);
|
|
2976
|
+
}
|
|
2977
|
+
});
|
|
2921
2978
|
},
|
|
2922
2979
|
cancel: function(e) {
|
|
2923
2980
|
var cronappDatasource = this.dataSource.transport.options.cronappDatasource;
|
|
@@ -3169,9 +3226,10 @@
|
|
|
3169
3226
|
let waitingPromise = false;
|
|
3170
3227
|
let datasource = new kendo.data.HierarchicalDataSource({
|
|
3171
3228
|
transport: {
|
|
3172
|
-
push: function(callback) {
|
|
3229
|
+
push: async function(callback) {
|
|
3230
|
+
let cronappDatasource = await this.options.cronappDatasource();
|
|
3173
3231
|
|
|
3174
|
-
if (!helperDirective.dataSourceEventsPush &&
|
|
3232
|
+
if (!helperDirective.dataSourceEventsPush && cronappDatasource) {
|
|
3175
3233
|
helperDirective.dataSourceEventsPush = {
|
|
3176
3234
|
create: function(data) {
|
|
3177
3235
|
|
|
@@ -3206,11 +3264,13 @@
|
|
|
3206
3264
|
}.bind(this)
|
|
3207
3265
|
};
|
|
3208
3266
|
|
|
3209
|
-
|
|
3267
|
+
cronappDatasource.addDataSourceEvents(helperDirective.dataSourceEventsPush);
|
|
3210
3268
|
}
|
|
3211
3269
|
},
|
|
3212
3270
|
|
|
3213
|
-
read:
|
|
3271
|
+
read: async function (e) {
|
|
3272
|
+
|
|
3273
|
+
let cronappDatasource = await this.options.cronappDatasource();
|
|
3214
3274
|
|
|
3215
3275
|
let conditionIsEmpty = (condition) => {
|
|
3216
3276
|
let result = true;
|
|
@@ -3226,9 +3286,6 @@
|
|
|
3226
3286
|
return result;
|
|
3227
3287
|
};
|
|
3228
3288
|
|
|
3229
|
-
|
|
3230
|
-
let cronappDatasource = this.options.cronappDatasource;
|
|
3231
|
-
|
|
3232
3289
|
for (key in e.data)
|
|
3233
3290
|
if(e.data[key] == undefined)
|
|
3234
3291
|
delete e.data[key];
|
|
@@ -3307,7 +3364,7 @@
|
|
|
3307
3364
|
},
|
|
3308
3365
|
options: {
|
|
3309
3366
|
fromRead: false,
|
|
3310
|
-
cronappDatasource: app.kendoHelper.
|
|
3367
|
+
cronappDatasource: async () => await app.kendoHelper.getCorrectlyDSPromise(options.dataSourceScreen.name, scope)
|
|
3311
3368
|
}
|
|
3312
3369
|
},
|
|
3313
3370
|
schema: schema
|
|
@@ -3698,6 +3755,7 @@
|
|
|
3698
3755
|
var found = _goTo(_scope, combobox, combobox.dataItem());
|
|
3699
3756
|
|
|
3700
3757
|
if (!found) {
|
|
3758
|
+
combobox.isEvaluating = true;
|
|
3701
3759
|
dataSourceScreen.findObj([value], false, (dataresult) => {
|
|
3702
3760
|
if (Array.isArray(dataresult)) {
|
|
3703
3761
|
dataresult = dataresult[0];
|
|
@@ -3707,7 +3765,8 @@
|
|
|
3707
3765
|
_goTo(_scope, combobox, dataresult);
|
|
3708
3766
|
modelSetter(_scope, value);
|
|
3709
3767
|
}
|
|
3710
|
-
|
|
3768
|
+
combobox.isEvaluating = false;
|
|
3769
|
+
}, () => combobox.isEvaluating = false, [combobox.options.dataValueField]);
|
|
3711
3770
|
}
|
|
3712
3771
|
}
|
|
3713
3772
|
}
|
|
@@ -4571,79 +4630,42 @@
|
|
|
4571
4630
|
|
|
4572
4631
|
.directive('cronDynamicMenu', ['$compile', '$translate', function ($compile, $translate) {
|
|
4573
4632
|
'use strict';
|
|
4574
|
-
const populateSubitems = (item) => {
|
|
4575
|
-
var subitem = item.menuItems;
|
|
4576
|
-
var templateSubitens = '';
|
|
4577
|
-
|
|
4578
|
-
subitem.forEach((subitem) => {
|
|
4579
|
-
var securitySubitem = (subitem.security && subitem.security != null) ? ' cronapp-security="' + subitem.security + '" ' : '';
|
|
4580
|
-
var actionSubitem = (subitem.action && subitem.action != null) ? ' ng-click="' + subitem.action + '" ' : '';
|
|
4581
|
-
var hideSubitem = (subitem.hide && subitem.hide != null) ? ' ng-hide="' + subitem.hide + '" ' : '';
|
|
4582
|
-
var iconClassSubitem = (subitem.iconClass && subitem.iconClass != null) ? '<i class="' + subitem.iconClass + '"></i> ' : '';
|
|
4583
|
-
var titleSubitem = '<span></span>';
|
|
4584
|
-
var caretSubitem = (subitem.menuItems && Array.isArray(subitem.menuItems) && (subitem.menuItems.length > 0)) ? '<span class="caret submenu"></span>' : '';
|
|
4585
|
-
|
|
4586
|
-
if (subitem.title) {
|
|
4587
|
-
titleSubitem = '<span>' + $translate.instant(subitem.title) + '</span>';
|
|
4588
|
-
}
|
|
4589
|
-
|
|
4590
|
-
if (subitem.menuItems.length > 0) {
|
|
4591
|
-
templateSubitens = templateSubitens + '<li class="dropdown-submenu">\
|
|
4592
|
-
<a class="dropdown-item dropdown-toggle" role="button" aria-haspopup="true" aria-expanded="false" href=""' + securitySubitem + actionSubitem + '>' + iconClassSubitem + titleSubitem + caretSubitem + '</a>\
|
|
4593
|
-
' + populateItems(subitem.menuItems) + '\
|
|
4594
|
-
</li>';
|
|
4595
|
-
|
|
4596
|
-
} else {
|
|
4597
|
-
templateSubitens = templateSubitens + '<li class="dropdown-submenu">\
|
|
4598
|
-
<a role="button" aria-haspopup="true" aria-expanded="false" href=""' + securitySubitem + actionSubitem + '>' + iconClassSubitem + titleSubitem + caretSubitem + '</a>\
|
|
4599
|
-
</li>';
|
|
4600
|
-
}
|
|
4601
|
-
});
|
|
4602
|
-
|
|
4603
|
-
if (templateSubitens != '') {
|
|
4604
|
-
templateSubitens = '<ul class="dropdown-menu">' + templateSubitens + '</ul>';
|
|
4605
|
-
}
|
|
4606
|
-
|
|
4607
|
-
return templateSubitens;
|
|
4608
|
-
};
|
|
4609
|
-
|
|
4610
4633
|
const populateItems = (items) => {
|
|
4611
4634
|
var templateItens = '';
|
|
4612
4635
|
|
|
4613
4636
|
if (items && items.length > 0 && Array.isArray(items)) {
|
|
4614
4637
|
items.forEach(function (item) {
|
|
4615
4638
|
|
|
4616
|
-
var security = (item.security && item.security != null) ?
|
|
4617
|
-
var action = (item.action && item.action != null) ?
|
|
4618
|
-
var hide = (item.hide && item.hide != null) ?
|
|
4619
|
-
var iconClass = (item.iconClass && item.iconClass != null) ?
|
|
4620
|
-
var title =
|
|
4621
|
-
var caret = (item.menuItems && Array.isArray(item.menuItems) && (item.menuItems.length > 0)) ?
|
|
4639
|
+
var security = (item.security && item.security != null) ? ` cronapp-security="${item.security }" ` : '';
|
|
4640
|
+
var action = (item.action && item.action != null) ? ` ng-click="${item.action}" ` : '';
|
|
4641
|
+
var hide = (item.hide && item.hide != null) ? ` ng-hide="${item.hide}" ` : '';
|
|
4642
|
+
var iconClass = (item.iconClass && item.iconClass != null) ? `<i class="${item.iconClass}" id="menu-tag-i-${item.id}"></i> ` : '';
|
|
4643
|
+
var title = `<span id="menu-tag-span-${item.id}"></span>`;
|
|
4644
|
+
var caret = (item.menuItems && Array.isArray(item.menuItems) && (item.menuItems.length > 0)) ? `<span class="caret submenu" id="menu-tag-span-sub-${item.id}"></span>` : '';
|
|
4622
4645
|
|
|
4623
4646
|
if (item.title) {
|
|
4624
|
-
title =
|
|
4647
|
+
title = `<span id="menu-tag-span-${item.id}">${$translate.instant(item.title)}</span>`;
|
|
4625
4648
|
}
|
|
4626
4649
|
|
|
4627
4650
|
if (item.menuItems.length > 0) {
|
|
4628
|
-
templateItens = templateItens +
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4651
|
+
templateItens = templateItens + `
|
|
4652
|
+
<li class="dropdown-submenu" ${security}${hide} id="menu-tag-li-sub-${item.id}"> \
|
|
4653
|
+
<a href="" ${action} id="menu-tag-a-sub-${item.id}" class="dropdown-item dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> ${iconClass} ${title} ${caret} </a> \
|
|
4654
|
+
${populateItems(item.menuItems)}\
|
|
4655
|
+
</li>`;
|
|
4633
4656
|
} else {
|
|
4634
|
-
templateItens = templateItens +
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4657
|
+
templateItens = templateItens + `
|
|
4658
|
+
<li class="dropdown-submenu" ${security} ${hide} id="menu-tag-li-${item.id}"> \
|
|
4659
|
+
<a href="" ${action} id="menu-tag-a-${item.id}" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">${iconClass} ${title} ${caret} </a>
|
|
4660
|
+
</li>`;
|
|
4638
4661
|
}
|
|
4639
4662
|
|
|
4640
4663
|
});
|
|
4641
4664
|
|
|
4642
4665
|
if (templateItens != '') {
|
|
4643
|
-
templateItens =
|
|
4666
|
+
templateItens = `<ul class="dropdown-menu" id="menu-tag-ul-${items[0].id}">${templateItens}</ul>`;
|
|
4644
4667
|
}
|
|
4645
4668
|
}
|
|
4646
|
-
|
|
4647
4669
|
return templateItens;
|
|
4648
4670
|
}
|
|
4649
4671
|
return {
|
|
@@ -4655,24 +4677,24 @@
|
|
|
4655
4677
|
|
|
4656
4678
|
menuOptions.subMenuOptions.forEach(function (menu) {
|
|
4657
4679
|
|
|
4658
|
-
var security = (menu.security && menu.security != null) ?
|
|
4659
|
-
var action = (menu.action && menu.action != null) ?
|
|
4660
|
-
var caret = (menu.menuItems && Array.isArray(menu.menuItems) && (menu.menuItems.length > 0)) ?
|
|
4661
|
-
var hide = (menu.hide && menu.hide != null) ?
|
|
4662
|
-
var iconClass = (menu.iconClass && menu.iconClass != null) ?
|
|
4663
|
-
var title =
|
|
4680
|
+
var security = (menu.security && menu.security != null) ? ` cronapp-security="${menu.security}" ` : '';
|
|
4681
|
+
var action = (menu.action && menu.action != null) ? ` ng-click="${menu.action }" ` : '';
|
|
4682
|
+
var caret = (menu.menuItems && Array.isArray(menu.menuItems) && (menu.menuItems.length > 0)) ? `<span class="caret" id="menu-tag-span-sub-${menu.id}"></span>` : '';
|
|
4683
|
+
var hide = (menu.hide && menu.hide != null) ? ` ng-hide="${menu.hide}" ` : '';
|
|
4684
|
+
var iconClass = (menu.iconClass && menu.iconClass != null) ? `<i class="${menu.iconClass}"></i> ` : '';
|
|
4685
|
+
var title = `<span id="menu-tag-span-${menu.id}"></span>`;
|
|
4664
4686
|
|
|
4665
4687
|
if (menu.title) {
|
|
4666
|
-
title =
|
|
4688
|
+
title = `<span id="menu-tag-span-${menu.id}">${$translate.instant(menu.title)}</span>`;
|
|
4667
4689
|
}
|
|
4668
4690
|
|
|
4669
|
-
template = template +
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
|
|
4691
|
+
template = template + `
|
|
4692
|
+
<li class="dropdown nav-item ${(isVertical ? 'col-md-12 padding-0' : '')}" ${security} ${hide} id="menu-tag-li-sub-${menu.id}">
|
|
4693
|
+
<a href="" ${action} id="menu-tag-a-sub-${menu.id}" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">\
|
|
4694
|
+
${iconClass} ${title} ${caret}
|
|
4695
|
+
</a>
|
|
4696
|
+
${populateItems(menu.menuItems)}
|
|
4697
|
+
</li>`;
|
|
4676
4698
|
|
|
4677
4699
|
})
|
|
4678
4700
|
}
|
|
@@ -4684,14 +4706,14 @@
|
|
|
4684
4706
|
//Somente fica na vertical se for o menu principal da IDE (E estiver configurado para isso)
|
|
4685
4707
|
let isVertical = element.closest('.crn-navigator-vertical').length;
|
|
4686
4708
|
|
|
4687
|
-
var TEMPLATE_MAIN = '<ul class="nav navbar-nav ' + (isVertical ? 'col-md-12 padding-0' : '') + ' " style="float:left"></ul>';
|
|
4688
4709
|
var options = {};
|
|
4689
4710
|
try {
|
|
4690
4711
|
options = JSON.parse(attrs.options);
|
|
4691
4712
|
} catch (e) {
|
|
4692
4713
|
console.log('CronDynamicMenu: Invalid configuration!')
|
|
4693
4714
|
}
|
|
4694
|
-
|
|
4715
|
+
let baseId = options && options.subMenuOptions ? options.subMenuOptions[0].id : "first";
|
|
4716
|
+
var TEMPLATE_MAIN = `<ul id="menu-tag-ul-base-${baseId}" class="nav navbar-nav ${(isVertical ? 'col-md-12 padding-0' : '')}" style="float:left"></ul>`;
|
|
4695
4717
|
var main = $(TEMPLATE_MAIN);
|
|
4696
4718
|
main.attr('id', attrs.id);
|
|
4697
4719
|
|
|
@@ -4733,7 +4755,6 @@
|
|
|
4733
4755
|
return false;
|
|
4734
4756
|
});
|
|
4735
4757
|
}
|
|
4736
|
-
|
|
4737
4758
|
});
|
|
4738
4759
|
}
|
|
4739
4760
|
}
|
|
@@ -5615,7 +5636,7 @@ function transformText() {
|
|
|
5615
5636
|
|
|
5616
5637
|
app.kendoHelper = {
|
|
5617
5638
|
getCorrectlyDS: (name, scope) => {
|
|
5618
|
-
if (scope[name].apiVersion) {
|
|
5639
|
+
if (scope[name] && scope[name].apiVersion) {
|
|
5619
5640
|
return scope[name];
|
|
5620
5641
|
}
|
|
5621
5642
|
else {
|
|
@@ -5624,6 +5645,32 @@ app.kendoHelper = {
|
|
|
5624
5645
|
return ds;
|
|
5625
5646
|
}
|
|
5626
5647
|
},
|
|
5648
|
+
getCorrectlyDSPromise: async (name, scope) => {
|
|
5649
|
+
return new Promise((resolve, reject) => {
|
|
5650
|
+
let findDs = () => {
|
|
5651
|
+
let datasource = null;
|
|
5652
|
+
if (scope[name] && scope[name].apiVersion) {
|
|
5653
|
+
datasource = scope[name];
|
|
5654
|
+
}
|
|
5655
|
+
else {
|
|
5656
|
+
let ds = scope.$parent[name];
|
|
5657
|
+
scope[name] = ds;
|
|
5658
|
+
datasource = ds;
|
|
5659
|
+
}
|
|
5660
|
+
|
|
5661
|
+
if (datasource) {
|
|
5662
|
+
resolve(datasource);
|
|
5663
|
+
}
|
|
5664
|
+
else if ($(`datasource[name="${name}"]`).length) {
|
|
5665
|
+
setTimeout(() => findDs(), 100);
|
|
5666
|
+
}
|
|
5667
|
+
else {
|
|
5668
|
+
reject(null);
|
|
5669
|
+
}
|
|
5670
|
+
}
|
|
5671
|
+
findDs();
|
|
5672
|
+
});
|
|
5673
|
+
},
|
|
5627
5674
|
receivePushData: comp => !comp || !comp.dataSource || (comp.dataSource.transport.options.refComponent = comp),
|
|
5628
5675
|
getSchema: function(dataSource) {
|
|
5629
5676
|
var parseAttribute = [
|
|
@@ -5993,7 +6040,7 @@ app.kendoHelper = {
|
|
|
5993
6040
|
}
|
|
5994
6041
|
}
|
|
5995
6042
|
if (idxSelected >-1 && !this.refComponent.selectable.options.multiple)
|
|
5996
|
-
this.refComponent.select(this.refComponent.table.find('tr')[idxSelected]);
|
|
6043
|
+
this.refComponent.select(this.refComponent.table.find('tr')[idxSelected + 1]);
|
|
5997
6044
|
}
|
|
5998
6045
|
}
|
|
5999
6046
|
}
|
package/package.json
CHANGED
package/cronapp-framework-js.iml
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<module type="WEB_MODULE" version="4">
|
|
3
|
-
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
4
|
-
<exclude-output />
|
|
5
|
-
<content url="file://$MODULE_DIR$" />
|
|
6
|
-
<orderEntry type="inheritedJdk" />
|
|
7
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
|
8
|
-
</component>
|
|
9
|
-
</module>
|