@syncfusion/ej2-inputs 30.1.37 → 30.1.40

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.
@@ -486,14 +486,26 @@ var Input;
486
486
  return container;
487
487
  }
488
488
  function encodePlaceHolder(placeholder) {
489
- let result = '';
490
- if (!isNullOrUndefined(placeholder) && placeholder !== '') {
491
- const spanEle = document.createElement('span');
492
- spanEle.innerHTML = '<input placeholder="' + placeholder + '"/>';
493
- const hiddenInput = (spanEle.children[0]);
494
- result = hiddenInput.placeholder;
489
+ if (placeholder == null || placeholder === '') {
490
+ return '';
495
491
  }
496
- return result;
492
+ const decoded = decodeHtmlEntities(placeholder);
493
+ return decoded;
494
+ }
495
+ function decodeHtmlEntities(str) {
496
+ const entityMap = {
497
+ '&amp;': '&',
498
+ // eslint-disable-next-line quotes
499
+ '&quot;': '"',
500
+ // eslint-disable-next-line quotes
501
+ '&#39;': "'",
502
+ '&lt;': '<',
503
+ '&gt;': '>',
504
+ '&eacute;': 'é' // tslint:disable-line:comma-dangle
505
+ };
506
+ // tslint:disable-next-line:typedef
507
+ // tslint-disable-next-line security/detect-object-injection
508
+ return str.replace(/&[a-zA-Z#0-9]+;/g, (entity) => entityMap[entity] || entity);
497
509
  }
498
510
  /**
499
511
  * Sets the value to the input element.
@@ -1744,7 +1756,8 @@ let NumericTextBox = class NumericTextBox extends Component {
1744
1756
  /* istanbul ignore next */
1745
1757
  if (this.isAngular
1746
1758
  && this.element.value !== getValue('decimal', getNumericObject(this.locale))
1747
- && this.element.value !== getValue('minusSign', getNumericObject(this.locale))) {
1759
+ && this.element.value !== getValue('minusSign', getNumericObject(this.locale))
1760
+ && this.numericRegex().test(this.element.value)) {
1748
1761
  let parsedValue = this.instance.getNumberParser({ format: 'n' })(this.element.value);
1749
1762
  parsedValue = isNaN(parsedValue) ? null : parsedValue;
1750
1763
  numerictextboxObj.localChange({ value: parsedValue });