ps-toolkit-ui 1.7.19 → 1.7.20

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.
@@ -1674,6 +1674,14 @@
1674
1674
  }, 500);
1675
1675
  });
1676
1676
  };
1677
+ FormClass.prototype.focus = function () {
1678
+ var i = this.inputs.find(function (x) { return !x.disabled && x.type !== exports.InputType.Label && x.type !== exports.InputType.Hidden &&
1679
+ x.type !== exports.InputType.Constant && x.type !== exports.InputType.Submit && x.type !== exports.InputType.Button && x.type !== exports.InputType.Icon &&
1680
+ x.type !== exports.InputType.Check; });
1681
+ if (i) {
1682
+ i.focus();
1683
+ }
1684
+ };
1677
1685
  FormClass.prototype.submit = function (onSubmit) {
1678
1686
  if (onSubmit === void 0) { onSubmit = null; }
1679
1687
  new RequestClass(this.environment, this.l).postForm(this, onSubmit);
@@ -1695,6 +1703,9 @@
1695
1703
  this.url = this.baseUrl;
1696
1704
  this.setButtons(this.onTop, false);
1697
1705
  this.clearInputs();
1706
+ if (this.onTop) {
1707
+ this.focus();
1708
+ }
1698
1709
  };
1699
1710
  FormClass.prototype.clearInputs = function () {
1700
1711
  this.inputs.filter(function (x) { return x.type !== exports.InputType.Constant; }).forEach(function (inp) {
@@ -3110,12 +3121,7 @@
3110
3121
  $__namespace('body').addClass('open-modal');
3111
3122
  $__namespace('#' + this.id + 'Modal').fadeIn(300, function () {
3112
3123
  if (_this.form != null) {
3113
- var i = _this.form.inputs.find(function (x) { return !x.disabled && x.type !== exports.InputType.Label && x.type !== exports.InputType.Hidden &&
3114
- x.type !== exports.InputType.Constant && x.type !== exports.InputType.Submit && x.type !== exports.InputType.Button && x.type !== exports.InputType.Icon &&
3115
- x.type !== exports.InputType.Check; });
3116
- if (i) {
3117
- i.focus();
3118
- }
3124
+ _this.form.focus();
3119
3125
  }
3120
3126
  });
3121
3127
  };
@@ -6826,7 +6832,6 @@
6826
6832
  return true;
6827
6833
  };
6828
6834
  this.inp.clear = function () {
6829
- console.log(_this.inp.clear);
6830
6835
  _this.inp.error = null;
6831
6836
  _this.inp.setValue(null, false);
6832
6837
  _this.changeType(exports.VehicleType.Car);
@@ -6849,7 +6854,51 @@
6849
6854
  };
6850
6855
  };
6851
6856
  FormVehicleSearchComponent.prototype.changeType = function (t) {
6857
+ var _this = this;
6852
6858
  this.type = t;
6859
+ if (this.wsAuth != null) {
6860
+ this.wsAuth.close();
6861
+ }
6862
+ if (t === exports.VehicleType.Fingerprint) {
6863
+ this.fingerprint.loading = true;
6864
+ this.fingerprint.placeholder = this.inp.l('LoadingText', 'Waiting');
6865
+ this.fingerprint.value = null;
6866
+ this.fingerprint.search = null;
6867
+ this.wsAuth = new WebSocket('ws://localhost:7890/Auth');
6868
+ this.wsAuth.onopen = function () {
6869
+ };
6870
+ this.wsAuth.onmessage = function (evt) {
6871
+ if (_this.wsAuth != null) {
6872
+ _this.wsAuth.close();
6873
+ }
6874
+ if (evt.data === 'Notfound') {
6875
+ HelperClass.addNotification(_this.inp.l('NotfoundTitle'));
6876
+ _this.fingerprint.placeholder = _this.inp.l('NotfoundTitle');
6877
+ _this.fingerprint.value = null;
6878
+ _this.fingerprint.search = null;
6879
+ _this.fingerprint.loading = false;
6880
+ }
6881
+ else if (evt.data.startsWith('Error')) {
6882
+ HelperClass.addNotification(evt.data);
6883
+ _this.fingerprint.placeholder = _this.inp.l('NotfoundTitle');
6884
+ _this.fingerprint.value = null;
6885
+ _this.fingerprint.search = null;
6886
+ _this.fingerprint.loading = false;
6887
+ }
6888
+ else {
6889
+ var user = JSON.parse(evt.data);
6890
+ _this.fingerprint.value = user.Id;
6891
+ _this.fingerprint.search = user.Name;
6892
+ _this.fingerprint.loading = false;
6893
+ }
6894
+ _this.wsAuth.close();
6895
+ _this.wsAuth = null;
6896
+ };
6897
+ this.wsAuth.onclose = function () {
6898
+ };
6899
+ }
6900
+ this.car.url = this.motor.url = this.carF.url = this.carG.url = this.driver.url = this.inp.url.replace('_{}', '_' + this.type);
6901
+ this.onFocusIn();
6853
6902
  };
6854
6903
  FormVehicleSearchComponent.prototype.onFocusIn = function () {
6855
6904
  var _this = this;