ps-toolkit-ui 1.22.20 → 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.
@@ -2083,7 +2083,7 @@ class InputClass {
2083
2083
  const rs = this.getSelectedOptions(f.options);
2084
2084
  l = l.concat(rs);
2085
2085
  }
2086
- return l;
2086
+ return l.sort((a, b) => a.priority - b.priority);
2087
2087
  }
2088
2088
  getSelectedRows(rows = this.rows) {
2089
2089
  let l = [];
@@ -2112,6 +2112,7 @@ class OptionClass {
2112
2112
  constructor(name, value, options = [], cls = null, dis = false) {
2113
2113
  this.show = true;
2114
2114
  this.selected = false;
2115
+ this.priority = 0;
2115
2116
  this.parent = null;
2116
2117
  this.loading = false;
2117
2118
  this.disabled = false;
@@ -5846,6 +5847,7 @@ class FormSelectComponent {
5846
5847
  constructor() {
5847
5848
  this.changeIndex = new EventEmitter();
5848
5849
  this.cSearch = '';
5850
+ this.priority = 0;
5849
5851
  }
5850
5852
  get type() { return InputType; }
5851
5853
  ngOnInit() {
@@ -5913,7 +5915,6 @@ class FormSelectComponent {
5913
5915
  d[this.inp.name + 'Name'] = this.inp.search;
5914
5916
  if (this.inp.addNew) {
5915
5917
  d[this.inp.name] = this.inp.search;
5916
- d[this.inp.name + 'Name'] = this.inp.search;
5917
5918
  d[this.inp.name + 'Id'] = this.inp.value;
5918
5919
  }
5919
5920
  return d;
@@ -6113,6 +6114,7 @@ class FormSelectComponent {
6113
6114
  this.inp.value = op.value;
6114
6115
  this.inp.options.find(x => x.value === op.parent.value).options.forEach(x => x.selected = false);
6115
6116
  op.selected = true;
6117
+ op.priority = this.priority++;
6116
6118
  }
6117
6119
  }
6118
6120
  toggle(op) {
@@ -6133,6 +6135,7 @@ class FormSelectComponent {
6133
6135
  }
6134
6136
  check(c) {
6135
6137
  c.selected = true;
6138
+ c.priority = this.priority++;
6136
6139
  if (this.inp.onlyChild) {
6137
6140
  this.checkChildren(c);
6138
6141
  }
@@ -6157,6 +6160,7 @@ class FormSelectComponent {
6157
6160
  }
6158
6161
  else {
6159
6162
  p.selected = true;
6163
+ p.priority = this.priority++;
6160
6164
  }
6161
6165
  this.checkParent(p.parent);
6162
6166
  }