ps-toolkit-ui 1.22.18 → 1.22.21

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; },
@@ -6974,8 +6976,12 @@
6974
6976
  d[_this.inp.name + 'Name'] = _this.inp.getSelectedName();
6975
6977
  return d;
6976
6978
  }
6977
- d[_this.inp.name] = _this.inp.addNew ? _this.inp.search : _this.inp.value;
6979
+ d[_this.inp.name] = _this.inp.value;
6978
6980
  d[_this.inp.name + 'Name'] = _this.inp.search;
6981
+ if (_this.inp.addNew) {
6982
+ d[_this.inp.name] = _this.inp.search;
6983
+ d[_this.inp.name + 'Id'] = _this.inp.value;
6984
+ }
6979
6985
  return d;
6980
6986
  };
6981
6987
  this.inp.focusOut = function () {
@@ -7189,6 +7195,7 @@
7189
7195
  this.inp.value = op.value;
7190
7196
  this.inp.options.find(function (x) { return x.value === op.parent.value; }).options.forEach(function (x) { return x.selected = false; });
7191
7197
  op.selected = true;
7198
+ op.priority = this.priority++;
7192
7199
  }
7193
7200
  };
7194
7201
  FormSelectComponent.prototype.toggle = function (op) {
@@ -7209,6 +7216,7 @@
7209
7216
  };
7210
7217
  FormSelectComponent.prototype.check = function (c) {
7211
7218
  c.selected = true;
7219
+ c.priority = this.priority++;
7212
7220
  if (this.inp.onlyChild) {
7213
7221
  this.checkChildren(c);
7214
7222
  }
@@ -7235,6 +7243,7 @@
7235
7243
  }
7236
7244
  else {
7237
7245
  p.selected = true;
7246
+ p.priority = this.priority++;
7238
7247
  }
7239
7248
  this.checkParent(p.parent);
7240
7249
  }