@progress/kendo-angular-inputs 21.4.1 → 22.0.0-develop.1

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 (189) hide show
  1. package/colorpicker/localization/messages.d.ts +1 -1
  2. package/common/radio-checkbox.base.d.ts +1 -1
  3. package/fesm2022/progress-kendo-angular-inputs.mjs +321 -321
  4. package/numerictextbox/localization/messages.d.ts +1 -1
  5. package/otpinput/localization/messages.d.ts +1 -1
  6. package/package.json +17 -25
  7. package/rangeslider/localization/messages.d.ts +1 -1
  8. package/signature/localization/messages.d.ts +1 -1
  9. package/slider/localization/messages.d.ts +1 -1
  10. package/sliders-common/slider-base.d.ts +1 -1
  11. package/switch/localization/messages.d.ts +1 -1
  12. package/text-fields-common/text-fields-base.d.ts +1 -1
  13. package/textbox/localization/messages.d.ts +1 -1
  14. package/esm2022/checkbox/checkbox.component.mjs +0 -227
  15. package/esm2022/checkbox/checkbox.directive.mjs +0 -96
  16. package/esm2022/checkbox/checked-state.mjs +0 -5
  17. package/esm2022/checkbox.module.mjs +0 -42
  18. package/esm2022/colorpicker/adaptiveness/adaptive-close-button.component.mjs +0 -62
  19. package/esm2022/colorpicker/adaptiveness/adaptive-renderer.component.mjs +0 -219
  20. package/esm2022/colorpicker/color-contrast-svg.component.mjs +0 -108
  21. package/esm2022/colorpicker/color-gradient-numeric-label.directive.mjs +0 -37
  22. package/esm2022/colorpicker/color-gradient-text-label.directive.mjs +0 -34
  23. package/esm2022/colorpicker/color-gradient.component.mjs +0 -1110
  24. package/esm2022/colorpicker/color-input.component.mjs +0 -498
  25. package/esm2022/colorpicker/color-palette.component.mjs +0 -629
  26. package/esm2022/colorpicker/colorpicker.component.mjs +0 -1315
  27. package/esm2022/colorpicker/constants.mjs +0 -40
  28. package/esm2022/colorpicker/contrast-validation.component.mjs +0 -83
  29. package/esm2022/colorpicker/contrast.component.mjs +0 -114
  30. package/esm2022/colorpicker/events/active-color-click-event.mjs +0 -55
  31. package/esm2022/colorpicker/events/cancel-event.mjs +0 -18
  32. package/esm2022/colorpicker/events/close-event.mjs +0 -10
  33. package/esm2022/colorpicker/events/kendo-drag-event.mjs +0 -5
  34. package/esm2022/colorpicker/events/open-event.mjs +0 -10
  35. package/esm2022/colorpicker/events.mjs +0 -8
  36. package/esm2022/colorpicker/flatcolorpicker-actions.component.mjs +0 -112
  37. package/esm2022/colorpicker/flatcolorpicker-header.component.mjs +0 -244
  38. package/esm2022/colorpicker/flatcolorpicker.component.mjs +0 -942
  39. package/esm2022/colorpicker/localization/colorgradient-localization.service.mjs +0 -46
  40. package/esm2022/colorpicker/localization/colorpalette-localization.service.mjs +0 -46
  41. package/esm2022/colorpicker/localization/colorpicker-localization.service.mjs +0 -31
  42. package/esm2022/colorpicker/localization/custom-messages.component.mjs +0 -51
  43. package/esm2022/colorpicker/localization/flatcolorpicker-localization.service.mjs +0 -46
  44. package/esm2022/colorpicker/localization/localized-colorpicker-messages.directive.mjs +0 -39
  45. package/esm2022/colorpicker/localization/messages.mjs +0 -201
  46. package/esm2022/colorpicker/models/actions-layout.mjs +0 -5
  47. package/esm2022/colorpicker/models/adaptive-mode.mjs +0 -8
  48. package/esm2022/colorpicker/models/colorpicker-view.mjs +0 -5
  49. package/esm2022/colorpicker/models/gradient-settings.mjs +0 -5
  50. package/esm2022/colorpicker/models/hsva.mjs +0 -5
  51. package/esm2022/colorpicker/models/output-format.mjs +0 -5
  52. package/esm2022/colorpicker/models/palette-presets.mjs +0 -62
  53. package/esm2022/colorpicker/models/palette-settings.mjs +0 -5
  54. package/esm2022/colorpicker/models/popup-settings.mjs +0 -5
  55. package/esm2022/colorpicker/models/rgb.mjs +0 -5
  56. package/esm2022/colorpicker/models/rgba.mjs +0 -5
  57. package/esm2022/colorpicker/models/table-cell.mjs +0 -5
  58. package/esm2022/colorpicker/models/tile-size.mjs +0 -5
  59. package/esm2022/colorpicker/models.mjs +0 -16
  60. package/esm2022/colorpicker/services/color-palette.service.mjs +0 -65
  61. package/esm2022/colorpicker/services/flatcolorpicker.service.mjs +0 -39
  62. package/esm2022/colorpicker/utils/color-parser.mjs +0 -164
  63. package/esm2022/colorpicker/utils/contrast-curve.mjs +0 -85
  64. package/esm2022/colorpicker/utils.mjs +0 -6
  65. package/esm2022/colorpicker.module.mjs +0 -50
  66. package/esm2022/common/dom-utils.mjs +0 -36
  67. package/esm2022/common/formservice.service.mjs +0 -21
  68. package/esm2022/common/math.mjs +0 -65
  69. package/esm2022/common/models/fillmode.mjs +0 -5
  70. package/esm2022/common/models/gutters.mjs +0 -5
  71. package/esm2022/common/models/responsive-breakpoints.mjs +0 -5
  72. package/esm2022/common/models/rounded.mjs +0 -5
  73. package/esm2022/common/models/size.mjs +0 -5
  74. package/esm2022/common/models/styling-classes.mjs +0 -5
  75. package/esm2022/common/models/type.mjs +0 -5
  76. package/esm2022/common/models.mjs +0 -9
  77. package/esm2022/common/radio-checkbox.base.mjs +0 -295
  78. package/esm2022/common/utils.mjs +0 -88
  79. package/esm2022/directives.mjs +0 -430
  80. package/esm2022/form/form.component.mjs +0 -163
  81. package/esm2022/form/formseparator.component.mjs +0 -80
  82. package/esm2022/form/utils.mjs +0 -147
  83. package/esm2022/form.module.mjs +0 -46
  84. package/esm2022/formfield/error.component.mjs +0 -70
  85. package/esm2022/formfield/formfield.component.mjs +0 -353
  86. package/esm2022/formfield/hint.component.mjs +0 -65
  87. package/esm2022/formfield/models/message-align.mjs +0 -5
  88. package/esm2022/formfield/models/orientation.mjs +0 -5
  89. package/esm2022/formfield/models/show-options.mjs +0 -5
  90. package/esm2022/formfield.module.mjs +0 -43
  91. package/esm2022/formfieldset/formfieldset.component.mjs +0 -174
  92. package/esm2022/index.mjs +0 -91
  93. package/esm2022/inputs.module.mjs +0 -91
  94. package/esm2022/maskedtextbox/maskedtextbox.component.mjs +0 -876
  95. package/esm2022/maskedtextbox/masking.service.mjs +0 -189
  96. package/esm2022/maskedtextbox/parsing/combinators.mjs +0 -28
  97. package/esm2022/maskedtextbox/parsing/parsers.mjs +0 -148
  98. package/esm2022/maskedtextbox/parsing/result.mjs +0 -44
  99. package/esm2022/maskedtextbox/parsing/stream.mjs +0 -43
  100. package/esm2022/maskedtextbox.module.mjs +0 -43
  101. package/esm2022/numerictextbox/arrow-direction.mjs +0 -13
  102. package/esm2022/numerictextbox/constants.mjs +0 -28
  103. package/esm2022/numerictextbox/localization/custom-messages.component.mjs +0 -55
  104. package/esm2022/numerictextbox/localization/localized-numerictextbox-messages.directive.mjs +0 -39
  105. package/esm2022/numerictextbox/localization/messages.mjs +0 -33
  106. package/esm2022/numerictextbox/numerictextbox.component.mjs +0 -1314
  107. package/esm2022/numerictextbox/utils.mjs +0 -92
  108. package/esm2022/numerictextbox.module.mjs +0 -46
  109. package/esm2022/otp.module.mjs +0 -44
  110. package/esm2022/otpinput/localization/custom-messages.component.mjs +0 -45
  111. package/esm2022/otpinput/localization/localized-textbox-messages.directive.mjs +0 -39
  112. package/esm2022/otpinput/localization/messages.mjs +0 -34
  113. package/esm2022/otpinput/models/otpinput-type.mjs +0 -5
  114. package/esm2022/otpinput/models/separator-icon.mjs +0 -5
  115. package/esm2022/otpinput/otpinput-separator.component.mjs +0 -93
  116. package/esm2022/otpinput/otpinput.component.mjs +0 -936
  117. package/esm2022/package-metadata.mjs +0 -16
  118. package/esm2022/progress-kendo-angular-inputs.mjs +0 -8
  119. package/esm2022/radiobutton/radiobutton.component.mjs +0 -212
  120. package/esm2022/radiobutton/radiobutton.directive.mjs +0 -81
  121. package/esm2022/radiobutton.module.mjs +0 -43
  122. package/esm2022/rangeslider/localization/custom-messages.component.mjs +0 -53
  123. package/esm2022/rangeslider/localization/localized-rangeslider-messages.directive.mjs +0 -39
  124. package/esm2022/rangeslider/localization/messages.mjs +0 -33
  125. package/esm2022/rangeslider/rangeslider-model.mjs +0 -53
  126. package/esm2022/rangeslider/rangeslider-value.type.mjs +0 -5
  127. package/esm2022/rangeslider/rangeslider.component.mjs +0 -625
  128. package/esm2022/rangeslider.module.mjs +0 -46
  129. package/esm2022/rating/directives/rating-hovered-item.directive.mjs +0 -35
  130. package/esm2022/rating/directives/rating-item.directive.mjs +0 -34
  131. package/esm2022/rating/directives/rating-selected-item.directive.mjs +0 -36
  132. package/esm2022/rating/models/precision.mjs +0 -5
  133. package/esm2022/rating/models/rating-item.interface.mjs +0 -5
  134. package/esm2022/rating/models/selection.mjs +0 -5
  135. package/esm2022/rating/rating.component.mjs +0 -754
  136. package/esm2022/rating.module.mjs +0 -46
  137. package/esm2022/shared/input-separator.component.mjs +0 -55
  138. package/esm2022/shared/input-spacer.component.mjs +0 -56
  139. package/esm2022/shared/shared-events.directive.mjs +0 -102
  140. package/esm2022/shared/utils.mjs +0 -13
  141. package/esm2022/signature/events/close-event.mjs +0 -10
  142. package/esm2022/signature/events/index.mjs +0 -6
  143. package/esm2022/signature/events/open-event.mjs +0 -10
  144. package/esm2022/signature/localization/custom-messages.component.mjs +0 -43
  145. package/esm2022/signature/localization/index.mjs +0 -7
  146. package/esm2022/signature/localization/localized-signature-messages.directive.mjs +0 -39
  147. package/esm2022/signature/localization/messages.mjs +0 -45
  148. package/esm2022/signature/signature.component.mjs +0 -981
  149. package/esm2022/signature.module.mjs +0 -47
  150. package/esm2022/slider/localization/custom-messages.component.mjs +0 -43
  151. package/esm2022/slider/localization/localized-slider-messages.directive.mjs +0 -39
  152. package/esm2022/slider/localization/messages.mjs +0 -39
  153. package/esm2022/slider/slider-model.mjs +0 -32
  154. package/esm2022/slider/slider.component.mjs +0 -671
  155. package/esm2022/slider.module.mjs +0 -48
  156. package/esm2022/sliders-common/label-template.directive.mjs +0 -37
  157. package/esm2022/sliders-common/slider-base.mjs +0 -300
  158. package/esm2022/sliders-common/slider-model.base.mjs +0 -118
  159. package/esm2022/sliders-common/slider-ticks.component.mjs +0 -147
  160. package/esm2022/sliders-common/sliders-util.mjs +0 -206
  161. package/esm2022/sliders-common/title-callback.mjs +0 -5
  162. package/esm2022/switch/events/blur-event.mjs +0 -13
  163. package/esm2022/switch/events/focus-event.mjs +0 -13
  164. package/esm2022/switch/localization/custom-messages.component.mjs +0 -43
  165. package/esm2022/switch/localization/localized-switch-messages.directive.mjs +0 -39
  166. package/esm2022/switch/localization/messages.mjs +0 -33
  167. package/esm2022/switch/switch.component.mjs +0 -585
  168. package/esm2022/switch.module.mjs +0 -44
  169. package/esm2022/text-fields-common/text-fields-base.mjs +0 -150
  170. package/esm2022/textarea/models/adornments-orientation.mjs +0 -5
  171. package/esm2022/textarea/models/flow.mjs +0 -5
  172. package/esm2022/textarea/models/resize.mjs +0 -5
  173. package/esm2022/textarea/models/textarea-settings.mjs +0 -5
  174. package/esm2022/textarea/textarea-prefix.component.mjs +0 -67
  175. package/esm2022/textarea/textarea-suffix.component.mjs +0 -67
  176. package/esm2022/textarea/textarea.component.mjs +0 -740
  177. package/esm2022/textarea/textarea.directive.mjs +0 -288
  178. package/esm2022/textarea.module.mjs +0 -46
  179. package/esm2022/textbox/localization/custom-messages.component.mjs +0 -43
  180. package/esm2022/textbox/localization/localized-textbox-messages.directive.mjs +0 -39
  181. package/esm2022/textbox/localization/messages.mjs +0 -27
  182. package/esm2022/textbox/models/icon-show-options.mjs +0 -5
  183. package/esm2022/textbox/textbox-prefix.directive.mjs +0 -50
  184. package/esm2022/textbox/textbox-suffix.directive.mjs +0 -49
  185. package/esm2022/textbox/textbox.component.mjs +0 -933
  186. package/esm2022/textbox/textbox.directive.mjs +0 -125
  187. package/esm2022/textbox.module.mjs +0 -51
  188. package/esm2022/validators/max.validator.mjs +0 -21
  189. package/esm2022/validators/min.validator.mjs +0 -21
@@ -1,740 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 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, HostBinding, Input, Output, ElementRef, EventEmitter, NgZone, Renderer2, ChangeDetectorRef, Injector, forwardRef, ContentChild } from '@angular/core';
6
- import { fromEvent } from 'rxjs';
7
- import { debounceTime, take } from 'rxjs/operators';
8
- import { NG_VALUE_ACCESSOR, NgControl } from '@angular/forms';
9
- import { KendoInput, guid, isDocumentAvailable, hasObservers, setHTMLAttributes, isControlRequired, isObjectPresent, removeHTMLAttributes, parseAttributes, EventsOutsideAngularDirective } from '@progress/kendo-angular-common';
10
- import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
11
- import { TextFieldsBase } from '../text-fields-common/text-fields-base';
12
- import { areSame, isPresent, getStylingClasses } from '../common/utils';
13
- import { invokeElementMethod } from '../common/dom-utils';
14
- import { validatePackage } from '@progress/kendo-licensing';
15
- import { packageMetadata } from '../package-metadata';
16
- import { TextAreaPrefixComponent } from './textarea-prefix.component';
17
- import { TextAreaSuffixComponent } from './textarea-suffix.component';
18
- import { InputSeparatorComponent } from '../shared/input-separator.component';
19
- import { NgClass } from '@angular/common';
20
- import { SharedInputEventsDirective } from '../shared/shared-events.directive';
21
- import * as i0 from "@angular/core";
22
- import * as i1 from "@progress/kendo-angular-l10n";
23
- const resizeClasses = {
24
- 'vertical': 'k-resize-y',
25
- 'horizontal': 'k-resize-x',
26
- 'both': 'k-resize',
27
- 'none': 'k-resize-none',
28
- 'auto': 'k-resize-none'
29
- };
30
- const FOCUSED = 'k-focus';
31
- const DEFAULT_SIZE = 'medium';
32
- const DEFAULT_ROUNDED = 'medium';
33
- const DEFAULT_FILL_MODE = 'solid';
34
- /**
35
- * Represents the Kendo UI TextArea component for Angular.
36
- *
37
- * Use this component to let users enter and edit multi-line text.
38
- *
39
- * @example
40
- * ```html
41
- * <kendo-textarea [(ngModel)]="value" [rows]="5" [cols]="30"></kendo-textarea>
42
- * ```
43
- *
44
- * @remarks
45
- * Supported children components are: {@link TextAreaPrefixComponent}, {@link TextAreaSuffixComponent}.
46
- */
47
- export class TextAreaComponent extends TextFieldsBase {
48
- localizationService;
49
- ngZone;
50
- changeDetector;
51
- renderer;
52
- injector;
53
- hostElement;
54
- /**
55
- * @hidden
56
- */
57
- focusableId = `k-${guid()}`;
58
- hostClasses = true;
59
- get flowCol() {
60
- return this.flow === 'vertical';
61
- }
62
- get flowRow() {
63
- return this.flow === 'horizontal';
64
- }
65
- _flow = 'vertical';
66
- /**
67
- * Specifies the flow direction of the TextArea sections. Use this property to set the position of adornments relative to the text area.
68
- */
69
- set flow(flow) {
70
- this._flow = flow;
71
- if (this.prefix) {
72
- this.prefix.flow = flow;
73
- }
74
- if (this.suffix) {
75
- this.suffix.flow = flow;
76
- }
77
- }
78
- get flow() {
79
- return this._flow;
80
- }
81
- /**
82
- * Sets the HTML attributes of the inner focusable input element. Some attributes are required for component functionality and cannot be changed.
83
- */
84
- set inputAttributes(attributes) {
85
- if (isObjectPresent(this.parsedAttributes)) {
86
- removeHTMLAttributes(this.parsedAttributes, this.renderer, this.input.nativeElement);
87
- }
88
- this._inputAttributes = attributes;
89
- this.parsedAttributes = this.inputAttributes ?
90
- parseAttributes(this.inputAttributes, this.defaultAttributes) :
91
- this.inputAttributes;
92
- this.setInputAttributes();
93
- }
94
- get inputAttributes() {
95
- return this._inputAttributes;
96
- }
97
- /**
98
- * Specifies the orientation of the TextArea adornments. Use this property to set the position of adornments relative to each other.
99
- *
100
- */
101
- set adornmentsOrientation(orientation) {
102
- this._adornmentsOrientation = orientation;
103
- if (this.prefix) {
104
- this.prefix.orientation = orientation;
105
- }
106
- if (this.suffix) {
107
- this.suffix.orientation = orientation;
108
- }
109
- }
110
- get adornmentsOrientation() {
111
- return this._adornmentsOrientation;
112
- }
113
- /**
114
- * Sets the visible height of the text area in lines.
115
- */
116
- rows;
117
- /**
118
- * Sets the visible width of the text area in average character width.
119
- */
120
- cols;
121
- /**
122
- * Sets the maximum number of characters allowed in the text area.
123
- */
124
- maxlength;
125
- /**
126
- * @hidden
127
- */
128
- maxResizableRows;
129
- /**
130
- * Sets the [`tabindex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
131
- * @default 0
132
- */
133
- tabindex = 0;
134
- /**
135
- * @hidden
136
- */
137
- set tabIndex(tabIndex) {
138
- this.tabindex = tabIndex;
139
- }
140
- get tabIndex() {
141
- return this.tabindex;
142
- }
143
- /**
144
- * Sets the resize behavior of the TextArea.
145
- *
146
- *
147
- * @default 'vertical'
148
- */
149
- resizable = 'vertical';
150
- /**
151
- * Sets the size of the TextArea. Controls the padding of the text area element ([see example]({% slug appearance_textarea %}#toc-size)).
152
- * @default 'medium'
153
- */
154
- set size(size) {
155
- const newSize = size ? size : DEFAULT_SIZE;
156
- this.handleClasses(newSize, 'size');
157
- this._size = newSize;
158
- }
159
- get size() {
160
- return this._size;
161
- }
162
- /**
163
- * Sets the border radius of the TextArea ([see example](slug:appearance_textarea#toc-roundness)).
164
- * @default 'medium'
165
- */
166
- set rounded(rounded) {
167
- const newRounded = rounded ? rounded : DEFAULT_ROUNDED;
168
- this.handleClasses(newRounded, 'rounded');
169
- this._rounded = newRounded;
170
- }
171
- get rounded() {
172
- return this._rounded;
173
- }
174
- /**
175
- * Sets the background and border styles of the TextArea ([see example](slug:appearance_textarea#toc-fill-mode)).
176
- * @default 'solid'
177
- */
178
- set fillMode(fillMode) {
179
- const newFillMode = fillMode ? fillMode : DEFAULT_FILL_MODE;
180
- this.handleClasses(newFillMode, 'fillMode');
181
- this._fillMode = newFillMode;
182
- }
183
- get fillMode() {
184
- return this._fillMode;
185
- }
186
- /**
187
- * Shows the prefix separator in the TextArea.
188
- * The separator is rendered only if a prefix template is declared.
189
- *
190
- * @default false
191
- */
192
- showPrefixSeparator = false;
193
- /**
194
- * Shows the suffix separator in the TextArea.
195
- * The separator is rendered only if a suffix template is declared.
196
- *
197
- * @default false
198
- */
199
- showSuffixSeparator = false;
200
- /**
201
- * Fires when the TextArea is focused.
202
- *
203
- * Use the `onFocus` property to subscribe to this event.
204
- */
205
- onFocus = new EventEmitter();
206
- /**
207
- * Fires when the TextArea gets blurred.
208
- *
209
- * Use the `onBlur` property to subscribe to this event.
210
- */
211
- onBlur = new EventEmitter();
212
- /**
213
- * Fires when the value changes or the TextArea is blurred ([see example](slug:events_textarea)).
214
- *
215
- * The event does not fire when the value changes programmatically or through form control binding.
216
- */
217
- valueChange = new EventEmitter();
218
- initialHeight;
219
- maxResizableHeight;
220
- resizeSubscription;
221
- resizeObserver;
222
- _size = 'medium';
223
- _rounded = 'medium';
224
- _fillMode = 'solid';
225
- _adornmentsOrientation = 'horizontal';
226
- _inputAttributes;
227
- parsedAttributes = {};
228
- get defaultAttributes() {
229
- return {
230
- id: this.focusableId,
231
- disabled: this.disabled ? '' : null,
232
- readonly: this.readonly ? '' : null,
233
- tabindex: this.disabled ? undefined : this.tabIndex,
234
- placeholder: this.placeholder,
235
- title: this.title,
236
- maxlength: this.maxlength,
237
- rows: this.rows,
238
- cols: this.cols,
239
- 'aria-disabled': this.disabled ? true : undefined,
240
- 'aria-readonly': this.readonly ? true : undefined,
241
- 'aria-invalid': this.isControlInvalid,
242
- required: this.isControlRequired ? '' : null
243
- };
244
- }
245
- get mutableAttributes() {
246
- return {
247
- 'aria-multiline': 'true'
248
- };
249
- }
250
- constructor(localizationService, ngZone, changeDetector, renderer, injector, hostElement) {
251
- super(localizationService, ngZone, changeDetector, renderer, injector, hostElement);
252
- this.localizationService = localizationService;
253
- this.ngZone = ngZone;
254
- this.changeDetector = changeDetector;
255
- this.renderer = renderer;
256
- this.injector = injector;
257
- this.hostElement = hostElement;
258
- validatePackage(packageMetadata);
259
- this.direction = localizationService.rtl ? 'rtl' : 'ltr';
260
- }
261
- ngAfterContentInit() {
262
- this.ngZone.onStable.pipe((take(1))).subscribe(() => {
263
- this.prefix && (this.prefix.orientation = this.adornmentsOrientation);
264
- this.suffix && (this.suffix.orientation = this.adornmentsOrientation);
265
- });
266
- }
267
- ngAfterViewInit() {
268
- this.ngZone.runOutsideAngular(() => {
269
- this.handleFlow();
270
- });
271
- this.ngZone.onStable.pipe(take(1)).subscribe(() => {
272
- if (this.prefix) {
273
- this.prefix.flow = this.flow;
274
- }
275
- if (this.suffix) {
276
- this.suffix.flow = this.flow;
277
- }
278
- });
279
- const stylingInputs = ['size', 'rounded', 'fillMode'];
280
- stylingInputs.forEach(input => {
281
- this.handleClasses(this[input], input);
282
- });
283
- }
284
- ngOnInit() {
285
- this.control = this.injector.get(NgControl, null);
286
- if (isDocumentAvailable() && this.resizable === 'auto') {
287
- this.resizeSubscription = fromEvent(window, 'resize')
288
- .pipe((debounceTime(50)))
289
- .subscribe(() => this.resize());
290
- this.attachResizeObserver();
291
- }
292
- if (this.hostElement) {
293
- this.renderer.removeAttribute(this.hostElement.nativeElement, "tabindex");
294
- }
295
- this.subscriptions = this.localizationService.changes.subscribe(({ rtl }) => {
296
- this.direction = rtl ? 'rtl' : 'ltr';
297
- });
298
- }
299
- ngOnChanges(changes) {
300
- const hostElement = this.hostElement.nativeElement;
301
- const element = this.input.nativeElement;
302
- if (changes.flow) {
303
- this.handleFlow();
304
- }
305
- if (changes.resizable) {
306
- if (this.resizable === 'auto') {
307
- this.ngZone.onStable.pipe(take(1)).subscribe(() => {
308
- this.initialHeight = element.offsetHeight;
309
- if (this.maxResizableRows && this.rows && isDocumentAvailable()) {
310
- const heightValue = parseFloat(getComputedStyle(element).getPropertyValue('height')) - 2 * parseFloat(getComputedStyle(element).getPropertyValue('padding'));
311
- this.maxResizableHeight = this.initialHeight + (heightValue * (this.maxResizableRows - this.rows));
312
- }
313
- });
314
- }
315
- else if (this.resizable !== 'both') {
316
- element.style.height = `${this.initialHeight}px`;
317
- }
318
- }
319
- if (changes.cols) {
320
- if (isPresent(changes.cols.currentValue)) {
321
- this.renderer.setStyle(hostElement, 'width', 'auto');
322
- }
323
- else {
324
- this.renderer.removeStyle(hostElement, 'width');
325
- }
326
- }
327
- if (changes.value) {
328
- this.resize();
329
- }
330
- }
331
- /**
332
- * @hidden
333
- */
334
- prefix;
335
- /**
336
- * @hidden
337
- */
338
- suffix;
339
- /**
340
- * @hidden
341
- */
342
- writeValue(value) {
343
- this.value = value;
344
- this.resize();
345
- this.changeDetector.markForCheck();
346
- }
347
- /**
348
- * @hidden
349
- */
350
- registerOnChange(fn) {
351
- this.ngChange = fn;
352
- }
353
- /**
354
- * @hidden
355
- */
356
- registerOnTouched(fn) {
357
- this.ngTouched = fn;
358
- }
359
- ngOnDestroy() {
360
- super.ngOnDestroy();
361
- if (this.resizeSubscription) {
362
- this.resizeSubscription.unsubscribe();
363
- }
364
- if (this.resizeObserver) {
365
- this.resizeObserver.disconnect();
366
- }
367
- }
368
- /**
369
- * @hidden
370
- */
371
- get resizableClass() {
372
- return resizeClasses[this.resizable];
373
- }
374
- /**
375
- * @hidden
376
- */
377
- get isControlInvalid() {
378
- return this.control && this.control.touched && !this.control.valid;
379
- }
380
- /**
381
- * @hidden
382
- */
383
- get isControlRequired() {
384
- return isControlRequired(this.control?.control);
385
- }
386
- /**
387
- * @hidden
388
- */
389
- get separatorOrientation() {
390
- return this.flow === 'horizontal' ? 'vertical' : 'horizontal';
391
- }
392
- /**
393
- * @hidden
394
- */
395
- get isFocused() {
396
- return this._isFocused;
397
- }
398
- /**
399
- * @hidden
400
- */
401
- set isFocused(value) {
402
- if (this._isFocused !== value && this.hostElement) {
403
- const element = this.hostElement.nativeElement;
404
- if (value && !this.disabled) {
405
- this.renderer.addClass(element, FOCUSED);
406
- }
407
- else {
408
- this.renderer.removeClass(element, FOCUSED);
409
- }
410
- this._isFocused = value;
411
- }
412
- }
413
- /**
414
- * @hidden
415
- */
416
- handleInput = (ev) => {
417
- const incomingValue = ev.target.value;
418
- this.updateValue(incomingValue);
419
- this.resize();
420
- };
421
- /**
422
- * @hidden
423
- */
424
- handleInputFocus = () => {
425
- if (!this.disabled) {
426
- if (this.selectOnFocus && this.value) {
427
- this.ngZone.run(() => {
428
- setTimeout(() => { this.selectAll(); });
429
- });
430
- }
431
- if (!this.isFocused) {
432
- this.handleFocus();
433
- }
434
- if (hasObservers(this.inputFocus)) {
435
- if (!this.focusChangedProgrammatically) {
436
- this.ngZone.run(() => {
437
- this.inputFocus.emit();
438
- });
439
- }
440
- }
441
- }
442
- };
443
- /**
444
- * Focuses the TextArea.
445
- */
446
- focus() {
447
- if (!this.input) {
448
- return;
449
- }
450
- this.focusChangedProgrammatically = true;
451
- this.isFocused = true;
452
- this.input.nativeElement.focus();
453
- this.focusChangedProgrammatically = false;
454
- }
455
- /**
456
- * Blurs the TextArea.
457
- */
458
- blur() {
459
- this.focusChangedProgrammatically = true;
460
- const isFocusedElement = this.hostElement.nativeElement.querySelector(':focus');
461
- if (isFocusedElement) {
462
- isFocusedElement.blur();
463
- }
464
- this.isFocused = false;
465
- this.focusChangedProgrammatically = false;
466
- }
467
- attachResizeObserver() {
468
- if (typeof ResizeObserver === 'undefined' || !this.hostElement?.nativeElement) {
469
- return;
470
- }
471
- this.ngZone.runOutsideAngular(() => {
472
- this.resizeObserver = new ResizeObserver(() => this.resize());
473
- this.resizeObserver.observe(this.hostElement.nativeElement);
474
- });
475
- }
476
- resize() {
477
- if (this.resizable !== 'auto') {
478
- return;
479
- }
480
- // The logic of the resize method, does not depend on Angular and thus moving it outisde of it
481
- // We need to ensure that the resizing logic runs after the value is updated thus the setTimout
482
- this.ngZone.runOutsideAngular(() => {
483
- setTimeout(() => {
484
- const hostElement = this.hostElement.nativeElement;
485
- const element = this.input.nativeElement;
486
- this.renderer.setStyle(element, 'height', `${this.initialHeight}px`);
487
- const scrollHeight = element.scrollHeight;
488
- if (scrollHeight > this.maxResizableHeight) {
489
- this.renderer.setStyle(element, 'height', `${this.maxResizableHeight}px`);
490
- return;
491
- }
492
- this.renderer.setStyle(hostElement, 'min-height', `${scrollHeight}px`);
493
- if (scrollHeight > this.initialHeight) {
494
- this.renderer.setStyle(element, 'height', `${scrollHeight}px`);
495
- }
496
- }, 0);
497
- });
498
- }
499
- /**
500
- * @hidden
501
- */
502
- handleFocus() {
503
- this.ngZone.run(() => {
504
- if (!this.focusChangedProgrammatically && hasObservers(this.onFocus)) {
505
- this.onFocus.emit();
506
- }
507
- this.isFocused = true;
508
- });
509
- }
510
- /**
511
- * @hidden
512
- */
513
- handleBlur() {
514
- this.changeDetector.markForCheck();
515
- this.ngZone.run(() => {
516
- if (!this.focusChangedProgrammatically) {
517
- this.onBlur.emit();
518
- }
519
- this.isFocused = false;
520
- });
521
- }
522
- updateValue(value) {
523
- if (!areSame(this.value, value)) {
524
- this.ngZone.run(() => {
525
- this.value = value;
526
- this.ngChange(value);
527
- this.valueChange.emit(value);
528
- this.changeDetector.markForCheck();
529
- });
530
- }
531
- }
532
- setSelection(start, end) {
533
- if (this.isFocused) {
534
- invokeElementMethod(this.input, 'setSelectionRange', start, end);
535
- }
536
- }
537
- selectAll() {
538
- if (this.value) {
539
- this.setSelection(0, this.value.length);
540
- }
541
- }
542
- handleClasses(value, input) {
543
- const elem = this.hostElement.nativeElement;
544
- const classes = getStylingClasses('input', input, this[input], value);
545
- if (classes.toRemove) {
546
- this.renderer.removeClass(elem, classes.toRemove);
547
- }
548
- if (classes.toAdd) {
549
- this.renderer.addClass(elem, classes.toAdd);
550
- }
551
- }
552
- handleFlow() {
553
- const isVertical = this.flow === 'vertical';
554
- const element = this.input.nativeElement;
555
- this.renderer[isVertical ? 'addClass' : 'removeClass'](element, '\!k-flex-none');
556
- }
557
- setInputAttributes() {
558
- const attributesToRender = Object.assign({}, this.mutableAttributes, this.parsedAttributes);
559
- setHTMLAttributes(attributesToRender, this.renderer, this.input.nativeElement, this.ngZone);
560
- }
561
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TextAreaComponent, deps: [{ token: i1.LocalizationService }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }, { token: i0.Injector }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
562
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: TextAreaComponent, isStandalone: true, selector: "kendo-textarea", inputs: { focusableId: "focusableId", flow: "flow", inputAttributes: "inputAttributes", adornmentsOrientation: "adornmentsOrientation", rows: "rows", cols: "cols", maxlength: "maxlength", maxResizableRows: "maxResizableRows", tabindex: "tabindex", tabIndex: "tabIndex", resizable: "resizable", size: "size", rounded: "rounded", fillMode: "fillMode", showPrefixSeparator: "showPrefixSeparator", showSuffixSeparator: "showSuffixSeparator" }, outputs: { onFocus: "focus", onBlur: "blur", valueChange: "valueChange" }, host: { properties: { "class.k-textarea": "this.hostClasses", "class.k-input": "this.hostClasses", "class.!k-flex-col": "this.flowCol", "class.!k-flex-row": "this.flowRow" } }, providers: [
563
- LocalizationService,
564
- { provide: L10N_PREFIX, useValue: 'kendo.textarea' },
565
- {
566
- provide: NG_VALUE_ACCESSOR,
567
- useExisting: forwardRef(() => TextAreaComponent),
568
- multi: true
569
- },
570
- { provide: KendoInput, useExisting: forwardRef(() => TextAreaComponent) }
571
- ], queries: [{ propertyName: "prefix", first: true, predicate: TextAreaPrefixComponent, descendants: true }, { propertyName: "suffix", first: true, predicate: TextAreaSuffixComponent, descendants: true }], exportAs: ["kendoTextArea"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `
572
- <ng-container
573
- kendoInputSharedEvents
574
- [hostElement]="hostElement"
575
- [(isFocused)]="isFocused"
576
- (handleBlur)="handleBlur()"
577
- (onFocus)="handleFocus()"
578
- >
579
- <ng-content select="kendo-textarea-prefix"></ng-content>
580
- @if (prefix && showPrefixSeparator) {
581
- <kendo-input-separator
582
- [orientation]="separatorOrientation"
583
- ></kendo-input-separator>
584
- }
585
- <textarea #input
586
- class="k-input-inner !k-overflow-auto"
587
- [attr.aria-multiline]="true"
588
- [attr.aria-disabled]="disabled ? true : undefined"
589
- [attr.aria-readonly]="readonly ? true : undefined"
590
- [attr.aria-invalid]="isControlInvalid"
591
- [id]="focusableId"
592
- [attr.required]="isControlRequired ? '' : null"
593
- [ngClass]="resizableClass"
594
- [value]="value"
595
- [attr.placeholder]="placeholder"
596
- [disabled]="disabled"
597
- [readonly]="readonly"
598
- [attr.rows]="rows"
599
- [attr.cols]="cols"
600
- [attr.tabindex]="tabIndex"
601
- [attr.title]="title"
602
- [attr.maxlength]="maxlength"
603
- [attr.aria-invalid]="isControlInvalid"
604
- [kendoEventsOutsideAngular]="{
605
- focus: handleInputFocus,
606
- blur: handleInputBlur,
607
- input: handleInput}"
608
- ></textarea>
609
- @if (suffix && showSuffixSeparator) {
610
- <kendo-input-separator
611
- [orientation]="separatorOrientation"
612
- ></kendo-input-separator>
613
- }
614
- <ng-content select="kendo-textarea-suffix"></ng-content>
615
- </ng-container>
616
- `, isInline: true, dependencies: [{ kind: "directive", type: SharedInputEventsDirective, selector: "[kendoInputSharedEvents]", inputs: ["hostElement", "clearButtonClicked", "isFocused"], outputs: ["isFocusedChange", "onFocus", "handleBlur"] }, { kind: "component", type: InputSeparatorComponent, selector: "kendo-input-separator, kendo-textbox-separator", inputs: ["orientation"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }] });
617
- }
618
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TextAreaComponent, decorators: [{
619
- type: Component,
620
- args: [{
621
- exportAs: 'kendoTextArea',
622
- providers: [
623
- LocalizationService,
624
- { provide: L10N_PREFIX, useValue: 'kendo.textarea' },
625
- {
626
- provide: NG_VALUE_ACCESSOR,
627
- useExisting: forwardRef(() => TextAreaComponent),
628
- multi: true
629
- },
630
- { provide: KendoInput, useExisting: forwardRef(() => TextAreaComponent) }
631
- ],
632
- selector: 'kendo-textarea',
633
- template: `
634
- <ng-container
635
- kendoInputSharedEvents
636
- [hostElement]="hostElement"
637
- [(isFocused)]="isFocused"
638
- (handleBlur)="handleBlur()"
639
- (onFocus)="handleFocus()"
640
- >
641
- <ng-content select="kendo-textarea-prefix"></ng-content>
642
- @if (prefix && showPrefixSeparator) {
643
- <kendo-input-separator
644
- [orientation]="separatorOrientation"
645
- ></kendo-input-separator>
646
- }
647
- <textarea #input
648
- class="k-input-inner !k-overflow-auto"
649
- [attr.aria-multiline]="true"
650
- [attr.aria-disabled]="disabled ? true : undefined"
651
- [attr.aria-readonly]="readonly ? true : undefined"
652
- [attr.aria-invalid]="isControlInvalid"
653
- [id]="focusableId"
654
- [attr.required]="isControlRequired ? '' : null"
655
- [ngClass]="resizableClass"
656
- [value]="value"
657
- [attr.placeholder]="placeholder"
658
- [disabled]="disabled"
659
- [readonly]="readonly"
660
- [attr.rows]="rows"
661
- [attr.cols]="cols"
662
- [attr.tabindex]="tabIndex"
663
- [attr.title]="title"
664
- [attr.maxlength]="maxlength"
665
- [attr.aria-invalid]="isControlInvalid"
666
- [kendoEventsOutsideAngular]="{
667
- focus: handleInputFocus,
668
- blur: handleInputBlur,
669
- input: handleInput}"
670
- ></textarea>
671
- @if (suffix && showSuffixSeparator) {
672
- <kendo-input-separator
673
- [orientation]="separatorOrientation"
674
- ></kendo-input-separator>
675
- }
676
- <ng-content select="kendo-textarea-suffix"></ng-content>
677
- </ng-container>
678
- `,
679
- standalone: true,
680
- imports: [SharedInputEventsDirective, InputSeparatorComponent, NgClass, EventsOutsideAngularDirective]
681
- }]
682
- }], ctorParameters: () => [{ type: i1.LocalizationService }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }, { type: i0.Injector }, { type: i0.ElementRef }], propDecorators: { focusableId: [{
683
- type: Input
684
- }], hostClasses: [{
685
- type: HostBinding,
686
- args: ['class.k-textarea']
687
- }, {
688
- type: HostBinding,
689
- args: ['class.k-input']
690
- }], flowCol: [{
691
- type: HostBinding,
692
- args: ['class.\!k-flex-col']
693
- }], flowRow: [{
694
- type: HostBinding,
695
- args: ['class.\!k-flex-row']
696
- }], flow: [{
697
- type: Input
698
- }], inputAttributes: [{
699
- type: Input
700
- }], adornmentsOrientation: [{
701
- type: Input
702
- }], rows: [{
703
- type: Input
704
- }], cols: [{
705
- type: Input
706
- }], maxlength: [{
707
- type: Input
708
- }], maxResizableRows: [{
709
- type: Input
710
- }], tabindex: [{
711
- type: Input
712
- }], tabIndex: [{
713
- type: Input
714
- }], resizable: [{
715
- type: Input
716
- }], size: [{
717
- type: Input
718
- }], rounded: [{
719
- type: Input
720
- }], fillMode: [{
721
- type: Input
722
- }], showPrefixSeparator: [{
723
- type: Input
724
- }], showSuffixSeparator: [{
725
- type: Input
726
- }], onFocus: [{
727
- type: Output,
728
- args: ['focus']
729
- }], onBlur: [{
730
- type: Output,
731
- args: ['blur']
732
- }], valueChange: [{
733
- type: Output
734
- }], prefix: [{
735
- type: ContentChild,
736
- args: [TextAreaPrefixComponent]
737
- }], suffix: [{
738
- type: ContentChild,
739
- args: [TextAreaSuffixComponent]
740
- }] } });