@progress/kendo-angular-inputs 19.3.0-develop.4 → 19.3.0-develop.41
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-palette.component.d.ts +1 -1
- package/colorpicker/colorpicker.component.d.ts +1 -1
- package/common/formservice.service.d.ts +14 -0
- package/common/models/gutters.d.ts +28 -0
- package/common/models/responsive-breakpoints.d.ts +34 -0
- package/common/utils.d.ts +0 -4
- package/directives.d.ts +19 -1
- package/esm2022/colorpicker/color-palette.component.mjs +3 -2
- package/esm2022/colorpicker/colorpicker.component.mjs +5 -4
- package/esm2022/common/formservice.service.mjs +21 -0
- package/esm2022/common/models/gutters.mjs +5 -0
- package/esm2022/common/models/responsive-breakpoints.mjs +5 -0
- package/esm2022/common/utils.mjs +0 -4
- package/esm2022/directives.mjs +24 -0
- package/esm2022/form/form.component.mjs +153 -0
- package/esm2022/form/formseparator.component.mjs +80 -0
- package/esm2022/form/utils.mjs +144 -0
- package/esm2022/form.module.mjs +46 -0
- package/esm2022/formfield/formfield.component.mjs +47 -5
- package/esm2022/formfieldset/formfieldset.component.mjs +170 -0
- package/esm2022/index.mjs +5 -0
- package/esm2022/inputs.module.mjs +26 -23
- package/esm2022/numerictextbox/numerictextbox.component.mjs +5 -4
- package/esm2022/otpinput/otpinput.component.mjs +6 -5
- package/esm2022/package-metadata.mjs +2 -2
- package/esm2022/rangeslider/rangeslider.component.mjs +8 -3
- package/esm2022/rating/rating.component.mjs +31 -26
- package/esm2022/shared/shared-events.directive.mjs +1 -1
- package/esm2022/signature/signature.component.mjs +1 -1
- package/esm2022/slider/slider.component.mjs +5 -3
- package/esm2022/switch/switch.component.mjs +2 -2
- package/esm2022/text-fields-common/text-fields-base.mjs +1 -1
- package/esm2022/textarea/models/textarea-settings.mjs +5 -0
- package/esm2022/textarea/textarea.component.mjs +35 -4
- package/fesm2022/progress-kendo-angular-inputs.mjs +717 -62
- package/form/form.component.d.ts +70 -0
- package/form/formseparator.component.d.ts +32 -0
- package/form/utils.d.ts +62 -0
- package/form.module.d.ts +36 -0
- package/formfield/formfield.component.d.ts +19 -4
- package/formfieldset/formfieldset.component.d.ts +68 -0
- package/index.d.ts +8 -0
- package/inputs.module.d.ts +25 -22
- package/numerictextbox/numerictextbox.component.d.ts +1 -1
- package/package.json +13 -13
- package/rangeslider/rangeslider.component.d.ts +1 -1
- package/slider/slider.component.d.ts +1 -1
- package/text-fields-common/text-fields-base.d.ts +1 -1
- package/textarea/models/textarea-settings.d.ts +101 -0
- package/textarea/textarea.component.d.ts +9 -3
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { processCssValue } from '@progress/kendo-angular-common';
|
|
6
|
+
/**
|
|
7
|
+
* @hidden
|
|
8
|
+
*/
|
|
9
|
+
export const DEFAULT_FORM_GUTTERS = { rows: '0px', cols: '32px' };
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
export const DEFAULT_FORMFIELDSET_GUTTERS = { rows: '0px', cols: '16px' };
|
|
14
|
+
/**
|
|
15
|
+
* @hidden
|
|
16
|
+
*/
|
|
17
|
+
export function innerWidth(element) {
|
|
18
|
+
let width = element.clientWidth;
|
|
19
|
+
const style = getComputedStyle(element);
|
|
20
|
+
width -= (parseFloat(style.paddingLeft) || 0) + (parseFloat(style.borderLeftWidth) || 0);
|
|
21
|
+
width -= (parseFloat(style.paddingRight) || 0) + (parseFloat(style.borderRightWidth) || 0);
|
|
22
|
+
return width;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @hidden
|
|
26
|
+
*/
|
|
27
|
+
export function processBreakpoints(breakpoints, containerWidth) {
|
|
28
|
+
if (!breakpoints?.length || containerWidth === null) {
|
|
29
|
+
return '';
|
|
30
|
+
}
|
|
31
|
+
for (const [index, breakpoint] of breakpoints.entries()) {
|
|
32
|
+
const minBreakpointWidth = breakpoint.minWidth || breakpoints[index - 1]?.maxWidth + 1 || 0;
|
|
33
|
+
const maxBreakpointWidth = breakpoint.maxWidth || breakpoints[index + 1]?.minWidth - 1 || Infinity;
|
|
34
|
+
if (containerWidth >= minBreakpointWidth && containerWidth <= maxBreakpointWidth) {
|
|
35
|
+
return breakpoint.value;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return '';
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* @hidden
|
|
42
|
+
*/
|
|
43
|
+
export const calculateColumns = (cols, containerWidth) => {
|
|
44
|
+
if (!cols) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
if (Array.isArray(cols) && cols.length > 0) {
|
|
48
|
+
const processedCols = processBreakpoints(cols, containerWidth) || null;
|
|
49
|
+
return typeof processedCols === 'string' ? parseInt(processedCols, 10) : processedCols;
|
|
50
|
+
}
|
|
51
|
+
else if (typeof cols === 'number') {
|
|
52
|
+
return cols;
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* @hidden
|
|
58
|
+
*
|
|
59
|
+
* Calculates gutters for rows and columns based on responsive breakpoints or fixed values
|
|
60
|
+
*/
|
|
61
|
+
export const calculateGutters = (gutters, containerWidth) => {
|
|
62
|
+
if (!gutters) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
if (typeof gutters === 'number' || typeof gutters === 'string') {
|
|
66
|
+
return { cols: gutters, rows: gutters };
|
|
67
|
+
}
|
|
68
|
+
else if (Array.isArray(gutters)) {
|
|
69
|
+
const processedGutters = processBreakpoints(gutters, containerWidth) || null;
|
|
70
|
+
return processedGutters !== null ? { cols: processedGutters, rows: processedGutters } : null;
|
|
71
|
+
}
|
|
72
|
+
else if (typeof gutters === 'object') {
|
|
73
|
+
const gutterObject = gutters;
|
|
74
|
+
const result = { rows: null, cols: null };
|
|
75
|
+
if (gutterObject.cols !== undefined && gutterObject.cols !== null) {
|
|
76
|
+
if (typeof gutterObject.cols === 'number' || typeof gutterObject.cols === 'string') {
|
|
77
|
+
result.cols = gutterObject.cols;
|
|
78
|
+
}
|
|
79
|
+
else if (Array.isArray(gutterObject.cols)) {
|
|
80
|
+
result.cols = processBreakpoints(gutterObject.cols, containerWidth) || null;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
result.cols = null;
|
|
85
|
+
}
|
|
86
|
+
if (gutterObject.rows !== undefined) {
|
|
87
|
+
if (typeof gutterObject.rows === 'number' || typeof gutterObject.rows === 'string') {
|
|
88
|
+
result.rows = gutterObject.rows;
|
|
89
|
+
}
|
|
90
|
+
else if (Array.isArray(gutterObject.rows)) {
|
|
91
|
+
result.rows = processBreakpoints(gutterObject.rows, containerWidth) || null;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
result.rows = null;
|
|
96
|
+
}
|
|
97
|
+
return result;
|
|
98
|
+
}
|
|
99
|
+
return null;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* @hidden
|
|
103
|
+
*
|
|
104
|
+
* Calculates column span value based on responsive breakpoints or fixed number
|
|
105
|
+
*/
|
|
106
|
+
export const calculateColSpan = (colSpan, containerWidth) => {
|
|
107
|
+
if (!colSpan) {
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
if (typeof colSpan === 'number') {
|
|
111
|
+
return colSpan;
|
|
112
|
+
}
|
|
113
|
+
else if (Array.isArray(colSpan) && colSpan.length > 0) {
|
|
114
|
+
const processedColSpan = processBreakpoints(colSpan, containerWidth) || null;
|
|
115
|
+
return typeof processedColSpan === 'string' ? parseInt(processedColSpan, 10) : processedColSpan;
|
|
116
|
+
}
|
|
117
|
+
return null;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* @hidden
|
|
121
|
+
*
|
|
122
|
+
* Generates CSS class names for columns
|
|
123
|
+
*/
|
|
124
|
+
export const generateColumnClass = (columnsNumber) => {
|
|
125
|
+
return columnsNumber && columnsNumber > 0 ? `k-grid-cols-${columnsNumber}` : '';
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* @hidden
|
|
129
|
+
*
|
|
130
|
+
* Generates CSS styles for gutters based on the provided gutters object.
|
|
131
|
+
*/
|
|
132
|
+
export const generateGuttersStyling = (gutters, defaultGutters = DEFAULT_FORM_GUTTERS) => {
|
|
133
|
+
const rows = processCssValue(gutters?.rows);
|
|
134
|
+
const cols = processCssValue(gutters?.cols);
|
|
135
|
+
return `${rows ?? defaultGutters.rows} ${cols ?? defaultGutters.cols}`;
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* @hidden
|
|
139
|
+
*
|
|
140
|
+
* Generates CSS class name for column span
|
|
141
|
+
*/
|
|
142
|
+
export const generateColSpanClass = (colSpan) => {
|
|
143
|
+
return colSpan ? `k-col-span-${colSpan}` : '';
|
|
144
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { NgModule } from '@angular/core';
|
|
6
|
+
import { KENDO_FORM } from './directives';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
import * as i1 from "./form/form.component";
|
|
9
|
+
import * as i2 from "./form/formseparator.component";
|
|
10
|
+
import * as i3 from "./formfieldset/formfieldset.component";
|
|
11
|
+
import * as i4 from "./formfield/formfield.component";
|
|
12
|
+
import * as i5 from "./formfield/hint.component";
|
|
13
|
+
import * as i6 from "./formfield/error.component";
|
|
14
|
+
//IMPORTANT: NgModule export kept for backwards compatibility
|
|
15
|
+
/**
|
|
16
|
+
* Defines the [NgModule](link:site.data.urls.angular['ngmoduleapi']) for the FormField, Error, and Hint components.
|
|
17
|
+
*
|
|
18
|
+
* Use this module to add Form features to your NgModule-based Angular application.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* import { FormModule } from '@progress/kendo-angular-inputs';
|
|
23
|
+
* import { NgModule } from '@angular/core';
|
|
24
|
+
* import { BrowserModule } from '@angular/platform-browser';
|
|
25
|
+
* import { AppComponent } from './app.component';
|
|
26
|
+
*
|
|
27
|
+
* @NgModule({
|
|
28
|
+
* declarations: [AppComponent],
|
|
29
|
+
* imports: [BrowserModule, FormModule],
|
|
30
|
+
* bootstrap: [AppComponent]
|
|
31
|
+
* })
|
|
32
|
+
* export class AppModule {}
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export class FormModule {
|
|
36
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
37
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: FormModule, imports: [i1.FormComponent, i2.FormSeparatorComponent, i3.FormFieldSetComponent, i4.FormFieldComponent, i5.HintComponent, i6.ErrorComponent], exports: [i1.FormComponent, i2.FormSeparatorComponent, i3.FormFieldSetComponent, i4.FormFieldComponent, i5.HintComponent, i6.ErrorComponent] });
|
|
38
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormModule, imports: [i1.FormComponent] });
|
|
39
|
+
}
|
|
40
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormModule, decorators: [{
|
|
41
|
+
type: NgModule,
|
|
42
|
+
args: [{
|
|
43
|
+
imports: [...KENDO_FORM],
|
|
44
|
+
exports: [...KENDO_FORM]
|
|
45
|
+
}]
|
|
46
|
+
}] });
|
|
@@ -12,8 +12,12 @@ import { packageMetadata } from '../package-metadata';
|
|
|
12
12
|
import { ErrorComponent } from './error.component';
|
|
13
13
|
import { HintComponent } from './hint.component';
|
|
14
14
|
import { NgIf } from '@angular/common';
|
|
15
|
+
import { FormService } from '../common/formservice.service';
|
|
16
|
+
import { filter } from 'rxjs/operators';
|
|
17
|
+
import { calculateColSpan, generateColSpanClass } from '../form/utils';
|
|
15
18
|
import * as i0 from "@angular/core";
|
|
16
19
|
import * as i1 from "@progress/kendo-angular-l10n";
|
|
20
|
+
import * as i2 from "../common/formservice.service";
|
|
17
21
|
/**
|
|
18
22
|
* Represents the Kendo UI FormField component for Angular.
|
|
19
23
|
* Use this component to group form-bound controls (Kendo Angular components or native HTML controls).
|
|
@@ -36,6 +40,7 @@ export class FormFieldComponent {
|
|
|
36
40
|
renderer;
|
|
37
41
|
localizationService;
|
|
38
42
|
hostElement;
|
|
43
|
+
formService;
|
|
39
44
|
hostClass = true;
|
|
40
45
|
/**
|
|
41
46
|
* @hidden
|
|
@@ -78,6 +83,8 @@ export class FormFieldComponent {
|
|
|
78
83
|
/**
|
|
79
84
|
* Specifies the layout orientation of the form field.
|
|
80
85
|
*
|
|
86
|
+
* @hidden
|
|
87
|
+
*
|
|
81
88
|
* @default 'vertical'
|
|
82
89
|
*/
|
|
83
90
|
orientation = 'vertical';
|
|
@@ -89,6 +96,11 @@ export class FormFieldComponent {
|
|
|
89
96
|
* @default 'initial'
|
|
90
97
|
*/
|
|
91
98
|
showErrors = 'initial';
|
|
99
|
+
/**
|
|
100
|
+
* Defines the colspan for the form field.
|
|
101
|
+
* Can be a number or an array of responsive breakpoints.
|
|
102
|
+
*/
|
|
103
|
+
colSpan;
|
|
92
104
|
/**
|
|
93
105
|
* @hidden
|
|
94
106
|
*/
|
|
@@ -110,15 +122,23 @@ export class FormFieldComponent {
|
|
|
110
122
|
control;
|
|
111
123
|
subscriptions = new Subscription();
|
|
112
124
|
rtl = false;
|
|
113
|
-
|
|
125
|
+
_formWidth = null;
|
|
126
|
+
_colSpanClass = null;
|
|
127
|
+
_previousColSpan = null;
|
|
128
|
+
constructor(renderer, localizationService, hostElement, formService) {
|
|
114
129
|
this.renderer = renderer;
|
|
115
130
|
this.localizationService = localizationService;
|
|
116
131
|
this.hostElement = hostElement;
|
|
132
|
+
this.formService = formService;
|
|
117
133
|
validatePackage(packageMetadata);
|
|
118
134
|
this.subscriptions.add(this.localizationService.changes.subscribe(({ rtl }) => {
|
|
119
135
|
this.rtl = rtl;
|
|
120
136
|
this.direction = this.rtl ? 'rtl' : 'ltr';
|
|
121
137
|
}));
|
|
138
|
+
this.subscriptions.add(this.formService.formWidth.pipe(filter((width) => width !== null)).subscribe((width) => {
|
|
139
|
+
this._formWidth = width;
|
|
140
|
+
this.updateColSpanClass();
|
|
141
|
+
}));
|
|
122
142
|
}
|
|
123
143
|
ngAfterViewInit() {
|
|
124
144
|
this.setDescription();
|
|
@@ -126,6 +146,11 @@ export class FormFieldComponent {
|
|
|
126
146
|
ngAfterViewChecked() {
|
|
127
147
|
this.updateDescription();
|
|
128
148
|
}
|
|
149
|
+
ngOnChanges(changes) {
|
|
150
|
+
if (changes['colSpan']) {
|
|
151
|
+
this.updateColSpanClass();
|
|
152
|
+
}
|
|
153
|
+
}
|
|
129
154
|
ngOnDestroy() {
|
|
130
155
|
this.subscriptions.unsubscribe();
|
|
131
156
|
}
|
|
@@ -230,14 +255,29 @@ export class FormFieldComponent {
|
|
|
230
255
|
this.subscriptions.add(this.errorChildren.changes.subscribe(() => this.updateDescription()));
|
|
231
256
|
this.subscriptions.add(this.hintChildren.changes.subscribe(() => this.updateDescription()));
|
|
232
257
|
}
|
|
233
|
-
|
|
234
|
-
|
|
258
|
+
updateColSpanClass() {
|
|
259
|
+
const hostElement = this.hostElement.nativeElement;
|
|
260
|
+
const newColSpan = calculateColSpan(this.colSpan, this._formWidth);
|
|
261
|
+
if (newColSpan !== this._previousColSpan) {
|
|
262
|
+
const newClass = generateColSpanClass(newColSpan);
|
|
263
|
+
if (this._colSpanClass) {
|
|
264
|
+
this.renderer.removeClass(hostElement, this._colSpanClass);
|
|
265
|
+
}
|
|
266
|
+
if (newClass) {
|
|
267
|
+
this.renderer.addClass(hostElement, newClass);
|
|
268
|
+
}
|
|
269
|
+
this._colSpanClass = newClass;
|
|
270
|
+
this._previousColSpan = newColSpan;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormFieldComponent, deps: [{ token: i0.Renderer2 }, { token: i1.LocalizationService }, { token: i0.ElementRef }, { token: i2.FormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
274
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FormFieldComponent, isStandalone: true, selector: "kendo-formfield", inputs: { showHints: "showHints", orientation: "orientation", showErrors: "showErrors", colSpan: "colSpan" }, host: { properties: { "class.k-form-field": "this.hostClass", "attr.dir": "this.direction", "class.k-form-field-error": "this.errorClass", "class.k-form-field-disabled": "this.disabledClass" } }, providers: [
|
|
235
275
|
LocalizationService,
|
|
236
276
|
{
|
|
237
277
|
provide: L10N_PREFIX,
|
|
238
278
|
useValue: 'kendo.formfield'
|
|
239
279
|
}
|
|
240
|
-
], queries: [{ propertyName: "kendoInput", first: true, predicate: KendoInput, descendants: true, static: true }, { propertyName: "formControls", predicate: NgControl, descendants: true }, { propertyName: "controlElementRefs", predicate: NgControl, descendants: true, read: ElementRef }, { propertyName: "errorChildren", predicate: ErrorComponent, descendants: true }, { propertyName: "hintChildren", predicate: HintComponent, descendants: true }], ngImport: i0, template: `
|
|
280
|
+
], queries: [{ propertyName: "kendoInput", first: true, predicate: KendoInput, descendants: true, static: true }, { propertyName: "formControls", predicate: NgControl, descendants: true }, { propertyName: "controlElementRefs", predicate: NgControl, descendants: true, read: ElementRef }, { propertyName: "errorChildren", predicate: ErrorComponent, descendants: true }, { propertyName: "hintChildren", predicate: HintComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: `
|
|
241
281
|
<ng-content select="label, kendo-label"></ng-content>
|
|
242
282
|
<div class="k-form-field-wrap">
|
|
243
283
|
<ng-content></ng-content>
|
|
@@ -268,7 +308,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
268
308
|
standalone: true,
|
|
269
309
|
imports: [NgIf]
|
|
270
310
|
}]
|
|
271
|
-
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i1.LocalizationService }, { type: i0.ElementRef }]; }, propDecorators: { hostClass: [{
|
|
311
|
+
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i1.LocalizationService }, { type: i0.ElementRef }, { type: i2.FormService }]; }, propDecorators: { hostClass: [{
|
|
272
312
|
type: HostBinding,
|
|
273
313
|
args: ['class.k-form-field']
|
|
274
314
|
}], direction: [{
|
|
@@ -301,4 +341,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
301
341
|
type: Input
|
|
302
342
|
}], showErrors: [{
|
|
303
343
|
type: Input
|
|
344
|
+
}], colSpan: [{
|
|
345
|
+
type: Input
|
|
304
346
|
}] } });
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { NgClass, NgIf, NgStyle } from '@angular/common';
|
|
6
|
+
import { Component, HostBinding, Input, ElementRef, Renderer2, ChangeDetectorRef, } from '@angular/core';
|
|
7
|
+
import { FormService } from '../common/formservice.service';
|
|
8
|
+
import { filter } from 'rxjs/operators';
|
|
9
|
+
import { calculateColSpan, calculateColumns, calculateGutters, DEFAULT_FORMFIELDSET_GUTTERS, generateColSpanClass, generateColumnClass, generateGuttersStyling } from '../form/utils';
|
|
10
|
+
import { Subscription } from 'rxjs';
|
|
11
|
+
import { validatePackage } from '@progress/kendo-licensing';
|
|
12
|
+
import { packageMetadata } from '../package-metadata';
|
|
13
|
+
import * as i0 from "@angular/core";
|
|
14
|
+
import * as i1 from "../common/formservice.service";
|
|
15
|
+
/**
|
|
16
|
+
* Represents the Kendo UI FormFieldSet component for Angular.
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* Supported children components are: {@link FormFieldComponent} and {@link FormSeparatorComponent}.
|
|
20
|
+
*/
|
|
21
|
+
export class FormFieldSetComponent {
|
|
22
|
+
elementRef;
|
|
23
|
+
renderer;
|
|
24
|
+
formService;
|
|
25
|
+
cdr;
|
|
26
|
+
formFieldSetClass = true;
|
|
27
|
+
/**
|
|
28
|
+
* Defines the legend for the fieldset.
|
|
29
|
+
*/
|
|
30
|
+
legend;
|
|
31
|
+
/**
|
|
32
|
+
* Defines the number of columns of the fieldset.
|
|
33
|
+
* Can be a number or an array of responsive breakpoints.
|
|
34
|
+
*/
|
|
35
|
+
cols;
|
|
36
|
+
/**
|
|
37
|
+
* Defines the gutters for the fieldset.
|
|
38
|
+
* You can specify gutters for rows and columns.
|
|
39
|
+
*/
|
|
40
|
+
gutters = { ...DEFAULT_FORMFIELDSET_GUTTERS };
|
|
41
|
+
/**
|
|
42
|
+
* Defines the colspan for the fieldset related to the parent Form component columns.
|
|
43
|
+
* Can be a number or an array of responsive breakpoints.
|
|
44
|
+
*/
|
|
45
|
+
colSpan;
|
|
46
|
+
/**
|
|
47
|
+
* @hidden
|
|
48
|
+
*/
|
|
49
|
+
columnsClass = '';
|
|
50
|
+
/**
|
|
51
|
+
* @hidden
|
|
52
|
+
*/
|
|
53
|
+
guttersStyle = '';
|
|
54
|
+
_formColumnsNumber;
|
|
55
|
+
_colSpanClass = null;
|
|
56
|
+
_formWidth = null;
|
|
57
|
+
_formGutters = { ...DEFAULT_FORMFIELDSET_GUTTERS };
|
|
58
|
+
_previousColSpan = null;
|
|
59
|
+
_previousCols = null;
|
|
60
|
+
_previousGutters;
|
|
61
|
+
subs = new Subscription();
|
|
62
|
+
constructor(elementRef, renderer, formService, cdr) {
|
|
63
|
+
this.elementRef = elementRef;
|
|
64
|
+
this.renderer = renderer;
|
|
65
|
+
this.formService = formService;
|
|
66
|
+
this.cdr = cdr;
|
|
67
|
+
validatePackage(packageMetadata);
|
|
68
|
+
}
|
|
69
|
+
ngOnInit() {
|
|
70
|
+
this.subs.add(this.formService.formWidth.pipe(filter((width) => width !== null)).subscribe((width) => {
|
|
71
|
+
this._formWidth = width;
|
|
72
|
+
this.applyColumns();
|
|
73
|
+
this.applyGutters();
|
|
74
|
+
this.updateColSpanClass();
|
|
75
|
+
}));
|
|
76
|
+
}
|
|
77
|
+
ngOnChanges(changes) {
|
|
78
|
+
if (changes['colSpan']) {
|
|
79
|
+
this.updateColSpanClass();
|
|
80
|
+
}
|
|
81
|
+
if (changes['cols']) {
|
|
82
|
+
this.applyColumns();
|
|
83
|
+
}
|
|
84
|
+
if (changes['gutters']) {
|
|
85
|
+
this.applyGutters();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
ngOnDestroy() {
|
|
89
|
+
this.subs.unsubscribe();
|
|
90
|
+
}
|
|
91
|
+
applyColumns() {
|
|
92
|
+
const containerWidth = this._formWidth;
|
|
93
|
+
const newColumnsNumber = calculateColumns(this.cols, containerWidth);
|
|
94
|
+
if (newColumnsNumber !== this._previousCols) {
|
|
95
|
+
this._formColumnsNumber = newColumnsNumber;
|
|
96
|
+
this.updateColumnClasses();
|
|
97
|
+
this._previousCols = newColumnsNumber;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
applyGutters() {
|
|
101
|
+
const containerWidth = this._formWidth;
|
|
102
|
+
const newGutters = calculateGutters(this.gutters, containerWidth);
|
|
103
|
+
if (newGutters && (newGutters.cols !== this._previousGutters?.cols || newGutters.rows !== this._previousGutters?.rows)) {
|
|
104
|
+
this._formGutters = newGutters;
|
|
105
|
+
this.updateGutterClasses();
|
|
106
|
+
this._previousGutters = newGutters;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
updateColumnClasses() {
|
|
110
|
+
this.columnsClass = generateColumnClass(this._formColumnsNumber);
|
|
111
|
+
this.cdr.detectChanges();
|
|
112
|
+
}
|
|
113
|
+
updateGutterClasses() {
|
|
114
|
+
this.guttersStyle = generateGuttersStyling(this._formGutters, { ...DEFAULT_FORMFIELDSET_GUTTERS });
|
|
115
|
+
this.cdr.detectChanges();
|
|
116
|
+
}
|
|
117
|
+
updateColSpanClass() {
|
|
118
|
+
const hostElement = this.elementRef.nativeElement;
|
|
119
|
+
const newColSpan = calculateColSpan(this.colSpan, this._formWidth);
|
|
120
|
+
if (newColSpan !== this._previousColSpan) {
|
|
121
|
+
const newClass = generateColSpanClass(newColSpan);
|
|
122
|
+
if (this._colSpanClass) {
|
|
123
|
+
this.renderer.removeClass(hostElement, this._colSpanClass);
|
|
124
|
+
}
|
|
125
|
+
if (newClass) {
|
|
126
|
+
this.renderer.addClass(hostElement, newClass);
|
|
127
|
+
}
|
|
128
|
+
this._colSpanClass = newClass;
|
|
129
|
+
this._previousColSpan = newColSpan;
|
|
130
|
+
this.cdr.detectChanges();
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormFieldSetComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1.FormService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
134
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FormFieldSetComponent, isStandalone: true, selector: "fieldset[kendoFormFieldSet]", inputs: { legend: "legend", cols: "cols", gutters: "gutters", colSpan: "colSpan" }, host: { properties: { "class.k-form-fieldset": "this.formFieldSetClass" } }, exportAs: ["kendoFormFieldSet"], usesOnChanges: true, ngImport: i0, template: `
|
|
135
|
+
<legend *ngIf="legend" class="k-form-legend">
|
|
136
|
+
{{ legend }}
|
|
137
|
+
</legend>
|
|
138
|
+
<div class="k-form-layout k-d-grid" [ngClass]="[columnsClass]" [ngStyle]="{'gap': guttersStyle}">
|
|
139
|
+
<ng-content></ng-content>
|
|
140
|
+
</div>
|
|
141
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
142
|
+
}
|
|
143
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormFieldSetComponent, decorators: [{
|
|
144
|
+
type: Component,
|
|
145
|
+
args: [{
|
|
146
|
+
exportAs: 'kendoFormFieldSet',
|
|
147
|
+
selector: 'fieldset[kendoFormFieldSet]',
|
|
148
|
+
template: `
|
|
149
|
+
<legend *ngIf="legend" class="k-form-legend">
|
|
150
|
+
{{ legend }}
|
|
151
|
+
</legend>
|
|
152
|
+
<div class="k-form-layout k-d-grid" [ngClass]="[columnsClass]" [ngStyle]="{'gap': guttersStyle}">
|
|
153
|
+
<ng-content></ng-content>
|
|
154
|
+
</div>
|
|
155
|
+
`,
|
|
156
|
+
standalone: true,
|
|
157
|
+
imports: [NgIf, NgClass, NgStyle],
|
|
158
|
+
}]
|
|
159
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i1.FormService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { formFieldSetClass: [{
|
|
160
|
+
type: HostBinding,
|
|
161
|
+
args: ['class.k-form-fieldset']
|
|
162
|
+
}], legend: [{
|
|
163
|
+
type: Input
|
|
164
|
+
}], cols: [{
|
|
165
|
+
type: Input
|
|
166
|
+
}], gutters: [{
|
|
167
|
+
type: Input
|
|
168
|
+
}], colSpan: [{
|
|
169
|
+
type: Input
|
|
170
|
+
}] } });
|
package/esm2022/index.mjs
CHANGED
|
@@ -35,10 +35,15 @@ export * from './colorpicker/events';
|
|
|
35
35
|
export { FlatColorPickerComponent } from './colorpicker/flatcolorpicker.component';
|
|
36
36
|
export { CheckBoxDirective } from './checkbox/checkbox.directive';
|
|
37
37
|
export { RadioButtonDirective } from './radiobutton/radiobutton.directive';
|
|
38
|
+
// Form Components
|
|
39
|
+
export { FormComponent } from './form/form.component';
|
|
40
|
+
export { FormSeparatorComponent } from './form/formseparator.component';
|
|
41
|
+
export { FormFieldSetComponent } from './formfieldset/formfieldset.component';
|
|
38
42
|
export { HintComponent } from './formfield/hint.component';
|
|
39
43
|
export { ErrorComponent } from './formfield/error.component';
|
|
40
44
|
export { FormFieldComponent } from './formfield/formfield.component';
|
|
41
45
|
export { FormFieldModule } from './formfield.module';
|
|
46
|
+
export { FormModule } from './form.module';
|
|
42
47
|
//TextBox Component
|
|
43
48
|
export { TextBoxComponent } from './textbox/textbox.component';
|
|
44
49
|
export { TextBoxPrefixTemplateDirective } from './textbox/textbox-prefix.directive';
|
|
@@ -30,27 +30,30 @@ import * as i17 from "./radiobutton/radiobutton.component";
|
|
|
30
30
|
import * as i18 from "./radiobutton/radiobutton.directive";
|
|
31
31
|
import * as i19 from "./switch/switch.component";
|
|
32
32
|
import * as i20 from "./switch/localization/custom-messages.component";
|
|
33
|
-
import * as i21 from "./
|
|
34
|
-
import * as i22 from "./
|
|
35
|
-
import * as i23 from "./
|
|
36
|
-
import * as i24 from "./
|
|
37
|
-
import * as i25 from "./
|
|
38
|
-
import * as i26 from "./
|
|
39
|
-
import * as i27 from "./
|
|
40
|
-
import * as i28 from "./
|
|
41
|
-
import * as i29 from "./
|
|
42
|
-
import * as i30 from "./
|
|
43
|
-
import * as i31 from "./
|
|
44
|
-
import * as i32 from "./rating/
|
|
45
|
-
import * as i33 from "./
|
|
46
|
-
import * as i34 from "./
|
|
47
|
-
import * as i35 from "./
|
|
48
|
-
import * as i36 from "./
|
|
49
|
-
import * as i37 from "./
|
|
50
|
-
import * as i38 from "./colorpicker/
|
|
51
|
-
import * as i39 from "./colorpicker/
|
|
52
|
-
import * as i40 from "./
|
|
53
|
-
import * as i41 from "./
|
|
33
|
+
import * as i21 from "./form/form.component";
|
|
34
|
+
import * as i22 from "./form/formseparator.component";
|
|
35
|
+
import * as i23 from "./formfieldset/formfieldset.component";
|
|
36
|
+
import * as i24 from "./formfield/formfield.component";
|
|
37
|
+
import * as i25 from "./formfield/hint.component";
|
|
38
|
+
import * as i26 from "./formfield/error.component";
|
|
39
|
+
import * as i27 from "./slider/slider.component";
|
|
40
|
+
import * as i28 from "./slider/localization/custom-messages.component";
|
|
41
|
+
import * as i29 from "./sliders-common/label-template.directive";
|
|
42
|
+
import * as i30 from "./rangeslider/rangeslider.component";
|
|
43
|
+
import * as i31 from "./rangeslider/localization/custom-messages.component";
|
|
44
|
+
import * as i32 from "./rating/rating.component";
|
|
45
|
+
import * as i33 from "./rating/directives/rating-item.directive";
|
|
46
|
+
import * as i34 from "./rating/directives/rating-hovered-item.directive";
|
|
47
|
+
import * as i35 from "./rating/directives/rating-selected-item.directive";
|
|
48
|
+
import * as i36 from "./signature/signature.component";
|
|
49
|
+
import * as i37 from "./signature/localization/custom-messages.component";
|
|
50
|
+
import * as i38 from "./colorpicker/colorpicker.component";
|
|
51
|
+
import * as i39 from "./colorpicker/localization/custom-messages.component";
|
|
52
|
+
import * as i40 from "./colorpicker/flatcolorpicker.component";
|
|
53
|
+
import * as i41 from "./colorpicker/color-gradient.component";
|
|
54
|
+
import * as i42 from "./colorpicker/color-palette.component";
|
|
55
|
+
import * as i43 from "./otpinput/otpinput.component";
|
|
56
|
+
import * as i44 from "./otpinput/localization/custom-messages.component";
|
|
54
57
|
//IMPORTANT: NgModule export kept for backwards compatibility
|
|
55
58
|
/**
|
|
56
59
|
* Defines the [`NgModule`](link:site.data.urls.angular['ngmoduleapi']) for the Inputs components.
|
|
@@ -74,8 +77,8 @@ import * as i41 from "./otpinput/localization/custom-messages.component";
|
|
|
74
77
|
*/
|
|
75
78
|
export class InputsModule {
|
|
76
79
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: InputsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
77
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: InputsModule, imports: [i1.TextBoxDirective, i2.TextBoxComponent, i3.InputSeparatorComponent, i4.TextBoxSuffixTemplateDirective, i5.TextBoxPrefixTemplateDirective, i6.TextBoxCustomMessagesComponent, i7.PrefixTemplateDirective, i7.SuffixTemplateDirective, i7.SeparatorComponent, i8.NumericTextBoxComponent, i9.NumericTextBoxCustomMessagesComponent, i7.PrefixTemplateDirective, i7.SuffixTemplateDirective, i7.SeparatorComponent, i10.MaskedTextBoxComponent, i7.PrefixTemplateDirective, i7.SuffixTemplateDirective, i7.SeparatorComponent, i11.TextAreaComponent, i12.TextAreaDirective, i13.TextAreaPrefixComponent, i14.TextAreaSuffixComponent, i7.SeparatorComponent, i15.CheckBoxComponent, i16.CheckBoxDirective, i17.RadioButtonComponent, i18.RadioButtonDirective, i19.SwitchComponent, i20.SwitchCustomMessagesComponent, i21.
|
|
78
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: InputsModule, providers: [IconsService, PopupService, ResizeBatchService, DialogContainerService, DialogService, WindowService, WindowContainerService, AdaptiveService], imports: [i2.TextBoxComponent, i7.SeparatorComponent, i8.NumericTextBoxComponent, i7.SeparatorComponent, i7.SeparatorComponent, i7.SeparatorComponent,
|
|
80
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: InputsModule, imports: [i1.TextBoxDirective, i2.TextBoxComponent, i3.InputSeparatorComponent, i4.TextBoxSuffixTemplateDirective, i5.TextBoxPrefixTemplateDirective, i6.TextBoxCustomMessagesComponent, i7.PrefixTemplateDirective, i7.SuffixTemplateDirective, i7.SeparatorComponent, i8.NumericTextBoxComponent, i9.NumericTextBoxCustomMessagesComponent, i7.PrefixTemplateDirective, i7.SuffixTemplateDirective, i7.SeparatorComponent, i10.MaskedTextBoxComponent, i7.PrefixTemplateDirective, i7.SuffixTemplateDirective, i7.SeparatorComponent, i11.TextAreaComponent, i12.TextAreaDirective, i13.TextAreaPrefixComponent, i14.TextAreaSuffixComponent, i7.SeparatorComponent, i15.CheckBoxComponent, i16.CheckBoxDirective, i17.RadioButtonComponent, i18.RadioButtonDirective, i19.SwitchComponent, i20.SwitchCustomMessagesComponent, i21.FormComponent, i22.FormSeparatorComponent, i23.FormFieldSetComponent, i24.FormFieldComponent, i25.HintComponent, i26.ErrorComponent, i24.FormFieldComponent, i25.HintComponent, i26.ErrorComponent, i27.SliderComponent, i28.SliderCustomMessagesComponent, i29.LabelTemplateDirective, i30.RangeSliderComponent, i31.RangeSliderCustomMessagesComponent, i29.LabelTemplateDirective, i32.RatingComponent, i33.RatingItemTemplateDirective, i34.RatingHoveredItemTemplateDirective, i35.RatingSelectedItemTemplateDirective, i36.SignatureComponent, i37.SignatureCustomMessagesComponent, i38.ColorPickerComponent, i39.ColorPickerCustomMessagesComponent, i40.FlatColorPickerComponent, i39.ColorPickerCustomMessagesComponent, i41.ColorGradientComponent, i39.ColorPickerCustomMessagesComponent, i42.ColorPaletteComponent, i39.ColorPickerCustomMessagesComponent, i43.OTPInputComponent, i44.OTPInputCustomMessagesComponent, i7.PrefixTemplateDirective, i7.SuffixTemplateDirective, i7.SeparatorComponent], exports: [i1.TextBoxDirective, i2.TextBoxComponent, i3.InputSeparatorComponent, i4.TextBoxSuffixTemplateDirective, i5.TextBoxPrefixTemplateDirective, i6.TextBoxCustomMessagesComponent, i7.PrefixTemplateDirective, i7.SuffixTemplateDirective, i7.SeparatorComponent, i8.NumericTextBoxComponent, i9.NumericTextBoxCustomMessagesComponent, i7.PrefixTemplateDirective, i7.SuffixTemplateDirective, i7.SeparatorComponent, i10.MaskedTextBoxComponent, i7.PrefixTemplateDirective, i7.SuffixTemplateDirective, i7.SeparatorComponent, i11.TextAreaComponent, i12.TextAreaDirective, i13.TextAreaPrefixComponent, i14.TextAreaSuffixComponent, i7.SeparatorComponent, i15.CheckBoxComponent, i16.CheckBoxDirective, i17.RadioButtonComponent, i18.RadioButtonDirective, i19.SwitchComponent, i20.SwitchCustomMessagesComponent, i21.FormComponent, i22.FormSeparatorComponent, i23.FormFieldSetComponent, i24.FormFieldComponent, i25.HintComponent, i26.ErrorComponent, i24.FormFieldComponent, i25.HintComponent, i26.ErrorComponent, i27.SliderComponent, i28.SliderCustomMessagesComponent, i29.LabelTemplateDirective, i30.RangeSliderComponent, i31.RangeSliderCustomMessagesComponent, i29.LabelTemplateDirective, i32.RatingComponent, i33.RatingItemTemplateDirective, i34.RatingHoveredItemTemplateDirective, i35.RatingSelectedItemTemplateDirective, i36.SignatureComponent, i37.SignatureCustomMessagesComponent, i38.ColorPickerComponent, i39.ColorPickerCustomMessagesComponent, i40.FlatColorPickerComponent, i39.ColorPickerCustomMessagesComponent, i41.ColorGradientComponent, i39.ColorPickerCustomMessagesComponent, i42.ColorPaletteComponent, i39.ColorPickerCustomMessagesComponent, i43.OTPInputComponent, i44.OTPInputCustomMessagesComponent, i7.PrefixTemplateDirective, i7.SuffixTemplateDirective, i7.SeparatorComponent] });
|
|
81
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: InputsModule, providers: [IconsService, PopupService, ResizeBatchService, DialogContainerService, DialogService, WindowService, WindowContainerService, AdaptiveService], imports: [i2.TextBoxComponent, i7.SeparatorComponent, i8.NumericTextBoxComponent, i7.SeparatorComponent, i7.SeparatorComponent, i7.SeparatorComponent, i21.FormComponent, i27.SliderComponent, i30.RangeSliderComponent, i32.RatingComponent, i36.SignatureComponent, i38.ColorPickerComponent, i40.FlatColorPickerComponent, i41.ColorGradientComponent, i43.OTPInputComponent, i7.SeparatorComponent] });
|
|
79
82
|
}
|
|
80
83
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: InputsModule, decorators: [{
|
|
81
84
|
type: NgModule,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
6
6
|
import { Component, ElementRef, EventEmitter, HostBinding, Input, Output, Renderer2, ViewChild, forwardRef, isDevMode, NgZone, ChangeDetectorRef, Injector, ContentChild } from '@angular/core';
|
|
7
|
-
import { anyChanged, hasObservers, Keys, guid, KendoInput, SuffixTemplateDirective, PrefixTemplateDirective, setHTMLAttributes, isControlRequired, isObjectPresent, removeHTMLAttributes, parseAttributes, EventsOutsideAngularDirective } from '@progress/kendo-angular-common';
|
|
7
|
+
import { anyChanged, hasObservers, Keys, guid, KendoInput, SuffixTemplateDirective, PrefixTemplateDirective, setHTMLAttributes, isControlRequired, isObjectPresent, removeHTMLAttributes, parseAttributes, EventsOutsideAngularDirective, normalizeNumpadKeys } from '@progress/kendo-angular-common';
|
|
8
8
|
import { areSame, getStylingClasses, requiresZoneOnBlur } from '../common/utils';
|
|
9
9
|
import { invokeElementMethod } from '../common/dom-utils';
|
|
10
10
|
import { add, toFixedPrecision, limitPrecision } from '../common/math';
|
|
@@ -616,10 +616,11 @@ export class NumericTextBoxComponent {
|
|
|
616
616
|
return;
|
|
617
617
|
}
|
|
618
618
|
let step;
|
|
619
|
-
|
|
619
|
+
const code = normalizeNumpadKeys(e);
|
|
620
|
+
if (code === Keys.ArrowDown) {
|
|
620
621
|
step = -1;
|
|
621
622
|
}
|
|
622
|
-
else if (
|
|
623
|
+
else if (code === Keys.ArrowUp) {
|
|
623
624
|
step = 1;
|
|
624
625
|
}
|
|
625
626
|
if (step && this.step) {
|
|
@@ -631,7 +632,7 @@ export class NumericTextBoxComponent {
|
|
|
631
632
|
end: input.selectionEnd,
|
|
632
633
|
start: input.selectionStart
|
|
633
634
|
};
|
|
634
|
-
this.pressedKey =
|
|
635
|
+
this.pressedKey = code;
|
|
635
636
|
};
|
|
636
637
|
/**
|
|
637
638
|
* @hidden
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
import { ChangeDetectorRef, Component, ElementRef, EventEmitter, HostBinding, Injector, Input, NgZone, Output, QueryList, Renderer2, ViewChildren, forwardRef } from "@angular/core";
|
|
6
6
|
import { SharedInputEventsDirective } from "../shared/shared-events.directive";
|
|
7
7
|
import { NgFor, NgIf } from "@angular/common";
|
|
8
|
-
import { KendoInput, Keys, hasObservers, isPresent } from "@progress/kendo-angular-common";
|
|
8
|
+
import { KendoInput, Keys, hasObservers, isPresent, normalizeNumpadKeys, replaceMessagePlaceholder } from "@progress/kendo-angular-common";
|
|
9
9
|
import { TextBoxComponent } from "../textbox/textbox.component";
|
|
10
10
|
import { NG_VALUE_ACCESSOR, NgControl } from "@angular/forms";
|
|
11
|
-
import { SIZE_MAP, areSame
|
|
11
|
+
import { SIZE_MAP, areSame } from "../common/utils";
|
|
12
12
|
import { L10N_PREFIX, LocalizationService } from "@progress/kendo-angular-l10n";
|
|
13
13
|
import { OTPInputSeparatorComponent } from "./otpinput-separator.component";
|
|
14
14
|
import { take } from "rxjs/operators";
|
|
@@ -574,14 +574,15 @@ export class OTPInputComponent {
|
|
|
574
574
|
this.inputFields.get(this.focusedInput).focus();
|
|
575
575
|
}
|
|
576
576
|
handleKeydown(event) {
|
|
577
|
+
const code = normalizeNumpadKeys(event);
|
|
577
578
|
if (this.readonly) {
|
|
578
|
-
const isCopyCommand = (event.ctrlKey || event.metaKey) &&
|
|
579
|
-
if (!(
|
|
579
|
+
const isCopyCommand = (event.ctrlKey || event.metaKey) && code === Keys.KeyC;
|
|
580
|
+
if (!(code === Keys.Tab || isCopyCommand)) {
|
|
580
581
|
event.preventDefault();
|
|
581
582
|
return;
|
|
582
583
|
}
|
|
583
584
|
}
|
|
584
|
-
switch (
|
|
585
|
+
switch (code) {
|
|
585
586
|
case Keys.ArrowRight:
|
|
586
587
|
event.preventDefault();
|
|
587
588
|
this.direction === 'ltr' ? this.focusNext() : this.focusPrevious();
|