@progress/kendo-angular-inputs 23.1.1-develop.1 → 23.1.1-develop.3

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/common/math.d.ts CHANGED
@@ -6,6 +6,10 @@
6
6
  * @hidden
7
7
  */
8
8
  export declare const limitPrecision: (precision: number) => number;
9
+ /**
10
+ * @hidden
11
+ */
12
+ export declare const parseExponent: (exponentMatch: RegExpMatchArray) => number;
9
13
  /**
10
14
  * @hidden
11
15
  */
@@ -133,11 +133,29 @@ const MAX_PRECISION = 20;
133
133
  * @hidden
134
134
  */
135
135
  const limitPrecision = (precision) => Math.min(precision, MAX_PRECISION);
136
+ /**
137
+ * @hidden
138
+ */
139
+ const parseExponent = (exponentMatch) => {
140
+ const sign = exponentMatch[1] === '-' ? -1 : 1;
141
+ return parseInt(exponentMatch[2], 10) * sign;
142
+ };
136
143
  /**
137
144
  * @hidden
138
145
  */
139
146
  const fractionLength = (value) => {
140
- return (String(value).split('.')[1] || "").length;
147
+ const stringValue = String(value);
148
+ const exponentMatch = /[eE]([-+]?)(\d+)/.exec(stringValue);
149
+ if (exponentMatch) {
150
+ const exponent = parseExponent(exponentMatch);
151
+ const fractionPart = (stringValue.split('.')[1] || "").split(/[eE]/)[0];
152
+ const mantissaDecimals = fractionPart.length;
153
+ return exponent < 0
154
+ ? Math.abs(exponent) + mantissaDecimals
155
+ : Math.max(0, mantissaDecimals - exponent);
156
+ }
157
+ const fraction = stringValue.split('.')[1] || "";
158
+ return fraction.length;
141
159
  };
142
160
  const maxFractionLength = (value1, value2) => {
143
161
  return Math.max(fractionLength(value1), fractionLength(value2));
@@ -566,7 +584,7 @@ const packageMetadata = {
566
584
  productCode: 'KENDOUIANGULAR',
567
585
  productCodes: ['KENDOUIANGULAR'],
568
586
  publishDate: 0,
569
- version: '23.1.1-develop.1',
587
+ version: '23.1.1-develop.3',
570
588
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
571
589
  };
572
590
 
@@ -3496,7 +3514,7 @@ const SPIN_DELAY = 50;
3496
3514
  /**
3497
3515
  * @hidden
3498
3516
  */
3499
- const EXPONENT_REGEX = /[eE][\-+]?([0-9]+)/;
3517
+ const EXPONENT_REGEX = /[eE]([-+]?)(\d+)/;
3500
3518
 
3501
3519
  /**
3502
3520
  * @hidden
@@ -3687,13 +3705,21 @@ class SharedInputEventsDirective {
3687
3705
  if (tabbing) {
3688
3706
  const closestTextbox = closest(args.relatedTarget, (element) => element === hostElement);
3689
3707
  if (!closestTextbox) {
3690
- this.handleBlur.emit();
3708
+ this.ngZone.run(() => {
3709
+ this.isFocused = false;
3710
+ this.isFocusedChange.emit(this.isFocused);
3711
+ this.handleBlur.emit();
3712
+ });
3691
3713
  }
3692
3714
  tabbing = false;
3693
3715
  }
3694
3716
  else {
3695
3717
  if (!cursorInsideWrapper && !this?.clearButtonClicked) {
3696
- this.handleBlur.emit();
3718
+ this.ngZone.run(() => {
3719
+ this.isFocused = false;
3720
+ this.isFocusedChange.emit(this.isFocused);
3721
+ this.handleBlur.emit();
3722
+ });
3697
3723
  }
3698
3724
  }
3699
3725
  }));
@@ -4237,6 +4263,16 @@ class NumericTextBoxComponent {
4237
4263
  */
4238
4264
  blur() {
4239
4265
  invokeElementMethod(this.numericInput, 'blur');
4266
+ // SharedInputEventsDirective skips focusout when the cursor is inside the host.
4267
+ if (this.focused) {
4268
+ this.ngZone.runOutsideAngular(() => {
4269
+ setTimeout(() => {
4270
+ if (this.focused && !this.hostElement.nativeElement.contains(document.activeElement)) {
4271
+ this.handleBlur(false);
4272
+ }
4273
+ });
4274
+ });
4275
+ }
4240
4276
  }
4241
4277
  /**
4242
4278
  * Notifies the NumericTextBoxComponent that the input value should be changed.
@@ -4355,7 +4391,7 @@ class NumericTextBoxComponent {
4355
4391
  /**
4356
4392
  * @hidden
4357
4393
  */
4358
- handleBlur = () => {
4394
+ handleBlur = (emitEvent = true) => {
4359
4395
  this.changeDetector.markForCheck();
4360
4396
  this.focused = false;
4361
4397
  //blur is thrown before input when dragging the input text in IE
@@ -4363,7 +4399,7 @@ class NumericTextBoxComponent {
4363
4399
  this.handleInput();
4364
4400
  }
4365
4401
  this.setInputValue();
4366
- if (hasObservers(this.onBlur)) {
4402
+ if (emitEvent && hasObservers(this.onBlur)) {
4367
4403
  this.ngZone.run(() => {
4368
4404
  this.ngTouched();
4369
4405
  this.onBlur.emit();
@@ -4670,7 +4706,10 @@ class NumericTextBoxComponent {
4670
4706
  let stringValue = Object.is(value, -0) ? '-0' : String(value);
4671
4707
  const exponentMatch = EXPONENT_REGEX.exec(stringValue);
4672
4708
  if (exponentMatch) {
4673
- stringValue = value.toFixed(limitPrecision(parseInt(exponentMatch[1], 10)));
4709
+ const exponent = parseExponent(exponentMatch);
4710
+ const significantDigits = stringValue.split('e')[0].replace(/[-.]/g, '').length;
4711
+ const decimalPlaces = Math.abs(exponent) + (exponent < 0 ? significantDigits - 1 : 0);
4712
+ stringValue = value.toFixed(limitPrecision(decimalPlaces));
4674
4713
  }
4675
4714
  return stringValue.replace(POINT, this.decimalSeparator);
4676
4715
  }
@@ -327,7 +327,7 @@ export declare class NumericTextBoxComponent implements ControlValueAccessor, On
327
327
  /**
328
328
  * @hidden
329
329
  */
330
- handleBlur: () => void;
330
+ handleBlur: (emitEvent?: boolean) => void;
331
331
  /**
332
332
  * @hidden
333
333
  */
@@ -7,7 +7,7 @@ export const packageMetadata = {
7
7
  "productCodes": [
8
8
  "KENDOUIANGULAR"
9
9
  ],
10
- "publishDate": 1771491690,
11
- "version": "23.1.1-develop.1",
10
+ "publishDate": 1771514207,
11
+ "version": "23.1.1-develop.3",
12
12
  "licensingDocsUrl": "https://www.telerik.com/kendo-angular-ui/my-license/"
13
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-angular-inputs",
3
- "version": "23.1.1-develop.1",
3
+ "version": "23.1.1-develop.3",
4
4
  "description": "Kendo UI for Angular Inputs Package - Everything you need to build professional form functionality (Checkbox, ColorGradient, ColorPalette, ColorPicker, FlatColorPicker, FormField, MaskedTextBox, NumericTextBox, RadioButton, RangeSlider, Slider, Switch, TextArea, and TextBox Components)",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Progress",
@@ -28,7 +28,7 @@
28
28
  "package": {
29
29
  "productName": "Kendo UI for Angular",
30
30
  "productCode": "KENDOUIANGULAR",
31
- "publishDate": 1771491690,
31
+ "publishDate": 1771514207,
32
32
  "licensingDocsUrl": "https://www.telerik.com/kendo-angular-ui/my-license/"
33
33
  }
34
34
  },
@@ -40,20 +40,20 @@
40
40
  "@angular/platform-browser": "19 - 21",
41
41
  "@progress/kendo-drawing": "^1.24.0",
42
42
  "@progress/kendo-licensing": "^1.10.0",
43
- "@progress/kendo-angular-buttons": "23.1.1-develop.1",
44
- "@progress/kendo-angular-common": "23.1.1-develop.1",
45
- "@progress/kendo-angular-utils": "23.1.1-develop.1",
46
- "@progress/kendo-angular-navigation": "23.1.1-develop.1",
47
- "@progress/kendo-angular-dialog": "23.1.1-develop.1",
48
- "@progress/kendo-angular-intl": "23.1.1-develop.1",
49
- "@progress/kendo-angular-l10n": "23.1.1-develop.1",
50
- "@progress/kendo-angular-popup": "23.1.1-develop.1",
51
- "@progress/kendo-angular-icons": "23.1.1-develop.1",
43
+ "@progress/kendo-angular-buttons": "23.1.1-develop.3",
44
+ "@progress/kendo-angular-common": "23.1.1-develop.3",
45
+ "@progress/kendo-angular-utils": "23.1.1-develop.3",
46
+ "@progress/kendo-angular-navigation": "23.1.1-develop.3",
47
+ "@progress/kendo-angular-dialog": "23.1.1-develop.3",
48
+ "@progress/kendo-angular-intl": "23.1.1-develop.3",
49
+ "@progress/kendo-angular-l10n": "23.1.1-develop.3",
50
+ "@progress/kendo-angular-popup": "23.1.1-develop.3",
51
+ "@progress/kendo-angular-icons": "23.1.1-develop.3",
52
52
  "rxjs": "^6.5.3 || ^7.0.0"
53
53
  },
54
54
  "dependencies": {
55
55
  "tslib": "^2.3.1",
56
- "@progress/kendo-angular-schematics": "23.1.1-develop.1",
56
+ "@progress/kendo-angular-schematics": "23.1.1-develop.3",
57
57
  "@progress/kendo-common": "^1.0.1",
58
58
  "@progress/kendo-draggable": "^3.0.0",
59
59
  "@progress/kendo-inputs-common": "^3.1.0"