@syncfusion/ej2-inputs 31.1.22 → 31.2.2
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.
- package/dist/ej2-inputs.min.js +2 -2
- package/dist/ej2-inputs.umd.min.js +2 -2
- package/dist/ej2-inputs.umd.min.js.map +1 -1
- package/dist/es6/ej2-inputs.es2015.js +60 -8
- package/dist/es6/ej2-inputs.es2015.js.map +1 -1
- package/dist/es6/ej2-inputs.es5.js +57 -5
- package/dist/es6/ej2-inputs.es5.js.map +1 -1
- package/dist/global/ej2-inputs.min.js +2 -2
- package/dist/global/ej2-inputs.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +5 -5
- package/src/numerictextbox/numerictextbox.d.ts +2 -0
- package/src/numerictextbox/numerictextbox.js +55 -3
- package/src/uploader/uploader.js +2 -2
- package/styles/bootstrap4.css +1 -1
- package/styles/input/_bootstrap4-definition.scss +1 -1
- package/styles/input/bootstrap4.css +1 -1
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 31.
|
|
3
|
+
* version : 31.2.2
|
|
4
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
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syncfusion/ej2-inputs",
|
|
3
|
-
"version": "31.
|
|
3
|
+
"version": "31.2.2",
|
|
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,10 +8,10 @@
|
|
|
8
8
|
"module": "./index.js",
|
|
9
9
|
"es2015": "./dist/es6/ej2-inputs.es5.js",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@syncfusion/ej2-base": "~31.
|
|
12
|
-
"@syncfusion/ej2-buttons": "~31.
|
|
13
|
-
"@syncfusion/ej2-popups": "~31.
|
|
14
|
-
"@syncfusion/ej2-splitbuttons": "~31.
|
|
11
|
+
"@syncfusion/ej2-base": "~31.2.2",
|
|
12
|
+
"@syncfusion/ej2-buttons": "~31.2.2",
|
|
13
|
+
"@syncfusion/ej2-popups": "~31.2.2",
|
|
14
|
+
"@syncfusion/ej2-splitbuttons": "~31.2.2"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {},
|
|
17
17
|
"keywords": [
|
|
@@ -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
|
-
|
|
816
|
-
|
|
817
|
-
valueString
|
|
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
|
*
|
package/src/uploader/uploader.js
CHANGED
|
@@ -1981,7 +1981,7 @@ var Uploader = /** @class */ (function (_super) {
|
|
|
1981
1981
|
var progressbarWrapper = this.createElement('span', { className: PROGRESS_WRAPPER });
|
|
1982
1982
|
var progressBar = this.createElement('progressbar', { className: PROGRESSBAR, attrs: { value: '0', max: '100' } });
|
|
1983
1983
|
var progressbarInnerWrapper = this.createElement('span', { className: PROGRESS_INNER_WRAPPER });
|
|
1984
|
-
progressBar.
|
|
1984
|
+
progressBar.style.width = '0%';
|
|
1985
1985
|
var progressbarText = this.createElement('span', { className: PROGRESSBAR_TEXT });
|
|
1986
1986
|
progressbarText.textContent = '0%';
|
|
1987
1987
|
progressbarInnerWrapper.appendChild(progressBar);
|
|
@@ -2004,7 +2004,7 @@ var Uploader = /** @class */ (function (_super) {
|
|
|
2004
2004
|
}
|
|
2005
2005
|
};
|
|
2006
2006
|
Uploader.prototype.changeProgressValue = function (li, progressValue) {
|
|
2007
|
-
li.querySelector('.' + PROGRESSBAR).
|
|
2007
|
+
li.querySelector('.' + PROGRESSBAR).style.width = progressValue;
|
|
2008
2008
|
li.querySelector('.' + PROGRESSBAR_TEXT).textContent = progressValue;
|
|
2009
2009
|
};
|
|
2010
2010
|
Uploader.prototype.uploadInProgress = function (e, files, customUI, request) {
|
package/styles/bootstrap4.css
CHANGED
|
@@ -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:
|
|
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:
|
|
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:
|
|
3846
|
+
font-size: 16px;
|
|
3847
3847
|
}
|
|
3848
3848
|
|
|
3849
3849
|
.e-float-input.e-small.e-bigger .e-clear-icon::before,
|