ps-toolkit-ui 1.22.20 → 1.22.22

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.
@@ -2758,7 +2758,7 @@
2758
2758
  }
2759
2759
  finally { if (e_8) throw e_8.error; }
2760
2760
  }
2761
- return l;
2761
+ return l.sort(function (a, b) { return a.priority - b.priority; });
2762
2762
  };
2763
2763
  InputClass.prototype.getSelectedRows = function (rows) {
2764
2764
  var e_9, _c;
@@ -2815,6 +2815,7 @@
2815
2815
  if (dis === void 0) { dis = false; }
2816
2816
  this.show = true;
2817
2817
  this.selected = false;
2818
+ this.priority = 0;
2818
2819
  this.parent = null;
2819
2820
  this.loading = false;
2820
2821
  this.disabled = false;
@@ -6906,6 +6907,7 @@
6906
6907
  function FormSelectComponent() {
6907
6908
  this.changeIndex = new core.EventEmitter();
6908
6909
  this.cSearch = '';
6910
+ this.priority = 0;
6909
6911
  }
6910
6912
  Object.defineProperty(FormSelectComponent.prototype, "type", {
6911
6913
  get: function () { return exports.InputType; },
@@ -6926,6 +6928,7 @@
6926
6928
  if (v != null) {
6927
6929
  _this.inp.value = v.map(String);
6928
6930
  _this.setValue(v.map(String));
6931
+ _this.priority = v.map(String).length;
6929
6932
  }
6930
6933
  }
6931
6934
  };
@@ -6959,6 +6962,7 @@
6959
6962
  }
6960
6963
  else {
6961
6964
  _this.setValue([]);
6965
+ _this.priority = 0;
6962
6966
  }
6963
6967
  if (_this.inp.rel != null) {
6964
6968
  _this.inp.rel.options = [];
@@ -6978,7 +6982,6 @@
6978
6982
  d[_this.inp.name + 'Name'] = _this.inp.search;
6979
6983
  if (_this.inp.addNew) {
6980
6984
  d[_this.inp.name] = _this.inp.search;
6981
- d[_this.inp.name + 'Name'] = _this.inp.search;
6982
6985
  d[_this.inp.name + 'Id'] = _this.inp.value;
6983
6986
  }
6984
6987
  return d;
@@ -7005,6 +7008,9 @@
7005
7008
  for (var rows_1 = __values(rows), rows_1_1 = rows_1.next(); !rows_1_1.done; rows_1_1 = rows_1.next()) {
7006
7009
  var r = rows_1_1.value;
7007
7010
  r.selected = ids.includes(r.value);
7011
+ if (r.selected) {
7012
+ r.priority = ids.indexOf(r.value);
7013
+ }
7008
7014
  if (this.inp.onlyChild) {
7009
7015
  if (r.selected) {
7010
7016
  this.checkParent(r.parent);
@@ -7194,6 +7200,7 @@
7194
7200
  this.inp.value = op.value;
7195
7201
  this.inp.options.find(function (x) { return x.value === op.parent.value; }).options.forEach(function (x) { return x.selected = false; });
7196
7202
  op.selected = true;
7203
+ op.priority = this.priority++;
7197
7204
  }
7198
7205
  };
7199
7206
  FormSelectComponent.prototype.toggle = function (op) {
@@ -7214,6 +7221,7 @@
7214
7221
  };
7215
7222
  FormSelectComponent.prototype.check = function (c) {
7216
7223
  c.selected = true;
7224
+ c.priority = this.priority++;
7217
7225
  if (this.inp.onlyChild) {
7218
7226
  this.checkChildren(c);
7219
7227
  }
@@ -7240,6 +7248,7 @@
7240
7248
  }
7241
7249
  else {
7242
7250
  p.selected = true;
7251
+ p.priority = this.priority++;
7243
7252
  }
7244
7253
  this.checkParent(p.parent);
7245
7254
  }