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.
@@ -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() {
@@ -5909,8 +5911,12 @@ class FormSelectComponent {
5909
5911
  d[this.inp.name + 'Name'] = this.inp.getSelectedName();
5910
5912
  return d;
5911
5913
  }
5912
- d[this.inp.name] = this.inp.addNew ? this.inp.search : this.inp.value;
5914
+ d[this.inp.name] = this.inp.value;
5913
5915
  d[this.inp.name + 'Name'] = this.inp.search;
5916
+ if (this.inp.addNew) {
5917
+ d[this.inp.name] = this.inp.search;
5918
+ d[this.inp.name + 'Id'] = this.inp.value;
5919
+ }
5914
5920
  return d;
5915
5921
  };
5916
5922
  this.inp.focusOut = () => {
@@ -6108,6 +6114,7 @@ class FormSelectComponent {
6108
6114
  this.inp.value = op.value;
6109
6115
  this.inp.options.find(x => x.value === op.parent.value).options.forEach(x => x.selected = false);
6110
6116
  op.selected = true;
6117
+ op.priority = this.priority++;
6111
6118
  }
6112
6119
  }
6113
6120
  toggle(op) {
@@ -6128,6 +6135,7 @@ class FormSelectComponent {
6128
6135
  }
6129
6136
  check(c) {
6130
6137
  c.selected = true;
6138
+ c.priority = this.priority++;
6131
6139
  if (this.inp.onlyChild) {
6132
6140
  this.checkChildren(c);
6133
6141
  }
@@ -6152,6 +6160,7 @@ class FormSelectComponent {
6152
6160
  }
6153
6161
  else {
6154
6162
  p.selected = true;
6163
+ p.priority = this.priority++;
6155
6164
  }
6156
6165
  this.checkParent(p.parent);
6157
6166
  }