@syncfusion/ej2-inputs 31.2.10 → 31.2.12

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.
@@ -1862,10 +1862,7 @@ let NumericTextBox = class NumericTextBox extends Component {
1862
1862
  modifyText() {
1863
1863
  if (this.value || this.value === 0) {
1864
1864
  const value = this.formatNumber();
1865
- let elementValue = this.isFocused ? value : this.instance.getNumberFormat(this.cultureInfo)(this.value);
1866
- if (/[eE]/.test(value)) {
1867
- elementValue = this.formatScientificNotation(elementValue);
1868
- }
1865
+ const elementValue = this.isFocused ? value : this.instance.getNumberFormat(this.cultureInfo)(this.value);
1869
1866
  this.setElementValue(elementValue);
1870
1867
  attributes(this.element, { 'aria-valuenow': value });
1871
1868
  if (!isNullOrUndefined(this.hiddenInput)) {
@@ -1919,7 +1916,6 @@ let NumericTextBox = class NumericTextBox extends Component {
1919
1916
  }
1920
1917
  formatNumber() {
1921
1918
  const numberOfDecimals = this.getNumberOfDecimals(this.value);
1922
- this.storedValueString = this.value.toString();
1923
1919
  return this.instance.getNumberFormat({
1924
1920
  maximumFractionDigits: numberOfDecimals,
1925
1921
  minimumFractionDigits: numberOfDecimals, useGrouping: false
@@ -2037,10 +2033,7 @@ let NumericTextBox = class NumericTextBox extends Component {
2037
2033
  }
2038
2034
  this.prevValue = this.value;
2039
2035
  if ((this.value || this.value === 0)) {
2040
- let formatValue = this.formatNumber();
2041
- if (/[eE]/.test(this.value.toString())) {
2042
- formatValue = this.formatScientificNotation(formatValue);
2043
- }
2036
+ const formatValue = this.formatNumber();
2044
2037
  this.setElementValue(formatValue);
2045
2038
  if (!this.isPrevFocused) {
2046
2039
  if (!Browser.isDevice && Browser.info.version === '11.0') {
@@ -2081,10 +2074,7 @@ let NumericTextBox = class NumericTextBox extends Component {
2081
2074
  if (!this.element.value.length) {
2082
2075
  this.setProperties({ value: null }, true);
2083
2076
  }
2084
- let parsedInput = this.instance.getNumberParser({ format: 'n' })(this.element.value);
2085
- if (/[eE]/.test(this.element.value)) {
2086
- parsedInput = parseFloat(this.formatScientificNotation(this.element.value));
2087
- }
2077
+ const parsedInput = this.instance.getNumberParser({ format: 'n' })(this.element.value);
2088
2078
  this.updateValue(parsedInput);
2089
2079
  if (!Browser.isDevice) {
2090
2080
  EventHandler.remove(this.element, 'mousewheel DOMMouseScroll', this.mouseWheel);
@@ -2186,40 +2176,6 @@ let NumericTextBox = class NumericTextBox extends Component {
2186
2176
  EventHandler.remove(this.spinDown, 'mouseleave', this.mouseUpClick);
2187
2177
  }
2188
2178
  }
2189
- formatScientificNotation(value) {
2190
- value = this.storedValueString ? this.storedValueString : value;
2191
- const [base, exponentPart] = value.toLowerCase().split('e');
2192
- const exponent = parseInt(exponentPart, 10);
2193
- const match = this.format.match(/n(\d+)/i);
2194
- const requiredDigits = match ? parseInt(match[1], 10) : 10;
2195
- const baseDigits = base.replace('.', '');
2196
- let fullDecimal;
2197
- if (exponent < 0) {
2198
- const zerosCount = Math.abs(Number(exponent)) - 1;
2199
- const limitedZeros = '0'.repeat(Math.min(zerosCount, requiredDigits));
2200
- fullDecimal = '0.' + limitedZeros + baseDigits;
2201
- }
2202
- else {
2203
- const [intPart, decPart = ''] = base.split('.');
2204
- const shift = exponent - decPart.length;
2205
- if (shift >= 0) {
2206
- fullDecimal = intPart + decPart + '0'.repeat(shift);
2207
- }
2208
- else {
2209
- const newDec = decPart.slice(0, exponent) + '.' + decPart.slice(exponent);
2210
- fullDecimal = intPart + newDec;
2211
- }
2212
- }
2213
- const [intPart, decPart = ''] = fullDecimal.split('.');
2214
- if (this.isFocused) {
2215
- const limitedDecimal = decPart.slice(0, requiredDigits);
2216
- return `${intPart}.${decPart}`;
2217
- }
2218
- else {
2219
- const formattedDecimal = decPart.padEnd(requiredDigits, '0').slice(0, requiredDigits);
2220
- return `${intPart}.${formattedDecimal}`;
2221
- }
2222
- }
2223
2179
  /**
2224
2180
  * Increments the NumericTextBox value with the specified step value.
2225
2181
  *