@progress/kendo-react-inputs 5.18.0-dev.202309120952 → 5.18.0-dev.202309121534
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/cdn/js/kendo-react-inputs.js +1 -1
- package/dist/es/numerictextbox/NumericTextBox.js +2 -1
- package/dist/es/numerictextbox/utils/index.js +16 -16
- package/dist/es/package-metadata.js +1 -1
- package/dist/npm/numerictextbox/NumericTextBox.js +2 -1
- package/dist/npm/numerictextbox/utils/index.js +16 -16
- package/dist/npm/package-metadata.js +1 -1
- package/dist/systemjs/kendo-react-inputs.js +1 -1
- package/package.json +16 -16
|
@@ -159,7 +159,8 @@ export var NumericTextBox = React.forwardRef(function (directProps, target) {
|
|
|
159
159
|
newState.selectionEnd - newState.selectionStart === String(newState.currentLooseValue).length) {
|
|
160
160
|
var numericSymbols = intlService.numberSymbols();
|
|
161
161
|
var isMinus = numericSymbols && event.key === numericSymbols.minusSign;
|
|
162
|
-
|
|
162
|
+
var isDecimal = numericSymbols && event.key === numericSymbols.decimal;
|
|
163
|
+
isPasteRef.current = !isMinus && !isDecimal;
|
|
163
164
|
return;
|
|
164
165
|
}
|
|
165
166
|
switch (event.keyCode) {
|
|
@@ -368,22 +368,7 @@ export var sanitizeNumber = function (state, format, intlService) {
|
|
|
368
368
|
setSelection(newState, getInitialPosition(newState.currentLooseValue, symbols), newState.currentLooseValue, formatInfo);
|
|
369
369
|
return newState;
|
|
370
370
|
}
|
|
371
|
-
// 3.
|
|
372
|
-
if (isMinusSymbolAdded(newState, symbols)) {
|
|
373
|
-
var nextValue = intlService.parseNumber(prevLooseValue, format);
|
|
374
|
-
newState.eventValue = -(nextValue !== null ? nextValue : 0);
|
|
375
|
-
newState.currentLooseValue = formatValue(newState.eventValue, format, intlService);
|
|
376
|
-
var currentNumberStart = getFirstNumberIndex(newState.currentLooseValue, DIGITS_REGEX);
|
|
377
|
-
var oldNumberStart = getFirstNumberIndex(prevLooseValueAsString, DIGITS_REGEX);
|
|
378
|
-
setSelection(newState, newState.selectionEnd - 1 + (currentNumberStart - oldNumberStart), newState.currentLooseValue, formatInfo);
|
|
379
|
-
return newState;
|
|
380
|
-
}
|
|
381
|
-
if (isMinusSymbolRemoved(newState, symbols)) {
|
|
382
|
-
newState.eventValue = intlService.parseNumber(newState.currentLooseValue, format);
|
|
383
|
-
setSelection(newState, newState.selectionStart, newState.currentLooseValue, formatInfo);
|
|
384
|
-
return newState;
|
|
385
|
-
}
|
|
386
|
-
// 4. Check is decimal symbol
|
|
371
|
+
// 3. Check is decimal symbol
|
|
387
372
|
if (newState.currentLooseValue === symbols.decimal) {
|
|
388
373
|
newState.eventValue = 0;
|
|
389
374
|
var valueCandidate = formatValue(newState.eventValue, format, intlService);
|
|
@@ -399,6 +384,21 @@ export var sanitizeNumber = function (state, format, intlService) {
|
|
|
399
384
|
setSelection(newState, getInitialPosition(newState.currentLooseValue, symbols) + 1, newState.currentLooseValue, formatInfo);
|
|
400
385
|
return newState;
|
|
401
386
|
}
|
|
387
|
+
// 4. Minus sign toggle
|
|
388
|
+
if (isMinusSymbolAdded(newState, symbols)) {
|
|
389
|
+
var nextValue = intlService.parseNumber(prevLooseValue, format);
|
|
390
|
+
newState.eventValue = -(nextValue !== null ? nextValue : 0);
|
|
391
|
+
newState.currentLooseValue = formatValue(newState.eventValue, format, intlService);
|
|
392
|
+
var currentNumberStart = getFirstNumberIndex(newState.currentLooseValue, DIGITS_REGEX);
|
|
393
|
+
var oldNumberStart = getFirstNumberIndex(prevLooseValueAsString, DIGITS_REGEX);
|
|
394
|
+
setSelection(newState, newState.selectionEnd - 1 + (currentNumberStart - oldNumberStart), newState.currentLooseValue, formatInfo);
|
|
395
|
+
return newState;
|
|
396
|
+
}
|
|
397
|
+
if (isMinusSymbolRemoved(newState, symbols)) {
|
|
398
|
+
newState.eventValue = intlService.parseNumber(newState.currentLooseValue, format);
|
|
399
|
+
setSelection(newState, newState.selectionStart, newState.currentLooseValue, formatInfo);
|
|
400
|
+
return newState;
|
|
401
|
+
}
|
|
402
402
|
// 5. Duplicate decimal - it's possible only as trailing
|
|
403
403
|
if (isDecimalDuplicated(newState, symbols)) {
|
|
404
404
|
setInvalid(newState, format, formatInfo, intlService);
|
|
@@ -5,7 +5,7 @@ export var packageMetadata = {
|
|
|
5
5
|
name: '@progress/kendo-react-inputs',
|
|
6
6
|
productName: 'KendoReact',
|
|
7
7
|
productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
|
|
8
|
-
publishDate:
|
|
8
|
+
publishDate: 1694530098,
|
|
9
9
|
version: '',
|
|
10
10
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
|
|
11
11
|
};
|
|
@@ -162,7 +162,8 @@ exports.NumericTextBox = React.forwardRef(function (directProps, target) {
|
|
|
162
162
|
newState.selectionEnd - newState.selectionStart === String(newState.currentLooseValue).length) {
|
|
163
163
|
var numericSymbols = intlService.numberSymbols();
|
|
164
164
|
var isMinus = numericSymbols && event.key === numericSymbols.minusSign;
|
|
165
|
-
|
|
165
|
+
var isDecimal = numericSymbols && event.key === numericSymbols.decimal;
|
|
166
|
+
isPasteRef.current = !isMinus && !isDecimal;
|
|
166
167
|
return;
|
|
167
168
|
}
|
|
168
169
|
switch (event.keyCode) {
|
|
@@ -398,22 +398,7 @@ var sanitizeNumber = function (state, format, intlService) {
|
|
|
398
398
|
(0, exports.setSelection)(newState, (0, exports.getInitialPosition)(newState.currentLooseValue, symbols), newState.currentLooseValue, formatInfo);
|
|
399
399
|
return newState;
|
|
400
400
|
}
|
|
401
|
-
// 3.
|
|
402
|
-
if ((0, exports.isMinusSymbolAdded)(newState, symbols)) {
|
|
403
|
-
var nextValue = intlService.parseNumber(prevLooseValue, format);
|
|
404
|
-
newState.eventValue = -(nextValue !== null ? nextValue : 0);
|
|
405
|
-
newState.currentLooseValue = (0, exports.formatValue)(newState.eventValue, format, intlService);
|
|
406
|
-
var currentNumberStart = (0, exports.getFirstNumberIndex)(newState.currentLooseValue, DIGITS_REGEX);
|
|
407
|
-
var oldNumberStart = (0, exports.getFirstNumberIndex)(prevLooseValueAsString, DIGITS_REGEX);
|
|
408
|
-
(0, exports.setSelection)(newState, newState.selectionEnd - 1 + (currentNumberStart - oldNumberStart), newState.currentLooseValue, formatInfo);
|
|
409
|
-
return newState;
|
|
410
|
-
}
|
|
411
|
-
if ((0, exports.isMinusSymbolRemoved)(newState, symbols)) {
|
|
412
|
-
newState.eventValue = intlService.parseNumber(newState.currentLooseValue, format);
|
|
413
|
-
(0, exports.setSelection)(newState, newState.selectionStart, newState.currentLooseValue, formatInfo);
|
|
414
|
-
return newState;
|
|
415
|
-
}
|
|
416
|
-
// 4. Check is decimal symbol
|
|
401
|
+
// 3. Check is decimal symbol
|
|
417
402
|
if (newState.currentLooseValue === symbols.decimal) {
|
|
418
403
|
newState.eventValue = 0;
|
|
419
404
|
var valueCandidate = (0, exports.formatValue)(newState.eventValue, format, intlService);
|
|
@@ -429,6 +414,21 @@ var sanitizeNumber = function (state, format, intlService) {
|
|
|
429
414
|
(0, exports.setSelection)(newState, (0, exports.getInitialPosition)(newState.currentLooseValue, symbols) + 1, newState.currentLooseValue, formatInfo);
|
|
430
415
|
return newState;
|
|
431
416
|
}
|
|
417
|
+
// 4. Minus sign toggle
|
|
418
|
+
if ((0, exports.isMinusSymbolAdded)(newState, symbols)) {
|
|
419
|
+
var nextValue = intlService.parseNumber(prevLooseValue, format);
|
|
420
|
+
newState.eventValue = -(nextValue !== null ? nextValue : 0);
|
|
421
|
+
newState.currentLooseValue = (0, exports.formatValue)(newState.eventValue, format, intlService);
|
|
422
|
+
var currentNumberStart = (0, exports.getFirstNumberIndex)(newState.currentLooseValue, DIGITS_REGEX);
|
|
423
|
+
var oldNumberStart = (0, exports.getFirstNumberIndex)(prevLooseValueAsString, DIGITS_REGEX);
|
|
424
|
+
(0, exports.setSelection)(newState, newState.selectionEnd - 1 + (currentNumberStart - oldNumberStart), newState.currentLooseValue, formatInfo);
|
|
425
|
+
return newState;
|
|
426
|
+
}
|
|
427
|
+
if ((0, exports.isMinusSymbolRemoved)(newState, symbols)) {
|
|
428
|
+
newState.eventValue = intlService.parseNumber(newState.currentLooseValue, format);
|
|
429
|
+
(0, exports.setSelection)(newState, newState.selectionStart, newState.currentLooseValue, formatInfo);
|
|
430
|
+
return newState;
|
|
431
|
+
}
|
|
432
432
|
// 5. Duplicate decimal - it's possible only as trailing
|
|
433
433
|
if ((0, exports.isDecimalDuplicated)(newState, symbols)) {
|
|
434
434
|
(0, exports.setInvalid)(newState, format, formatInfo, intlService);
|
|
@@ -8,7 +8,7 @@ exports.packageMetadata = {
|
|
|
8
8
|
name: '@progress/kendo-react-inputs',
|
|
9
9
|
productName: 'KendoReact',
|
|
10
10
|
productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
|
|
11
|
-
publishDate:
|
|
11
|
+
publishDate: 1694530098,
|
|
12
12
|
version: '',
|
|
13
13
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
|
|
14
14
|
};
|