ps-toolkit-ui 0.0.133 → 0.0.137

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.
@@ -2590,7 +2590,7 @@
2590
2590
  var _loop_1 = function (option) {
2591
2591
  var opt = new InputClass(this_1.table.environment, this_1.table.l, option.Name, option.Icon, option.InputType === exports.PermissionInputTypeEnum.Icon ? exports.InputType.Icon : exports.InputType.Button, 'blue h-25 m-h-5 d-ib va-m f-u');
2592
2592
  opt.row = this_1.row;
2593
- if (option.Action === 'Update') {
2593
+ if (option.AcceessType === exports.PermissionAccessTypeEnum.Update) {
2594
2594
  if (this_1.table.form) {
2595
2595
  opt.onClick = function () {
2596
2596
  _this.table.form.url = _this.table.url + 'Update/' + _this.row.Data.Id;
@@ -2621,7 +2621,7 @@
2621
2621
  opt.url = this_1.table.url + '/Update/' + this_1.row.Data.Id;
2622
2622
  }
2623
2623
  }
2624
- else if (option.Action === 'Delete') {
2624
+ else if (option.AcceessType === exports.PermissionAccessTypeEnum.Delete) {
2625
2625
  opt.class = opt.class.replace('blue', 'red');
2626
2626
  opt.onClick = function () {
2627
2627
  if (_this.table.form) {
@@ -7237,48 +7237,58 @@
7237
7237
  this.permission = false;
7238
7238
  return;
7239
7239
  }
7240
- try {
7241
- for (var _b = __values(this.permissions.getAccesses().filter(function (x) { return x.InputAction !== exports.PermissionInputActionEnum.None; })), _c = _b.next(); !_c.done; _c = _b.next()) {
7242
- var access = _c.value;
7243
- var accessInp = new InputClass(this.environment, this.l, access.Name, access.Icon, access.InputType === exports.PermissionInputTypeEnum.Button ? exports.InputType.Button : exports.InputType.Icon, 'blue w-u h-30');
7244
- if (access.Action === 'Insert') {
7245
- accessInp.class = accessInp.class.replace('blue', 'green');
7246
- if (this.form) {
7247
- this.form.url = this.form.baseUrl = this.url + 'Insert';
7248
- if (!this.form.onTop) {
7249
- accessInp.onClick = function () {
7250
- _this.form.onSuccessBase = function () {
7251
- _this.modal.hide();
7252
- _this.load();
7253
- };
7254
- _this.showInsertModal();
7240
+ var _loop_1 = function (access) {
7241
+ if (this_1.buttons.filter(function (x) { return x.name === access.Name; }).length > 0) {
7242
+ return "continue";
7243
+ }
7244
+ var accessInp = new InputClass(this_1.environment, this_1.l, access.Name, access.Icon, access.InputType === exports.PermissionInputTypeEnum.Button ? exports.InputType.Button : exports.InputType.Icon, 'blue w-u h-30');
7245
+ if (access.AccessType === exports.PermissionAccessTypeEnum.Insert) {
7246
+ accessInp.class = accessInp.class.replace('blue', 'green');
7247
+ console.log(this_1.name, this_1.form, '111111111111');
7248
+ if (this_1.form) {
7249
+ this_1.form.url = this_1.form.baseUrl = this_1.url + 'Insert';
7250
+ if (!this_1.form.onTop) {
7251
+ accessInp.onClick = function () {
7252
+ _this.form.onSuccessBase = function () {
7253
+ _this.modal.hide();
7254
+ _this.load();
7255
7255
  };
7256
- }
7257
- else {
7258
- this.form.displayLabel = false;
7259
- }
7256
+ _this.showInsertModal();
7257
+ };
7260
7258
  }
7261
7259
  else {
7262
- if (this.modal) {
7263
- accessInp.onClick = function () {
7264
- _this.modal.show();
7265
- };
7266
- }
7267
- else {
7268
- accessInp.url = this.url + 'Insert';
7269
- }
7260
+ this_1.form.displayLabel = false;
7261
+ console.log(this_1.form, '222222222');
7262
+ return "continue";
7270
7263
  }
7271
7264
  }
7272
- else if (access.InputAction === exports.PermissionInputActionEnum.Report) {
7273
- var p = new PermissionClass();
7274
- p.RelatedId = 'Index';
7275
- p.Area = this.permissions.Area;
7276
- p.Controller = 'Print';
7277
- p.Action = this.permissions.Controller;
7278
- accessInp.url = '/Report' + p.getUrl();
7279
- accessInp.urlNewTab = true;
7265
+ else {
7266
+ if (this_1.modal) {
7267
+ accessInp.onClick = function () {
7268
+ _this.modal.show();
7269
+ };
7270
+ }
7271
+ else {
7272
+ accessInp.url = this_1.url + 'Insert';
7273
+ }
7280
7274
  }
7281
- this.buttons.push(accessInp);
7275
+ }
7276
+ else if (access.InputAction === exports.PermissionInputActionEnum.Report) {
7277
+ var p = new PermissionClass();
7278
+ p.RelatedId = 'Index';
7279
+ p.Area = this_1.permissions.Area;
7280
+ p.Controller = 'Print';
7281
+ p.Action = this_1.permissions.Controller;
7282
+ accessInp.url = '/Report' + p.getUrl();
7283
+ accessInp.urlNewTab = true;
7284
+ }
7285
+ this_1.buttons.push(accessInp);
7286
+ };
7287
+ var this_1 = this;
7288
+ try {
7289
+ for (var _b = __values(this.permissions.getAccesses().filter(function (x) { return x.InputAction !== exports.PermissionInputActionEnum.None; })), _c = _b.next(); !_c.done; _c = _b.next()) {
7290
+ var access = _c.value;
7291
+ _loop_1(access);
7282
7292
  }
7283
7293
  }
7284
7294
  catch (e_2_1) { e_2 = { error: e_2_1 }; }