@eturnity/eturnity_reusable_components 8.22.17 → 8.22.18

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.
@@ -1002,18 +1002,21 @@
1002
1002
  this.textInput = evaluatedVal
1003
1003
  },
1004
1004
  onInputBlur(e) {
1005
+ const defaultNumber =
1006
+ this.defaultNumber || this.defaultNumber === 0
1007
+ ? this.defaultNumber
1008
+ : this.minNumber || this.minNumber === 0
1009
+ ? this.minNumber
1010
+ : null
1005
1011
  this.isFocused = false
1006
1012
  let evaluatedVal
1007
1013
  try {
1008
1014
  evaluatedVal = this.onEvaluateCode(this.enteredValue)
1009
1015
  } finally {
1010
1016
  this.inputValue = this.onChangeHandler(evaluatedVal)
1011
- if (
1012
- this.enteredval != '' &&
1013
- this.inputValue !== undefined &&
1014
- !Number.isNaN(this.inputValue) &&
1015
- typeof this.inputValue == 'number'
1016
- ) {
1017
+ if (isNaN(this.inputValue) && this.enteredval === undefined) {
1018
+ this.$emit(EVENT_TYPES.INPUT_BLUR, defaultNumber)
1019
+ } else if (!isNaN(this.inputValue)) {
1017
1020
  this.$emit(EVENT_TYPES.INPUT_BLUR, this.inputValue)
1018
1021
  }
1019
1022
  }
@@ -1024,11 +1027,15 @@
1024
1027
  }
1025
1028
  this.isFocused = true
1026
1029
  this.textInput = this.formatWithCurrency(this.value)
1030
+
1027
1031
  this.enteredValue = stringToNumber({
1028
1032
  value: this.textInput,
1029
1033
  numberPrecision: this.numberPrecision,
1030
1034
  minDecimals: this.minDecimals,
1031
1035
  })
1036
+ if (isNaN(this.enteredValue)) {
1037
+ this.enteredValue = ''
1038
+ }
1032
1039
  this.$nextTick(() => {
1033
1040
  this.$refs.inputField1.$el.select()
1034
1041
  })