ps-toolkit-ui 0.0.26 → 0.0.30
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/bundles/ps-toolkit-ui.umd.js +86 -74
- package/bundles/ps-toolkit-ui.umd.js.map +1 -1
- package/bundles/ps-toolkit-ui.umd.min.js +1 -1
- package/bundles/ps-toolkit-ui.umd.min.js.map +1 -1
- package/esm2015/lib/classes/form.class.js +1 -2
- package/esm2015/lib/classes/permission.class.js +6 -3
- package/esm2015/lib/classes/string.class.js +2 -1
- package/esm2015/lib/classes/table.class.js +19 -15
- package/esm2015/lib/components/base.component.js +3 -10
- package/esm2015/lib/components/table/row/table.row.component.js +60 -47
- package/esm2015/lib/components/table/table.component.js +2 -2
- package/fesm2015/ps-toolkit-ui.js +86 -73
- package/fesm2015/ps-toolkit-ui.js.map +1 -1
- package/lib/classes/permission.class.d.ts +2 -2
- package/lib/classes/string.class.d.ts +1 -0
- package/lib/classes/table.class.d.ts +1 -0
- package/package.json +1 -1
- package/ps-toolkit-ui.metadata.json +1 -1
|
@@ -153,6 +153,7 @@
|
|
|
153
153
|
RePassword: 'تکرار کلمه عبور',
|
|
154
154
|
PassportLetter: 'حرف',
|
|
155
155
|
Passport: 'گذرنامه',
|
|
156
|
+
List: 'لیست',
|
|
156
157
|
Priority: 'اولویت',
|
|
157
158
|
PassportImage: 'تصویر گذرنامه',
|
|
158
159
|
PassportExpireDate: 'تاریخ انقضاء گذرنامه',
|
|
@@ -1505,7 +1506,6 @@
|
|
|
1505
1506
|
FormClass.prototype.clear = function () {
|
|
1506
1507
|
this.method = exports.Method.Post;
|
|
1507
1508
|
this.url = this.baseUrl;
|
|
1508
|
-
this.name = this.name.replace('Update', 'Insert');
|
|
1509
1509
|
this.setButtons(this.onTop, false);
|
|
1510
1510
|
this.clearInputs();
|
|
1511
1511
|
};
|
|
@@ -2358,6 +2358,8 @@
|
|
|
2358
2358
|
this.confirmShow = new core.EventEmitter();
|
|
2359
2359
|
this.changeRows = new core.EventEmitter();
|
|
2360
2360
|
this.loadParent = new core.EventEmitter();
|
|
2361
|
+
this.optEdit = null;
|
|
2362
|
+
this.optDelete = null;
|
|
2361
2363
|
this.showChildren = null;
|
|
2362
2364
|
this.addChildren = null;
|
|
2363
2365
|
this.itemsWidth = 0;
|
|
@@ -2374,8 +2376,14 @@
|
|
|
2374
2376
|
var percent = _a.percent;
|
|
2375
2377
|
return a + percent;
|
|
2376
2378
|
}, 0);
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
+
var updateAccess = this.table.permissions.getAccess('Update');
|
|
2380
|
+
var deleteAccess = this.table.permissions.getAccess('Delete');
|
|
2381
|
+
if (updateAccess != null) {
|
|
2382
|
+
this.optEdit = new InputClass(this.table.environment, this.table.l, updateAccess.Name, 'fad fa-pen', exports.InputType.Icon, 'blue h-25 m-h-5 d-ib va-m f-u');
|
|
2383
|
+
}
|
|
2384
|
+
if (deleteAccess != null) {
|
|
2385
|
+
this.optDelete = new InputClass(this.table.environment, this.table.l, deleteAccess.Name, 'fad fa-trash', exports.InputType.Icon, 'red h-25 m-h-5 d-ib va-m f-u');
|
|
2386
|
+
}
|
|
2379
2387
|
if (this.table.hasChildren) {
|
|
2380
2388
|
if (!this.table.childrenAutoLoad) {
|
|
2381
2389
|
this.children = this.getChildren();
|
|
@@ -2418,54 +2426,58 @@
|
|
|
2418
2426
|
};
|
|
2419
2427
|
}
|
|
2420
2428
|
this.options = this.getOptions();
|
|
2421
|
-
if (this.
|
|
2422
|
-
this.
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
_this.table.
|
|
2426
|
-
_this.table.
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2429
|
+
if (this.optEdit !== null) {
|
|
2430
|
+
if (this.table.form) {
|
|
2431
|
+
this.optEdit.onClick = function () {
|
|
2432
|
+
_this.table.form.url = _this.table.url + 'Update/' + _this.row.Id;
|
|
2433
|
+
if (_this.table.hasChildren && _this.row.ParentId != null) {
|
|
2434
|
+
_this.table.form.onSuccessBase = function () {
|
|
2435
|
+
_this.table.modal.hide();
|
|
2436
|
+
if (_this.table.childrenAutoLoad) {
|
|
2437
|
+
_this.loadParent.emit(_this.row.ParentId);
|
|
2438
|
+
}
|
|
2439
|
+
else {
|
|
2440
|
+
_this.table.load();
|
|
2441
|
+
}
|
|
2442
|
+
};
|
|
2443
|
+
}
|
|
2444
|
+
else {
|
|
2445
|
+
_this.table.form.onSuccessBase = function () {
|
|
2446
|
+
if (!_this.table.form.onTop) {
|
|
2447
|
+
_this.table.modal.hide();
|
|
2448
|
+
}
|
|
2449
|
+
_this.table.form.clear();
|
|
2431
2450
|
_this.table.load();
|
|
2432
|
-
}
|
|
2433
|
-
}
|
|
2451
|
+
};
|
|
2452
|
+
}
|
|
2453
|
+
_this.edit();
|
|
2454
|
+
};
|
|
2455
|
+
}
|
|
2456
|
+
else {
|
|
2457
|
+
this.optEdit.url = this.table.url + '/Update/' + this.row.Id;
|
|
2458
|
+
}
|
|
2459
|
+
}
|
|
2460
|
+
if (this.optDelete != null) {
|
|
2461
|
+
this.optDelete.onClick = function () {
|
|
2462
|
+
if (_this.table.form) {
|
|
2463
|
+
_this.table.form.clear();
|
|
2464
|
+
}
|
|
2465
|
+
if (_this.table.permissions.Type === exports.PermissionTypeEnum.Form) {
|
|
2466
|
+
_this.table.rows = _this.table.rows.filter(function (x) { return x.Id !== _this.row.Id; });
|
|
2467
|
+
_this.changeRows.emit(_this.row);
|
|
2434
2468
|
}
|
|
2435
2469
|
else {
|
|
2436
|
-
_this.
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2470
|
+
_this.confirmShow.emit({ id: _this.row.Id, accept: function () {
|
|
2471
|
+
if (_this.table.hasChildren && _this.table.childrenAutoLoad && _this.row.ParentId != null) {
|
|
2472
|
+
_this.loadParent.emit(_this.row.ParentId);
|
|
2473
|
+
}
|
|
2474
|
+
else {
|
|
2475
|
+
_this.table.load();
|
|
2476
|
+
}
|
|
2477
|
+
} });
|
|
2443
2478
|
}
|
|
2444
|
-
_this.edit();
|
|
2445
2479
|
};
|
|
2446
2480
|
}
|
|
2447
|
-
else {
|
|
2448
|
-
this.optEdit.url = this.table.url + '/Update/' + this.row.Id;
|
|
2449
|
-
}
|
|
2450
|
-
this.optDelete.onClick = function () {
|
|
2451
|
-
if (_this.table.form) {
|
|
2452
|
-
_this.table.form.clear();
|
|
2453
|
-
}
|
|
2454
|
-
if (_this.table.permissions.Type === exports.PermissionTypeEnum.Form) {
|
|
2455
|
-
_this.table.rows = _this.table.rows.filter(function (x) { return x.Id !== _this.row.Id; });
|
|
2456
|
-
_this.changeRows.emit(_this.row);
|
|
2457
|
-
}
|
|
2458
|
-
else {
|
|
2459
|
-
_this.confirmShow.emit({ id: _this.row.Id, accept: function () {
|
|
2460
|
-
if (_this.table.hasChildren && _this.table.childrenAutoLoad && _this.row.ParentId != null) {
|
|
2461
|
-
_this.loadParent.emit(_this.row.ParentId);
|
|
2462
|
-
}
|
|
2463
|
-
else {
|
|
2464
|
-
_this.table.load();
|
|
2465
|
-
}
|
|
2466
|
-
} });
|
|
2467
|
-
}
|
|
2468
|
-
};
|
|
2469
2481
|
if (this.table.sortable) {
|
|
2470
2482
|
this.setSortRow();
|
|
2471
2483
|
}
|
|
@@ -2591,8 +2603,9 @@
|
|
|
2591
2603
|
};
|
|
2592
2604
|
TableRowComponent.prototype.edit = function () {
|
|
2593
2605
|
var _this = this;
|
|
2606
|
+
var editAccess = this.table.permissions.getAccess('Update');
|
|
2594
2607
|
if (this.table.permissions.Type === exports.PermissionTypeEnum.Form) {
|
|
2595
|
-
this.table.form.name =
|
|
2608
|
+
this.table.form.name = editAccess.Name;
|
|
2596
2609
|
this.table.form.setData(this.row);
|
|
2597
2610
|
this.table.form.setButtons(this.table.form.onTop, true, this.row.Id);
|
|
2598
2611
|
this.table.form.inputs.filter(function (x) { return x.inEditDisabled; }).forEach(function (x) { return x.disabled = true; });
|
|
@@ -2600,7 +2613,7 @@
|
|
|
2600
2613
|
}
|
|
2601
2614
|
else {
|
|
2602
2615
|
new RequestClass(this.table.environment, this.table.l).send(this.table.url + 'Get/' + this.row.Id, exports.Method.Post, null, this.optEdit, function (result) {
|
|
2603
|
-
_this.table.form.name =
|
|
2616
|
+
_this.table.form.name = editAccess.Name;
|
|
2604
2617
|
_this.table.form.setButtons(_this.table.form.onTop, true, _this.row.Id);
|
|
2605
2618
|
_this.table.form.setData(result);
|
|
2606
2619
|
_this.table.form.inputs.filter(function (x) { return x.inEditDisabled; }).forEach(function (x) { return x.disabled = true; });
|
|
@@ -2866,7 +2879,7 @@
|
|
|
2866
2879
|
TableComponent.decorators = [
|
|
2867
2880
|
{ type: core.Component, args: [{
|
|
2868
2881
|
selector: 'lib-table',
|
|
2869
|
-
template: "<div [id]=\"table.id + 'Table'\" [style]=\"table.style\" #tableDiv [className]=\"(table.class ? table.class : '') + (table.sortable ? 'sortable' : '') + (table.hasChildren ? ' has-children' : '') + ' table-con'\">\r\n <div *ngIf=\"table.displayLabel\" class=\"title\">\r\n {{this.table.
|
|
2882
|
+
template: "<div [id]=\"table.id + 'Table'\" [style]=\"table.style\" #tableDiv [className]=\"(table.class ? table.class : '') + (table.sortable ? 'sortable' : '') + (table.hasChildren ? ' has-children' : '') + ' table-con'\">\r\n <div *ngIf=\"table.displayLabel\" class=\"title\">\r\n {{this.table.title ? this.table.title : 'List'}}\r\n <div class=\"extra-buttons\" *ngIf=\"table.extraButtons\">\r\n <div *ngIf=\"table.permissions && table.permissions.hasAccess('Report')\" class=\"export\">\r\n <lib-form-icon [inp]=\"export\"></lib-form-icon>\r\n <div class=\"export-dropdown\" #exportDropDown>\r\n <div (click)=\"report('Print')\" class=\"item\"><div class=\"text\">Print</div><i class=\"fad fa-print\"></i></div>\r\n <div (click)=\"report('Excel')\" class=\"item\"><div class=\"text\">Excel</div><i class=\"fad fa-file-excel\"></i></div>\r\n <div (click)=\"report('CSV')\" class=\"item\"><div class=\"text\">CSV</div><i class=\"fad fa-file-csv\"></i></div>\r\n <div (click)=\"report('PDF')\" class=\"item\"><div class=\"text\">PDF</div><i class=\"fad fa-file-pdf\"></i></div>\r\n </div>\r\n </div>\r\n <lib-form-icon [inp]=\"reload\"></lib-form-icon>\r\n <lib-form-icon [inp]=\"maximum\"></lib-form-icon>\r\n </div>\r\n <div *ngIf=\"table.buttons.length > 0\" class=\"buttons\">\r\n <lib-form-button [inp]=\"btn\" *ngFor=\"let btn of table.buttons\"></lib-form-button>\r\n </div>\r\n </div>\r\n <div class=\"search-form\" *ngIf=\"table.searchForm\">\r\n <lib-form [form]=\"table.searchForm\"></lib-form>\r\n </div>\r\n <lib-form *ngIf=\"table.form && table.form.onTop\" [form]=\"table.form\"></lib-form>\r\n <table>\r\n <thead>\r\n <tr>\r\n <th *ngIf=\"table.hasChildren\" style=\"width: 50px\"></th>\r\n <th *ngIf=\"table.sortable\" style=\"width: 50px\"></th>\r\n <th *ngIf=\"table.withSelect\" style=\"width: 50px\">\r\n <i (click)=\"selectAll()\" [className]=\"(allSelected() ? 'fas fa-check-square green' : isSelected() ? 'fas fa-minus-square green' : 'far fa-square') + ' select-row'\" *ngIf=\"table.rows.length > 0\"></i>\r\n </th>\r\n <th (click)=\"!table.sortable && col.sort && changeSort($event, col.name)\" [className]=\"(!table.sortable && col.sort ? 'sort' : '')\" *ngFor=\"let col of table.cols\" [style]=\"{width: col.percent + '%'}\">\r\n <i *ngIf=\"!table.sortable && col.sort\" [className]=\"'sort-icon fas' + (table.sort === col.name ? (table.sortType === 'ASC' ? ' fa-sort-up' : ' fa-sort-down') : ' fa-sort')\"></i>\r\n <span *ngIf=\"col.search == null\">{{ table.l(col.name) }}</span>\r\n <div class=\"w-90 header-search p-h-20 m-r-5\" *ngIf=\"!table.sortable && col.search != null\">\r\n <lib-form-textbox *ngIf=\"col.type != colType.Date\" [inp]=\"col.search\"></lib-form-textbox>\r\n <lib-form-date *ngIf=\"col.type == colType.Date\" [inp]=\"col.search\"></lib-form-date>\r\n </div>\r\n </th>\r\n<!-- <th *ngIf=\"table.hasOption()\" [style]=\"{width: (100 - itemsWidth) + '%'}\">-->\r\n<!-- <span *ngIf=\"!table.withSelect || !isSelected()\">{{ table.l('Options') }}</span>-->\r\n<!-- <span *ngIf=\"table.withSelect && isSelected()\" class=\"option-con\">-->\r\n<!-- <span *ngFor=\"let opt of options\">-->\r\n<!-- <lib-form-button *ngIf=\"opt.type == type.Button\" [inp]=\"opt\"></lib-form-button>-->\r\n<!-- <lib-form-icon *ngIf=\"opt.type == type.Icon\" [inp]=\"opt\"></lib-form-icon>-->\r\n<!-- </span>-->\r\n<!-- </span>-->\r\n<!-- </th>-->\r\n </tr>\r\n </thead>\r\n <tbody #rows [style]=\"table.perPage > 0 ? {height: table.height * table.perPage + 'px'} : table.loading || !table.permission || table.rows.length == 0 ? {height: '100px'} : {}\">\r\n <lib-table-row (confirmShow)=\"onConfirmShow($event)\" [level]=\"1\" (changeRows)=\"onChangeRows($event)\" [id]=\"row.id ? row.id : ''\" [table]=\"table\" [row]=\"row\" *ngFor=\"let row of getRows()\"></lib-table-row>\r\n <tr *ngIf=\"table.perPage > 0\" [style]=\"{height: (table.perPage > 0 ? (table.perPage - table.rows.length) * table.height : '100') + 'px', visibility: 'hidden'}\"></tr>\r\n <lib-table-loading [table]=\"table\"></lib-table-loading>\r\n </tbody>\r\n <tfoot>\r\n <tr>\r\n <td colspan=\"100%\">\r\n <lib-table-pagination [table]=\"table\" *ngIf=\"table.perPage > 0\"></lib-table-pagination>\r\n </td>\r\n </tr>\r\n </tfoot>\r\n </table>\r\n <lib-modal *ngIf=\"table.modal != null\" [modal]=\"table.modal\"></lib-modal>\r\n <lib-modal [modal]=\"opt.modal\" *ngFor=\"let opt of getOptionModals()\"></lib-modal>\r\n <lib-confirm #confirm [tableId]=\"table.name\"></lib-confirm>\r\n</div>\r\n",
|
|
2870
2883
|
styles: [".table-con{background-color:#fff;border-radius:5px;box-shadow:var(--box-shadow-table);float:right;padding:20px;position:relative;width:100%}.table-con.maximum{border-radius:0;height:100%;overflow-y:auto;position:fixed;right:0;top:0;width:100%;z-index:11}.table-con>.title{float:right;font-family:VazirBold;font-size:16px;height:40px;line-height:40px;margin-bottom:10px;position:relative;text-align:right;width:100%}.table-con>.title .extra-buttons{float:left;margin-top:5px}.table-con>.title .extra-buttons .export{float:right;position:relative}.table-con>.title .extra-buttons .export .export-dropdown{background-color:#fff;border-radius:5px;box-shadow:var(--box-shadow-table);display:none;overflow:hidden;padding:15px 0;position:absolute;right:-50px;top:35px;width:130px;z-index:2}.table-con>.title .extra-buttons .export .export-dropdown .item{cursor:pointer;float:right;padding:0 15px;text-align:center;width:100%}.table-con>.title .extra-buttons .export .export-dropdown .item:hover{background-color:var(--black-22)}.table-con>.title .extra-buttons .export .export-dropdown .text{float:right;font-family:VazirLight;font-size:13px;height:40px;line-height:41px;width:70%}.table-con>.title .extra-buttons .export .export-dropdown i{color:var(--black-88);float:right;font-size:14px;height:40px;line-height:40px;width:30%}.table-con>.title .buttons{float:left;margin-left:10px;margin-top:5px}.table-con>.search-form{border-radius:5px;float:right;margin-bottom:5px;width:100%}.table-con table{border-spacing:0!important;width:100%}.table-con table thead tr{-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;position:relative}.table-con table thead tr th{background-color:var(--base-11);color:var(--black-88);font-family:VazirLight;font-size:12px;font-weight:400;height:45px;position:relative;vertical-align:middle}.table-con table thead tr th:first-child{border-bottom-right-radius:5px;border-top-right-radius:5px}.table-con table thead tr th:last-child{border-bottom-left-radius:5px;border-top-left-radius:5px}.table-con table thead tr th.sort{cursor:pointer}.table-con table thead tr th .sort-icon{font-size:13px;height:20px;left:5px;line-height:20px;opacity:.6;position:absolute;top:calc(50% - 10px);width:20px}.table-con table tbody{position:relative}.table-con table tfoot tr{height:45px}.table-con table tfoot tr td{position:relative;vertical-align:bottom}::ng-deep .table-con:not(.sortable) table lib-table-row:last-of-type>tr:after{background-image:unset}::ng-deep .table-con table thead tr th .select-row{cursor:pointer;font-size:18px;height:30px;line-height:30px}"]
|
|
2871
2884
|
},] }
|
|
2872
2885
|
];
|
|
@@ -5040,14 +5053,13 @@
|
|
|
5040
5053
|
};
|
|
5041
5054
|
|
|
5042
5055
|
var PermissionClass = /** @class */ (function () {
|
|
5043
|
-
function PermissionClass(Name, Icon, Type, Area, Controller, Action,
|
|
5056
|
+
function PermissionClass(Name, Icon, Type, Area, Controller, Action, Accesses) {
|
|
5044
5057
|
if (Name === void 0) { Name = ''; }
|
|
5045
5058
|
if (Icon === void 0) { Icon = ''; }
|
|
5046
5059
|
if (Type === void 0) { Type = null; }
|
|
5047
5060
|
if (Area === void 0) { Area = ''; }
|
|
5048
5061
|
if (Controller === void 0) { Controller = ''; }
|
|
5049
5062
|
if (Action === void 0) { Action = ''; }
|
|
5050
|
-
if (Children === void 0) { Children = []; }
|
|
5051
5063
|
if (Accesses === void 0) { Accesses = []; }
|
|
5052
5064
|
this.Name = Name;
|
|
5053
5065
|
this.Icon = Icon;
|
|
@@ -5055,11 +5067,14 @@
|
|
|
5055
5067
|
this.Area = Area;
|
|
5056
5068
|
this.Controller = Controller;
|
|
5057
5069
|
this.Action = Action;
|
|
5058
|
-
this.Children = Children;
|
|
5059
5070
|
this.Accesses = Accesses;
|
|
5060
5071
|
this.RelatedId = null;
|
|
5061
5072
|
this.Condition = null;
|
|
5062
5073
|
}
|
|
5074
|
+
PermissionClass.prototype.getAccess = function (a) {
|
|
5075
|
+
var c = this.Accesses.filter(function (x) { return x.Action === a && x.Type === exports.PermissionTypeEnum.Access; });
|
|
5076
|
+
return c.length > 0 ? c[0] : null;
|
|
5077
|
+
};
|
|
5063
5078
|
PermissionClass.prototype.hasAccess = function (a) {
|
|
5064
5079
|
return this.Accesses.filter(function (x) { return x.Action === a && x.Type === exports.PermissionTypeEnum.Access; }).length > 0;
|
|
5065
5080
|
};
|
|
@@ -6886,18 +6901,11 @@
|
|
|
6886
6901
|
return p.length > 0 ? this.getPermissionClass(p[0]) : null;
|
|
6887
6902
|
};
|
|
6888
6903
|
BaseComponent.prototype.getPermissionClass = function (p) {
|
|
6889
|
-
|
|
6890
|
-
console.log(p);
|
|
6891
|
-
console.log('$$$$$$$$$$');
|
|
6892
|
-
return new PermissionClass(p.Name, p.Icon, p.Type, p.Area, p.Controller, p.Action, [], this.getPermissionAccessesClass(p.Id));
|
|
6904
|
+
return new PermissionClass(p.Name, p.Icon, p.Type, p.Area, p.Controller, p.Action, this.getPermissionAccessesClass(p.Id));
|
|
6893
6905
|
};
|
|
6894
6906
|
BaseComponent.prototype.getPermissionAccessesClass = function (parentId) {
|
|
6895
6907
|
var _this = this;
|
|
6896
|
-
|
|
6897
|
-
console.log(parentId);
|
|
6898
|
-
console.log(this.app.currentUser.Permissions.filter(function (x) { return x.ParentId = parentId; }));
|
|
6899
|
-
console.log('--------------');
|
|
6900
|
-
return this.app.currentUser.Permissions.filter(function (x) { return x.ParentId = parentId; }).map(function (x) { return _this.getPermissionClass(x); });
|
|
6908
|
+
return this.app.currentUser.Permissions.filter(function (x) { return x.ParentId === parentId; }).map(function (x) { return _this.getPermissionClass(x); });
|
|
6901
6909
|
};
|
|
6902
6910
|
BaseComponent.prototype.hasAccess = function (a) {
|
|
6903
6911
|
return this.permissions ? this.permissions.hasAccess(a) : false;
|
|
@@ -6961,6 +6969,7 @@
|
|
|
6961
6969
|
this.page = 1;
|
|
6962
6970
|
this.sort = null;
|
|
6963
6971
|
this.queryParams = {};
|
|
6972
|
+
this.title = null;
|
|
6964
6973
|
this.sortType = null;
|
|
6965
6974
|
this.displayLabel = true;
|
|
6966
6975
|
this.isReport = false;
|
|
@@ -7034,7 +7043,9 @@
|
|
|
7034
7043
|
return this.url + (this.isReport || isReport ? 'Report?' : 'List');
|
|
7035
7044
|
};
|
|
7036
7045
|
TableClass.prototype.showInsertModal = function () {
|
|
7046
|
+
var insertAccess = this.permissions.getAccess('Insert');
|
|
7037
7047
|
this.form.url = this.form.baseUrl = this.url + 'Insert';
|
|
7048
|
+
this.form.name = insertAccess.Name;
|
|
7038
7049
|
this.form.method = exports.Method.Post;
|
|
7039
7050
|
this.form.inputs.filter(function (x) { return x.inEditDisabled; }).forEach(function (x) { return x.disabled = false; });
|
|
7040
7051
|
this.form.inputs.filter(function (x) { return !x.inEditVisible; }).forEach(function (x) { return x.visible = true; });
|
|
@@ -7045,7 +7056,9 @@
|
|
|
7045
7056
|
var _this = this;
|
|
7046
7057
|
if (changeRows === void 0) { changeRows = null; }
|
|
7047
7058
|
this.permission = true;
|
|
7048
|
-
|
|
7059
|
+
var listAccess = this.permissions.getAccess('List');
|
|
7060
|
+
if (this.permissions && listAccess !== null) {
|
|
7061
|
+
this.title = listAccess.Name;
|
|
7049
7062
|
this.url = this.permissions.getUrl();
|
|
7050
7063
|
if (this.permissions.Type !== exports.PermissionTypeEnum.Form) {
|
|
7051
7064
|
this.load();
|
|
@@ -7058,8 +7071,9 @@
|
|
|
7058
7071
|
this.permission = false;
|
|
7059
7072
|
return;
|
|
7060
7073
|
}
|
|
7061
|
-
var
|
|
7062
|
-
if (
|
|
7074
|
+
var insertAccess = this.permissions.getAccess('Insert');
|
|
7075
|
+
if (insertAccess != null) {
|
|
7076
|
+
var insert = new InputClass(this.environment, this.l, insertAccess.Name, 'fad fa-plus fa-rotate-90', exports.InputType.Button, 'w-u green h-30');
|
|
7063
7077
|
if (this.form) {
|
|
7064
7078
|
this.form.url = this.form.baseUrl = this.url + 'Insert';
|
|
7065
7079
|
if (!this.form.onTop) {
|
|
@@ -7077,8 +7091,15 @@
|
|
|
7077
7091
|
}
|
|
7078
7092
|
}
|
|
7079
7093
|
else {
|
|
7080
|
-
insert.url = this.url;
|
|
7081
7094
|
this.buttons.unshift(insert);
|
|
7095
|
+
if (this.modal) {
|
|
7096
|
+
insert.onClick = function () {
|
|
7097
|
+
_this.modal.show();
|
|
7098
|
+
};
|
|
7099
|
+
}
|
|
7100
|
+
else {
|
|
7101
|
+
insert.url = this.url + 'Insert';
|
|
7102
|
+
}
|
|
7082
7103
|
}
|
|
7083
7104
|
}
|
|
7084
7105
|
if ((this.permissions.hasAccess('Insert') || this.permissions.hasAccess('Update')) && this.form) {
|
|
@@ -7109,16 +7130,6 @@
|
|
|
7109
7130
|
this.modal.form = this.form;
|
|
7110
7131
|
}
|
|
7111
7132
|
}
|
|
7112
|
-
else {
|
|
7113
|
-
if (this.modal) {
|
|
7114
|
-
insert.onClick = function () {
|
|
7115
|
-
_this.modal.show();
|
|
7116
|
-
};
|
|
7117
|
-
}
|
|
7118
|
-
else {
|
|
7119
|
-
insert.url = this.url + 'Insert';
|
|
7120
|
-
}
|
|
7121
|
-
}
|
|
7122
7133
|
var _loop_1 = function (option) {
|
|
7123
7134
|
if (this_1.options.filter(function (x) { return x.name === option.Name; }).length > 0) {
|
|
7124
7135
|
return "continue";
|
|
@@ -7153,6 +7164,7 @@
|
|
|
7153
7164
|
opt.modal.table.set();
|
|
7154
7165
|
}
|
|
7155
7166
|
if (opt.modal.form) {
|
|
7167
|
+
opt.modal.form.name = option.Name;
|
|
7156
7168
|
opt.modal.form.url = opt.modal.form.baseUrl + 'Update/' + btn.row.Id;
|
|
7157
7169
|
opt.modal.form.loadData(opt.modal.form.baseUrl + 'Get/' + btn.row.Id);
|
|
7158
7170
|
opt.modal.form.onSuccessBase = function () {
|