@progress/kendo-angular-inputs 18.1.0-develop.30 → 18.1.0-develop.5
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/colorpicker/color-gradient.component.d.ts +1 -19
- package/colorpicker/color-input.component.d.ts +3 -15
- package/colorpicker/color-palette.component.d.ts +6 -16
- package/colorpicker/colorpicker.component.d.ts +8 -55
- package/colorpicker/flatcolorpicker-actions.component.d.ts +1 -3
- package/colorpicker/flatcolorpicker-header.component.d.ts +1 -3
- package/colorpicker/flatcolorpicker.component.d.ts +1 -19
- package/colorpicker/localization/messages.d.ts +1 -9
- package/esm2022/colorpicker/color-gradient.component.mjs +17 -75
- package/esm2022/colorpicker/color-input.component.mjs +23 -56
- package/esm2022/colorpicker/color-palette.component.mjs +15 -45
- package/esm2022/colorpicker/colorpicker.component.mjs +41 -182
- package/esm2022/colorpicker/flatcolorpicker-actions.component.mjs +7 -22
- package/esm2022/colorpicker/flatcolorpicker-header.component.mjs +3 -8
- package/esm2022/colorpicker/flatcolorpicker.component.mjs +17 -72
- package/esm2022/colorpicker/localization/messages.mjs +1 -13
- package/esm2022/colorpicker/services/flatcolorpicker.service.mjs +3 -3
- package/esm2022/colorpicker.module.mjs +2 -3
- package/esm2022/inputs.module.mjs +2 -3
- package/esm2022/otpinput/otpinput.component.mjs +45 -75
- package/esm2022/package-metadata.mjs +2 -2
- package/fesm2022/progress-kendo-angular-inputs.mjs +3092 -3765
- package/otpinput/models/separator-icon.d.ts +3 -9
- package/otpinput/otpinput.component.d.ts +7 -4
- package/package.json +11 -13
- package/colorpicker/adaptiveness/adaptive-close-button.component.d.ts +0 -20
- package/colorpicker/adaptiveness/adaptive-renderer.component.d.ts +0 -38
- package/colorpicker/color-gradient-text-label.directive.d.ts +0 -19
- package/colorpicker/models/adaptive-mode.d.ts +0 -23
- package/esm2022/colorpicker/adaptiveness/adaptive-close-button.component.mjs +0 -62
- package/esm2022/colorpicker/adaptiveness/adaptive-renderer.component.mjs +0 -205
- package/esm2022/colorpicker/color-gradient-text-label.directive.mjs +0 -34
- package/esm2022/colorpicker/models/adaptive-mode.mjs +0 -27
|
@@ -59,7 +59,7 @@ export class OTPInputComponent {
|
|
|
59
59
|
*/
|
|
60
60
|
spacing = true;
|
|
61
61
|
/**
|
|
62
|
-
*
|
|
62
|
+
* Adds a separator between groups of input fields.
|
|
63
63
|
*
|
|
64
64
|
* > The configuration can only be applied when `groupLength` is set.
|
|
65
65
|
*/
|
|
@@ -107,7 +107,7 @@ export class OTPInputComponent {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
this._groupLength = length;
|
|
110
|
-
this.
|
|
110
|
+
this.populateSeparatorPosititons();
|
|
111
111
|
}
|
|
112
112
|
/**
|
|
113
113
|
* Configures the value of the component. Unfilled input fields are represented with space.
|
|
@@ -116,8 +116,8 @@ export class OTPInputComponent {
|
|
|
116
116
|
return this._value;
|
|
117
117
|
}
|
|
118
118
|
set value(input) {
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
if (this._value === input ||
|
|
120
|
+
(this.type === 'number' && isPresent(input) && !this.isValidNumber(input))) {
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
123
123
|
if (!isPresent(input)) {
|
|
@@ -209,6 +209,10 @@ export class OTPInputComponent {
|
|
|
209
209
|
* might cause a mix-up with the built-in `valueChange` mechanisms of the `ngModel` or `formControl` bindings.
|
|
210
210
|
*/
|
|
211
211
|
valueChange = new EventEmitter();
|
|
212
|
+
/**
|
|
213
|
+
* Fires when the length of the trimmed value is equal to `length`.
|
|
214
|
+
*/
|
|
215
|
+
inputFinish = new EventEmitter();
|
|
212
216
|
/**
|
|
213
217
|
* Fires each time the user focuses the OTP Input.
|
|
214
218
|
*/
|
|
@@ -308,7 +312,7 @@ export class OTPInputComponent {
|
|
|
308
312
|
if (typeof this.groupLength === 'number') {
|
|
309
313
|
this.populateGroupArray(this.groupLength);
|
|
310
314
|
}
|
|
311
|
-
this.
|
|
315
|
+
this.populateSeparatorPosititons();
|
|
312
316
|
}
|
|
313
317
|
if (changes.spacing) {
|
|
314
318
|
if (this.spacing === true) {
|
|
@@ -319,12 +323,8 @@ export class OTPInputComponent {
|
|
|
319
323
|
}
|
|
320
324
|
}
|
|
321
325
|
if (changes.type && this.type === 'number') {
|
|
322
|
-
if (isPresent(this.value) && !this.
|
|
326
|
+
if (isPresent(this.value) && !this.isValidNumber(this.value)) {
|
|
323
327
|
this.value = null;
|
|
324
|
-
this.zone.runOutsideAngular(() => setTimeout(() => this.zone.run(() => {
|
|
325
|
-
this.ngChange(null);
|
|
326
|
-
this.cdr.markForCheck();
|
|
327
|
-
})));
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
330
|
}
|
|
@@ -395,13 +395,13 @@ export class OTPInputComponent {
|
|
|
395
395
|
* @hidden
|
|
396
396
|
*/
|
|
397
397
|
showGroupSeparator(index) {
|
|
398
|
-
return this.groupLengthArray && index < this.groupLengthArray.length - 1;
|
|
398
|
+
return this.separator && this.groupLengthArray && index < this.groupLengthArray.length - 1;
|
|
399
399
|
}
|
|
400
400
|
/**
|
|
401
401
|
* @hidden
|
|
402
402
|
*/
|
|
403
403
|
showSeparator(index) {
|
|
404
|
-
return this.groupLength ? this.separatorPositions.has(index) : false;
|
|
404
|
+
return this.separator && this.groupLength ? this.separatorPositions.has(index) : false;
|
|
405
405
|
}
|
|
406
406
|
/**
|
|
407
407
|
* @hidden
|
|
@@ -412,16 +412,16 @@ export class OTPInputComponent {
|
|
|
412
412
|
index = this.getIndexByGroup(groupIndex, index);
|
|
413
413
|
}
|
|
414
414
|
let newValue = '';
|
|
415
|
-
this.inputFields.forEach((input) => newValue = newValue.concat(input.value?.toString() ||
|
|
415
|
+
this.inputFields.forEach((input) => newValue = newValue.concat(input.value?.toString() || " "));
|
|
416
416
|
if (!areSame(this.value, newValue)) {
|
|
417
|
-
this.
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
this.valueChange.emit(newValue);
|
|
421
|
-
this.cdr.markForCheck();
|
|
422
|
-
});
|
|
417
|
+
this.value = newValue;
|
|
418
|
+
this.ngChange(newValue);
|
|
419
|
+
this.valueChange.emit(newValue);
|
|
423
420
|
}
|
|
424
421
|
this.inputFieldValueChanged = false;
|
|
422
|
+
if (this.value && this.value.trim().length === this.length) {
|
|
423
|
+
this.inputFinish.emit(this.value);
|
|
424
|
+
}
|
|
425
425
|
if (isPresent(index) && isPresent(this.inputFields?.get(index).value)) {
|
|
426
426
|
this.focusNext();
|
|
427
427
|
}
|
|
@@ -444,13 +444,7 @@ export class OTPInputComponent {
|
|
|
444
444
|
handleInput(event, index, groupIndex) {
|
|
445
445
|
if (this.type === 'number' && !this.isValidNumber(event?.data)) {
|
|
446
446
|
const inputIndex = groupIndex ? this.getIndexByGroup(groupIndex, index) : index;
|
|
447
|
-
|
|
448
|
-
if (this.value && this.isValidNumber(this.value[inputIndex])) {
|
|
449
|
-
textbox.value = this.value[inputIndex];
|
|
450
|
-
}
|
|
451
|
-
else {
|
|
452
|
-
textbox.value = null;
|
|
453
|
-
}
|
|
447
|
+
this.inputFields.get(inputIndex).value = null;
|
|
454
448
|
this.showInvalidInput(inputIndex);
|
|
455
449
|
return;
|
|
456
450
|
}
|
|
@@ -577,35 +571,24 @@ export class OTPInputComponent {
|
|
|
577
571
|
this.inputFields.get(this.focusedInput).focus();
|
|
578
572
|
}
|
|
579
573
|
handleKeydown(event) {
|
|
580
|
-
if (
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
event.preventDefault();
|
|
584
|
-
return;
|
|
585
|
-
}
|
|
574
|
+
if (event.keyCode === Keys.ArrowRight) {
|
|
575
|
+
event.preventDefault();
|
|
576
|
+
this.direction === 'ltr' ? this.focusNext() : this.focusPrevious();
|
|
586
577
|
}
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
break;
|
|
602
|
-
case Keys.Delete:
|
|
603
|
-
event.preventDefault();
|
|
604
|
-
this.inputFields.get(this.focusedInput).value = null;
|
|
605
|
-
this.handleValueChange();
|
|
606
|
-
break;
|
|
607
|
-
default:
|
|
608
|
-
break;
|
|
578
|
+
if (event.keyCode === Keys.ArrowLeft) {
|
|
579
|
+
event.preventDefault();
|
|
580
|
+
this.direction === 'ltr' ? this.focusPrevious() : this.focusNext();
|
|
581
|
+
}
|
|
582
|
+
if (event.keyCode === Keys.Backspace) {
|
|
583
|
+
event.preventDefault();
|
|
584
|
+
this.inputFields.get(this.focusedInput).value = null;
|
|
585
|
+
this.handleValueChange();
|
|
586
|
+
this.focusPrevious();
|
|
587
|
+
}
|
|
588
|
+
if (event.keyCode === Keys.Delete) {
|
|
589
|
+
event.preventDefault();
|
|
590
|
+
this.inputFields.get(this.focusedInput).value = null;
|
|
591
|
+
this.handleValueChange();
|
|
609
592
|
}
|
|
610
593
|
}
|
|
611
594
|
isValidGroupArray(groups) {
|
|
@@ -628,7 +611,7 @@ export class OTPInputComponent {
|
|
|
628
611
|
this.adjacentGroups = [...this.groupLengthArray];
|
|
629
612
|
}
|
|
630
613
|
}
|
|
631
|
-
|
|
614
|
+
populateSeparatorPosititons() {
|
|
632
615
|
let itemIndex = 0;
|
|
633
616
|
this.separatorPositions.clear();
|
|
634
617
|
if (!isPresent(this.groupLengthArray)) {
|
|
@@ -707,33 +690,18 @@ export class OTPInputComponent {
|
|
|
707
690
|
!isNaN(Number(trimmedValue));
|
|
708
691
|
}
|
|
709
692
|
showInvalidInput(index) {
|
|
710
|
-
const
|
|
711
|
-
|
|
712
|
-
const inputElement = textbox.input.nativeElement;
|
|
713
|
-
this.renderer.addClass(textboxElement, 'k-invalid');
|
|
714
|
-
if (textbox.value && this.isValidNumber(textbox.value)) {
|
|
715
|
-
this.zone.onStable.pipe(take(1)).subscribe(() => inputElement.select());
|
|
716
|
-
}
|
|
693
|
+
const inputElement = this.inputFields.get(index).hostElement.nativeElement;
|
|
694
|
+
this.renderer.addClass(inputElement, 'k-invalid');
|
|
717
695
|
this.zone.runOutsideAngular(() => {
|
|
718
696
|
setTimeout(() => {
|
|
719
|
-
if (!this.isControlInvalid &&
|
|
720
|
-
this.renderer.removeClass(
|
|
697
|
+
if (!this.isControlInvalid && inputElement) {
|
|
698
|
+
this.renderer.removeClass(inputElement, 'k-invalid');
|
|
721
699
|
}
|
|
722
700
|
}, 300);
|
|
723
701
|
});
|
|
724
702
|
}
|
|
725
|
-
containsDigitsOrSpaces(value) {
|
|
726
|
-
// @ts-expect-error TS does not allow comparing string with number
|
|
727
|
-
const isDigitOrSpace = (char) => (char == +char) || char === ' ';
|
|
728
|
-
for (let i = 0; i < value.length; i++) {
|
|
729
|
-
if (!isDigitOrSpace(value[i])) {
|
|
730
|
-
return false;
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
return true;
|
|
734
|
-
}
|
|
735
703
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: OTPInputComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.Injector }, { token: i0.Renderer2 }, { token: i1.LocalizationService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
736
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: OTPInputComponent, isStandalone: true, selector: "kendo-otpinput", inputs: { length: "length", type: "type", spacing: "spacing", separator: "separator", disabled: "disabled", readonly: "readonly", placeholder: "placeholder", groupLength: "groupLength", value: "value", size: "size", rounded: "rounded", fillMode: "fillMode", inputAttributes: "inputAttributes" }, outputs: { valueChange: "valueChange", onFocus: "focus", onBlur: "blur" }, host: { properties: { "class.k-otp": "this.wrapperClass", "class.k-invalid": "this.invalidClass", "attr.dir": "this.direction", "attr.role": "this.role" } }, providers: [
|
|
704
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: OTPInputComponent, isStandalone: true, selector: "kendo-otpinput", inputs: { length: "length", type: "type", spacing: "spacing", separator: "separator", disabled: "disabled", readonly: "readonly", placeholder: "placeholder", groupLength: "groupLength", value: "value", size: "size", rounded: "rounded", fillMode: "fillMode", inputAttributes: "inputAttributes" }, outputs: { valueChange: "valueChange", inputFinish: "inputFinish", onFocus: "focus", onBlur: "blur" }, host: { properties: { "class.k-otp": "this.wrapperClass", "class.k-invalid": "this.invalidClass", "attr.dir": "this.direction", "attr.role": "this.role" } }, providers: [
|
|
737
705
|
LocalizationService,
|
|
738
706
|
{ provide: L10N_PREFIX, useValue: 'kendo.otpinput' },
|
|
739
707
|
{
|
|
@@ -903,6 +871,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
903
871
|
type: Input
|
|
904
872
|
}], valueChange: [{
|
|
905
873
|
type: Output
|
|
874
|
+
}], inputFinish: [{
|
|
875
|
+
type: Output
|
|
906
876
|
}], onFocus: [{
|
|
907
877
|
type: Output,
|
|
908
878
|
args: ['focus']
|
|
@@ -10,7 +10,7 @@ export const packageMetadata = {
|
|
|
10
10
|
productName: 'Kendo UI for Angular',
|
|
11
11
|
productCode: 'KENDOUIANGULAR',
|
|
12
12
|
productCodes: ['KENDOUIANGULAR'],
|
|
13
|
-
publishDate:
|
|
14
|
-
version: '18.1.0-develop.
|
|
13
|
+
publishDate: 1738324844,
|
|
14
|
+
version: '18.1.0-develop.5',
|
|
15
15
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
|
16
16
|
};
|