@progress/kendo-angular-inputs 13.2.1-develop.11 → 13.2.1-develop.13

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 (289) hide show
  1. package/LICENSE.md +11 -0
  2. package/NOTICE.txt +654 -0
  3. package/README.md +184 -0
  4. package/checkbox/checkbox.directive.d.ts +52 -0
  5. package/checkbox.module.d.ts +43 -0
  6. package/colorpicker/color-contrast-svg.component.d.ts +29 -0
  7. package/colorpicker/color-gradient-numeric-label.directive.d.ts +20 -0
  8. package/colorpicker/color-gradient.component.d.ts +281 -0
  9. package/colorpicker/color-input.component.d.ts +95 -0
  10. package/colorpicker/color-palette.component.d.ts +221 -0
  11. package/colorpicker/colorpicker.component.d.ts +383 -0
  12. package/colorpicker/constants.d.ts +41 -0
  13. package/colorpicker/contrast-validation.component.d.ts +24 -0
  14. package/colorpicker/contrast.component.d.ts +25 -0
  15. package/colorpicker/events/active-color-click-event.d.ts +53 -0
  16. package/colorpicker/events/cancel-event.d.ts +15 -0
  17. package/colorpicker/events/close-event.d.ts +10 -0
  18. package/colorpicker/events/kendo-drag-event.d.ts +21 -0
  19. package/colorpicker/events/open-event.d.ts +10 -0
  20. package/colorpicker/events.d.ts +8 -0
  21. package/colorpicker/flatcolorpicker-actions.component.d.ts +24 -0
  22. package/colorpicker/flatcolorpicker-header.component.d.ts +43 -0
  23. package/colorpicker/flatcolorpicker.component.d.ts +267 -0
  24. package/colorpicker/focus-on-dom-ready.directive.d.ts +18 -0
  25. package/colorpicker/localization/colorgradient-localization.service.d.ts +17 -0
  26. package/colorpicker/localization/colorpalette-localization.service.d.ts +17 -0
  27. package/colorpicker/localization/colorpicker-localization.service.d.ts +14 -0
  28. package/colorpicker/localization/custom-messages.component.d.ts +17 -0
  29. package/colorpicker/localization/flatcolorpicker-localization.service.d.ts +17 -0
  30. package/colorpicker/localization/localized-colorpicker-messages.directive.d.ts +16 -0
  31. package/colorpicker/localization/messages.d.ts +121 -0
  32. package/colorpicker/models/actions-layout.d.ts +8 -0
  33. package/colorpicker/models/colorpicker-view.d.ts +8 -0
  34. package/colorpicker/models/gradient-settings.d.ts +35 -0
  35. package/colorpicker/models/hsva.d.ts +13 -0
  36. package/colorpicker/models/output-format.d.ts +8 -0
  37. package/colorpicker/models/palette-presets.d.ts +61 -0
  38. package/colorpicker/models/palette-settings.d.ts +33 -0
  39. package/colorpicker/models/popup-settings.d.ts +18 -0
  40. package/colorpicker/models/rgb.d.ts +12 -0
  41. package/colorpicker/models/rgba.d.ts +13 -0
  42. package/colorpicker/models/table-cell.d.ts +11 -0
  43. package/colorpicker/models/tile-size.d.ts +11 -0
  44. package/colorpicker/models.d.ts +16 -0
  45. package/colorpicker/services/color-palette.service.d.ts +19 -0
  46. package/colorpicker/services/flatcolorpicker.service.d.ts +15 -0
  47. package/colorpicker/utils/color-parser.d.ts +77 -0
  48. package/colorpicker/utils/contrast-curve.d.ts +37 -0
  49. package/colorpicker/utils.d.ts +6 -0
  50. package/colorpicker.module.d.ts +35 -0
  51. package/common/dom-utils.d.ts +25 -0
  52. package/common/math.d.ts +36 -0
  53. package/common/models/fillmode.d.ts +9 -0
  54. package/common/models/rounded.d.ts +14 -0
  55. package/common/models/size.d.ts +9 -0
  56. package/common/models/styling-classes.d.ts +11 -0
  57. package/common/models.d.ts +8 -0
  58. package/common/utils.d.ts +56 -0
  59. package/esm2020/checkbox/checkbox.directive.mjs +94 -0
  60. package/esm2020/checkbox.module.mjs +52 -0
  61. package/esm2020/colorpicker/color-contrast-svg.component.mjs +97 -0
  62. package/esm2020/colorpicker/color-gradient-numeric-label.directive.mjs +31 -0
  63. package/esm2020/colorpicker/color-gradient.component.mjs +1003 -0
  64. package/esm2020/colorpicker/color-input.component.mjs +433 -0
  65. package/esm2020/colorpicker/color-palette.component.mjs +553 -0
  66. package/esm2020/colorpicker/colorpicker.component.mjs +1086 -0
  67. package/esm2020/colorpicker/constants.mjs +40 -0
  68. package/esm2020/colorpicker/contrast-validation.component.mjs +72 -0
  69. package/esm2020/colorpicker/contrast.component.mjs +100 -0
  70. package/esm2020/colorpicker/events/active-color-click-event.mjs +58 -0
  71. package/esm2020/colorpicker/events/cancel-event.mjs +14 -0
  72. package/esm2020/colorpicker/events/close-event.mjs +10 -0
  73. package/esm2020/colorpicker/events/kendo-drag-event.mjs +5 -0
  74. package/esm2020/colorpicker/events/open-event.mjs +10 -0
  75. package/esm2020/colorpicker/events.mjs +8 -0
  76. package/esm2020/colorpicker/flatcolorpicker-actions.component.mjs +93 -0
  77. package/esm2020/colorpicker/flatcolorpicker-header.component.mjs +217 -0
  78. package/esm2020/colorpicker/flatcolorpicker.component.mjs +829 -0
  79. package/esm2020/colorpicker/focus-on-dom-ready.directive.mjs +29 -0
  80. package/esm2020/colorpicker/localization/colorgradient-localization.service.mjs +45 -0
  81. package/esm2020/colorpicker/localization/colorpalette-localization.service.mjs +45 -0
  82. package/esm2020/colorpicker/localization/colorpicker-localization.service.mjs +31 -0
  83. package/esm2020/colorpicker/localization/custom-messages.component.mjs +41 -0
  84. package/esm2020/colorpicker/localization/flatcolorpicker-localization.service.mjs +45 -0
  85. package/esm2020/colorpicker/localization/localized-colorpicker-messages.directive.mjs +37 -0
  86. package/esm2020/colorpicker/localization/messages.mjs +75 -0
  87. package/esm2020/colorpicker/models/actions-layout.mjs +5 -0
  88. package/esm2020/colorpicker/models/colorpicker-view.mjs +5 -0
  89. package/esm2020/colorpicker/models/gradient-settings.mjs +5 -0
  90. package/esm2020/colorpicker/models/hsva.mjs +5 -0
  91. package/esm2020/colorpicker/models/output-format.mjs +5 -0
  92. package/esm2020/colorpicker/models/palette-presets.mjs +62 -0
  93. package/esm2020/colorpicker/models/palette-settings.mjs +5 -0
  94. package/esm2020/colorpicker/models/popup-settings.mjs +5 -0
  95. package/esm2020/colorpicker/models/rgb.mjs +5 -0
  96. package/esm2020/colorpicker/models/rgba.mjs +5 -0
  97. package/esm2020/colorpicker/models/table-cell.mjs +5 -0
  98. package/esm2020/colorpicker/models/tile-size.mjs +6 -0
  99. package/esm2020/colorpicker/models.mjs +16 -0
  100. package/esm2020/colorpicker/services/color-palette.service.mjs +67 -0
  101. package/esm2020/colorpicker/services/flatcolorpicker.service.mjs +39 -0
  102. package/esm2020/colorpicker/utils/color-parser.mjs +164 -0
  103. package/esm2020/colorpicker/utils/contrast-curve.mjs +85 -0
  104. package/esm2020/colorpicker/utils.mjs +6 -0
  105. package/esm2020/colorpicker.module.mjs +104 -0
  106. package/esm2020/common/dom-utils.mjs +36 -0
  107. package/esm2020/common/math.mjs +65 -0
  108. package/esm2020/common/models/fillmode.mjs +5 -0
  109. package/esm2020/common/models/rounded.mjs +5 -0
  110. package/esm2020/common/models/size.mjs +5 -0
  111. package/esm2020/common/models/styling-classes.mjs +5 -0
  112. package/esm2020/common/models.mjs +8 -0
  113. package/esm2020/common/utils.mjs +81 -0
  114. package/esm2020/formfield/error.component.mjs +68 -0
  115. package/esm2020/formfield/formfield.component.mjs +284 -0
  116. package/esm2020/formfield/hint.component.mjs +63 -0
  117. package/esm2020/formfield/models/message-align.mjs +5 -0
  118. package/esm2020/formfield/models/orientation.mjs +5 -0
  119. package/esm2020/formfield/models/show-options.mjs +5 -0
  120. package/esm2020/formfield.module.mjs +54 -0
  121. package/esm2020/index.mjs +66 -0
  122. package/esm2020/inputs.module.mjs +98 -0
  123. package/esm2020/maskedtextbox/maskedtextbox.component.mjs +711 -0
  124. package/esm2020/maskedtextbox/masking.service.mjs +191 -0
  125. package/esm2020/maskedtextbox/parsing/combinators.mjs +28 -0
  126. package/esm2020/maskedtextbox/parsing/parsers.mjs +147 -0
  127. package/esm2020/maskedtextbox/parsing/result.mjs +41 -0
  128. package/esm2020/maskedtextbox/parsing/stream.mjs +41 -0
  129. package/esm2020/maskedtextbox.module.mjs +53 -0
  130. package/esm2020/numerictextbox/arrow-direction.mjs +13 -0
  131. package/esm2020/numerictextbox/constants.mjs +28 -0
  132. package/esm2020/numerictextbox/localization/custom-messages.component.mjs +41 -0
  133. package/esm2020/numerictextbox/localization/localized-numerictextbox-messages.directive.mjs +37 -0
  134. package/esm2020/numerictextbox/localization/messages.mjs +25 -0
  135. package/esm2020/numerictextbox/numerictextbox.component.mjs +1105 -0
  136. package/esm2020/numerictextbox/utils.mjs +92 -0
  137. package/esm2020/numerictextbox.module.mjs +66 -0
  138. package/esm2020/package-metadata.mjs +15 -0
  139. package/esm2020/progress-kendo-angular-inputs.mjs +8 -0
  140. package/esm2020/radiobutton/radiobutton.directive.mjs +76 -0
  141. package/esm2020/radiobutton.module.mjs +52 -0
  142. package/esm2020/rangeslider/localization/custom-messages.component.mjs +41 -0
  143. package/esm2020/rangeslider/localization/localized-rangeslider-messages.directive.mjs +37 -0
  144. package/esm2020/rangeslider/localization/messages.mjs +25 -0
  145. package/esm2020/rangeslider/rangeslider-model.mjs +52 -0
  146. package/esm2020/rangeslider/rangeslider-value.type.mjs +5 -0
  147. package/esm2020/rangeslider/rangeslider.component.mjs +605 -0
  148. package/esm2020/rangeslider.module.mjs +71 -0
  149. package/esm2020/shared/input-separator.component.mjs +41 -0
  150. package/esm2020/shared/textarea.directive.mjs +260 -0
  151. package/esm2020/shared/utils.mjs +13 -0
  152. package/esm2020/shared.module.mjs +32 -0
  153. package/esm2020/signature/events/close-event.mjs +10 -0
  154. package/esm2020/signature/events/index.mjs +6 -0
  155. package/esm2020/signature/events/open-event.mjs +10 -0
  156. package/esm2020/signature/localization/custom-messages.component.mjs +41 -0
  157. package/esm2020/signature/localization/index.mjs +7 -0
  158. package/esm2020/signature/localization/localized-signature-messages.directive.mjs +37 -0
  159. package/esm2020/signature/localization/messages.mjs +29 -0
  160. package/esm2020/signature/signature.component.mjs +906 -0
  161. package/esm2020/signature.module.mjs +79 -0
  162. package/esm2020/slider/localization/custom-messages.component.mjs +41 -0
  163. package/esm2020/slider/localization/localized-slider-messages.directive.mjs +37 -0
  164. package/esm2020/slider/localization/messages.mjs +27 -0
  165. package/esm2020/slider/slider-model.mjs +34 -0
  166. package/esm2020/slider/slider.component.mjs +646 -0
  167. package/esm2020/slider.module.mjs +73 -0
  168. package/esm2020/sliders-common/label-template.directive.mjs +45 -0
  169. package/esm2020/sliders-common/slider-base.mjs +255 -0
  170. package/esm2020/sliders-common/slider-model.base.mjs +93 -0
  171. package/esm2020/sliders-common/slider-ticks.component.mjs +125 -0
  172. package/esm2020/sliders-common/sliders-common.module.mjs +42 -0
  173. package/esm2020/sliders-common/sliders-util.mjs +219 -0
  174. package/esm2020/sliders-common/title-callback.mjs +5 -0
  175. package/esm2020/switch/events/blur-event.mjs +9 -0
  176. package/esm2020/switch/events/focus-event.mjs +9 -0
  177. package/esm2020/switch/localization/custom-messages.component.mjs +41 -0
  178. package/esm2020/switch/localization/localized-switch-messages.directive.mjs +37 -0
  179. package/esm2020/switch/localization/messages.mjs +25 -0
  180. package/esm2020/switch/switch.component.mjs +577 -0
  181. package/esm2020/switch.module.mjs +68 -0
  182. package/esm2020/text-fields-common/text-fields-base.mjs +128 -0
  183. package/esm2020/textarea/models/flow.mjs +5 -0
  184. package/esm2020/textarea/models/resize.mjs +5 -0
  185. package/esm2020/textarea/textarea-suffix.component.mjs +40 -0
  186. package/esm2020/textarea/textarea.component.mjs +604 -0
  187. package/esm2020/textarea.module.mjs +68 -0
  188. package/esm2020/textbox/localization/custom-messages.component.mjs +41 -0
  189. package/esm2020/textbox/localization/localized-textbox-messages.directive.mjs +37 -0
  190. package/esm2020/textbox/localization/messages.mjs +23 -0
  191. package/esm2020/textbox/models/icon-show-options.mjs +5 -0
  192. package/esm2020/textbox/textbox-prefix.directive.mjs +38 -0
  193. package/esm2020/textbox/textbox-suffix.directive.mjs +37 -0
  194. package/esm2020/textbox/textbox.component.mjs +849 -0
  195. package/esm2020/textbox/textbox.directive.mjs +121 -0
  196. package/esm2020/textbox.module.mjs +89 -0
  197. package/esm2020/validators/max.validator.mjs +21 -0
  198. package/esm2020/validators/min.validator.mjs +21 -0
  199. package/fesm2015/progress-kendo-angular-inputs.mjs +15090 -0
  200. package/fesm2020/progress-kendo-angular-inputs.mjs +15055 -0
  201. package/formfield/error.component.d.ts +31 -0
  202. package/formfield/formfield.component.d.ts +98 -0
  203. package/formfield/hint.component.d.ts +29 -0
  204. package/formfield/models/message-align.d.ts +8 -0
  205. package/formfield/models/orientation.d.ts +9 -0
  206. package/formfield/models/show-options.d.ts +16 -0
  207. package/formfield.module.d.ts +45 -0
  208. package/index.d.ts +76 -0
  209. package/inputs.module.d.ts +55 -0
  210. package/maskedtextbox/maskedtextbox.component.d.ts +315 -0
  211. package/maskedtextbox/masking.service.d.ts +48 -0
  212. package/maskedtextbox/parsing/combinators.d.ts +13 -0
  213. package/maskedtextbox/parsing/parsers.d.ts +51 -0
  214. package/maskedtextbox/parsing/result.d.ts +27 -0
  215. package/maskedtextbox/parsing/stream.d.ts +26 -0
  216. package/maskedtextbox.module.d.ts +44 -0
  217. package/numerictextbox/arrow-direction.d.ts +12 -0
  218. package/numerictextbox/constants.d.ts +28 -0
  219. package/numerictextbox/localization/custom-messages.component.d.ts +17 -0
  220. package/numerictextbox/localization/localized-numerictextbox-messages.directive.d.ts +16 -0
  221. package/numerictextbox/localization/messages.d.ts +21 -0
  222. package/numerictextbox/numerictextbox.component.d.ts +364 -0
  223. package/numerictextbox/utils.d.ts +44 -0
  224. package/numerictextbox.module.d.ts +47 -0
  225. package/package-metadata.d.ts +9 -0
  226. package/package.json +74 -0
  227. package/progress-kendo-angular-inputs.d.ts +9 -0
  228. package/radiobutton/radiobutton.directive.d.ts +38 -0
  229. package/radiobutton.module.d.ts +43 -0
  230. package/rangeslider/localization/custom-messages.component.d.ts +17 -0
  231. package/rangeslider/localization/localized-rangeslider-messages.directive.d.ts +16 -0
  232. package/rangeslider/localization/messages.d.ts +21 -0
  233. package/rangeslider/rangeslider-model.d.ts +15 -0
  234. package/rangeslider/rangeslider-value.type.d.ts +9 -0
  235. package/rangeslider/rangeslider.component.d.ts +139 -0
  236. package/rangeslider.module.d.ts +48 -0
  237. package/schematics/collection.json +12 -0
  238. package/schematics/ngAdd/index.js +11 -0
  239. package/schematics/ngAdd/schema.json +28 -0
  240. package/shared/input-separator.component.d.ts +28 -0
  241. package/shared/textarea.directive.d.ts +99 -0
  242. package/shared/utils.d.ts +10 -0
  243. package/shared.module.d.ts +19 -0
  244. package/signature/events/close-event.d.ts +10 -0
  245. package/signature/events/index.d.ts +6 -0
  246. package/signature/events/open-event.d.ts +10 -0
  247. package/signature/localization/custom-messages.component.d.ts +17 -0
  248. package/signature/localization/index.d.ts +7 -0
  249. package/signature/localization/localized-signature-messages.directive.d.ts +16 -0
  250. package/signature/localization/messages.d.ts +29 -0
  251. package/signature/signature.component.d.ts +364 -0
  252. package/signature.module.d.ts +48 -0
  253. package/slider/localization/custom-messages.component.d.ts +17 -0
  254. package/slider/localization/localized-slider-messages.directive.d.ts +16 -0
  255. package/slider/localization/messages.d.ts +25 -0
  256. package/slider/slider-model.d.ts +14 -0
  257. package/slider/slider.component.d.ts +175 -0
  258. package/slider.module.d.ts +50 -0
  259. package/sliders-common/label-template.directive.d.ts +36 -0
  260. package/sliders-common/slider-base.d.ts +141 -0
  261. package/sliders-common/slider-model.base.d.ts +26 -0
  262. package/sliders-common/slider-ticks.component.d.ts +26 -0
  263. package/sliders-common/sliders-common.module.d.ts +17 -0
  264. package/sliders-common/sliders-util.d.ts +119 -0
  265. package/sliders-common/title-callback.d.ts +10 -0
  266. package/switch/events/blur-event.d.ts +13 -0
  267. package/switch/events/focus-event.d.ts +13 -0
  268. package/switch/localization/custom-messages.component.d.ts +17 -0
  269. package/switch/localization/localized-switch-messages.directive.d.ts +16 -0
  270. package/switch/localization/messages.d.ts +21 -0
  271. package/switch/switch.component.d.ts +216 -0
  272. package/switch.module.d.ts +46 -0
  273. package/text-fields-common/text-fields-base.d.ts +91 -0
  274. package/textarea/models/flow.d.ts +12 -0
  275. package/textarea/models/resize.d.ts +16 -0
  276. package/textarea/textarea-suffix.component.d.ts +26 -0
  277. package/textarea/textarea.component.d.ts +225 -0
  278. package/textarea.module.d.ts +48 -0
  279. package/textbox/localization/custom-messages.component.d.ts +17 -0
  280. package/textbox/localization/localized-textbox-messages.directive.d.ts +16 -0
  281. package/textbox/localization/messages.d.ts +17 -0
  282. package/textbox/models/icon-show-options.d.ts +13 -0
  283. package/textbox/textbox-prefix.directive.d.ts +29 -0
  284. package/textbox/textbox-suffix.directive.d.ts +28 -0
  285. package/textbox/textbox.component.d.ts +376 -0
  286. package/textbox/textbox.directive.d.ts +59 -0
  287. package/textbox.module.d.ts +53 -0
  288. package/validators/max.validator.d.ts +8 -0
  289. package/validators/min.validator.d.ts +8 -0
@@ -0,0 +1,604 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 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 } from '@angular/core';
6
+ import { fromEvent } from 'rxjs';
7
+ import { debounceTime } from 'rxjs/operators';
8
+ import { NG_VALUE_ACCESSOR, NgControl } from '@angular/forms';
9
+ import { KendoInput, guid, isDocumentAvailable, hasObservers, Keys } 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 { closest } from './../common/dom-utils';
15
+ import { validatePackage } from '@progress/kendo-licensing';
16
+ import { packageMetadata } from '../package-metadata';
17
+ import * as i0 from "@angular/core";
18
+ import * as i1 from "@progress/kendo-angular-l10n";
19
+ import * as i2 from "@angular/common";
20
+ import * as i3 from "@progress/kendo-angular-common";
21
+ const resizeClasses = {
22
+ 'vertical': 'k-resize-y',
23
+ 'horizontal': 'k-resize-x',
24
+ 'both': 'k-resize',
25
+ 'none': 'k-resize-none',
26
+ 'auto': 'k-resize-none'
27
+ };
28
+ const FOCUSED = 'k-focus';
29
+ const DEFAULT_SIZE = 'medium';
30
+ const DEFAULT_ROUNDED = 'medium';
31
+ const DEFAULT_FILL_MODE = 'solid';
32
+ /**
33
+ * Represents the [Kendo UI TextArea component for Angular]({% slug overview_textarea %}).
34
+ */
35
+ export class TextAreaComponent extends TextFieldsBase {
36
+ constructor(localizationService, ngZone, changeDetector, renderer, injector, hostElement) {
37
+ super(localizationService, ngZone, changeDetector, renderer, injector, hostElement);
38
+ this.localizationService = localizationService;
39
+ this.ngZone = ngZone;
40
+ this.changeDetector = changeDetector;
41
+ this.renderer = renderer;
42
+ this.injector = injector;
43
+ this.hostElement = hostElement;
44
+ /**
45
+ * @hidden
46
+ */
47
+ this.focusableId = `k-${guid()}`;
48
+ this.hostClasses = true;
49
+ /**
50
+ * Specifies the flow direction of the TextArea sections. This property is useful when adornments are used, in order to specify
51
+ * their position in relation to the textarea element.
52
+ *
53
+ * The possible values are:
54
+ * * `vertical`(Default) —TextArea sections are placed from top to bottom.
55
+ * * `horizontal`—TextArea sections are placed from left to right in `ltr`, and from right to left in `rtl` mode.
56
+ */
57
+ this.flow = 'vertical';
58
+ /**
59
+ * Specifies the [tabindex](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
60
+ */
61
+ this.tabindex = 0;
62
+ /**
63
+ * Configures the resize behavior of the TextArea.
64
+ *
65
+ * The possible values are:
66
+ * * `vertical`(Default)—The TextArea component can be resized only vertically.
67
+ * * `horizontal`—The TextArea component can be resized only horizontally.
68
+ * * `both`—The TextArea component can be resized in both (horizontal and vertical) directions.
69
+ * * `auto`—Specifies whether the TextArea component will adjust its height automatically, based on the content.
70
+ * * `none`—The TextArea cannot be resized.
71
+ *
72
+ */
73
+ this.resizable = 'vertical';
74
+ /**
75
+ * Fires each time the user focuses the TextArea component.
76
+ *
77
+ * > To wire the event programmatically, use the `onFocus` property.
78
+ *
79
+ * @example
80
+ * ```ts
81
+ * _@Component({
82
+ * selector: 'my-app',
83
+ * template: `
84
+ * <kendo-textarea (focus)="handleFocus()"></kendo-textarea>
85
+ * `
86
+ * })
87
+ * class AppComponent {
88
+ * public handleFocus(): void {
89
+ * console.log('Component is focused');
90
+ * }
91
+ * }
92
+ * ```
93
+ */
94
+ this.onFocus = new EventEmitter();
95
+ /**
96
+ * Fires each time the TextArea component gets blurred.
97
+ *
98
+ * > To wire the event programmatically, use the `onBlur` property.
99
+ *
100
+ * @example
101
+ * ```ts
102
+ * _@Component({
103
+ * selector: 'my-app',
104
+ * template: `
105
+ * <kendo-textarea (blur)="handleBlur()"></kendo-textarea>
106
+ * `
107
+ * })
108
+ * class AppComponent {
109
+ * public handleBlur(): void {
110
+ * console.log('Component is blurred');
111
+ * }
112
+ * }
113
+ * ```
114
+ */
115
+ this.onBlur = new EventEmitter();
116
+ /**
117
+ * Fires each time the value is changed or the component is blurred
118
+ * ([see example]({% slug overview_textarea %}#toc-events)).
119
+ * When the component value is changed programmatically or via its form control binding, the valueChange event is not emitted.
120
+ */
121
+ this.valueChange = new EventEmitter();
122
+ this._size = 'medium';
123
+ this._rounded = 'medium';
124
+ this._fillMode = 'solid';
125
+ /**
126
+ * @hidden
127
+ */
128
+ this.handleInput = (ev) => {
129
+ const incomingValue = ev.target.value;
130
+ this.updateValue(incomingValue);
131
+ this.resize();
132
+ };
133
+ /**
134
+ * @hidden
135
+ */
136
+ this.handleInputFocus = () => {
137
+ if (!this.disabled) {
138
+ if (this.selectOnFocus && this.value) {
139
+ this.ngZone.run(() => {
140
+ setTimeout(() => { this.selectAll(); });
141
+ });
142
+ }
143
+ if (hasObservers(this.onFocus)) {
144
+ if (!this.isFocused) {
145
+ this.ngZone.run(() => {
146
+ this.onFocus.emit();
147
+ });
148
+ }
149
+ }
150
+ if (hasObservers(this.inputFocus)) {
151
+ if (!this.focusChangedProgrammatically) {
152
+ this.ngZone.run(() => {
153
+ this.inputFocus.emit();
154
+ });
155
+ }
156
+ }
157
+ this.ngZone.run(() => {
158
+ this.isFocused = true;
159
+ });
160
+ }
161
+ };
162
+ validatePackage(packageMetadata);
163
+ this.direction = localizationService.rtl ? 'rtl' : 'ltr';
164
+ }
165
+ get flowCol() {
166
+ return this.flow === 'vertical';
167
+ }
168
+ get flowRow() {
169
+ return this.flow === 'horizontal';
170
+ }
171
+ /**
172
+ * @hidden
173
+ */
174
+ set tabIndex(tabIndex) {
175
+ this.tabindex = tabIndex;
176
+ }
177
+ get tabIndex() {
178
+ return this.tabindex;
179
+ }
180
+ /**
181
+ * The size property specifies the padding of the internal textarea element
182
+ * ([see example]({% slug appearance_textarea %}#toc-size)).
183
+ *
184
+ * The possible values are:
185
+ * * `small`
186
+ * * `medium` (default)
187
+ * * `large`
188
+ * * `none`
189
+ */
190
+ set size(size) {
191
+ const newSize = size ? size : DEFAULT_SIZE;
192
+ this.handleClasses(newSize, 'size');
193
+ this._size = newSize;
194
+ }
195
+ get size() {
196
+ return this._size;
197
+ }
198
+ /**
199
+ * The rounded property specifies the border radius of the TextArea
200
+ * ([see example]({% slug appearance_textarea %}#toc-rounded)).
201
+ *
202
+ * The possible values are:
203
+ * * `small`
204
+ * * `medium` (default)
205
+ * * `large`
206
+ * * `none`
207
+ */
208
+ set rounded(rounded) {
209
+ const newRounded = rounded ? rounded : DEFAULT_ROUNDED;
210
+ this.handleClasses(newRounded, 'rounded');
211
+ this._rounded = newRounded;
212
+ }
213
+ get rounded() {
214
+ return this._rounded;
215
+ }
216
+ /**
217
+ * The fillMode property specifies the background and border styles of the TextArea
218
+ * ([see example]({% slug appearance_textarea %}#toc-fillMode)).
219
+ *
220
+ * The possible values are:
221
+ * * `flat`
222
+ * * `solid` (default)
223
+ * * `outline`
224
+ * * `none`
225
+ */
226
+ set fillMode(fillMode) {
227
+ const newFillMode = fillMode ? fillMode : DEFAULT_FILL_MODE;
228
+ this.handleClasses(newFillMode, 'fillMode');
229
+ this._fillMode = newFillMode;
230
+ }
231
+ get fillMode() {
232
+ return this._fillMode;
233
+ }
234
+ ngAfterViewInit() {
235
+ const hostElement = this.hostElement.nativeElement;
236
+ let cursorInsideWrapper = false;
237
+ let tabbing = false;
238
+ this.ngZone.runOutsideAngular(() => {
239
+ // focusIn and focusOut are relative to the host element
240
+ this.subscriptions.add(this.renderer.listen(hostElement, 'focusin', () => {
241
+ if (!this.isFocused) {
242
+ this.ngZone.run(() => {
243
+ this.onFocus.emit();
244
+ this.isFocused = true;
245
+ });
246
+ }
247
+ }));
248
+ this.subscriptions.add(this.renderer.listen(hostElement, 'focusout', (args) => {
249
+ if (!this.isFocused) {
250
+ return;
251
+ }
252
+ if (tabbing) {
253
+ const closestTextbox = closest(args.relatedTarget, (element) => element === this.hostElement.nativeElement);
254
+ if (!closestTextbox) {
255
+ this.handleBlur();
256
+ }
257
+ tabbing = false;
258
+ }
259
+ else {
260
+ if (!cursorInsideWrapper) {
261
+ this.handleBlur();
262
+ }
263
+ }
264
+ }));
265
+ this.subscriptions.add(this.renderer.listen(hostElement, 'mouseenter', () => {
266
+ cursorInsideWrapper = true;
267
+ }));
268
+ this.subscriptions.add(this.renderer.listen(hostElement, 'mouseleave', () => {
269
+ cursorInsideWrapper = false;
270
+ }));
271
+ this.subscriptions.add(this.renderer.listen(hostElement, 'keydown', (args) => {
272
+ if (args.keyCode === Keys.Tab) {
273
+ tabbing = true;
274
+ }
275
+ else {
276
+ tabbing = false;
277
+ }
278
+ }));
279
+ this.handleFlow();
280
+ });
281
+ const stylingInputs = ['size', 'rounded', 'fillMode'];
282
+ stylingInputs.forEach(input => {
283
+ this.handleClasses(this[input], input);
284
+ });
285
+ }
286
+ ngOnInit() {
287
+ this.control = this.injector.get(NgControl, null);
288
+ if (isDocumentAvailable() && this.resizable === 'auto') {
289
+ this.resizeSubscription = fromEvent(window, 'resize')
290
+ .pipe((debounceTime(50)))
291
+ .subscribe(() => this.resize());
292
+ }
293
+ if (this.hostElement) {
294
+ this.renderer.removeAttribute(this.hostElement.nativeElement, "tabindex");
295
+ }
296
+ this.subscriptions = this.localizationService.changes.subscribe(({ rtl }) => {
297
+ this.direction = rtl ? 'rtl' : 'ltr';
298
+ });
299
+ }
300
+ ngOnChanges(changes) {
301
+ const hostElement = this.hostElement.nativeElement;
302
+ const element = this.input.nativeElement;
303
+ if (changes.flow) {
304
+ this.handleFlow();
305
+ }
306
+ if (changes.resizable) {
307
+ if (this.resizable === 'auto') {
308
+ this.renderer.removeClass(element, '\!k-overflow-y-auto');
309
+ this.initialHeight = element.offsetHeight;
310
+ }
311
+ else {
312
+ this.renderer.addClass(element, '\!k-overflow-y-auto');
313
+ element.style.height = `${this.initialHeight}px`;
314
+ }
315
+ }
316
+ if (changes.cols) {
317
+ if (isPresent(changes.cols.currentValue)) {
318
+ this.renderer.setStyle(hostElement, 'width', 'auto');
319
+ }
320
+ else {
321
+ this.renderer.removeStyle(hostElement, 'width');
322
+ }
323
+ }
324
+ if (changes.value) {
325
+ this.resize();
326
+ }
327
+ }
328
+ /**
329
+ * @hidden
330
+ */
331
+ writeValue(value) {
332
+ this.value = value;
333
+ this.resize();
334
+ }
335
+ /**
336
+ * @hidden
337
+ */
338
+ registerOnChange(fn) {
339
+ this.ngChange = fn;
340
+ }
341
+ /**
342
+ * @hidden
343
+ */
344
+ registerOnTouched(fn) {
345
+ this.ngTouched = fn;
346
+ }
347
+ updateValue(value) {
348
+ if (!areSame(this.value, value)) {
349
+ this.ngZone.run(() => {
350
+ this.value = value;
351
+ this.ngChange(value);
352
+ this.valueChange.emit(value);
353
+ this.changeDetector.markForCheck();
354
+ });
355
+ }
356
+ }
357
+ ngOnDestroy() {
358
+ super.ngOnDestroy();
359
+ if (this.resizeSubscription) {
360
+ this.resizeSubscription.unsubscribe();
361
+ }
362
+ }
363
+ /**
364
+ * @hidden
365
+ */
366
+ get resizableClass() {
367
+ return resizeClasses[this.resizable];
368
+ }
369
+ /**
370
+ * @hidden
371
+ */
372
+ get isControlInvalid() {
373
+ return this.control && this.control.touched && !this.control.valid;
374
+ }
375
+ /**
376
+ * Focuses the TextArea component.
377
+ *
378
+ * @example
379
+ * ```ts
380
+ * _@Component({
381
+ * selector: 'my-app',
382
+ * template: `
383
+ * <button (click)="textarea.focus()">Focus the textarea</button>
384
+ * <kendo-textarea #textarea></kendo-textarea>
385
+ * `
386
+ * })
387
+ * class AppComponent { }
388
+ * ```
389
+ */
390
+ focus() {
391
+ if (!this.input) {
392
+ return;
393
+ }
394
+ this.focusChangedProgrammatically = true;
395
+ this.isFocused = true;
396
+ this.input.nativeElement.focus();
397
+ this.focusChangedProgrammatically = false;
398
+ }
399
+ /**
400
+ * Blurs the TextArea component.
401
+ */
402
+ blur() {
403
+ this.focusChangedProgrammatically = true;
404
+ const isFocusedElement = this.hostElement.nativeElement.querySelector(':focus');
405
+ if (isFocusedElement) {
406
+ isFocusedElement.blur();
407
+ }
408
+ this.isFocused = false;
409
+ this.focusChangedProgrammatically = false;
410
+ }
411
+ resize() {
412
+ if (this.resizable !== 'auto') {
413
+ return;
414
+ }
415
+ // The logic of the resize method, does not depend on Angular and thus moving it outisde of it
416
+ // We need to ensure that the resizing logic runs after the value is updated thus the setTimout
417
+ this.ngZone.runOutsideAngular(() => {
418
+ setTimeout(() => {
419
+ const hostElement = this.hostElement.nativeElement;
420
+ const element = this.input.nativeElement;
421
+ this.renderer.setStyle(element, 'height', `${this.initialHeight}px`);
422
+ const scrollHeight = element.scrollHeight;
423
+ this.renderer.setStyle(hostElement, 'min-height', `${scrollHeight}px`);
424
+ if (scrollHeight > this.initialHeight) {
425
+ this.renderer.setStyle(element, 'height', `${scrollHeight}px`);
426
+ }
427
+ }, 0);
428
+ });
429
+ }
430
+ get isFocused() {
431
+ return this._isFocused;
432
+ }
433
+ set isFocused(value) {
434
+ if (this._isFocused !== value && this.hostElement) {
435
+ const element = this.hostElement.nativeElement;
436
+ if (value && !this.disabled) {
437
+ this.renderer.addClass(element, FOCUSED);
438
+ }
439
+ else {
440
+ this.renderer.removeClass(element, FOCUSED);
441
+ }
442
+ this._isFocused = value;
443
+ }
444
+ }
445
+ handleBlur() {
446
+ this.ngZone.run(() => {
447
+ if (!this.focusChangedProgrammatically) {
448
+ this.onBlur.emit();
449
+ }
450
+ this.isFocused = false;
451
+ });
452
+ }
453
+ setSelection(start, end) {
454
+ if (this.isFocused) {
455
+ invokeElementMethod(this.input, 'setSelectionRange', start, end);
456
+ }
457
+ }
458
+ selectAll() {
459
+ if (this.value) {
460
+ this.setSelection(0, this.value.length);
461
+ }
462
+ }
463
+ handleClasses(value, input) {
464
+ const elem = this.hostElement.nativeElement;
465
+ const classes = getStylingClasses('input', input, this[input], value);
466
+ if (classes.toRemove) {
467
+ this.renderer.removeClass(elem, classes.toRemove);
468
+ }
469
+ if (classes.toAdd) {
470
+ this.renderer.addClass(elem, classes.toAdd);
471
+ }
472
+ }
473
+ handleFlow() {
474
+ const isVertical = this.flow === 'vertical';
475
+ const hostElement = this.hostElement.nativeElement;
476
+ const element = this.input.nativeElement;
477
+ const suffix = hostElement.children[1];
478
+ this.renderer[isVertical ? 'addClass' : 'removeClass'](element, '\!k-flex-none');
479
+ if (suffix) {
480
+ this.renderer[isVertical ? 'removeClass' : 'addClass'](suffix, '\!k-align-items-start');
481
+ }
482
+ }
483
+ }
484
+ TextAreaComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", 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 });
485
+ TextAreaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: TextAreaComponent, selector: "kendo-textarea", inputs: { focusableId: "focusableId", flow: "flow", rows: "rows", cols: "cols", maxlength: "maxlength", tabindex: "tabindex", tabIndex: "tabIndex", resizable: "resizable", size: "size", rounded: "rounded", fillMode: "fillMode" }, 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: [
486
+ LocalizationService,
487
+ { provide: L10N_PREFIX, useValue: 'kendo.textarea' },
488
+ {
489
+ provide: NG_VALUE_ACCESSOR,
490
+ useExisting: forwardRef(() => TextAreaComponent),
491
+ multi: true
492
+ },
493
+ { provide: KendoInput, useExisting: forwardRef(() => TextAreaComponent) }
494
+ ], exportAs: ["kendoTextArea"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `
495
+ <textarea
496
+ #input
497
+ [attr.aria-multiline]="true"
498
+ [attr.aria-disabled]="disabled ? true : undefined"
499
+ [attr.aria-readonly]="readonly ? true : undefined"
500
+ class="k-input-inner"
501
+ [ngClass]="resizableClass"
502
+ [id]="focusableId"
503
+ [value]="value"
504
+ [attr.placeholder]="placeholder"
505
+ [disabled]="disabled"
506
+ [readonly]="readonly"
507
+ [attr.rows]="rows"
508
+ [attr.cols]="cols"
509
+ [attr.tabindex]="tabIndex"
510
+ [attr.title]="title"
511
+ [attr.maxlength]="maxlength"
512
+ [attr.aria-invalid]="isControlInvalid"
513
+ [kendoEventsOutsideAngular]="{
514
+ focus: handleInputFocus,
515
+ blur: handleInputBlur,
516
+ input: handleInput}">
517
+ </textarea>
518
+ <ng-content select="kendo-textarea-suffix"></ng-content>
519
+ `, isInline: true, directives: [{ type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3.EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }] });
520
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: TextAreaComponent, decorators: [{
521
+ type: Component,
522
+ args: [{
523
+ exportAs: 'kendoTextArea',
524
+ providers: [
525
+ LocalizationService,
526
+ { provide: L10N_PREFIX, useValue: 'kendo.textarea' },
527
+ {
528
+ provide: NG_VALUE_ACCESSOR,
529
+ useExisting: forwardRef(() => TextAreaComponent),
530
+ multi: true
531
+ },
532
+ { provide: KendoInput, useExisting: forwardRef(() => TextAreaComponent) }
533
+ ],
534
+ selector: 'kendo-textarea',
535
+ template: `
536
+ <textarea
537
+ #input
538
+ [attr.aria-multiline]="true"
539
+ [attr.aria-disabled]="disabled ? true : undefined"
540
+ [attr.aria-readonly]="readonly ? true : undefined"
541
+ class="k-input-inner"
542
+ [ngClass]="resizableClass"
543
+ [id]="focusableId"
544
+ [value]="value"
545
+ [attr.placeholder]="placeholder"
546
+ [disabled]="disabled"
547
+ [readonly]="readonly"
548
+ [attr.rows]="rows"
549
+ [attr.cols]="cols"
550
+ [attr.tabindex]="tabIndex"
551
+ [attr.title]="title"
552
+ [attr.maxlength]="maxlength"
553
+ [attr.aria-invalid]="isControlInvalid"
554
+ [kendoEventsOutsideAngular]="{
555
+ focus: handleInputFocus,
556
+ blur: handleInputBlur,
557
+ input: handleInput}">
558
+ </textarea>
559
+ <ng-content select="kendo-textarea-suffix"></ng-content>
560
+ `
561
+ }]
562
+ }], ctorParameters: function () { return [{ type: i1.LocalizationService }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }, { type: i0.Injector }, { type: i0.ElementRef }]; }, propDecorators: { focusableId: [{
563
+ type: Input
564
+ }], hostClasses: [{
565
+ type: HostBinding,
566
+ args: ['class.k-textarea']
567
+ }, {
568
+ type: HostBinding,
569
+ args: ['class.k-input']
570
+ }], flowCol: [{
571
+ type: HostBinding,
572
+ args: ['class.\!k-flex-col']
573
+ }], flowRow: [{
574
+ type: HostBinding,
575
+ args: ['class.\!k-flex-row']
576
+ }], flow: [{
577
+ type: Input
578
+ }], rows: [{
579
+ type: Input
580
+ }], cols: [{
581
+ type: Input
582
+ }], maxlength: [{
583
+ type: Input
584
+ }], tabindex: [{
585
+ type: Input
586
+ }], tabIndex: [{
587
+ type: Input
588
+ }], resizable: [{
589
+ type: Input
590
+ }], size: [{
591
+ type: Input
592
+ }], rounded: [{
593
+ type: Input
594
+ }], fillMode: [{
595
+ type: Input
596
+ }], onFocus: [{
597
+ type: Output,
598
+ args: ['focus']
599
+ }], onBlur: [{
600
+ type: Output,
601
+ args: ['blur']
602
+ }], valueChange: [{
603
+ type: Output
604
+ }] } });
@@ -0,0 +1,68 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 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 { CommonModule } from "@angular/common";
7
+ import { TextAreaComponent } from "./textarea/textarea.component";
8
+ import { EventsModule } from "@progress/kendo-angular-common";
9
+ import { TextAreaSuffixComponent } from './textarea/textarea-suffix.component';
10
+ import { SharedModule, SHARED_DIRECTIVES } from './shared.module';
11
+ import * as i0 from "@angular/core";
12
+ import * as i1 from "./shared/input-separator.component";
13
+ import * as i2 from "./shared/textarea.directive";
14
+ /**
15
+ * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
16
+ * definition for the TextArea component.
17
+ *
18
+ * @example
19
+ *
20
+ * ```ts-no-run
21
+ * // Import the TextArea module
22
+ * import { TextAreaModule } from '@progress/kendo-angular-inputs';
23
+ *
24
+ * // The browser platform with a compiler
25
+ * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
26
+ *
27
+ * import { NgModule } from '@angular/core';
28
+ *
29
+ * // Import the app component
30
+ * import { AppComponent } from './app.component';
31
+ *
32
+ * // Define the app module
33
+ * _@NgModule({
34
+ * declarations: [AppComponent], // declare app component
35
+ * imports: [BrowserModule, TextAreaModule], // import TextArea module
36
+ * bootstrap: [AppComponent]
37
+ * })
38
+ * export class AppModule {}
39
+ *
40
+ * // Compile and launch the module
41
+ * platformBrowserDynamic().bootstrapModule(AppModule);
42
+ *
43
+ * ```
44
+ */
45
+ export class TextAreaModule {
46
+ }
47
+ TextAreaModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: TextAreaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
48
+ TextAreaModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: TextAreaModule, declarations: [TextAreaComponent,
49
+ TextAreaSuffixComponent], imports: [CommonModule, EventsModule, SharedModule], exports: [TextAreaComponent,
50
+ EventsModule,
51
+ TextAreaSuffixComponent, i1.InputSeparatorComponent, i2.TextAreaDirective] });
52
+ TextAreaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: TextAreaModule, imports: [[CommonModule, EventsModule, SharedModule], EventsModule] });
53
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: TextAreaModule, decorators: [{
54
+ type: NgModule,
55
+ args: [{
56
+ declarations: [
57
+ TextAreaComponent,
58
+ TextAreaSuffixComponent
59
+ ],
60
+ exports: [
61
+ TextAreaComponent,
62
+ EventsModule,
63
+ TextAreaSuffixComponent,
64
+ SHARED_DIRECTIVES
65
+ ],
66
+ imports: [CommonModule, EventsModule, SharedModule]
67
+ }]
68
+ }] });