@progress/kendo-angular-inputs 19.3.0-develop.4 → 19.3.0-develop.40

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.
Files changed (50) hide show
  1. package/colorpicker/color-palette.component.d.ts +1 -1
  2. package/colorpicker/colorpicker.component.d.ts +1 -1
  3. package/common/formservice.service.d.ts +14 -0
  4. package/common/models/gutters.d.ts +28 -0
  5. package/common/models/responsive-breakpoints.d.ts +34 -0
  6. package/common/utils.d.ts +0 -4
  7. package/directives.d.ts +19 -1
  8. package/esm2022/colorpicker/color-palette.component.mjs +3 -2
  9. package/esm2022/colorpicker/colorpicker.component.mjs +5 -4
  10. package/esm2022/common/formservice.service.mjs +21 -0
  11. package/esm2022/common/models/gutters.mjs +5 -0
  12. package/esm2022/common/models/responsive-breakpoints.mjs +5 -0
  13. package/esm2022/common/utils.mjs +0 -4
  14. package/esm2022/directives.mjs +24 -0
  15. package/esm2022/form/form.component.mjs +153 -0
  16. package/esm2022/form/formseparator.component.mjs +80 -0
  17. package/esm2022/form/utils.mjs +144 -0
  18. package/esm2022/form.module.mjs +46 -0
  19. package/esm2022/formfield/formfield.component.mjs +47 -5
  20. package/esm2022/formfieldset/formfieldset.component.mjs +170 -0
  21. package/esm2022/index.mjs +5 -0
  22. package/esm2022/inputs.module.mjs +26 -23
  23. package/esm2022/numerictextbox/numerictextbox.component.mjs +5 -4
  24. package/esm2022/otpinput/otpinput.component.mjs +6 -5
  25. package/esm2022/package-metadata.mjs +2 -2
  26. package/esm2022/rangeslider/rangeslider.component.mjs +8 -3
  27. package/esm2022/rating/rating.component.mjs +31 -26
  28. package/esm2022/shared/shared-events.directive.mjs +1 -1
  29. package/esm2022/signature/signature.component.mjs +1 -1
  30. package/esm2022/slider/slider.component.mjs +5 -3
  31. package/esm2022/switch/switch.component.mjs +2 -2
  32. package/esm2022/text-fields-common/text-fields-base.mjs +1 -1
  33. package/esm2022/textarea/models/textarea-settings.mjs +5 -0
  34. package/esm2022/textarea/textarea.component.mjs +35 -4
  35. package/fesm2022/progress-kendo-angular-inputs.mjs +717 -62
  36. package/form/form.component.d.ts +70 -0
  37. package/form/formseparator.component.d.ts +32 -0
  38. package/form/utils.d.ts +62 -0
  39. package/form.module.d.ts +36 -0
  40. package/formfield/formfield.component.d.ts +19 -4
  41. package/formfieldset/formfieldset.component.d.ts +68 -0
  42. package/index.d.ts +8 -0
  43. package/inputs.module.d.ts +25 -22
  44. package/numerictextbox/numerictextbox.component.d.ts +1 -1
  45. package/package.json +13 -13
  46. package/rangeslider/rangeslider.component.d.ts +1 -1
  47. package/slider/slider.component.d.ts +1 -1
  48. package/text-fields-common/text-fields-base.d.ts +1 -1
  49. package/textarea/models/textarea-settings.d.ts +101 -0
  50. package/textarea/textarea.component.d.ts +9 -3
@@ -175,7 +175,7 @@ export declare class ColorPaletteComponent implements OnInit, AfterViewInit, OnD
175
175
  /**
176
176
  * @hidden
177
177
  */
178
- handleKeydown(event: any): void;
178
+ handleKeydown(event: KeyboardEvent): void;
179
179
  /**
180
180
  * @hidden
181
181
  */
@@ -383,7 +383,7 @@ export declare class ColorPickerComponent implements OnInit, AfterViewInit, OnCh
383
383
  /**
384
384
  * @hidden
385
385
  */
386
- handleWrapperKeyDown(event: any): void;
386
+ handleWrapperKeyDown(event: KeyboardEvent): void;
387
387
  /**
388
388
  * @hidden
389
389
  */
@@ -0,0 +1,14 @@
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 { BehaviorSubject } from 'rxjs';
6
+ import * as i0 from "@angular/core";
7
+ /**
8
+ * @hidden
9
+ */
10
+ export declare class FormService {
11
+ formWidth: BehaviorSubject<number>;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormService, never>;
13
+ static ɵprov: i0.ɵɵInjectableDeclaration<FormService>;
14
+ }
@@ -0,0 +1,28 @@
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 { ResponsiveFormBreakPoint } from './responsive-breakpoints';
6
+ /**
7
+ * Represents the gutters configuration for a Form layout. Defines the spacing between the columns and rows of the Form.
8
+ * Set any property to a number or a string to apply that value as a fixed gutter size. Set it to an array of responsive breakpoints to allow different gutter sizes in relation to the current Form width.
9
+ * Numeric values are interpreted as pixels. String values can include units like `px`, `rem`, `em`, etc.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const formGutters: Gutters = {
14
+ * cols: 16,
15
+ * rows: '1rem'
16
+ * };
17
+ * ```
18
+ */
19
+ export interface Gutters {
20
+ /**
21
+ * Defines the gutters for the columns in the Form.
22
+ */
23
+ cols?: number | string | ResponsiveFormBreakPoint[];
24
+ /**
25
+ * Defines the gutters for the rows in the Form.
26
+ */
27
+ rows?: number | string | ResponsiveFormBreakPoint[];
28
+ }
@@ -0,0 +1,34 @@
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
+ /**
6
+ * Defines responsive breakpoints for form controls in relation to the width of the Form component.
7
+ * Each breakpoint can specify a minimum and/or maximum width, and a value that represents either the number of columns
8
+ * or the colspan/gutters for that breakpoint.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const breakpoints: ResponsiveFormBreakPoint[] = [
13
+ * { minWidth: 768, value: 2 },
14
+ * { maxWidth: 767, value: 1 }
15
+ * ];
16
+ * ```
17
+ */
18
+ export interface ResponsiveFormBreakPoint {
19
+ /**
20
+ * Specifies the minimum Form width for this breakpoint in pixels.
21
+ */
22
+ minWidth?: number;
23
+ /**
24
+ * Specifies the maximum Form width for this breakpoint in pixels.
25
+ */
26
+ maxWidth?: number;
27
+ /**
28
+ * Specifies the value associated with this breakpoint.
29
+ * Can represent the number of columns or the colspan/gutters for the form control.
30
+ * For gutters configurations, numeric values are interpreted as pixels, while string values can include units like `px`, `em`, etc.
31
+ * For columns number and colspan, numeric values are typically used and strings are parsed to numbers.
32
+ */
33
+ value: number | string;
34
+ }
package/common/utils.d.ts CHANGED
@@ -65,7 +65,3 @@ export declare const COMPONENT_TYPE: InjectionToken<ComponentType>;
65
65
  * @hidden
66
66
  */
67
67
  export type ComponentType = 'radio' | 'checkbox';
68
- /**
69
- * @hidden
70
- */
71
- export declare const replaceMessagePlaceholder: (message: string, name: string, value: string) => string;
package/directives.d.ts CHANGED
@@ -43,6 +43,9 @@ import { TextBoxComponent } from "./textbox/textbox.component";
43
43
  import { TextBoxDirective } from "./textbox/textbox.directive";
44
44
  import { OTPInputComponent } from "./otpinput/otpinput.component";
45
45
  import { OTPInputCustomMessagesComponent } from "./otpinput/localization/custom-messages.component";
46
+ import { FormComponent } from "./form/form.component";
47
+ import { FormSeparatorComponent } from "./form/formseparator.component";
48
+ import { FormFieldSetComponent } from "./formfieldset/formfieldset.component";
46
49
  /**
47
50
  * Use the `KENDO_TEXTBOX` utility array to add all TextBox-related components and directives to a standalone Angular component.
48
51
  *
@@ -178,6 +181,21 @@ export declare const KENDO_SWITCH: readonly [typeof SwitchComponent, typeof Swit
178
181
  * ```
179
182
  */
180
183
  export declare const KENDO_FORMFIELD: readonly [typeof FormFieldComponent, typeof HintComponent, typeof ErrorComponent];
184
+ /**
185
+ * Use the `KENDO_FORM` utility array to add all Form-related components and directives to a standalone Angular component.
186
+ *
187
+ * @example
188
+ * ```typescript
189
+ * import { KENDO_FORM } from '@progress/kendo-angular-inputs';
190
+ * @Component({
191
+ * standalone: true,
192
+ * imports: [KENDO_FORM],
193
+ * template: `<form kendoForm>...</form>`
194
+ * })
195
+ * export class MyComponent {}
196
+ * ```
197
+ */
198
+ export declare const KENDO_FORM: readonly [typeof FormComponent, typeof FormSeparatorComponent, typeof FormFieldSetComponent, typeof FormFieldComponent, typeof HintComponent, typeof ErrorComponent];
181
199
  /**
182
200
  * Use the `KENDO_SLIDER` utility array to add all Slider-related components and directives to a standalone Angular component.
183
201
  *
@@ -312,4 +330,4 @@ export declare const KENDO_COLORGRADIENT: readonly [typeof ColorGradientComponen
312
330
  * export class MyComponent {}
313
331
  * ```
314
332
  */
315
- export declare const KENDO_INPUTS: readonly [typeof TextBoxDirective, typeof TextBoxComponent, typeof InputSeparatorComponent, typeof TextBoxSuffixTemplateDirective, typeof TextBoxPrefixTemplateDirective, typeof TextBoxCustomMessagesComponent, typeof PrefixTemplateDirective, typeof SuffixTemplateDirective, typeof SeparatorComponent, typeof NumericTextBoxComponent, typeof NumericTextBoxCustomMessagesComponent, typeof PrefixTemplateDirective, typeof SuffixTemplateDirective, typeof SeparatorComponent, typeof MaskedTextBoxComponent, typeof PrefixTemplateDirective, typeof SuffixTemplateDirective, typeof SeparatorComponent, typeof TextAreaComponent, typeof TextAreaDirective, typeof TextAreaPrefixComponent, typeof TextAreaSuffixComponent, typeof SeparatorComponent, typeof CheckBoxComponent, typeof CheckBoxDirective, typeof RadioButtonComponent, typeof RadioButtonDirective, typeof SwitchComponent, typeof SwitchCustomMessagesComponent, typeof FormFieldComponent, typeof HintComponent, typeof ErrorComponent, typeof SliderComponent, typeof SliderCustomMessagesComponent, typeof LabelTemplateDirective, typeof RangeSliderComponent, typeof RangeSliderCustomMessagesComponent, typeof LabelTemplateDirective, typeof RatingComponent, typeof RatingItemTemplateDirective, typeof RatingHoveredItemTemplateDirective, typeof RatingSelectedItemTemplateDirective, typeof SignatureComponent, typeof SignatureCustomMessagesComponent, typeof ColorPickerComponent, typeof ColorPickerCustomMessagesComponent, typeof FlatColorPickerComponent, typeof ColorPickerCustomMessagesComponent, typeof ColorGradientComponent, typeof ColorPickerCustomMessagesComponent, typeof ColorPaletteComponent, typeof ColorPickerCustomMessagesComponent, typeof OTPInputComponent, typeof OTPInputCustomMessagesComponent];
333
+ export declare const KENDO_INPUTS: readonly [typeof TextBoxDirective, typeof TextBoxComponent, typeof InputSeparatorComponent, typeof TextBoxSuffixTemplateDirective, typeof TextBoxPrefixTemplateDirective, typeof TextBoxCustomMessagesComponent, typeof PrefixTemplateDirective, typeof SuffixTemplateDirective, typeof SeparatorComponent, typeof NumericTextBoxComponent, typeof NumericTextBoxCustomMessagesComponent, typeof PrefixTemplateDirective, typeof SuffixTemplateDirective, typeof SeparatorComponent, typeof MaskedTextBoxComponent, typeof PrefixTemplateDirective, typeof SuffixTemplateDirective, typeof SeparatorComponent, typeof TextAreaComponent, typeof TextAreaDirective, typeof TextAreaPrefixComponent, typeof TextAreaSuffixComponent, typeof SeparatorComponent, typeof CheckBoxComponent, typeof CheckBoxDirective, typeof RadioButtonComponent, typeof RadioButtonDirective, typeof SwitchComponent, typeof SwitchCustomMessagesComponent, typeof FormComponent, typeof FormSeparatorComponent, typeof FormFieldSetComponent, typeof FormFieldComponent, typeof HintComponent, typeof ErrorComponent, typeof FormFieldComponent, typeof HintComponent, typeof ErrorComponent, typeof SliderComponent, typeof SliderCustomMessagesComponent, typeof LabelTemplateDirective, typeof RangeSliderComponent, typeof RangeSliderCustomMessagesComponent, typeof LabelTemplateDirective, typeof RatingComponent, typeof RatingItemTemplateDirective, typeof RatingHoveredItemTemplateDirective, typeof RatingSelectedItemTemplateDirective, typeof SignatureComponent, typeof SignatureCustomMessagesComponent, typeof ColorPickerComponent, typeof ColorPickerCustomMessagesComponent, typeof FlatColorPickerComponent, typeof ColorPickerCustomMessagesComponent, typeof ColorGradientComponent, typeof ColorPickerCustomMessagesComponent, typeof ColorPaletteComponent, typeof ColorPickerCustomMessagesComponent, typeof OTPInputComponent, typeof OTPInputCustomMessagesComponent];
@@ -5,7 +5,7 @@
5
5
  /* eslint-disable @typescript-eslint/no-explicit-any */
6
6
  import { Component, Input, EventEmitter, Output, HostBinding, forwardRef, ChangeDetectorRef, Renderer2, ElementRef, NgZone } from '@angular/core';
7
7
  import { NG_VALUE_ACCESSOR } from '@angular/forms';
8
- import { Keys, KendoInput, guid } from '@progress/kendo-angular-common';
8
+ import { Keys, KendoInput, guid, normalizeNumpadKeys } from '@progress/kendo-angular-common';
9
9
  import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
10
10
  import { validatePackage } from '@progress/kendo-licensing';
11
11
  import { Subscription } from 'rxjs';
@@ -282,8 +282,9 @@ export class ColorPaletteComponent {
282
282
  * @hidden
283
283
  */
284
284
  handleKeydown(event) {
285
+ const code = normalizeNumpadKeys(event);
285
286
  const isRTL = this.direction === 'rtl';
286
- switch (event.keyCode) {
287
+ switch (code) {
287
288
  case Keys.ArrowDown:
288
289
  this.handleCellNavigation(0, 1);
289
290
  break;
@@ -12,7 +12,7 @@ import { PopupService } from '@progress/kendo-angular-popup';
12
12
  import { ButtonComponent } from '@progress/kendo-angular-buttons';
13
13
  import { AdaptiveService } from '@progress/kendo-angular-utils';
14
14
  import { validatePackage } from '@progress/kendo-licensing';
15
- import { Keys, KendoInput, isChanged, closest, guid, ResizeSensorComponent, isDocumentAvailable } from '@progress/kendo-angular-common';
15
+ import { Keys, KendoInput, isChanged, closest, guid, ResizeSensorComponent, isDocumentAvailable, normalizeNumpadKeys } from '@progress/kendo-angular-common';
16
16
  import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
17
17
  import { packageMetadata } from '../package-metadata';
18
18
  import { PALETTEPRESETS } from './models';
@@ -665,7 +665,8 @@ export class ColorPickerComponent {
665
665
  * @hidden
666
666
  */
667
667
  handleWrapperKeyDown(event) {
668
- if (event.keyCode === Keys.ArrowDown || event.keyCode === Keys.Enter) {
668
+ const code = normalizeNumpadKeys(event);
669
+ if (code === Keys.ArrowDown || code === Keys.Enter) {
669
670
  event.preventDefault();
670
671
  this.ngZone.run(() => {
671
672
  this.toggleWithEvents(true);
@@ -701,11 +702,11 @@ export class ColorPickerComponent {
701
702
  * @hidden
702
703
  */
703
704
  handlePopupKeyDown(event) {
704
- if (event.keyCode === Keys.Escape) {
705
+ if (event.code === Keys.Escape) {
705
706
  this.toggleWithEvents(false);
706
707
  this.host.nativeElement.focus();
707
708
  }
708
- if (event.keyCode === Keys.Tab) {
709
+ if (event.code === Keys.Tab) {
709
710
  const currentElement = event.shiftKey ? this.firstFocusableElement.nativeElement : this.lastFocusableElement.nativeElement;
710
711
  const nextElement = event.shiftKey ? this.lastFocusableElement.nativeElement : this.firstFocusableElement.nativeElement;
711
712
  if (event.target === currentElement) {
@@ -0,0 +1,21 @@
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 { Injectable } from '@angular/core';
6
+ import { BehaviorSubject } from 'rxjs';
7
+ import * as i0 from "@angular/core";
8
+ /**
9
+ * @hidden
10
+ */
11
+ export class FormService {
12
+ formWidth = new BehaviorSubject(null);
13
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
14
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormService, providedIn: 'root' });
15
+ }
16
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormService, decorators: [{
17
+ type: Injectable,
18
+ args: [{
19
+ providedIn: 'root',
20
+ }]
21
+ }] });
@@ -0,0 +1,5 @@
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
+ export {};
@@ -0,0 +1,5 @@
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
+ export {};
@@ -86,7 +86,3 @@ export const getStylingClasses = (componentType, stylingOption, previousValue, n
86
86
  * Used to differentiate between the Radio and CheckBox components in their base class.
87
87
  */
88
88
  export const COMPONENT_TYPE = new InjectionToken('TYPE_TOKEN');
89
- /**
90
- * @hidden
91
- */
92
- export const replaceMessagePlaceholder = (message, name, value) => message.replace(new RegExp(`{\\s*${name}\\s*}`, 'g'), value);
@@ -43,6 +43,9 @@ import { TextBoxComponent } from "./textbox/textbox.component";
43
43
  import { TextBoxDirective } from "./textbox/textbox.directive";
44
44
  import { OTPInputComponent } from "./otpinput/otpinput.component";
45
45
  import { OTPInputCustomMessagesComponent } from "./otpinput/localization/custom-messages.component";
46
+ import { FormComponent } from "./form/form.component";
47
+ import { FormSeparatorComponent } from "./form/formseparator.component";
48
+ import { FormFieldSetComponent } from "./formfieldset/formfieldset.component";
46
49
  /**
47
50
  * Use the `KENDO_TEXTBOX` utility array to add all TextBox-related components and directives to a standalone Angular component.
48
51
  *
@@ -221,6 +224,26 @@ export const KENDO_FORMFIELD = [
221
224
  HintComponent,
222
225
  ErrorComponent
223
226
  ];
227
+ /**
228
+ * Use the `KENDO_FORM` utility array to add all Form-related components and directives to a standalone Angular component.
229
+ *
230
+ * @example
231
+ * ```typescript
232
+ * import { KENDO_FORM } from '@progress/kendo-angular-inputs';
233
+ * @Component({
234
+ * standalone: true,
235
+ * imports: [KENDO_FORM],
236
+ * template: `<form kendoForm>...</form>`
237
+ * })
238
+ * export class MyComponent {}
239
+ * ```
240
+ */
241
+ export const KENDO_FORM = [
242
+ FormComponent,
243
+ FormSeparatorComponent,
244
+ FormFieldSetComponent,
245
+ ...KENDO_FORMFIELD
246
+ ];
224
247
  /**
225
248
  * Use the `KENDO_SLIDER` utility array to add all Slider-related components and directives to a standalone Angular component.
226
249
  *
@@ -391,6 +414,7 @@ export const KENDO_INPUTS = [
391
414
  ...KENDO_CHECKBOX,
392
415
  ...KENDO_RADIOBUTTON,
393
416
  ...KENDO_SWITCH,
417
+ ...KENDO_FORM,
394
418
  ...KENDO_FORMFIELD,
395
419
  ...KENDO_SLIDER,
396
420
  ...KENDO_RANGESLIDER,
@@ -0,0 +1,153 @@
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, ElementRef, HostBinding, Input, ChangeDetectorRef } from '@angular/core';
7
+ import { ResizeSensorComponent, shouldShowValidationUI, getLicenseMessage, WatermarkOverlayComponent } from '@progress/kendo-angular-common';
8
+ import { calculateColumns, calculateGutters, DEFAULT_FORM_GUTTERS, generateColumnClass, generateGuttersStyling, innerWidth } from './utils';
9
+ import { FormService } from '../common/formservice.service';
10
+ import { validatePackage } from '@progress/kendo-licensing';
11
+ import { packageMetadata } from '../package-metadata';
12
+ import * as i0 from "@angular/core";
13
+ import * as i1 from "../common/formservice.service";
14
+ /**
15
+ * Represents the Kendo UI Form component for Angular.
16
+ *
17
+ * @remarks
18
+ * Supported children components are: {@link FormFieldComponent}, {@link FormSeparatorComponent}, and {@link FormFieldSetComponent}.
19
+ */
20
+ export class FormComponent {
21
+ element;
22
+ cdr;
23
+ formService;
24
+ /**
25
+ * Defines the orientation of the form.
26
+ *
27
+ * @default 'vertical'
28
+ */
29
+ orientation = 'vertical';
30
+ /**
31
+ * Defines the number of columns in the form.
32
+ * Can be a number or an array of responsive breakpoints.
33
+ */
34
+ cols;
35
+ /**
36
+ * Defines the gutters for the form.
37
+ * You can specify gutters for rows and columns.
38
+ */
39
+ gutters = { ...DEFAULT_FORM_GUTTERS };
40
+ /**
41
+ * @hidden
42
+ */
43
+ columnsClass = '';
44
+ /**
45
+ * @hidden
46
+ */
47
+ guttersStyle = '';
48
+ /**
49
+ * @hidden
50
+ */
51
+ showLicenseWatermark = false;
52
+ /**
53
+ * @hidden
54
+ */
55
+ licenseMessage;
56
+ get formClass() {
57
+ return 'k-form k-form-md';
58
+ }
59
+ get horizontalClass() {
60
+ return this.orientation === 'horizontal';
61
+ }
62
+ _formColumnsNumber;
63
+ _formGutters = { ...DEFAULT_FORM_GUTTERS };
64
+ constructor(element, cdr, formService) {
65
+ this.element = element;
66
+ this.cdr = cdr;
67
+ this.formService = formService;
68
+ const isValid = validatePackage(packageMetadata);
69
+ this.licenseMessage = getLicenseMessage(packageMetadata);
70
+ this.showLicenseWatermark = shouldShowValidationUI(isValid);
71
+ }
72
+ ngAfterContentInit() {
73
+ this.applyColumns();
74
+ this.applyGutters();
75
+ this.formService.formWidth.next(innerWidth(this.element.nativeElement));
76
+ }
77
+ ngOnChanges(changes) {
78
+ if (changes['cols']) {
79
+ this.applyColumns();
80
+ }
81
+ if (changes['gutters']) {
82
+ this.applyGutters();
83
+ }
84
+ }
85
+ /**
86
+ * @hidden
87
+ */
88
+ onResize() {
89
+ this.formService.formWidth.next(innerWidth(this.element.nativeElement));
90
+ const previousColumnsNumber = this._formColumnsNumber;
91
+ const previousGutters = this._formGutters;
92
+ this.applyColumns();
93
+ this.applyGutters();
94
+ if (previousColumnsNumber !== this._formColumnsNumber) {
95
+ this.cdr.detectChanges();
96
+ }
97
+ if (previousGutters?.cols !== this._formGutters?.cols || previousGutters?.rows !== this._formGutters?.rows) {
98
+ this.cdr.detectChanges();
99
+ }
100
+ }
101
+ applyColumns() {
102
+ const containerWidth = innerWidth(this.element.nativeElement);
103
+ this._formColumnsNumber = calculateColumns(this.cols, containerWidth);
104
+ this.updateColumnClasses();
105
+ }
106
+ applyGutters() {
107
+ const containerWidth = innerWidth(this.element.nativeElement);
108
+ this._formGutters = calculateGutters(this.gutters, containerWidth);
109
+ this.updateGutterClasses();
110
+ }
111
+ updateColumnClasses() {
112
+ this.columnsClass = generateColumnClass(this._formColumnsNumber);
113
+ }
114
+ updateGutterClasses() {
115
+ this.guttersStyle = generateGuttersStyling(this._formGutters, { ...DEFAULT_FORM_GUTTERS });
116
+ }
117
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1.FormService }], target: i0.ɵɵFactoryTarget.Component });
118
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FormComponent, isStandalone: true, selector: "form[kendoForm]", inputs: { orientation: "orientation", cols: "cols", gutters: "gutters" }, host: { properties: { "class": "this.formClass", "class.k-form-horizontal": "this.horizontalClass" } }, exportAs: ["kendoForm"], usesOnChanges: true, ngImport: i0, template: `
119
+ <div class="k-form-layout k-d-grid" [ngClass]="[columnsClass]" [ngStyle]="{ gap: guttersStyle }">
120
+ <ng-content></ng-content>
121
+ </div>
122
+ <kendo-resize-sensor (resize)="onResize()"></kendo-resize-sensor>
123
+ <div kendoWatermarkOverlay *ngIf="showLicenseWatermark" [licenseMessage]="licenseMessage"></div>
124
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ResizeSensorComponent, selector: "kendo-resize-sensor", inputs: ["rateLimit"], outputs: ["resize"] }, { kind: "component", type: WatermarkOverlayComponent, selector: "div[kendoWatermarkOverlay]", inputs: ["licenseMessage"] }] });
125
+ }
126
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormComponent, decorators: [{
127
+ type: Component,
128
+ args: [{
129
+ exportAs: 'kendoForm',
130
+ selector: 'form[kendoForm]',
131
+ template: `
132
+ <div class="k-form-layout k-d-grid" [ngClass]="[columnsClass]" [ngStyle]="{ gap: guttersStyle }">
133
+ <ng-content></ng-content>
134
+ </div>
135
+ <kendo-resize-sensor (resize)="onResize()"></kendo-resize-sensor>
136
+ <div kendoWatermarkOverlay *ngIf="showLicenseWatermark" [licenseMessage]="licenseMessage"></div>
137
+ `,
138
+ standalone: true,
139
+ imports: [NgClass, NgStyle, NgIf, ResizeSensorComponent, WatermarkOverlayComponent],
140
+ }]
141
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1.FormService }]; }, propDecorators: { orientation: [{
142
+ type: Input
143
+ }], cols: [{
144
+ type: Input
145
+ }], gutters: [{
146
+ type: Input
147
+ }], formClass: [{
148
+ type: HostBinding,
149
+ args: ['class']
150
+ }], horizontalClass: [{
151
+ type: HostBinding,
152
+ args: ['class.k-form-horizontal']
153
+ }] } });
@@ -0,0 +1,80 @@
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 { Component, ElementRef, HostBinding, Input, Renderer2 } from '@angular/core';
6
+ import { validatePackage } from '@progress/kendo-licensing';
7
+ import { packageMetadata } from '../package-metadata';
8
+ import { calculateColSpan, generateColSpanClass } from './utils';
9
+ import { Subscription } from 'rxjs';
10
+ import { FormService } from '../common/formservice.service';
11
+ import { filter } from 'rxjs/operators';
12
+ import * as i0 from "@angular/core";
13
+ import * as i1 from "../common/formservice.service";
14
+ /**
15
+ * Represents the Kendo UI Form Separator component for Angular.
16
+ */
17
+ export class FormSeparatorComponent {
18
+ renderer;
19
+ hostElement;
20
+ formService;
21
+ hostClass = true;
22
+ /**
23
+ * Defines the colspan for the separator element related to the parent Form component columns.
24
+ * Can be a number or an array of responsive breakpoints.
25
+ */
26
+ colSpan;
27
+ _formWidth = null;
28
+ _colSpanClass = null;
29
+ _previousColSpan = null;
30
+ subscriptions = new Subscription();
31
+ constructor(renderer, hostElement, formService) {
32
+ this.renderer = renderer;
33
+ this.hostElement = hostElement;
34
+ this.formService = formService;
35
+ validatePackage(packageMetadata);
36
+ this.subscriptions.add(this.formService.formWidth.pipe(filter((width) => width !== null)).subscribe((width) => {
37
+ this._formWidth = width;
38
+ this.updateColSpanClass();
39
+ }));
40
+ }
41
+ ngOnChanges(changes) {
42
+ if (changes['colSpan']) {
43
+ this.updateColSpanClass();
44
+ }
45
+ }
46
+ ngOnDestroy() {
47
+ this.subscriptions.unsubscribe();
48
+ }
49
+ updateColSpanClass() {
50
+ const hostElement = this.hostElement.nativeElement;
51
+ const newColSpan = calculateColSpan(this.colSpan, this._formWidth);
52
+ if (newColSpan !== this._previousColSpan) {
53
+ const newClass = generateColSpanClass(newColSpan);
54
+ if (this._colSpanClass) {
55
+ this.renderer.removeClass(hostElement, this._colSpanClass);
56
+ }
57
+ if (newClass) {
58
+ this.renderer.addClass(hostElement, newClass);
59
+ }
60
+ this._colSpanClass = newClass;
61
+ this._previousColSpan = newColSpan;
62
+ }
63
+ }
64
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormSeparatorComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i1.FormService }], target: i0.ɵɵFactoryTarget.Component });
65
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FormSeparatorComponent, isStandalone: true, selector: "kendo-form-separator", inputs: { colSpan: "colSpan" }, host: { properties: { "class.k-form-separator": "this.hostClass" } }, exportAs: ["kendoFormSeparator"], usesOnChanges: true, ngImport: i0, template: ``, isInline: true });
66
+ }
67
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormSeparatorComponent, decorators: [{
68
+ type: Component,
69
+ args: [{
70
+ exportAs: 'kendoFormSeparator',
71
+ selector: 'kendo-form-separator',
72
+ template: ``,
73
+ standalone: true,
74
+ }]
75
+ }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i1.FormService }]; }, propDecorators: { hostClass: [{
76
+ type: HostBinding,
77
+ args: ['class.k-form-separator']
78
+ }], colSpan: [{
79
+ type: Input
80
+ }] } });