ps-toolkit-ui 1.12.97 → 1.12.99

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.
@@ -2999,9 +2999,6 @@
2999
2999
  }
3000
3000
  }, 500);
3001
3001
  };
3002
- TableRowComponent.prototype.getOptionUrl = function (url, relatedId, rowId) {
3003
- return (relatedId ? url.replace('{}', relatedId) : (url.match(/{}/g) || []).length > 1 ? url.replace('/{}', '') : url).replace('{}', rowId);
3004
- };
3005
3002
  TableRowComponent.prototype.setOptions = function () {
3006
3003
  var e_1, _b, e_2, _c;
3007
3004
  var _this = this;
@@ -3041,7 +3038,7 @@
3041
3038
  if (option.AccessType === exports.PermissionAccessTypeEnum.Update) {
3042
3039
  if (this_2.table.form) {
3043
3040
  opt.onClick = function () {
3044
- _this.table.form.url = _this.getOptionUrl(option.Url, _this.table.permissions.RelatedId, _this.row.Data.Id);
3041
+ _this.table.form.url = _this.table.getOptionUrl(option.Url, _this.table.permissions.RelatedId, _this.row.Data.Id);
3045
3042
  if (_this.table.hasChildren && _this.row.Data.ParentId != null) {
3046
3043
  _this.table.form.onSuccessBase = function () {
3047
3044
  _this.table.modal.hide();
@@ -3066,7 +3063,7 @@
3066
3063
  };
3067
3064
  }
3068
3065
  else {
3069
- opt.url = this_2.getOptionUrl(option.Url, this_2.table.permissions.RelatedId, this_2.row.Data.Id);
3066
+ opt.url = this_2.table.getOptionUrl(option.Url, this_2.table.permissions.RelatedId, this_2.row.Data.Id);
3070
3067
  }
3071
3068
  }
3072
3069
  else if (option.AccessType === exports.PermissionAccessTypeEnum.Delete) {
@@ -3082,7 +3079,7 @@
3082
3079
  else {
3083
3080
  _this.confirmShow.emit({
3084
3081
  action: option.Action,
3085
- url: _this.getOptionUrl(option.Url, _this.table.permissions.RelatedId, _this.row.Data.Id),
3082
+ url: _this.table.getOptionUrl(option.Url, _this.table.permissions.RelatedId, _this.row.Data.Id),
3086
3083
  accept: function () {
3087
3084
  if (_this.table.hasChildren && _this.table.childrenAutoLoad && _this.row.Data.ParentId != null) {
3088
3085
  _this.loadParent.emit(_this.row.Data.ParentId);
@@ -3096,7 +3093,7 @@
3096
3093
  };
3097
3094
  }
3098
3095
  else if (option.AccessType === exports.PermissionAccessTypeEnum.Report) {
3099
- opt.url = this_2.getOptionUrl('/report' + option.Url, this_2.table.permissions.RelatedId, this_2.row.Data.Id);
3096
+ opt.url = this_2.table.getOptionUrl('/report' + option.Url, this_2.table.permissions.RelatedId, this_2.row.Data.Id);
3100
3097
  opt.urlNewTab = true;
3101
3098
  }
3102
3099
  else if (option.InputAction === exports.PermissionInputActionEnum.Link || option.InputAction === exports.PermissionInputActionEnum.LinkNewTab) {
@@ -3170,7 +3167,7 @@
3170
3167
  p.Area = this_2.table.permissions.Area;
3171
3168
  p.Controller = option.Controller;
3172
3169
  p.Action = option.Action;
3173
- opt.url = '/file' + this_2.getOptionUrl(option.Url, this_2.table.permissions.RelatedId, this_2.row.Data.Id);
3170
+ opt.url = '/file' + this_2.table.getOptionUrl(option.Url, this_2.table.permissions.RelatedId, this_2.row.Data.Id);
3174
3171
  opt.urlNewTab = true;
3175
3172
  }
3176
3173
  else if (option.InputAction === exports.PermissionInputActionEnum.Confirm) {
@@ -3180,7 +3177,7 @@
3180
3177
  p.Area = _this.table.permissions.Area;
3181
3178
  p.Controller = option.Controller;
3182
3179
  p.Action = option.Action;
3183
- _this.table.showConfirm(_this.table.l(option.Action + 'Confirm'), _this.getOptionUrl(option.Url, _this.table.permissions.RelatedId, _this.row.Data.Id), null, function () {
3180
+ _this.table.showConfirm(_this.table.l(option.Action + 'Confirm'), _this.table.getOptionUrl(option.Url, _this.table.permissions.RelatedId, _this.row.Data.Id), null, function () {
3184
3181
  _this.table.load();
3185
3182
  });
3186
3183
  };
@@ -3345,7 +3342,7 @@
3345
3342
  this.table.form.inputs.forEach(function (x) { return x.required = x.inEditRequired; });
3346
3343
  }
3347
3344
  else {
3348
- new RequestClass(this.table.environment, this.table.l).send(this.getOptionUrl(option.Url.replace('update', 'get'), this.table.permissions.RelatedId, this.row.Data.Id), exports.Method.Post, null, opt, function (result) {
3345
+ new RequestClass(this.table.environment, this.table.l).send(this.table.getOptionUrl(option.Url.replace('update', 'get'), this.table.permissions.RelatedId, this.row.Data.Id), exports.Method.Post, null, opt, function (result) {
3349
3346
  _this.table.form.name = opt.name;
3350
3347
  _this.table.form.setData(result);
3351
3348
  _this.table.form.setButtons(_this.table.form.onTop, true, _this.row.Data.Id);
@@ -3630,7 +3627,7 @@
3630
3627
  TableComponent.decorators = [
3631
3628
  { type: core.Component, args: [{
3632
3629
  selector: 'lib-table',
3633
- 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 <div class=\"f-r\">{{this.table.title ? this.table.title : table.l('List')}}</div>\r\n <span class=\"description\" *ngIf=\"this.table.description != null\" [innerHTML]=\"'( ' + this.table.description + ' )'\"></span>\r\n <div class=\"extra-buttons\" *ngIf=\"table.showExtraButtons\">\r\n <span *ngIf=\"isSelected()\">\r\n <lib-form-icon *ngFor=\"let btn of table.extraButtons\" [inp]=\"btn\"></lib-form-icon>\r\n </span>\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 <span *ngFor=\"let btn of table.buttons\">\r\n <lib-form-button [inp]=\"btn\" *ngIf=\"btn.type == type.Button\"></lib-form-button>\r\n <lib-form-label [inp]=\"btn\" *ngIf=\"btn.type == type.Label\"></lib-form-label>\r\n </span>\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 <div class=\"table\">\r\n <div class=\"header\">\r\n <div [className]=\"(table.hasChildren ? 'with-handle-children ' : '') + (table.sortable ? 'with-handle-sortable ' : '') + (table.withSelect ? 'with-handle-select ' : '') + 'row'\">\r\n <div class=\"handle-con\">\r\n <div class=\"handle handle-sortable\" *ngIf=\"table.sortable\"></div>\r\n <div class=\"handle handle-select\" *ngIf=\"table.hasChildren\"></div>\r\n <div class=\"handle handle-children\" *ngIf=\"table.withSelect\">\r\n <i (click)=\"selectAll()\" [className]=\"(allSelected() ? 'fa-solid fa-square-check c-green' : isSelected() ? 'fa-solid fa-square-minus c-green' : 'fa-regular fa-square') + ' select-row'\" *ngIf=\"table.rows.length > 0\"></i>\r\n </div>\r\n </div>\r\n <div (click)=\"!table.sortable && col.sort && changeSort($event, col.name)\" [className]=\"(!table.sortable && col.sort ? 'sort ' : '') + col.class + ' ' + col.name + '-cell cell w-100'\" *ngFor=\"let col of table.cols\">\r\n <div class=\"header-title\" *ngIf=\"col.search == null || table.sortable\" [innerHTML]=\"table.l(col.name)\"></div>\r\n <div class=\"header-search\" *ngIf=\"!table.sortable && col.search != null\">\r\n <lib-form-textbox *ngIf=\"col.type != colType.Date && col.type != colType.DateTime && col.type != colType.Month && col.enum == null\" [inp]=\"col.search\"></lib-form-textbox>\r\n <lib-form-date *ngIf=\"(col.type == colType.Date || col.type == colType.DateTime || col.type == colType.Month) && col.enum == null\" [inp]=\"col.search\"></lib-form-date>\r\n <lib-form-select *ngIf=\"col.enum != null\" [inp]=\"col.search\"></lib-form-select>\r\n </div>\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 </div>\r\n <div class=\"cell options\" *ngIf=\"table.optionType == tableOptionType.Show\">{{table.l('Options')}}</div>\r\n </div>\r\n </div>\r\n <div class=\"body\" #rows [style]=\"table.perPage > 0 ? {minHeight: table.height * table.perPage + 'px'} : {minHeight: '120px'}\">\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 <lib-table-loading [table]=\"table\"></lib-table-loading>\r\n </div>\r\n </div>\r\n <lib-table-pagination [table]=\"table\" *ngIf=\"table.perPage > 0\"></lib-table-pagination>\r\n <lib-modal *ngIf=\"table.modal != null\" [modal]=\"table.modal\"></lib-modal>\r\n <lib-modal [modal]=\"opt\" *ngFor=\"let opt of getModals()\"></lib-modal>\r\n <lib-confirm #confirm [tableId]=\"table.name\"></lib-confirm>\r\n</div>\r\n",
3630
+ 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 <div class=\"f-r\">{{this.table.title ? this.table.title : table.l('List')}}</div>\r\n <span class=\"description\" *ngIf=\"this.table.description != null\" [innerHTML]=\"'( ' + this.table.description + ' )'\"></span>\r\n <div class=\"extra-buttons\" *ngIf=\"table.showExtraButtons\">\r\n <span *ngIf=\"isSelected()\">\r\n <lib-form-icon *ngFor=\"let btn of table.extraButtons\" [inp]=\"btn\"></lib-form-icon>\r\n </span>\r\n <span *ngIf=\"!isSelected()\">\r\n <lib-form-icon [inp]=\"reload\"></lib-form-icon>\r\n <lib-form-icon [inp]=\"maximum\"></lib-form-icon>\r\n </span>\r\n </div>\r\n <div *ngIf=\"table.buttons.length > 0\" class=\"buttons\">\r\n <span *ngFor=\"let btn of table.buttons\">\r\n <lib-form-button [inp]=\"btn\" *ngIf=\"btn.type == type.Button\"></lib-form-button>\r\n <lib-form-label [inp]=\"btn\" *ngIf=\"btn.type == type.Label\"></lib-form-label>\r\n </span>\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 <div class=\"table\">\r\n <div class=\"header\">\r\n <div [className]=\"(table.hasChildren ? 'with-handle-children ' : '') + (table.sortable ? 'with-handle-sortable ' : '') + (table.withSelect ? 'with-handle-select ' : '') + 'row'\">\r\n <div class=\"handle-con\">\r\n <div class=\"handle handle-sortable\" *ngIf=\"table.sortable\"></div>\r\n <div class=\"handle handle-select\" *ngIf=\"table.hasChildren\"></div>\r\n <div class=\"handle handle-children\" *ngIf=\"table.withSelect\">\r\n <i (click)=\"selectAll()\" [className]=\"(allSelected() ? 'fa-solid fa-square-check c-green' : isSelected() ? 'fa-solid fa-square-minus c-green' : 'fa-regular fa-square') + ' select-row'\" *ngIf=\"table.rows.length > 0\"></i>\r\n </div>\r\n </div>\r\n <div (click)=\"!table.sortable && col.sort && changeSort($event, col.name)\" [className]=\"(!table.sortable && col.sort ? 'sort ' : '') + col.class + ' ' + col.name + '-cell cell w-100'\" *ngFor=\"let col of table.cols\">\r\n <div class=\"header-title\" *ngIf=\"col.search == null || table.sortable\" [innerHTML]=\"table.l(col.name)\"></div>\r\n <div class=\"header-search\" *ngIf=\"!table.sortable && col.search != null\">\r\n <lib-form-textbox *ngIf=\"col.type != colType.Date && col.type != colType.DateTime && col.type != colType.Month && col.enum == null\" [inp]=\"col.search\"></lib-form-textbox>\r\n <lib-form-date *ngIf=\"(col.type == colType.Date || col.type == colType.DateTime || col.type == colType.Month) && col.enum == null\" [inp]=\"col.search\"></lib-form-date>\r\n <lib-form-select *ngIf=\"col.enum != null\" [inp]=\"col.search\"></lib-form-select>\r\n </div>\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 </div>\r\n <div class=\"cell options\" *ngIf=\"table.optionType == tableOptionType.Show\">{{table.l('Options')}}</div>\r\n </div>\r\n </div>\r\n <div class=\"body\" #rows [style]=\"table.perPage > 0 ? {minHeight: table.height * table.perPage + 'px'} : {minHeight: '120px'}\">\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 <lib-table-loading [table]=\"table\"></lib-table-loading>\r\n </div>\r\n </div>\r\n <lib-table-pagination [table]=\"table\" *ngIf=\"table.perPage > 0\"></lib-table-pagination>\r\n <lib-modal *ngIf=\"table.modal != null\" [modal]=\"table.modal\"></lib-modal>\r\n <lib-modal [modal]=\"opt\" *ngFor=\"let opt of getModals()\"></lib-modal>\r\n <lib-confirm #confirm [tableId]=\"table.name\"></lib-confirm>\r\n</div>\r\n",
3634
3631
  styles: [".table-con{background-color:#fff;border-radius:var(--border-radius-base);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:102}.table-con>.title{float:right;font-size:16px;font-weight:700;line-height:40px;margin-bottom:10px;position:relative;text-align:right;width:100%}.table-con>.title .description{font-size:13px;font-weight:200;margin-right:10px}.table-con>.title .buttons,.table-con>.title .extra-buttons{float:left;margin-top:5px;position:relative;z-index:1}.table-con>.title .extra-buttons{min-width:80px}.table-con>.search-form{border-radius:var(--border-radius-base);float:right;margin-bottom:10px;width:100%}.table-con .table,.table-con .table .header{float:right;width:100%}.table-con .table .header .row{-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;align-items:center;background-color:var(--base-white);border-radius:var(--border-radius-base);display:flex;flex-wrap:wrap;float:right;justify-content:right;position:relative;width:100%}.table-con .table .header .row.with-handle-children,.table-con .table .header .row.with-handle-select,.table-con .table .header .row.with-handle-sortable{padding-right:30px}.table-con .table .header .row.with-handle-children.with-handle-select,.table-con .table .header .row.with-handle-sortable.with-handle-children,.table-con .table .header .row.with-handle-sortable.with-handle-select{padding-right:60px}.table-con .table .header .row.with-handle-sortable.with-handle-children.with-handle-select{padding-right:90px}.table-con .table .header .row .cell{align-items:center;color:var(--black-light);display:flex;float:right;font-size:12px;font-weight:200;font-weight:400;height:45px;justify-content:center;position:relative}.table-con .table .header .row .cell.options{margin-left:auto;margin-right:auto}.table-con .table .header .row .handle-con{height:100%;position:absolute;right:0;top:0}.table-con .table .header .row .handle-con .handle{align-items:center;display:flex;float:right;height:100%;justify-content:center;width:30px}.table-con .table .header .row .handle-con .handle i{cursor:pointer;font-size:18px}.table-con .table .header .row .cell.sort{cursor:pointer}.table-con .table .header .row .cell .header-title{float:right;padding:0 15px;text-align:center;width:calc(100% - 20px)}.table-con .table .header .row .cell .header-search{float:right;width:calc(100% - 20px)}.table-con .table .header .row .cell .sort-icon{float:right;font-size:13px;height:20px;left:5px;line-height:20px;opacity:.6;top:calc(50% - 10px);width:20px}.table-con .table .body{float:right;position:relative;width:100%}::ng-deep .table-con:not(.sortable) .table lib-table-row:last-of-type>.row-con>.row:after{background-image:unset}::ng-deep .table-con .table .header .row .cell .select-row{cursor:pointer;font-size:18px;height:30px;line-height:30px}"]
3635
3632
  },] }
3636
3633
  ];
@@ -8421,7 +8418,6 @@
8421
8418
  return p.length > 0 ? this.getPermissionClass(p[0]) : null;
8422
8419
  };
8423
8420
  BaseComponent.prototype.getPermissionClass = function (p) {
8424
- console.log(p, 'getPermissionClass');
8425
8421
  return new PermissionClass(p.Name, p.Icon, p.Type, p.InputType, p.AccessType, p.InputAction, this.app.area, p.Controller, p.Action, p.Url, p.Multi, p.Condition, this.getPermissionAccessesClass(p.Id));
8426
8422
  };
8427
8423
  BaseComponent.prototype.getPermissionAccessesClass = function (parentId) {
@@ -8599,6 +8595,9 @@
8599
8595
  TableClass.prototype.data = function () {
8600
8596
  return this.rows.filter(function (x) { return x.selected; }).map(function (x) { return x.Data; });
8601
8597
  };
8598
+ TableClass.prototype.getOptionUrl = function (url, relatedId, rowId) {
8599
+ return (relatedId ? url.replace('{}', relatedId) : (url.match(/{}/g) || []).length > 1 ? url.replace('/{}', '') : url).replace('{}', rowId);
8600
+ };
8602
8601
  TableClass.prototype.searchData = function (report) {
8603
8602
  var e_1, _a, e_2, _b;
8604
8603
  if (report === void 0) { report = false; }
@@ -8760,14 +8759,28 @@
8760
8759
  }
8761
8760
  finally { if (e_3) throw e_3.error; }
8762
8761
  }
8763
- console.log(this.permissions.getOptions());
8764
- console.log(this.permissions.getOptions().filter(function (x) { return x.Multi; }));
8762
+ var _loop_2 = function (option) {
8763
+ var opt = new InputClass(this_2.environment, this_2.l, option.Name, option.Icon, exports.InputType.Icon, 'm-r-10-p');
8764
+ opt.onClick = function () {
8765
+ var p = new PermissionClass();
8766
+ p.RelatedId = _this.permissions.RelatedId;
8767
+ p.Area = _this.permissions.Area;
8768
+ p.Controller = option.Controller;
8769
+ p.Action = option.Action;
8770
+ var data = { Ids: _this.data().map(function (x) { return x.Id; }) };
8771
+ console.log(_this.getOptionUrl(option.Url, _this.permissions.RelatedId, ''));
8772
+ console.log(data);
8773
+ _this.showConfirm(_this.l(option.Action + 'ConfirmMulti'), _this.getOptionUrl(option.Url, _this.permissions.RelatedId, ''), data, function () {
8774
+ _this.load();
8775
+ });
8776
+ };
8777
+ this_2.extraButtons.push(opt);
8778
+ };
8779
+ var this_2 = this;
8765
8780
  try {
8766
8781
  for (var _e = __values(this.permissions.getOptions().filter(function (x) { return x.Multi; })), _f = _e.next(); !_f.done; _f = _e.next()) {
8767
- var multiOptions = _f.value;
8768
- console.log(multiOptions);
8769
- var option = new InputClass(this.environment, this.l, multiOptions.Name, multiOptions.Icon, exports.InputType.Icon, 'm-r-10-p');
8770
- this.extraButtons.push(option);
8782
+ var option = _f.value;
8783
+ _loop_2(option);
8771
8784
  }
8772
8785
  }
8773
8786
  catch (e_4_1) { e_4 = { error: e_4_1 }; }