@syncfusion/ej2-inputs 31.1.21 → 31.1.23

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.
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 31.1.21
4
- * Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
3
+ * version : 31.1.23
4
+ * Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
7
7
  * licensing@syncfusion.com. Any infringement will be prosecuted under
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncfusion/ej2-inputs",
3
- "version": "31.1.21",
3
+ "version": "31.1.23",
4
4
  "description": "A package of Essential JS 2 input components such as Textbox, Color-picker, Masked-textbox, Numeric-textbox, Slider, Upload, and Form-validator that is used to get input from the users.",
5
5
  "author": "Syncfusion Inc.",
6
6
  "license": "SEE LICENSE IN license",
@@ -8,7 +8,7 @@
8
8
  "module": "./index.js",
9
9
  "es2015": "./dist/es6/ej2-inputs.es5.js",
10
10
  "dependencies": {
11
- "@syncfusion/ej2-base": "~31.1.20",
11
+ "@syncfusion/ej2-base": "~31.1.22",
12
12
  "@syncfusion/ej2-buttons": "~31.1.21",
13
13
  "@syncfusion/ej2-popups": "~31.1.20",
14
14
  "@syncfusion/ej2-splitbuttons": "~31.1.17"
@@ -1302,14 +1302,32 @@ var ColorPicker = /** @class */ (function (_super) {
1302
1302
  switch (!e.altKey && e.keyCode) {
1303
1303
  case 39:
1304
1304
  e.preventDefault();
1305
- selectedEle = prevSelectedEle ? tiles[this.tilePosition(tiles, prevSelectedEle, this.enableRtl ? -1 : 1)]
1306
- : tiles[this.enableRtl ? tiles.length - 1 : 0];
1305
+ if (prevSelectedEle && ((!this.enableRtl && tiles.indexOf(prevSelectedEle) === tiles.length - 1)
1306
+ || (this.enableRtl && tiles.indexOf(prevSelectedEle) === 0))) {
1307
+ idx = this.enableRtl ? tiles.length - 1 : 0;
1308
+ }
1309
+ else {
1310
+ idx = prevSelectedEle ? this.tilePosition(tiles, prevSelectedEle, this.enableRtl ? -1 : 1)
1311
+ : (this.enableRtl ? tiles.length - 1 : 0);
1312
+ }
1313
+ if (tiles[idx]) {
1314
+ selectedEle = tiles[idx];
1315
+ }
1307
1316
  this.keySelectionChanges(selectedEle);
1308
1317
  break;
1309
1318
  case 37:
1310
1319
  e.preventDefault();
1311
- selectedEle = prevSelectedEle ? tiles[this.tilePosition(tiles, prevSelectedEle, this.enableRtl ? 1 : -1)]
1312
- : tiles[this.enableRtl ? 0 : tiles.length - 1];
1320
+ if (prevSelectedEle && ((!this.enableRtl && tiles.indexOf(prevSelectedEle) === 0)
1321
+ || (this.enableRtl && tiles.indexOf(prevSelectedEle) === tiles.length - 1))) {
1322
+ idx = this.enableRtl ? 0 : tiles.length - 1;
1323
+ }
1324
+ else {
1325
+ idx = prevSelectedEle ? this.tilePosition(tiles, prevSelectedEle, this.enableRtl ? 1 : -1)
1326
+ : (this.enableRtl ? 0 : tiles.length - 1);
1327
+ }
1328
+ if (tiles[idx]) {
1329
+ selectedEle = tiles[idx];
1330
+ }
1313
1331
  this.keySelectionChanges(selectedEle);
1314
1332
  break;
1315
1333
  case 38:
@@ -51,6 +51,7 @@ export declare class NumericTextBox extends Component<HTMLInputElement> implemen
51
51
  private isDynamicChange;
52
52
  private inputValue;
53
53
  private clearButton;
54
+ private storedValueString;
54
55
  /**
55
56
  * Gets or Sets the CSS classes to root element of the NumericTextBox which helps to customize the
56
57
  * complete UI styles for the NumericTextBox component.
@@ -319,6 +320,7 @@ export declare class NumericTextBox extends Component<HTMLInputElement> implemen
319
320
  private getElementData;
320
321
  private floatLabelTypeUpdate;
321
322
  private mouseUpClick;
323
+ private formatScientificNotation;
322
324
  /**
323
325
  * Increments the NumericTextBox value with the specified step value.
324
326
  *
@@ -781,6 +781,9 @@ var NumericTextBox = /** @class */ (function (_super) {
781
781
  if (this.value || this.value === 0) {
782
782
  var value = this.formatNumber();
783
783
  var elementValue = this.isFocused ? value : this.instance.getNumberFormat(this.cultureInfo)(this.value);
784
+ if (/[eE]/.test(value)) {
785
+ elementValue = this.formatScientificNotation(elementValue);
786
+ }
784
787
  this.setElementValue(elementValue);
785
788
  attributes(this.element, { 'aria-valuenow': value });
786
789
  if (!isNullOrUndefined(this.hiddenInput)) {
@@ -812,9 +815,17 @@ var NumericTextBox = /** @class */ (function (_super) {
812
815
  var EXPREGEXP = new RegExp('[eE][\-+]?([0-9]+)');
813
816
  var valueString = value.toString();
814
817
  if (EXPREGEXP.test(valueString)) {
815
- var result = EXPREGEXP.exec(valueString);
816
- if (!isNullOrUndefined(result)) {
817
- valueString = value.toFixed(Math.min(parseInt(result[1], 10), 20));
818
+ if (/[eE]/.test(valueString)) {
819
+ valueString = value.toFixed(20).replace(/0+$/, '');
820
+ if (valueString.charAt(valueString.length - 1) === '.') {
821
+ valueString = valueString.slice(0, valueString.length - 1);
822
+ }
823
+ }
824
+ else {
825
+ var result = EXPREGEXP.exec(valueString);
826
+ if (!isNullOrUndefined(result)) {
827
+ valueString = value.toFixed(Math.min(parseInt(result[1], 10), 20));
828
+ }
818
829
  }
819
830
  }
820
831
  var decimalPart = valueString.split('.')[1];
@@ -826,6 +837,7 @@ var NumericTextBox = /** @class */ (function (_super) {
826
837
  };
827
838
  NumericTextBox.prototype.formatNumber = function () {
828
839
  var numberOfDecimals = this.getNumberOfDecimals(this.value);
840
+ this.storedValueString = this.value.toString();
829
841
  return this.instance.getNumberFormat({
830
842
  maximumFractionDigits: numberOfDecimals,
831
843
  minimumFractionDigits: numberOfDecimals, useGrouping: false
@@ -939,6 +951,9 @@ var NumericTextBox = /** @class */ (function (_super) {
939
951
  this.prevValue = this.value;
940
952
  if ((this.value || this.value === 0)) {
941
953
  var formatValue_1 = this.formatNumber();
954
+ if (/[eE]/.test(this.value.toString())) {
955
+ formatValue_1 = this.formatScientificNotation(formatValue_1);
956
+ }
942
957
  this.setElementValue(formatValue_1);
943
958
  if (!this.isPrevFocused) {
944
959
  if (!Browser.isDevice && Browser.info.version === '11.0') {
@@ -981,6 +996,9 @@ var NumericTextBox = /** @class */ (function (_super) {
981
996
  this.setProperties({ value: null }, true);
982
997
  }
983
998
  var parsedInput = this.instance.getNumberParser({ format: 'n' })(this.element.value);
999
+ if (/[eE]/.test(this.element.value)) {
1000
+ parsedInput = parseFloat(this.formatScientificNotation(this.element.value));
1001
+ }
984
1002
  this.updateValue(parsedInput);
985
1003
  if (!Browser.isDevice) {
986
1004
  EventHandler.remove(this.element, 'mousewheel DOMMouseScroll', this.mouseWheel);
@@ -1082,6 +1100,40 @@ var NumericTextBox = /** @class */ (function (_super) {
1082
1100
  EventHandler.remove(this.spinDown, 'mouseleave', this.mouseUpClick);
1083
1101
  }
1084
1102
  };
1103
+ NumericTextBox.prototype.formatScientificNotation = function (value) {
1104
+ value = this.storedValueString ? this.storedValueString : value;
1105
+ var _a = value.toLowerCase().split('e'), base = _a[0], exponentPart = _a[1];
1106
+ var exponent = parseInt(exponentPart, 10);
1107
+ var match = this.format.match(/n(\d+)/i);
1108
+ var requiredDigits = match ? parseInt(match[1], 10) : 10;
1109
+ var baseDigits = base.replace('.', '');
1110
+ var fullDecimal;
1111
+ if (exponent < 0) {
1112
+ var zerosCount = Math.abs(Number(exponent)) - 1;
1113
+ var limitedZeros = '0'.repeat(Math.min(zerosCount, requiredDigits));
1114
+ fullDecimal = '0.' + limitedZeros + baseDigits;
1115
+ }
1116
+ else {
1117
+ var _b = base.split('.'), intPart_1 = _b[0], _c = _b[1], decPart_1 = _c === void 0 ? '' : _c;
1118
+ var shift = exponent - decPart_1.length;
1119
+ if (shift >= 0) {
1120
+ fullDecimal = intPart_1 + decPart_1 + '0'.repeat(shift);
1121
+ }
1122
+ else {
1123
+ var newDec = decPart_1.slice(0, exponent) + '.' + decPart_1.slice(exponent);
1124
+ fullDecimal = intPart_1 + newDec;
1125
+ }
1126
+ }
1127
+ var _d = fullDecimal.split('.'), intPart = _d[0], _e = _d[1], decPart = _e === void 0 ? '' : _e;
1128
+ if (this.isFocused) {
1129
+ var limitedDecimal = decPart.slice(0, requiredDigits);
1130
+ return intPart + "." + decPart;
1131
+ }
1132
+ else {
1133
+ var formattedDecimal = decPart.padEnd(requiredDigits, '0').slice(0, requiredDigits);
1134
+ return intPart + "." + formattedDecimal;
1135
+ }
1136
+ };
1085
1137
  /**
1086
1138
  * Increments the NumericTextBox value with the specified step value.
1087
1139
  *
@@ -562,6 +562,7 @@ export declare class Slider extends Component<HTMLElement> implements INotifyPro
562
562
  private setCSSClass;
563
563
  private setEnabled;
564
564
  private getTheme;
565
+ private secureRandom;
565
566
  /**
566
567
  * Initialize the rendering
567
568
  *
@@ -357,6 +357,11 @@ var Slider = /** @class */ (function (_super) {
357
357
  var theme = window.getComputedStyle(container, ':after').getPropertyValue('content');
358
358
  return theme.replace(/['"]+/g, '');
359
359
  };
360
+ Slider.prototype.secureRandom = function () {
361
+ var array = new Uint32Array(1);
362
+ window.crypto.getRandomValues(array);
363
+ return array[0] / (0xFFFFFFFF + 1);
364
+ };
360
365
  /**
361
366
  * Initialize the rendering
362
367
  *
@@ -382,7 +387,7 @@ var Slider = /** @class */ (function (_super) {
382
387
  attrs: {
383
388
  type: 'hidden', value: (isNullOrUndefined(this.value) ? (isNullOrUndefined(this.min) ? '0' : this.min.toString()) : this.value.toString()),
384
389
  name: this.element.getAttribute('name') || this.element.getAttribute('id') ||
385
- '_' + (Math.random() * 1000).toFixed(0) + 'slider', class: classNames.sliderHiddenInput
390
+ '_' + (this.secureRandom() * 1000).toFixed(0) + 'slider', class: classNames.sliderHiddenInput
386
391
  }
387
392
  }));
388
393
  this.hiddenInput.tabIndex = -1;
@@ -3853,7 +3853,7 @@ textarea.e-input.e-bigger.e-small,
3853
3853
  .e-bigger .e-float-input .e-clear-icon::before,
3854
3854
  .e-bigger .e-input-group .e-clear-icon::before,
3855
3855
  .e-bigger .e-input-group.e-control-wrapper .e-clear-icon::before {
3856
- font-size: 12px;
3856
+ font-size: 16px;
3857
3857
  }
3858
3858
 
3859
3859
  .e-float-input.e-small.e-bigger .e-clear-icon::before,
@@ -49,7 +49,7 @@ $float-input-wrap-padding-top: $zero-value !default;
49
49
  $input-padding-bottom: $zero-value !default;
50
50
  $input-focus-padding-bottom: $zero-value !default;
51
51
  $input-clear-icon: 10px !default;
52
- $input-bigger-clear-icon: 12px !default;
52
+ $input-bigger-clear-icon: 16px !default;
53
53
  $input-small-clear-icon: 8px !default;
54
54
  $input-bigger-small-clear-icon: 12px !default;
55
55
  $input-clear-icon-padding: $zero-value !default;
@@ -3843,7 +3843,7 @@ textarea.e-input.e-bigger.e-small,
3843
3843
  .e-bigger .e-float-input .e-clear-icon::before,
3844
3844
  .e-bigger .e-input-group .e-clear-icon::before,
3845
3845
  .e-bigger .e-input-group.e-control-wrapper .e-clear-icon::before {
3846
- font-size: 12px;
3846
+ font-size: 16px;
3847
3847
  }
3848
3848
 
3849
3849
  .e-float-input.e-small.e-bigger .e-clear-icon::before,