ps-toolkit-ui 1.20.0 → 1.20.2

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.
@@ -3876,49 +3876,12 @@
3876
3876
  configurable: true
3877
3877
  });
3878
3878
  TableComponent.prototype.ngOnInit = function () {
3879
- var e_1, _a;
3880
3879
  var _this = this;
3881
3880
  this.reload = new InputClass(this.table.environment, this.table.l, 'Reload', 'fad fa-sync-alt', exports.InputType.Icon, 'm-r-10-p');
3882
- this.excel = new InputClass(this.table.environment, this.table.l, 'ExportExcel', 'fad fa-arrow-down-to-line f-s-21', exports.InputType.Icon, 'm-r-10-p');
3881
+ this.excel = new InputClass(this.table.environment, this.table.l, 'ExportExcel', 'fad fa-file-excel f-s-21', exports.InputType.Icon, 'm-r-10-p');
3883
3882
  this.maximum = new InputClass(this.table.environment, this.table.l, 'Maximum', 'fad fa-arrows-maximize', exports.InputType.Icon, 'm-r-10-p');
3884
3883
  this.expertSearch = new InputClass(this.table.environment, this.table.l, 'ExpertSearch', 'fad fa-magnifying-glass', exports.InputType.Icon, 'm-r-10-p');
3885
- try {
3886
- for (var _b = __values(this.table.cols.filter(function (x) { return x.withSearch; })), _c = _b.next(); !_c.done; _c = _b.next()) {
3887
- var c = _c.value;
3888
- c.search = new InputClass(this.table.environment, this.table.l, c.name, null, exports.InputType.Text, 'h-25 table-search', c.searchDefault);
3889
- if (c.type === exports.TableCollType.Date || c.type === exports.TableCollType.DateTime || c.type === exports.TableCollType.DateDif || c.type === exports.TableCollType.DateRemain) {
3890
- c.search.type = exports.InputType.Date;
3891
- }
3892
- else if (c.type === exports.TableCollType.Month) {
3893
- c.search.type = exports.InputType.Month;
3894
- }
3895
- else if (c.type === exports.TableCollType.Year) {
3896
- c.search.type = exports.InputType.Year;
3897
- }
3898
- else if (c.type === exports.TableCollType.Price) {
3899
- c.search.type = exports.InputType.Price;
3900
- }
3901
- else if (c.enum != null) {
3902
- c.search.type = exports.InputType.Select;
3903
- c.search.options = [new OptionClass('', '-1')].concat(EnumUtils.getKeysAndValues(c.enum).map(function (x) { return new OptionClass(_this.table.l(x.key), x.value.toString()); }));
3904
- }
3905
- else {
3906
- c.search.type = exports.InputType.Text;
3907
- }
3908
- c.search.displayLabel = false;
3909
- c.search.onChange = function () {
3910
- _this.table.page = 1;
3911
- _this.table.load();
3912
- };
3913
- }
3914
- }
3915
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
3916
- finally {
3917
- try {
3918
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
3919
- }
3920
- finally { if (e_1) throw e_1.error; }
3921
- }
3884
+ this.table.setCols();
3922
3885
  if (this.table.sortable) {
3923
3886
  this.table.perPage = -1;
3924
3887
  this.table.onLoad = function () {
@@ -9293,6 +9256,47 @@
9293
9256
  TableClass.prototype.data = function () {
9294
9257
  return this.rows.filter(function (x) { return x.checked; }).map(function (x) { return x.Data; });
9295
9258
  };
9259
+ TableClass.prototype.setCols = function () {
9260
+ var e_1, _c;
9261
+ var _this = this;
9262
+ try {
9263
+ for (var _d = __values(this.cols.filter(function (x) { return x.withSearch; })), _e = _d.next(); !_e.done; _e = _d.next()) {
9264
+ var c = _e.value;
9265
+ c.search = new InputClass(this.environment, this.l, c.name, null, exports.InputType.Text, 'h-25 table-search', c.searchDefault);
9266
+ if (c.type === exports.TableCollType.Date || c.type === exports.TableCollType.DateTime || c.type === exports.TableCollType.DateDif || c.type === exports.TableCollType.DateRemain) {
9267
+ c.search.type = exports.InputType.Date;
9268
+ }
9269
+ else if (c.type === exports.TableCollType.Month) {
9270
+ c.search.type = exports.InputType.Month;
9271
+ }
9272
+ else if (c.type === exports.TableCollType.Year) {
9273
+ c.search.type = exports.InputType.Year;
9274
+ }
9275
+ else if (c.type === exports.TableCollType.Price) {
9276
+ c.search.type = exports.InputType.Price;
9277
+ }
9278
+ else if (c.enum != null) {
9279
+ c.search.type = exports.InputType.Select;
9280
+ c.search.options = [new OptionClass('', '-1')].concat(EnumUtils.getKeysAndValues(c.enum).map(function (x) { return new OptionClass(_this.l(x.key), x.value.toString()); }));
9281
+ }
9282
+ else {
9283
+ c.search.type = exports.InputType.Text;
9284
+ }
9285
+ c.search.displayLabel = false;
9286
+ c.search.onChange = function () {
9287
+ _this.page = 1;
9288
+ _this.load();
9289
+ };
9290
+ }
9291
+ }
9292
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
9293
+ finally {
9294
+ try {
9295
+ if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
9296
+ }
9297
+ finally { if (e_1) throw e_1.error; }
9298
+ }
9299
+ };
9296
9300
  TableClass.prototype.sendRequest = function (btn) {
9297
9301
  var _this = this;
9298
9302
  if (btn === void 0) { btn = null; }
@@ -9385,7 +9389,7 @@
9385
9389
  return (relatedId ? url.replace('{}', relatedId) : (url.match(/{}/g) || []).length > 1 ? url.replace('/{}', '') : url).replace('{}', rowId);
9386
9390
  };
9387
9391
  TableClass.prototype.searchData = function (report) {
9388
- var e_1, _c;
9392
+ var e_2, _c;
9389
9393
  if (report === void 0) { report = false; }
9390
9394
  var d = {};
9391
9395
  if (!report) {
@@ -9410,12 +9414,12 @@
9410
9414
  this.addData(d, c.name, vl);
9411
9415
  }
9412
9416
  }
9413
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
9417
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
9414
9418
  finally {
9415
9419
  try {
9416
9420
  if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
9417
9421
  }
9418
- finally { if (e_1) throw e_1.error; }
9422
+ finally { if (e_2) throw e_2.error; }
9419
9423
  }
9420
9424
  if (this.withRelatedRow) {
9421
9425
  d = Object.assign({}, d, this.relatedRow);
@@ -9423,7 +9427,7 @@
9423
9427
  return this.searchForm ? this.searchForm.data(d) : d;
9424
9428
  };
9425
9429
  TableClass.prototype.addData = function (d, name, vl) {
9426
- var e_2, _c;
9430
+ var e_3, _c;
9427
9431
  if (typeof vl === 'object' && !(vl instanceof Array)) {
9428
9432
  try {
9429
9433
  for (var _d = __values(Object.entries(vl)), _e = _d.next(); !_e.done; _e = _d.next()) {
@@ -9433,12 +9437,12 @@
9433
9437
  }
9434
9438
  }
9435
9439
  }
9436
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
9440
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
9437
9441
  finally {
9438
9442
  try {
9439
9443
  if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
9440
9444
  }
9441
- finally { if (e_2) throw e_2.error; }
9445
+ finally { if (e_3) throw e_3.error; }
9442
9446
  }
9443
9447
  }
9444
9448
  else {
@@ -9468,7 +9472,7 @@
9468
9472
  this.modal.show(data);
9469
9473
  };
9470
9474
  TableClass.prototype.set = function (changeRows) {
9471
- var e_3, _c, e_4, _d;
9475
+ var e_4, _c, e_5, _d;
9472
9476
  var _this = this;
9473
9477
  if (changeRows === void 0) { changeRows = null; }
9474
9478
  this.permission = true;
@@ -9578,12 +9582,12 @@
9578
9582
  _loop_1(access);
9579
9583
  }
9580
9584
  }
9581
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
9585
+ catch (e_4_1) { e_4 = { error: e_4_1 }; }
9582
9586
  finally {
9583
9587
  try {
9584
9588
  if (_f && !_f.done && (_c = _e.return)) _c.call(_e);
9585
9589
  }
9586
- finally { if (e_3) throw e_3.error; }
9590
+ finally { if (e_4) throw e_4.error; }
9587
9591
  }
9588
9592
  var _loop_2 = function (option) {
9589
9593
  var opt = new InputClass(this_2.environment, this_2.l, option.Name, option.Icon, exports.InputType.Icon, 'm-r-10-p');
@@ -9620,12 +9624,12 @@
9620
9624
  _loop_2(option);
9621
9625
  }
9622
9626
  }
9623
- catch (e_4_1) { e_4 = { error: e_4_1 }; }
9627
+ catch (e_5_1) { e_5 = { error: e_5_1 }; }
9624
9628
  finally {
9625
9629
  try {
9626
9630
  if (_h && !_h.done && (_d = _g.return)) _d.call(_g);
9627
9631
  }
9628
- finally { if (e_4) throw e_4.error; }
9632
+ finally { if (e_5) throw e_5.error; }
9629
9633
  }
9630
9634
  if (this.form) {
9631
9635
  this.form.addButtons('Save', this.permissions.Type === exports.PermissionTypeEnum.Form ? 'green w-10 only-icon f-l' : 'green', this.permissions.Type !== exports.PermissionTypeEnum.Form, this.permissions.getAccesses().some(function (x) { return x.AccessType === exports.PermissionAccessTypeEnum.Insert; }), this.permissions.Type === exports.PermissionTypeEnum.Form ? function (data) {
@@ -9695,7 +9699,7 @@
9695
9699
  }
9696
9700
  };
9697
9701
  TableClass.prototype.getCell = function (row, col) {
9698
- var e_5, _c;
9702
+ var e_6, _c;
9699
9703
  // console.log('getCell');
9700
9704
  var cv = _.get(row.Data, col.name);
9701
9705
  if (cv === null) {
@@ -9760,12 +9764,12 @@
9760
9764
  }
9761
9765
  }
9762
9766
  }
9763
- catch (e_5_1) { e_5 = { error: e_5_1 }; }
9767
+ catch (e_6_1) { e_6 = { error: e_6_1 }; }
9764
9768
  finally {
9765
9769
  try {
9766
9770
  if (cv_1_1 && !cv_1_1.done && (_c = cv_1.return)) _c.call(cv_1);
9767
9771
  }
9768
- finally { if (e_5) throw e_5.error; }
9772
+ finally { if (e_6) throw e_6.error; }
9769
9773
  }
9770
9774
  return files;
9771
9775
  }