ps-toolkit-ui 0.0.25 → 0.0.29

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.
@@ -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
- this.optEdit = new InputClass(this.table.environment, this.table.l, this.table.name + 'UpdateTitle', 'fad fa-pen', exports.InputType.Icon, 'blue h-25 m-h-5 d-ib va-m f-u');
2378
- this.optDelete = new InputClass(this.table.environment, this.table.l, this.table.name + 'DeleteTitle', 'fad fa-trash', exports.InputType.Icon, 'red h-25 m-h-5 d-ib va-m f-u');
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.table.form) {
2422
- this.optEdit.onClick = function () {
2423
- _this.table.form.url = _this.table.url + 'Update/' + _this.row.Id;
2424
- if (_this.table.hasChildren && _this.row.ParentId != null) {
2425
- _this.table.form.onSuccessBase = function () {
2426
- _this.table.modal.hide();
2427
- if (_this.table.childrenAutoLoad) {
2428
- _this.loadParent.emit(_this.row.ParentId);
2429
- }
2430
- else {
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.table.form.onSuccessBase = function () {
2437
- if (!_this.table.form.onTop) {
2438
- _this.table.modal.hide();
2439
- }
2440
- _this.table.form.clear();
2441
- _this.table.load();
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 = this.table.name + 'UpdateTitle';
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 = _this.table.name + 'UpdateTitle';
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.l(this.table.name + 'ListTitle')}}\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",
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, Children, Accesses) {
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
  };
@@ -6880,23 +6895,17 @@
6880
6895
  }
6881
6896
  BaseComponent.prototype.getPermission = function () {
6882
6897
  var _this = this;
6898
+ console.log('getPermissiongetPermissiongetPermissiongetPermission');
6883
6899
  var p = this.app.currentUser.Permissions.filter(function (per) { return per.Controller === _this.c && (_this.a == null || per.Action === _this.a) &&
6884
6900
  per.Type === exports.PermissionTypeEnum.Item; });
6885
6901
  return p.length > 0 ? this.getPermissionClass(p[0]) : null;
6886
6902
  };
6887
6903
  BaseComponent.prototype.getPermissionClass = function (p) {
6888
- console.log('$$$$$$$$$$');
6889
- console.log(p);
6890
- console.log('$$$$$$$$$$');
6891
- 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));
6892
6905
  };
6893
6906
  BaseComponent.prototype.getPermissionAccessesClass = function (parentId) {
6894
6907
  var _this = this;
6895
- console.log('--------------');
6896
- console.log(parentId);
6897
- console.log(this.app.currentUser.Permissions.filter(function (x) { return x.ParentId = parentId; }));
6898
- console.log('--------------');
6899
- 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); });
6900
6909
  };
6901
6910
  BaseComponent.prototype.hasAccess = function (a) {
6902
6911
  return this.permissions ? this.permissions.hasAccess(a) : false;
@@ -6960,6 +6969,7 @@
6960
6969
  this.page = 1;
6961
6970
  this.sort = null;
6962
6971
  this.queryParams = {};
6972
+ this.title = null;
6963
6973
  this.sortType = null;
6964
6974
  this.displayLabel = true;
6965
6975
  this.isReport = false;
@@ -7033,7 +7043,9 @@
7033
7043
  return this.url + (this.isReport || isReport ? 'Report?' : 'List');
7034
7044
  };
7035
7045
  TableClass.prototype.showInsertModal = function () {
7046
+ var insertAccess = this.permissions.getAccess('Insert');
7036
7047
  this.form.url = this.form.baseUrl = this.url + 'Insert';
7048
+ this.form.name = insertAccess.Name;
7037
7049
  this.form.method = exports.Method.Post;
7038
7050
  this.form.inputs.filter(function (x) { return x.inEditDisabled; }).forEach(function (x) { return x.disabled = false; });
7039
7051
  this.form.inputs.filter(function (x) { return !x.inEditVisible; }).forEach(function (x) { return x.visible = true; });
@@ -7044,7 +7056,9 @@
7044
7056
  var _this = this;
7045
7057
  if (changeRows === void 0) { changeRows = null; }
7046
7058
  this.permission = true;
7047
- if (this.permissions && this.permissions.hasAccess('List')) {
7059
+ var listAccess = this.permissions.getAccess('List');
7060
+ if (this.permissions && listAccess !== null) {
7061
+ this.title = listAccess.Name;
7048
7062
  this.url = this.permissions.getUrl();
7049
7063
  if (this.permissions.Type !== exports.PermissionTypeEnum.Form) {
7050
7064
  this.load();
@@ -7057,8 +7071,9 @@
7057
7071
  this.permission = false;
7058
7072
  return;
7059
7073
  }
7060
- var insert = new InputClass(this.environment, this.l, this.name + 'InsertTitle', 'fad fa-plus fa-rotate-90', exports.InputType.Button, 'w-u green h-30');
7061
- if (this.permissions.hasAccess('Insert')) {
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');
7062
7077
  if (this.form) {
7063
7078
  this.form.url = this.form.baseUrl = this.url + 'Insert';
7064
7079
  if (!this.form.onTop) {
@@ -7076,8 +7091,15 @@
7076
7091
  }
7077
7092
  }
7078
7093
  else {
7079
- insert.url = this.url;
7080
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
+ }
7081
7103
  }
7082
7104
  }
7083
7105
  if ((this.permissions.hasAccess('Insert') || this.permissions.hasAccess('Update')) && this.form) {
@@ -7108,16 +7130,6 @@
7108
7130
  this.modal.form = this.form;
7109
7131
  }
7110
7132
  }
7111
- else {
7112
- if (this.modal) {
7113
- insert.onClick = function () {
7114
- _this.modal.show();
7115
- };
7116
- }
7117
- else {
7118
- insert.url = this.url + 'Insert';
7119
- }
7120
- }
7121
7133
  var _loop_1 = function (option) {
7122
7134
  if (this_1.options.filter(function (x) { return x.name === option.Name; }).length > 0) {
7123
7135
  return "continue";