ps-toolkit-ui 1.5.2 → 1.5.3

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.
@@ -4841,20 +4841,7 @@
4841
4841
  }
4842
4842
  };
4843
4843
  this.inp.isValid = function () {
4844
- _this.inp.value = _this.getValue();
4845
- if (_this.inp.required && !_this.inp.value) {
4846
- _this.inp.error = exports.InputError.Required;
4847
- return false;
4848
- }
4849
- if (!_this.inp.required && !_this.inp.value) {
4850
- return true;
4851
- }
4852
- if (_this.inp.required && _this.inp.type === exports.InputType.Plaque &&
4853
- (!_this.part1.isValid() || !_this.part2.isValid() || !_this.part3.isValid() || !_this.part4.isValid())) {
4854
- _this.inp.error = exports.InputError.Invalid;
4855
- return false;
4856
- }
4857
- if (_this.inp.required && (_this.inp.type === exports.InputType.PlaqueM || _this.inp.type === exports.InputType.PlaqueF) && (!_this.part1.isValid() || !_this.part3.isValid())) {
4844
+ if (!_this.isValid()) {
4858
4845
  _this.inp.error = exports.InputError.Invalid;
4859
4846
  return false;
4860
4847
  }
@@ -4873,6 +4860,13 @@
4873
4860
  _this.onFocusIn();
4874
4861
  };
4875
4862
  };
4863
+ FormPlaqueComponent.prototype.isValid = function () {
4864
+ if (this.inp.required && this.inp.type === exports.InputType.Plaque &&
4865
+ (!this.part1.isValid() || !this.part2.isValid() || !this.part3.isValid() || !this.part4.isValid())) {
4866
+ return false;
4867
+ }
4868
+ return !(this.inp.required && (this.inp.type === exports.InputType.PlaqueM || this.inp.type === exports.InputType.PlaqueF) && (!this.part1.isValid() || !this.part3.isValid()));
4869
+ };
4876
4870
  FormPlaqueComponent.prototype.changeFocus = function (p, a) {
4877
4871
  if (this.inp.type === exports.InputType.Plaque) {
4878
4872
  if (p === 'Part1') {
@@ -4952,9 +4946,9 @@
4952
4946
  }
4953
4947
  };
4954
4948
  FormPlaqueComponent.prototype.getValue = function () {
4955
- return this.inp.type === exports.InputType.Plaque ?
4949
+ return this.isValid() ? (this.inp.type === exports.InputType.Plaque ?
4956
4950
  (this.part1.value ? this.part1.value : '') + "_" + (this.part2.value ? this.part2.value : '') + "_" + (this.part3.value ? this.part3.value : '') + "_" + (this.part4.value ? this.part4.value : '') :
4957
- (this.part1.value ? this.part1.value : '') + "_" + (this.part3.value ? this.part3.value : '');
4951
+ (this.part1.value ? this.part1.value : '') + "_" + (this.part3.value ? this.part3.value : '')) : null;
4958
4952
  };
4959
4953
  return FormPlaqueComponent;
4960
4954
  }());