@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.
@@ -489,14 +489,26 @@ var Input;
489
489
  return container;
490
490
  }
491
491
  function encodePlaceHolder(placeholder) {
492
- var result = '';
493
- if (!isNullOrUndefined(placeholder) && placeholder !== '') {
494
- var spanEle = document.createElement('span');
495
- spanEle.innerHTML = '<input placeholder="' + placeholder + '"/>';
496
- var hiddenInput = (spanEle.children[0]);
497
- result = hiddenInput.placeholder;
492
+ if (placeholder == null || placeholder === '') {
493
+ return '';
498
494
  }
499
- return result;
495
+ var decoded = decodeHtmlEntities(placeholder);
496
+ return decoded;
497
+ }
498
+ function decodeHtmlEntities(str) {
499
+ var entityMap = {
500
+ '&amp;': '&',
501
+ // eslint-disable-next-line quotes
502
+ '&quot;': '"',
503
+ // eslint-disable-next-line quotes
504
+ '&#39;': "'",
505
+ '&lt;': '<',
506
+ '&gt;': '>',
507
+ '&eacute;': 'é' // tslint:disable-line:comma-dangle
508
+ };
509
+ // tslint:disable-next-line:typedef
510
+ // tslint-disable-next-line security/detect-object-injection
511
+ return str.replace(/&[a-zA-Z#0-9]+;/g, function (entity) { return entityMap[entity] || entity; });
500
512
  }
501
513
  /**
502
514
  * Sets the value to the input element.
@@ -1774,7 +1786,8 @@ var NumericTextBox = /** @__PURE__ @class */ (function (_super) {
1774
1786
  /* istanbul ignore next */
1775
1787
  if (this.isAngular
1776
1788
  && this.element.value !== getValue('decimal', getNumericObject(this.locale))
1777
- && this.element.value !== getValue('minusSign', getNumericObject(this.locale))) {
1789
+ && this.element.value !== getValue('minusSign', getNumericObject(this.locale))
1790
+ && this.numericRegex().test(this.element.value)) {
1778
1791
  var parsedValue = this.instance.getNumberParser({ format: 'n' })(this.element.value);
1779
1792
  parsedValue = isNaN(parsedValue) ? null : parsedValue;
1780
1793
  numerictextboxObj.localChange({ value: parsedValue });