* Check if the given value is within the `minimumValue` and `maximumValue` range, while using the override options set with `overrideMinMaxLimits`. * The minimum and maximum limit test results are returned in an array like `[isMinimumLimitRespected, isMaximumLimitRespected]`. * * @par
(value, settings)
| 6039 | * @returns {[boolean, boolean]} |
| 6040 | */ |
| 6041 | static _checkIfInRangeWithOverrideOption(value, settings) { |
| 6042 | if ((AutoNumericHelper.isNull(value) && settings.emptyInputBehavior === AutoNumeric.options.emptyInputBehavior.null) || // When the `null` value is accepted as the `rawValue`, the limits are ignored |
| 6043 | settings.overrideMinMaxLimits === AutoNumeric.options.overrideMinMaxLimits.ignore || |
| 6044 | settings.overrideMinMaxLimits === AutoNumeric.options.overrideMinMaxLimits.invalid) { |
| 6045 | return [true, true]; |
| 6046 | } |
| 6047 | |
| 6048 | value = value.toString(); |
| 6049 | value = value.replace(',', '.'); |
| 6050 | const minParse = AutoNumericHelper.parseStr(settings.minimumValue); |
| 6051 | const maxParse = AutoNumericHelper.parseStr(settings.maximumValue); |
| 6052 | const valParse = AutoNumericHelper.parseStr(value); |
| 6053 | |
| 6054 | let result; |
| 6055 | switch (settings.overrideMinMaxLimits) { |
| 6056 | case AutoNumeric.options.overrideMinMaxLimits.floor: |
| 6057 | result = [AutoNumericHelper.testMinMax(minParse, valParse) > -1, true]; |
| 6058 | break; |
| 6059 | case AutoNumeric.options.overrideMinMaxLimits.ceiling: |
| 6060 | result = [true, AutoNumericHelper.testMinMax(maxParse, valParse) < 1]; |
| 6061 | break; |
| 6062 | default: |
| 6063 | result = [AutoNumericHelper.testMinMax(minParse, valParse) > -1, AutoNumericHelper.testMinMax(maxParse, valParse) < 1]; |
| 6064 | } |
| 6065 | |
| 6066 | return result; |
| 6067 | } |
| 6068 | |
| 6069 | /** |
| 6070 | * Returns `true` if the given value is within the `minimumValue` and `maximumValue` limits, while using the override options set with `overrideMinMaxLimits`, `false` otherwise |
no test coverage detected