@progress/kendo-angular-inputs 25.4.0-develop.24 → 25.4.0-develop.26

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.
@@ -38,6 +38,24 @@ const isPresent = (value) => value !== null && value !== undefined;
38
38
  * @hidden
39
39
  */
40
40
  const areSame = (value1, value2) => value1 === value2 || (value1 === null && value2 === undefined) || (value1 === undefined && value2 === null);
41
+ /**
42
+ * @hidden
43
+ */
44
+ const limitMaxLength = (value, maxLength) => {
45
+ const exceedsMaxLength = isPresent(maxLength) && maxLength >= 0 && value?.length > maxLength;
46
+ if (!exceedsMaxLength) {
47
+ return value;
48
+ }
49
+ const limitedValue = value.slice(0, maxLength);
50
+ const lastCodeUnit = limitedValue.charCodeAt(limitedValue.length - 1);
51
+ const nextCodeUnit = value.charCodeAt(limitedValue.length);
52
+ const splitsSurrogatePair = lastCodeUnit >= 0xD800 && lastCodeUnit <= 0xDBFF &&
53
+ nextCodeUnit >= 0xDC00 && nextCodeUnit <= 0xDFFF;
54
+ if (splitsSurrogatePair) {
55
+ return limitedValue.slice(0, -1);
56
+ }
57
+ return limitedValue;
58
+ };
41
59
  /**
42
60
  * @hidden
43
61
  */
@@ -590,8 +608,8 @@ const packageMetadata = {
590
608
  productName: 'Kendo UI for Angular',
591
609
  productCode: 'KENDOUIANGULAR',
592
610
  productCodes: ['KENDOUIANGULAR'],
593
- publishDate: 1793608174,
594
- version: '25.4.0-develop.24',
611
+ publishDate: 1793619002,
612
+ version: '25.4.0-develop.26',
595
613
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
596
614
  };
597
615
 
@@ -8427,6 +8445,7 @@ class TextBoxComponent {
8427
8445
  prefix;
8428
8446
  control;
8429
8447
  subscriptions;
8448
+ composing = false;
8430
8449
  _focusableId = signal(`k-${guid()}`, ...(ngDevMode ? [{ debugName: "_focusableId" }] : []));
8431
8450
  _title = signal(undefined, ...(ngDevMode ? [{ debugName: "_title" }] : []));
8432
8451
  _type = signal('text', ...(ngDevMode ? [{ debugName: "_type" }] : []));
@@ -8560,10 +8579,27 @@ class TextBoxComponent {
8560
8579
  this.focusChangedProgrammatically = false;
8561
8580
  }
8562
8581
  };
8582
+ /**
8583
+ * @hidden
8584
+ */
8585
+ handleCompositionStart = () => {
8586
+ this.composing = true;
8587
+ };
8588
+ /**
8589
+ * @hidden
8590
+ */
8591
+ handleCompositionEnd = () => {
8592
+ this.composing = false;
8593
+ this.enforceMaxLength(true);
8594
+ };
8563
8595
  /**
8564
8596
  * @hidden
8565
8597
  */
8566
8598
  handleInputBlur = () => {
8599
+ if (this.composing) {
8600
+ this.composing = false;
8601
+ this.enforceMaxLength();
8602
+ }
8567
8603
  if (hasObservers(this.inputBlur) || requiresZoneOnBlur(this.control)) {
8568
8604
  this.ngZone.run(() => {
8569
8605
  this.ngTouched();
@@ -8579,8 +8615,14 @@ class TextBoxComponent {
8579
8615
  const target = ev.target;
8580
8616
  const isBrowserSafari = isSafari(navigator.userAgent);
8581
8617
  const incomingValue = isBrowserSafari && isJapanese(target.value) ? ev.data : target.value;
8618
+ const value = this.composing || ev.isComposing
8619
+ ? incomingValue
8620
+ : limitMaxLength(incomingValue, this.maxlength);
8582
8621
  const [caretStart, caretEnd] = [target.selectionStart, target.selectionEnd];
8583
- this.updateValue(incomingValue);
8622
+ if (value !== incomingValue) {
8623
+ target.value = value;
8624
+ }
8625
+ this.updateValue(value);
8584
8626
  if (isBrowserSafari) {
8585
8627
  target.setSelectionRange(caretStart, caretEnd);
8586
8628
  }
@@ -8771,6 +8813,17 @@ class TextBoxComponent {
8771
8813
  });
8772
8814
  }
8773
8815
  }
8816
+ enforceMaxLength(syncValue = false) {
8817
+ const target = this.input.nativeElement;
8818
+ const value = limitMaxLength(target.value, this.maxlength);
8819
+ if (value !== target.value) {
8820
+ target.value = value;
8821
+ this.updateValue(value);
8822
+ }
8823
+ else if (syncValue) {
8824
+ this.updateValue(value);
8825
+ }
8826
+ }
8774
8827
  /**
8775
8828
  * @hidden
8776
8829
  */
@@ -8860,7 +8913,9 @@ class TextBoxComponent {
8860
8913
  [kendoEventsOutsideAngular]="{
8861
8914
  focus: handleInputFocus,
8862
8915
  blur: handleInputBlur,
8863
- input: handleInput
8916
+ input: handleInput,
8917
+ compositionstart: handleCompositionStart,
8918
+ compositionend: handleCompositionEnd
8864
8919
  }"
8865
8920
  />
8866
8921
  @if (showClearButton()) {
@@ -8968,7 +9023,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.33", ngImpo
8968
9023
  [kendoEventsOutsideAngular]="{
8969
9024
  focus: handleInputFocus,
8970
9025
  blur: handleInputBlur,
8971
- input: handleInput
9026
+ input: handleInput,
9027
+ compositionstart: handleCompositionStart,
9028
+ compositionend: handleCompositionEnd
8972
9029
  }"
8973
9030
  />
8974
9031
  @if (showClearButton()) {
@@ -18957,6 +19014,7 @@ class TextFieldsBase {
18957
19014
  * @hidden
18958
19015
  */
18959
19016
  handleInputBlur = () => {
19017
+ this.onInputBlur();
18960
19018
  this.changeDetector.markForCheck();
18961
19019
  if (hasObservers(this.inputBlur) || requiresZoneOnBlur(this.control)) {
18962
19020
  this.ngZone.run(() => {
@@ -18965,6 +19023,7 @@ class TextFieldsBase {
18965
19023
  });
18966
19024
  }
18967
19025
  };
19026
+ onInputBlur() { }
18968
19027
  /**
18969
19028
  * @hidden
18970
19029
  * Called when the status of the component changes to or from `disabled`.
@@ -19259,6 +19318,7 @@ class TextAreaComponent extends TextFieldsBase {
19259
19318
  * The event does not fire when the value changes programmatically or through form control binding.
19260
19319
  */
19261
19320
  valueChange = new EventEmitter();
19321
+ composing = false;
19262
19322
  initialHeight;
19263
19323
  maxResizableHeight;
19264
19324
  resizeSubscription;
@@ -19466,14 +19526,39 @@ class TextAreaComponent extends TextFieldsBase {
19466
19526
  this._isFocused = value;
19467
19527
  }
19468
19528
  }
19529
+ /**
19530
+ * @hidden
19531
+ */
19532
+ handleCompositionStart = () => {
19533
+ this.composing = true;
19534
+ };
19535
+ /**
19536
+ * @hidden
19537
+ */
19538
+ handleCompositionEnd = () => {
19539
+ this.composing = false;
19540
+ this.enforceMaxLength(true);
19541
+ };
19469
19542
  /**
19470
19543
  * @hidden
19471
19544
  */
19472
19545
  handleInput = (ev) => {
19473
- const incomingValue = ev.target.value;
19546
+ const target = ev.target;
19547
+ const incomingValue = this.composing || ev.isComposing
19548
+ ? target.value
19549
+ : limitMaxLength(target.value, this.maxlength);
19550
+ if (incomingValue !== target.value) {
19551
+ target.value = incomingValue;
19552
+ }
19474
19553
  this.updateValue(incomingValue);
19475
19554
  this.resize();
19476
19555
  };
19556
+ onInputBlur() {
19557
+ if (this.composing) {
19558
+ this.composing = false;
19559
+ this.enforceMaxLength();
19560
+ }
19561
+ }
19477
19562
  /**
19478
19563
  * @hidden
19479
19564
  */
@@ -19586,6 +19671,18 @@ class TextAreaComponent extends TextFieldsBase {
19586
19671
  });
19587
19672
  }
19588
19673
  }
19674
+ enforceMaxLength(syncValue = false) {
19675
+ const target = this.input.nativeElement;
19676
+ const value = limitMaxLength(target.value, this.maxlength);
19677
+ if (value !== target.value) {
19678
+ target.value = value;
19679
+ this.updateValue(value);
19680
+ this.resize();
19681
+ }
19682
+ else if (syncValue) {
19683
+ this.updateValue(value);
19684
+ }
19685
+ }
19589
19686
  setSelection(start, end) {
19590
19687
  if (this.isFocused) {
19591
19688
  invokeElementMethod(this.input, 'setSelectionRange', start, end);
@@ -19660,7 +19757,10 @@ class TextAreaComponent extends TextFieldsBase {
19660
19757
  [kendoEventsOutsideAngular]="{
19661
19758
  focus: handleInputFocus,
19662
19759
  blur: handleInputBlur,
19663
- input: handleInput}"
19760
+ input: handleInput,
19761
+ compositionstart: handleCompositionStart,
19762
+ compositionend: handleCompositionEnd
19763
+ }"
19664
19764
  ></textarea>
19665
19765
  @if (suffix && showSuffixSeparator) {
19666
19766
  <kendo-input-separator
@@ -19722,7 +19822,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.33", ngImpo
19722
19822
  [kendoEventsOutsideAngular]="{
19723
19823
  focus: handleInputFocus,
19724
19824
  blur: handleInputBlur,
19725
- input: handleInput}"
19825
+ input: handleInput,
19826
+ compositionstart: handleCompositionStart,
19827
+ compositionend: handleCompositionEnd
19828
+ }"
19726
19829
  ></textarea>
19727
19830
  @if (suffix && showSuffixSeparator) {
19728
19831
  <kendo-input-separator
@@ -21061,7 +21164,7 @@ class FormComponent {
21061
21164
  this.localizationService = localizationService;
21062
21165
  const isValid = validatePackage(packageMetadata);
21063
21166
  this.licenseMessage = getLicenseMessage(packageMetadata);
21064
- this.showLicenseWatermark = shouldShowValidationUI(isValid);
21167
+ this.showLicenseWatermark = shouldShowValidationUI(isValid, packageMetadata);
21065
21168
  this.direction = localizationService.rtl ? 'rtl' : 'ltr';
21066
21169
  this.subscriptions.add(this.localizationService.changes.subscribe(({ rtl }) => {
21067
21170
  this.direction = rtl ? 'rtl' : 'ltr';
package/index.d.ts CHANGED
@@ -2118,6 +2118,7 @@ declare class TextBoxComponent implements ControlValueAccessor {
2118
2118
  prefix: TextBoxPrefixTemplateDirective | PrefixTemplateDirective;
2119
2119
  protected control: NgControl;
2120
2120
  protected subscriptions: Subscription;
2121
+ private composing;
2121
2122
  private _focusableId;
2122
2123
  private _title;
2123
2124
  private _type;
@@ -2166,6 +2167,14 @@ declare class TextBoxComponent implements ControlValueAccessor {
2166
2167
  * @hidden
2167
2168
  */
2168
2169
  handleInputFocus: () => void;
2170
+ /**
2171
+ * @hidden
2172
+ */
2173
+ handleCompositionStart: () => void;
2174
+ /**
2175
+ * @hidden
2176
+ */
2177
+ handleCompositionEnd: () => void;
2169
2178
  /**
2170
2179
  * @hidden
2171
2180
  */
@@ -2263,6 +2272,7 @@ declare class TextBoxComponent implements ControlValueAccessor {
2263
2272
  private setSelection;
2264
2273
  private selectAll;
2265
2274
  private updateValue;
2275
+ private enforceMaxLength;
2266
2276
  /**
2267
2277
  * @hidden
2268
2278
  */
@@ -2431,6 +2441,7 @@ declare abstract class TextFieldsBase {
2431
2441
  * @hidden
2432
2442
  */
2433
2443
  handleInputBlur: () => void;
2444
+ protected onInputBlur(): void;
2434
2445
  /**
2435
2446
  * @hidden
2436
2447
  * Called when the status of the component changes to or from `disabled`.
@@ -2685,6 +2696,7 @@ declare class TextAreaComponent extends TextFieldsBase implements ControlValueAc
2685
2696
  * The event does not fire when the value changes programmatically or through form control binding.
2686
2697
  */
2687
2698
  valueChange: EventEmitter<any>;
2699
+ private composing;
2688
2700
  private initialHeight;
2689
2701
  private maxResizableHeight;
2690
2702
  private resizeSubscription;
@@ -2757,10 +2769,19 @@ declare class TextAreaComponent extends TextFieldsBase implements ControlValueAc
2757
2769
  * @hidden
2758
2770
  */
2759
2771
  set isFocused(value: boolean);
2772
+ /**
2773
+ * @hidden
2774
+ */
2775
+ handleCompositionStart: () => void;
2776
+ /**
2777
+ * @hidden
2778
+ */
2779
+ handleCompositionEnd: () => void;
2760
2780
  /**
2761
2781
  * @hidden
2762
2782
  */
2763
2783
  handleInput: (ev: any) => void;
2784
+ protected onInputBlur(): void;
2764
2785
  /**
2765
2786
  * @hidden
2766
2787
  */
@@ -2784,6 +2805,7 @@ declare class TextAreaComponent extends TextFieldsBase implements ControlValueAc
2784
2805
  */
2785
2806
  handleBlur(): void;
2786
2807
  private updateValue;
2808
+ private enforceMaxLength;
2787
2809
  private setSelection;
2788
2810
  private selectAll;
2789
2811
  private handleClasses;
@@ -7,7 +7,7 @@ export const packageMetadata = {
7
7
  "productCodes": [
8
8
  "KENDOUIANGULAR"
9
9
  ],
10
- "publishDate": 1793608174,
11
- "version": "25.4.0-develop.24",
10
+ "publishDate": 1793619002,
11
+ "version": "25.4.0-develop.26",
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": "25.4.0-develop.24",
3
+ "version": "25.4.0-develop.26",
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",
@@ -62,7 +62,7 @@
62
62
  "package": {
63
63
  "productName": "Kendo UI for Angular",
64
64
  "productCode": "KENDOUIANGULAR",
65
- "publishDate": 1793608174,
65
+ "publishDate": 1793619002,
66
66
  "licensingDocsUrl": "https://www.telerik.com/kendo-angular-ui/my-license/"
67
67
  }
68
68
  },
@@ -73,21 +73,21 @@
73
73
  "@angular/forms": "20 - 22",
74
74
  "@angular/platform-browser": "20 - 22",
75
75
  "@progress/kendo-drawing": "^1.25.0",
76
- "@progress/kendo-licensing": "^1.11.0",
77
- "@progress/kendo-angular-buttons": "25.4.0-develop.24",
78
- "@progress/kendo-angular-common": "25.4.0-develop.24",
79
- "@progress/kendo-angular-utils": "25.4.0-develop.24",
80
- "@progress/kendo-angular-navigation": "25.4.0-develop.24",
81
- "@progress/kendo-angular-dialog": "25.4.0-develop.24",
82
- "@progress/kendo-angular-intl": "25.4.0-develop.24",
83
- "@progress/kendo-angular-l10n": "25.4.0-develop.24",
84
- "@progress/kendo-angular-popup": "25.4.0-develop.24",
85
- "@progress/kendo-angular-icons": "25.4.0-develop.24",
76
+ "@progress/kendo-licensing": "^1.12.0",
77
+ "@progress/kendo-angular-buttons": "25.4.0-develop.26",
78
+ "@progress/kendo-angular-common": "25.4.0-develop.26",
79
+ "@progress/kendo-angular-utils": "25.4.0-develop.26",
80
+ "@progress/kendo-angular-navigation": "25.4.0-develop.26",
81
+ "@progress/kendo-angular-dialog": "25.4.0-develop.26",
82
+ "@progress/kendo-angular-intl": "25.4.0-develop.26",
83
+ "@progress/kendo-angular-l10n": "25.4.0-develop.26",
84
+ "@progress/kendo-angular-popup": "25.4.0-develop.26",
85
+ "@progress/kendo-angular-icons": "25.4.0-develop.26",
86
86
  "rxjs": "^6.5.3 || ^7.0.0"
87
87
  },
88
88
  "dependencies": {
89
89
  "tslib": "^2.3.1",
90
- "@progress/kendo-angular-schematics": "25.4.0-develop.24",
90
+ "@progress/kendo-angular-schematics": "25.4.0-develop.26",
91
91
  "@progress/kendo-common": "^1.0.1",
92
92
  "@progress/kendo-draggable": "^3.0.0",
93
93
  "@progress/kendo-inputs-common": "^3.1.0"