@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,1086 @@
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
+ /* eslint-disable @typescript-eslint/no-explicit-any */
6
+ import { take } from 'rxjs/operators';
7
+ import { Component, HostBinding, Input, Output, EventEmitter, ViewChild, ElementRef, TemplateRef, ViewContainerRef, forwardRef, ChangeDetectorRef, NgZone, Renderer2, Injector, isDevMode } from '@angular/core';
8
+ import { NG_VALUE_ACCESSOR, NgControl } from '@angular/forms';
9
+ import { Subscription } from 'rxjs';
10
+ import { FlatColorPickerComponent } from './flatcolorpicker.component';
11
+ import { PopupService } from '@progress/kendo-angular-popup';
12
+ import { validatePackage } from '@progress/kendo-licensing';
13
+ import { Keys, KendoInput, isChanged, closest, guid } from '@progress/kendo-angular-common';
14
+ import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
15
+ import { packageMetadata } from '../package-metadata';
16
+ import { PALETTEPRESETS } from './models';
17
+ import { ActiveColorClickEvent, ColorPickerCloseEvent, ColorPickerOpenEvent } from './events';
18
+ import { parseColor } from './utils';
19
+ import { getStylingClasses, isPresent } from '../common/utils';
20
+ import { ColorPickerLocalizationService } from './localization/colorpicker-localization.service';
21
+ import { DEFAULT_ACCESSIBLE_PRESET, DEFAULT_PRESET } from './constants';
22
+ import { parseCSSClassNames } from '@progress/kendo-angular-common';
23
+ import { caretAltDownIcon } from '@progress/kendo-svg-icons';
24
+ import * as i0 from "@angular/core";
25
+ import * as i1 from "@progress/kendo-angular-popup";
26
+ import * as i2 from "@progress/kendo-angular-l10n";
27
+ import * as i3 from "@progress/kendo-angular-icons";
28
+ import * as i4 from "@progress/kendo-angular-buttons";
29
+ import * as i5 from "./flatcolorpicker.component";
30
+ import * as i6 from "./localization/localized-colorpicker-messages.directive";
31
+ import * as i7 from "@angular/common";
32
+ const DOM_FOCUS_EVENTS = ['focus', 'blur'];
33
+ const DEFAULT_SIZE = 'medium';
34
+ const DEFAULT_ROUNDED = 'medium';
35
+ const DEFAULT_FILL_MODE = 'solid';
36
+ /**
37
+ * @hidden
38
+ */
39
+ let nextColorPickerId = 0;
40
+ /**
41
+ * Represents the [Kendo UI ColorPicker component for Angular]({% slug overview_colorpicker %}).
42
+ *
43
+ * The ColorPicker is a powerful tool for choosing colors from Gradient and Palette views
44
+ * which are rendered in its popup. It supports previewing the selected color, reverting it to its previous state or clearing it completely.
45
+ */
46
+ export class ColorPickerComponent {
47
+ constructor(host, popupService, cdr, localizationService, ngZone, renderer, injector) {
48
+ this.host = host;
49
+ this.popupService = popupService;
50
+ this.cdr = cdr;
51
+ this.localizationService = localizationService;
52
+ this.ngZone = ngZone;
53
+ this.renderer = renderer;
54
+ this.injector = injector;
55
+ this.hostClasses = true;
56
+ this.role = 'combobox';
57
+ this.hasPopup = 'dialog';
58
+ /**
59
+ * Specifies the views that will be rendered in the popup.
60
+ * By default both the gradient and palette views will be rendered.
61
+ */
62
+ this.views = ['gradient', 'palette'];
63
+ /**
64
+ * Sets the read-only state of the ColorPicker.
65
+ *
66
+ * @default false
67
+ */
68
+ this.readonly = false;
69
+ /**
70
+ * Sets the disabled state of the ColorPicker.
71
+ *
72
+ * @default false
73
+ */
74
+ this.disabled = false;
75
+ /**
76
+ * Specifies the output format of the ColorPicker.
77
+ *
78
+ * If the input value is in a different format, it will be parsed into the specified output `format`.
79
+ *
80
+ * The supported values are:
81
+ * * `rgba` (default)
82
+ * * `hex`
83
+ */
84
+ this.format = 'rgba';
85
+ /**
86
+ * Specifies whether the ColorPicker should display a 'Clear color' button.
87
+ *
88
+ * @default true
89
+ */
90
+ this.clearButton = true;
91
+ /**
92
+ * Displays `Apply` and `Cancel` action buttons and color preview panes.
93
+ *
94
+ * When enabled, the component value will not change immediately upon
95
+ * color selection, but only after the `Apply` button is clicked.
96
+ *
97
+ * The `Cancel` button reverts the current selection to its
98
+ * previous state i.e. to the current value.
99
+ *
100
+ * @default false
101
+ */
102
+ this.preview = false;
103
+ /**
104
+ * Configures the layout of the `Apply` and `Cancel` action buttons.
105
+ *
106
+ * The possible values are:
107
+ * * `start`
108
+ * * `center`
109
+ * * `end` (default)
110
+ * * `stretch`
111
+ */
112
+ this.actionsLayout = 'end';
113
+ /**
114
+ * Fires each time the value is changed.
115
+ */
116
+ this.valueChange = new EventEmitter();
117
+ /**
118
+ * Fires each time the popup is about to open.
119
+ * This event is preventable. If you cancel it, the popup will remain closed.
120
+ */
121
+ this.open = new EventEmitter();
122
+ /**
123
+ * Fires each time the popup is about to close.
124
+ * This event is preventable. If you cancel it, the popup will remain open.
125
+ */
126
+ this.close = new EventEmitter();
127
+ /**
128
+ * Fires each time ColorPicker is focused.
129
+ */
130
+ this.onFocus = new EventEmitter();
131
+ /**
132
+ * Fires each time the ColorPicker is blurred.
133
+ */
134
+ this.onBlur = new EventEmitter();
135
+ /**
136
+ * Fires when the user cancels the current color selection.
137
+ *
138
+ * Fires on preview pane or 'Cancel' button click.
139
+ */
140
+ this.cancel = new EventEmitter();
141
+ /**
142
+ * Fires each time the left side of the ColorPicker wrapper is clicked.
143
+ * The event is triggered regardless of whether a ColorPicker icon is set or not.
144
+ *
145
+ * The [ActiveColorClickEvent]({% slug api_inputs_activecolorclickevent %}) event provides the option to prevent the popup opening.
146
+ */
147
+ this.activeColorClick = new EventEmitter();
148
+ /**
149
+ * @hidden
150
+ * Fires each time the clear button is clicked.
151
+ */
152
+ this.clearButtonClick = new EventEmitter();
153
+ /**
154
+ * Fires each time the view is about to change.
155
+ * Used to provide a two-way binding for the `activeView` property.
156
+ */
157
+ this.activeViewChange = new EventEmitter();
158
+ /**
159
+ * Indicates whether the ColorPicker wrapper is focused.
160
+ */
161
+ this.isFocused = false;
162
+ /**
163
+ * @hidden
164
+ */
165
+ this.arrowDownIcon = caretAltDownIcon;
166
+ this._tabindex = 0;
167
+ this._popupSettings = { animate: true };
168
+ this._paletteSettings = {};
169
+ this._gradientSettings = { opacity: true, delay: 0 };
170
+ this._size = 'medium';
171
+ this._rounded = 'medium';
172
+ this._fillMode = 'solid';
173
+ this.subscriptions = new Subscription();
174
+ this.popupSubs = new Subscription();
175
+ this.notifyNgTouched = () => { };
176
+ this.notifyNgChanged = () => { };
177
+ this.domFocusListener = (event) => event.stopImmediatePropagation();
178
+ validatePackage(packageMetadata);
179
+ this.dynamicRTLSubscription = this.localizationService.changes.subscribe(({ rtl }) => {
180
+ this.direction = rtl ? 'rtl' : 'ltr';
181
+ });
182
+ this.colorPickerId = nextColorPickerId++;
183
+ }
184
+ get focusedClass() {
185
+ return this.isFocused;
186
+ }
187
+ get disabledClass() {
188
+ return this.disabled;
189
+ }
190
+ get ariaReadonly() {
191
+ return this.readonly;
192
+ }
193
+ get ariaExpanded() {
194
+ return this.isOpen;
195
+ }
196
+ get hostTabindex() {
197
+ return this.tabindex;
198
+ }
199
+ get isControlInvalid() {
200
+ return (this.control?.invalid)?.toString();
201
+ }
202
+ /**
203
+ * @hidden
204
+ */
205
+ set view(view) {
206
+ this.views = [view];
207
+ }
208
+ get view() {
209
+ return (this.views && this.views.length > 0) ? this.views[0] : null;
210
+ }
211
+ /**
212
+ * Specifies the value of the initially selected color.
213
+ */
214
+ set value(value) {
215
+ this._value = parseColor(value, this.format, this.gradientSettings.opacity);
216
+ }
217
+ get value() {
218
+ return this._value;
219
+ }
220
+ /**
221
+ * Configures the popup of the ColorPicker.
222
+ */
223
+ set popupSettings(value) {
224
+ this._popupSettings = Object.assign(this._popupSettings, value);
225
+ }
226
+ get popupSettings() {
227
+ return this._popupSettings;
228
+ }
229
+ /**
230
+ * Configures the palette that is displayed in the ColorPicker popup.
231
+ */
232
+ set paletteSettings(value) {
233
+ this._paletteSettings = Object.assign(this._paletteSettings, value);
234
+ }
235
+ get paletteSettings() {
236
+ return this._paletteSettings;
237
+ }
238
+ /**
239
+ * Configures the gradient that is displayed in the ColorPicker popup.
240
+ */
241
+ set gradientSettings(value) {
242
+ this._gradientSettings = Object.assign(this._gradientSettings, value);
243
+ }
244
+ get gradientSettings() {
245
+ return this._gradientSettings;
246
+ }
247
+ /**
248
+ * Defines an SVGIcon to be rendered within the button.
249
+ * The input can take either an [existing Kendo SVG icon](slug:svgicon_list) or a custom one.
250
+ */
251
+ set svgIcon(icon) {
252
+ if (isDevMode() && icon && this.icon && this.iconClass) {
253
+ throw new Error('Setting both icon/svgIcon and iconClass options at the same time is not supported.');
254
+ }
255
+ this._svgIcon = icon;
256
+ }
257
+ get svgIcon() {
258
+ return this._svgIcon;
259
+ }
260
+ /**
261
+ * Specifies the [tabindex](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
262
+ *
263
+ * @default 0
264
+ */
265
+ set tabindex(value) {
266
+ const tabindex = Number(value);
267
+ const defaultValue = 0;
268
+ this._tabindex = !isNaN(tabindex) ? tabindex : defaultValue;
269
+ }
270
+ get tabindex() {
271
+ return !this.disabled ? this._tabindex : undefined;
272
+ }
273
+ /**
274
+ * The size property specifies the padding of the ColorPicker internal elements
275
+ * ([see example]({% slug appearance_colorpicker %}#toc-size)).
276
+ *
277
+ * The possible values are:
278
+ * * `small`
279
+ * * `medium` (default)
280
+ * * `large`
281
+ * * `none`
282
+ */
283
+ set size(size) {
284
+ const newSize = size ? size : DEFAULT_SIZE;
285
+ this.handleClasses(newSize, 'size');
286
+ this._size = newSize;
287
+ }
288
+ get size() {
289
+ return this._size;
290
+ }
291
+ /**
292
+ * The rounded property specifies the border radius of the ColorPicker
293
+ * ([see example]({% slug appearance_colorpicker %}#toc-rounded)).
294
+ *
295
+ * The possible values are:
296
+ * * `small`
297
+ * * `medium` (default)
298
+ * * `large`
299
+ * * `full`
300
+ * * `none`
301
+ */
302
+ set rounded(rounded) {
303
+ const newRounded = rounded ? rounded : DEFAULT_ROUNDED;
304
+ this.handleClasses(newRounded, 'rounded');
305
+ this._rounded = newRounded;
306
+ }
307
+ get rounded() {
308
+ return this._rounded;
309
+ }
310
+ /**
311
+ * The fillMode property specifies the background and border styles of the ColorPicker
312
+ * ([see example]({% slug appearance_colorpicker %}#toc-fillMode)).
313
+ *
314
+ * The possible values are:
315
+ * * `flat`
316
+ * * `solid` (default)
317
+ * * `outline`
318
+ * * `none`
319
+ */
320
+ set fillMode(fillMode) {
321
+ const newFillMode = fillMode ? fillMode : DEFAULT_FILL_MODE;
322
+ this.handleClasses(newFillMode, 'fillMode');
323
+ this._fillMode = newFillMode;
324
+ }
325
+ get fillMode() {
326
+ return this._fillMode;
327
+ }
328
+ /**
329
+ * Indicates whether the ColorPicker popup is open.
330
+ */
331
+ get isOpen() {
332
+ return isPresent(this.popupRef);
333
+ }
334
+ /**
335
+ * @hidden
336
+ */
337
+ get customIconStyles() {
338
+ if (this.iconClass) {
339
+ let parsedIconClass = '';
340
+ parseCSSClassNames(this.iconClass).forEach(iconClass => {
341
+ parsedIconClass += iconClass + ' ';
342
+ });
343
+ return parsedIconClass.slice(0, -1);
344
+ }
345
+ return '';
346
+ }
347
+ /**
348
+ * @hidden
349
+ */
350
+ get iconStyles() {
351
+ if (this.icon && !this.iconClass) {
352
+ return `${this.icon}`;
353
+ }
354
+ return '';
355
+ }
356
+ ngOnInit() {
357
+ const defaultPreset = (this.format !== 'name') ? DEFAULT_PRESET : DEFAULT_ACCESSIBLE_PRESET;
358
+ const settingsPalette = this._paletteSettings.palette;
359
+ const presetColumns = typeof settingsPalette === 'string' && PALETTEPRESETS[settingsPalette] ?
360
+ PALETTEPRESETS[settingsPalette].columns :
361
+ undefined;
362
+ this._paletteSettings = {
363
+ palette: settingsPalette || defaultPreset,
364
+ tileSize: this._paletteSettings.tileSize || 24,
365
+ columns: this._paletteSettings.columns || presetColumns || 10
366
+ };
367
+ this.handleHostId();
368
+ this.renderer.setAttribute(this.host.nativeElement, 'aria-controls', `k-colorpicker-popup-${this.colorPickerId}`);
369
+ this.control = this.injector.get(NgControl, null);
370
+ }
371
+ ngAfterViewInit() {
372
+ const stylingInputs = ['size', 'rounded', 'fillMode'];
373
+ stylingInputs.forEach(input => {
374
+ this.handleClasses(this[input], input);
375
+ });
376
+ this.setHostElementAriaLabel();
377
+ this.initDomEvents();
378
+ }
379
+ ngOnChanges(changes) {
380
+ if (changes.format && changes.format.currentValue === 'name') {
381
+ this.activeView = 'palette';
382
+ }
383
+ if (this.activeView === 'gradient' && this.gradientSettings.opacity) {
384
+ this.format = 'rgba';
385
+ this.value = parseColor(this.value, this.format, this.gradientSettings.opacity);
386
+ }
387
+ if (isChanged('value', changes)) {
388
+ this.setHostElementAriaLabel();
389
+ }
390
+ }
391
+ ngOnDestroy() {
392
+ this.closePopup();
393
+ if (this.dynamicRTLSubscription) {
394
+ this.dynamicRTLSubscription.unsubscribe();
395
+ }
396
+ this.subscriptions.unsubscribe();
397
+ this.handleDomEvents('remove', DOM_FOCUS_EVENTS);
398
+ }
399
+ /**
400
+ * @hidden
401
+ */
402
+ handleCancelEvent(ev) {
403
+ this.cancel.emit(ev);
404
+ }
405
+ /**
406
+ * @hidden
407
+ */
408
+ togglePopup() {
409
+ this.focus();
410
+ this.toggleWithEvents(!this.isOpen);
411
+ }
412
+ /**
413
+ * @hidden
414
+ */
415
+ handleWrapperClick(event) {
416
+ if (this.disabled) {
417
+ return;
418
+ }
419
+ this.focus();
420
+ if (closest(event.target, (element) => element === this.activeColor.nativeElement)) {
421
+ const event = new ActiveColorClickEvent(this.value);
422
+ this.activeColorClick.emit(event);
423
+ if (!event.isOpenPrevented() || this.isOpen) {
424
+ this.toggleWithEvents(!this.isOpen);
425
+ }
426
+ return;
427
+ }
428
+ this.toggleWithEvents(!this.isOpen);
429
+ }
430
+ /**
431
+ * Focuses the wrapper of the ColorPicker.
432
+ */
433
+ focus() {
434
+ this.isFocused = true;
435
+ this.host.nativeElement.focus();
436
+ }
437
+ /**
438
+ * @hidden
439
+ */
440
+ handleWrapperFocus() {
441
+ if (this.isFocused) {
442
+ return;
443
+ }
444
+ this.ngZone.run(() => {
445
+ this.focus();
446
+ this.onFocus.emit();
447
+ });
448
+ }
449
+ /**
450
+ * Blurs the ColorPicker.
451
+ */
452
+ blur() {
453
+ this.isFocused = false;
454
+ this.host.nativeElement.blur();
455
+ this.notifyNgTouched();
456
+ }
457
+ /**
458
+ * @hidden
459
+ */
460
+ handleWrapperBlur() {
461
+ if (this.isOpen) {
462
+ return;
463
+ }
464
+ this.ngZone.run(() => {
465
+ this.onBlur.emit();
466
+ this.isFocused = false;
467
+ });
468
+ }
469
+ /**
470
+ * Clears the value of the ColorPicker.
471
+ */
472
+ reset() {
473
+ if (!isPresent(this.value)) {
474
+ return;
475
+ }
476
+ this._value = undefined;
477
+ this.setHostElementAriaLabel();
478
+ this.notifyNgChanged(undefined);
479
+ }
480
+ /**
481
+ * Toggles the popup of the ColorPicker.
482
+ * Does not trigger the `open` and `close` events of the component.
483
+ *
484
+ * @param open An optional parameter. Specifies whether the popup will be opened or closed.
485
+ */
486
+ toggle(open) {
487
+ if (this.disabled || this.readonly) {
488
+ return;
489
+ }
490
+ this.cdr.markForCheck();
491
+ this.closePopup();
492
+ open = isPresent(open) ? open : !this.isOpen;
493
+ if (open) {
494
+ this.openPopup();
495
+ this.focusFirstElement();
496
+ }
497
+ }
498
+ /**
499
+ * @hidden
500
+ */
501
+ handleValueChange(color) {
502
+ const parsedColor = parseColor(color, this.format, this.gradientSettings.opacity);
503
+ const valueChange = parsedColor !== this.value;
504
+ if (valueChange) {
505
+ this.value = parsedColor;
506
+ this.valueChange.emit(parsedColor);
507
+ this.setHostElementAriaLabel();
508
+ this.notifyNgChanged(parsedColor);
509
+ }
510
+ }
511
+ /**
512
+ * @hidden
513
+ */
514
+ handlePopupBlur(event) {
515
+ if (this.popupBlurInvalid(event)) {
516
+ return;
517
+ }
518
+ this.isFocused = false;
519
+ this.onBlur.emit();
520
+ this.notifyNgTouched();
521
+ this.toggleWithEvents(false);
522
+ }
523
+ /**
524
+ * @hidden
525
+ */
526
+ writeValue(value) {
527
+ this.value = value;
528
+ }
529
+ /**
530
+ * @hidden
531
+ */
532
+ registerOnChange(fn) {
533
+ this.notifyNgChanged = fn;
534
+ }
535
+ /**
536
+ * @hidden
537
+ */
538
+ registerOnTouched(fn) {
539
+ this.notifyNgTouched = fn;
540
+ }
541
+ /**
542
+ * @hidden
543
+ */
544
+ setDisabledState(isDisabled) {
545
+ this.cdr.markForCheck();
546
+ this.disabled = isDisabled;
547
+ }
548
+ /**
549
+ * @hidden
550
+ */
551
+ handleWrapperKeyDown(event) {
552
+ if (event.keyCode === Keys.ArrowDown || event.keyCode === Keys.Enter) {
553
+ event.preventDefault();
554
+ this.ngZone.run(() => {
555
+ this.toggleWithEvents(true);
556
+ });
557
+ }
558
+ }
559
+ /**
560
+ * @hidden
561
+ */
562
+ handlePopupKeyDown(event) {
563
+ if (event.keyCode === Keys.Escape) {
564
+ this.toggleWithEvents(false);
565
+ this.host.nativeElement.focus();
566
+ }
567
+ if (event.keyCode === Keys.Tab) {
568
+ const currentElement = event.shiftKey ? this.firstFocusableElement.nativeElement : this.lastFocusableElement.nativeElement;
569
+ const nextElement = event.shiftKey ? this.lastFocusableElement.nativeElement : this.firstFocusableElement.nativeElement;
570
+ if (event.target === currentElement) {
571
+ event.preventDefault();
572
+ nextElement.focus();
573
+ }
574
+ }
575
+ }
576
+ /**
577
+ * @hidden
578
+ * Used by the FloatingLabel to determine if the component is empty.
579
+ */
580
+ isEmpty() {
581
+ return false;
582
+ }
583
+ setHostElementAriaLabel() {
584
+ const ariaLabelValue = `${this.value ? this.value : this.localizationService.get('colorPickerNoColor')}`;
585
+ this.renderer.setAttribute(this.host.nativeElement, 'aria-label', ariaLabelValue);
586
+ }
587
+ handleClasses(value, input) {
588
+ const elem = this.host.nativeElement;
589
+ const classes = getStylingClasses('picker', input, this[input], value);
590
+ if (classes.toRemove) {
591
+ this.renderer.removeClass(elem, classes.toRemove);
592
+ }
593
+ if (classes.toAdd) {
594
+ this.renderer.addClass(elem, classes.toAdd);
595
+ }
596
+ }
597
+ popupBlurInvalid(ev) {
598
+ const focusInFlatColorPickerElement = this.popupRef.popupElement.contains(ev.relatedTarget);
599
+ const hostClicked = closest(ev.relatedTarget, (element) => element === this.host.nativeElement);
600
+ return Boolean(hostClicked || focusInFlatColorPickerElement);
601
+ }
602
+ toggleWithEvents(open) {
603
+ const sameState = this.isOpen === open;
604
+ if (this.disabled || this.readonly || sameState) {
605
+ return;
606
+ }
607
+ let eventArgs;
608
+ if (open) {
609
+ eventArgs = new ColorPickerOpenEvent();
610
+ this.open.emit(eventArgs);
611
+ }
612
+ else {
613
+ eventArgs = new ColorPickerCloseEvent();
614
+ this.close.emit(eventArgs);
615
+ }
616
+ if (!eventArgs.isDefaultPrevented()) {
617
+ this.toggle(open);
618
+ }
619
+ if (open) {
620
+ this.focusFirstElement();
621
+ }
622
+ }
623
+ focusFirstElement() {
624
+ this.ngZone.onStable.pipe(take(1)).subscribe(() => {
625
+ if (this.flatColorPicker) {
626
+ const gradientDragHandle = this.flatColorPicker.gradient?.gradientDragHandle;
627
+ const palette = this.flatColorPicker.palette?.host;
628
+ const elementToFocus = gradientDragHandle ? gradientDragHandle : palette;
629
+ elementToFocus.nativeElement.focus();
630
+ }
631
+ });
632
+ }
633
+ openPopup() {
634
+ const horizontalAlign = this.direction === "rtl" ? "right" : "left";
635
+ const anchorPosition = { horizontal: horizontalAlign, vertical: "bottom" };
636
+ const popupPosition = { horizontal: horizontalAlign, vertical: "top" };
637
+ this.popupRef = this.popupService.open({
638
+ anchor: this.activeColor,
639
+ animate: this.popupSettings.animate,
640
+ appendTo: this.popupSettings.appendTo,
641
+ popupAlign: popupPosition,
642
+ anchorAlign: anchorPosition,
643
+ popupClass: 'k-colorpicker-popup',
644
+ content: this.popupTemplate,
645
+ positionMode: 'absolute'
646
+ });
647
+ this.renderer.setAttribute(this.popupRef.popupElement.querySelector('.k-colorpicker-popup'), 'id', `k-colorpicker-popup-${this.colorPickerId}`);
648
+ this.popupSubs.add(this.popupRef.popupAnchorViewportLeave.subscribe(() => {
649
+ this.toggleWithEvents(false);
650
+ if (!this.isOpen) {
651
+ this.host.nativeElement.focus({
652
+ preventScroll: true
653
+ });
654
+ }
655
+ }));
656
+ }
657
+ closePopup() {
658
+ if (!this.isOpen) {
659
+ return;
660
+ }
661
+ this.popupSubs.unsubscribe();
662
+ this.popupRef.close();
663
+ this.popupRef = null;
664
+ }
665
+ get firstFocusableElement() {
666
+ if (!this.flatColorPicker.header || (this.views.length <= 1 && !this.flatColorPicker.clearButton)) {
667
+ const gradient = this.flatColorPicker.gradient;
668
+ return gradient ? gradient.gradientDragHandle : this.flatColorPicker.palette.host;
669
+ }
670
+ return this.views.length > 1 ? this.flatColorPicker.header.viewButtonsCollection.toArray()[0] : this.flatColorPicker.header.clearButtonElement;
671
+ }
672
+ get lastFocusableElement() {
673
+ if (this.preview) {
674
+ return this.flatColorPicker.footer.lastButton;
675
+ }
676
+ if (this.flatColorPicker.palette) {
677
+ return this.flatColorPicker.palette.host;
678
+ }
679
+ const gradient = this.flatColorPicker.gradient;
680
+ const inputs = gradient && gradient.inputs;
681
+ if (gradient && inputs && inputs.formatView === 'hex') {
682
+ return inputs.hexInput;
683
+ }
684
+ return this.gradientSettings.opacity ? inputs.opacityInput.numericInput : inputs.blueInput.numericInput;
685
+ }
686
+ handleDomEvents(action, events) {
687
+ const hostElement = this.host.nativeElement;
688
+ events.forEach(ev => hostElement[`${action}EventListener`](ev, this.domFocusListener, true));
689
+ }
690
+ initDomEvents() {
691
+ if (!this.host) {
692
+ return;
693
+ }
694
+ const hostElement = this.host.nativeElement;
695
+ this.ngZone.runOutsideAngular(() => {
696
+ this.subscriptions.add(this.renderer.listen(hostElement, 'focusin', () => {
697
+ this.handleWrapperFocus();
698
+ }));
699
+ this.subscriptions.add(this.renderer.listen(hostElement, 'focusout', (event) => {
700
+ const closestPopup = this.popupRef ?
701
+ closest(event.relatedTarget, (element) => element === this.flatColorPicker.host.nativeElement) :
702
+ false;
703
+ const closestWrapper = closest(event.relatedTarget, (element) => element === this.host.nativeElement);
704
+ if (!closestPopup && !closestWrapper) {
705
+ this.handleWrapperBlur();
706
+ }
707
+ }));
708
+ this.handleDomEvents('add', DOM_FOCUS_EVENTS);
709
+ this.subscriptions.add(this.renderer.listen(hostElement, 'keydown', (event) => {
710
+ this.handleWrapperKeyDown(event);
711
+ }));
712
+ this.subscriptions.add(this.renderer.listen(hostElement, 'click', (event) => {
713
+ this.ngZone.run(() => {
714
+ this.handleWrapperClick(event);
715
+ });
716
+ }));
717
+ });
718
+ }
719
+ handleHostId() {
720
+ const hostElement = this.host.nativeElement;
721
+ const existingId = hostElement.getAttribute('id');
722
+ if (existingId) {
723
+ this.focusableId = existingId;
724
+ }
725
+ else {
726
+ const id = `k-${guid()}`;
727
+ hostElement.setAttribute('id', id);
728
+ this.focusableId = id;
729
+ }
730
+ }
731
+ }
732
+ ColorPickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ColorPickerComponent, deps: [{ token: i0.ElementRef }, { token: i1.PopupService }, { token: i0.ChangeDetectorRef }, { token: i2.LocalizationService }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
733
+ ColorPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: ColorPickerComponent, selector: "kendo-colorpicker", inputs: { views: "views", view: "view", activeView: "activeView", readonly: "readonly", disabled: "disabled", format: "format", value: "value", popupSettings: "popupSettings", paletteSettings: "paletteSettings", gradientSettings: "gradientSettings", icon: "icon", iconClass: "iconClass", svgIcon: "svgIcon", clearButton: "clearButton", tabindex: "tabindex", preview: "preview", actionsLayout: "actionsLayout", size: "size", rounded: "rounded", fillMode: "fillMode" }, outputs: { valueChange: "valueChange", open: "open", close: "close", onFocus: "focus", onBlur: "blur", cancel: "cancel", activeColorClick: "activeColorClick", clearButtonClick: "clearButtonClick", activeViewChange: "activeViewChange" }, host: { properties: { "class.k-colorpicker": "this.hostClasses", "class.k-icon-picker": "this.hostClasses", "class.k-picker": "this.hostClasses", "class.k-focus": "this.focusedClass", "attr.aria-disabled": "this.disabledClass", "class.k-disabled": "this.disabledClass", "attr.aria-readonly": "this.ariaReadonly", "attr.aria-expanded": "this.ariaExpanded", "attr.tabindex": "this.hostTabindex", "attr.dir": "this.direction", "attr.role": "this.role", "attr.aria-haspopup": "this.hasPopup", "attr.aria-invalid": "this.isControlInvalid" } }, providers: [{
734
+ multi: true,
735
+ provide: NG_VALUE_ACCESSOR,
736
+ useExisting: forwardRef(() => ColorPickerComponent)
737
+ }, {
738
+ provide: KendoInput,
739
+ useExisting: forwardRef(() => ColorPickerComponent)
740
+ },
741
+ ColorPickerLocalizationService,
742
+ {
743
+ provide: LocalizationService,
744
+ useExisting: ColorPickerLocalizationService
745
+ },
746
+ {
747
+ provide: L10N_PREFIX,
748
+ useValue: 'kendo.colorpicker'
749
+ }
750
+ ], viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "activeColor", first: true, predicate: ["activeColor"], descendants: true, static: true }, { propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, static: true }, { propertyName: "flatColorPicker", first: true, predicate: ["flatColorPicker"], descendants: true }], exportAs: ["kendoColorPicker"], usesOnChanges: true, ngImport: i0, template: `
751
+ <ng-container kendoColorPickerLocalizedMessages
752
+ i18n-colorPickerNoColor="kendo.colorpicker.colorPickerNoColor|The aria-label applied to the ColorPicker component when the value is empty."
753
+ colorPickerNoColor="Colorpicker no color chosen"
754
+ i18n-flatColorPickerNoColor="kendo.colorpicker.flatColorPickerNoColor|The aria-label applied to the FlatColorPicker component when the value is empty."
755
+ flatColorPickerNoColor="Flatcolorpicker no color chosen"
756
+ i18n-colorGradientNoColor="kendo.colorpicker.colorGradientNoColor|The aria-label applied to the ColorGradient component when the value is empty."
757
+ colorGradientNoColor="Colorgradient no color chosen"
758
+ i18n-colorPaletteNoColor="kendo.colorpicker.colorPaletteNoColor|The aria-label applied to the ColorPalette component when the value is empty."
759
+ colorPaletteNoColor="Colorpalette no color chosen"
760
+ i18n-colorGradientHandle="kendo.colorpicker.colorGradientHandle|The title for the gradient color drag handle chooser."
761
+ colorGradientHandle="Choose color"
762
+ i18n-clearButton="kendo.colorpicker.clearButton|The title for the clear button."
763
+ clearButton="Clear value"
764
+ i18n-hueSliderHandle="kendo.colorpicker.hueSliderHandle|The title for the hue slider handle."
765
+ hueSliderHandle="Set hue"
766
+ i18n-opacitySliderHandle="kendo.colorpicker.opacitySliderHandle|The title for the opacity slider handle."
767
+ opacitySliderHandle="Set opacity"
768
+ i18n-contrastRatio="kendo.colorpicker.contrastRatio|The contrast ratio message for the contrast tool."
769
+ contrastRatio="Contrast ratio"
770
+ i18n-previewColor="kendo.colorpicker.previewColor|The message for the color preview pane."
771
+ previewColor="Color preview"
772
+ i18n-revertSelection="kendo.colorpicker.revertSelection|The message for the selected color pane."
773
+ revertSelection="Revert selection"
774
+ i18n-gradientView="kendo.colorpicker.gradientView|The message for the gradient view button."
775
+ gradientView="Gradient view"
776
+ i18n-paletteView="kendo.colorpicker.paletteView|The message for the palette view button."
777
+ paletteView="Palette view"
778
+ i18n-formatButton="kendo.colorpicker.formatButton|The message for the input format toggle button."
779
+ formatButton="Change color format"
780
+ i18n-applyButton="kendo.colorpicker.applyButton|The message for the Apply action button."
781
+ applyButton="Apply"
782
+ i18n-cancelButton="kendo.colorpicker.cancelButton|The message for the Cancel action button."
783
+ cancelButton="Cancel"
784
+ i18n-redChannelLabel="kendo.colorpicker.redChannelLabel|The label of the NumericTextBox representing the red color channel."
785
+ redChannelLabel="Red channel"
786
+ i18n-greenChannelLabel="kendo.colorpicker.greenChannelLabel|The label of the NumericTextBox representing the green color channel."
787
+ greenChannelLabel="Green channel"
788
+ i18n-blueChannelLabel="kendo.colorpicker.blueChannelLabel|The label of the NumericTextBox representing the blue color channel."
789
+ blueChannelLabel="Blue channel"
790
+ i18n-alphaChannelLabel="kendo.colorpicker.alphaChannelLabel|The label of the NumericTextBox representing the alpha color channel."
791
+ alphaChannelLabel="Alpha channel"
792
+ i18n-redInputPlaceholder="kendo.colorpicker.redInputPlaceholder|The placeholder for the red color input."
793
+ redChannelLabel="R"
794
+ i18n-greenInputPlaceholder="kendo.colorpicker.greenInputPlaceholder|The placeholder for the green color input."
795
+ greenInputPlaceholder="G"
796
+ i18n-blueInputPlaceholder="kendo.colorpicker.blueInputPlaceholder|The placeholder for the blue color input."
797
+ blueInputPlaceholder="B"
798
+ i18n-hexInputPlaceholder="kendo.colorpicker.hexInputPlaceholder|The placeholder for the HEX color input."
799
+ hexInputPlaceholder="HEX">
800
+ </ng-container>
801
+ <span #activeColor class="k-input-inner">
802
+ <span
803
+ class="k-value-icon k-color-preview"
804
+ [ngClass]="{'k-icon-color-preview': customIconStyles || iconStyles || svgIcon, 'k-no-color': !value}"
805
+ >
806
+ <kendo-icon-wrapper
807
+ *ngIf="iconClass || icon || svgIcon"
808
+ [name]="iconStyles"
809
+ innerCssClass="k-color-preview-icon"
810
+ [customFontClass]="customIconStyles"
811
+ [svgIcon]="svgIcon"
812
+ >
813
+ </kendo-icon-wrapper>
814
+ <span class="k-color-preview-mask" [style.background-color]="value"></span>
815
+ </span>
816
+
817
+ </span>
818
+ <button
819
+ kendoButton
820
+ tabindex="-1"
821
+ type="button"
822
+ icon="caret-alt-down"
823
+ [svgIcon]="arrowDownIcon"
824
+ aria-hidden="true"
825
+ class="k-input-button"
826
+ >
827
+ </button>
828
+ <ng-template #popupTemplate>
829
+ <kendo-flatcolorpicker
830
+ #flatColorPicker
831
+ [value]="value"
832
+ [format]="format"
833
+ [views]="views"
834
+ [activeView]="activeView"
835
+ [actionsLayout]="actionsLayout"
836
+ [preview]="preview"
837
+ [gradientSettings]="gradientSettings"
838
+ [paletteSettings]="paletteSettings"
839
+ [clearButton]="clearButton"
840
+ (cancel)="handleCancelEvent($event)"
841
+ (focusout)="handlePopupBlur($event)"
842
+ (valueChange)="handleValueChange($event)"
843
+ (keydown)="handlePopupKeyDown($event)"
844
+ (activeViewChange)="activeViewChange.emit($event)"
845
+ (clearButtonClick)="clearButtonClick.emit()"
846
+ (actionButtonClick)="togglePopup()">
847
+ </kendo-flatcolorpicker>
848
+ </ng-template>
849
+ <ng-container #container></ng-container>
850
+ `, isInline: true, components: [{ type: i3.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { type: i4.ButtonComponent, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { type: i5.FlatColorPickerComponent, selector: "kendo-flatcolorpicker", inputs: ["readonly", "disabled", "format", "value", "tabindex", "clearButton", "preview", "actionsLayout", "activeView", "views", "gradientSettings", "paletteSettings"], outputs: ["valueChange", "cancel", "activeViewChange", "clearButtonClick", "actionButtonClick"], exportAs: ["kendoFlatColorPicker"] }], directives: [{ type: i6.LocalizedColorPickerMessagesDirective, selector: "[kendoColorPickerLocalizedMessages], [kendoFlatColorPickerLocalizedMessages], [kendoColorGradientLocalizedMessages], [kendoColorPaletteLocalizedMessages]" }, { type: i7.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
851
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ColorPickerComponent, decorators: [{
852
+ type: Component,
853
+ args: [{
854
+ exportAs: 'kendoColorPicker',
855
+ selector: 'kendo-colorpicker',
856
+ providers: [{
857
+ multi: true,
858
+ provide: NG_VALUE_ACCESSOR,
859
+ useExisting: forwardRef(() => ColorPickerComponent)
860
+ }, {
861
+ provide: KendoInput,
862
+ useExisting: forwardRef(() => ColorPickerComponent)
863
+ },
864
+ ColorPickerLocalizationService,
865
+ {
866
+ provide: LocalizationService,
867
+ useExisting: ColorPickerLocalizationService
868
+ },
869
+ {
870
+ provide: L10N_PREFIX,
871
+ useValue: 'kendo.colorpicker'
872
+ }],
873
+ template: `
874
+ <ng-container kendoColorPickerLocalizedMessages
875
+ i18n-colorPickerNoColor="kendo.colorpicker.colorPickerNoColor|The aria-label applied to the ColorPicker component when the value is empty."
876
+ colorPickerNoColor="Colorpicker no color chosen"
877
+ i18n-flatColorPickerNoColor="kendo.colorpicker.flatColorPickerNoColor|The aria-label applied to the FlatColorPicker component when the value is empty."
878
+ flatColorPickerNoColor="Flatcolorpicker no color chosen"
879
+ i18n-colorGradientNoColor="kendo.colorpicker.colorGradientNoColor|The aria-label applied to the ColorGradient component when the value is empty."
880
+ colorGradientNoColor="Colorgradient no color chosen"
881
+ i18n-colorPaletteNoColor="kendo.colorpicker.colorPaletteNoColor|The aria-label applied to the ColorPalette component when the value is empty."
882
+ colorPaletteNoColor="Colorpalette no color chosen"
883
+ i18n-colorGradientHandle="kendo.colorpicker.colorGradientHandle|The title for the gradient color drag handle chooser."
884
+ colorGradientHandle="Choose color"
885
+ i18n-clearButton="kendo.colorpicker.clearButton|The title for the clear button."
886
+ clearButton="Clear value"
887
+ i18n-hueSliderHandle="kendo.colorpicker.hueSliderHandle|The title for the hue slider handle."
888
+ hueSliderHandle="Set hue"
889
+ i18n-opacitySliderHandle="kendo.colorpicker.opacitySliderHandle|The title for the opacity slider handle."
890
+ opacitySliderHandle="Set opacity"
891
+ i18n-contrastRatio="kendo.colorpicker.contrastRatio|The contrast ratio message for the contrast tool."
892
+ contrastRatio="Contrast ratio"
893
+ i18n-previewColor="kendo.colorpicker.previewColor|The message for the color preview pane."
894
+ previewColor="Color preview"
895
+ i18n-revertSelection="kendo.colorpicker.revertSelection|The message for the selected color pane."
896
+ revertSelection="Revert selection"
897
+ i18n-gradientView="kendo.colorpicker.gradientView|The message for the gradient view button."
898
+ gradientView="Gradient view"
899
+ i18n-paletteView="kendo.colorpicker.paletteView|The message for the palette view button."
900
+ paletteView="Palette view"
901
+ i18n-formatButton="kendo.colorpicker.formatButton|The message for the input format toggle button."
902
+ formatButton="Change color format"
903
+ i18n-applyButton="kendo.colorpicker.applyButton|The message for the Apply action button."
904
+ applyButton="Apply"
905
+ i18n-cancelButton="kendo.colorpicker.cancelButton|The message for the Cancel action button."
906
+ cancelButton="Cancel"
907
+ i18n-redChannelLabel="kendo.colorpicker.redChannelLabel|The label of the NumericTextBox representing the red color channel."
908
+ redChannelLabel="Red channel"
909
+ i18n-greenChannelLabel="kendo.colorpicker.greenChannelLabel|The label of the NumericTextBox representing the green color channel."
910
+ greenChannelLabel="Green channel"
911
+ i18n-blueChannelLabel="kendo.colorpicker.blueChannelLabel|The label of the NumericTextBox representing the blue color channel."
912
+ blueChannelLabel="Blue channel"
913
+ i18n-alphaChannelLabel="kendo.colorpicker.alphaChannelLabel|The label of the NumericTextBox representing the alpha color channel."
914
+ alphaChannelLabel="Alpha channel"
915
+ i18n-redInputPlaceholder="kendo.colorpicker.redInputPlaceholder|The placeholder for the red color input."
916
+ redChannelLabel="R"
917
+ i18n-greenInputPlaceholder="kendo.colorpicker.greenInputPlaceholder|The placeholder for the green color input."
918
+ greenInputPlaceholder="G"
919
+ i18n-blueInputPlaceholder="kendo.colorpicker.blueInputPlaceholder|The placeholder for the blue color input."
920
+ blueInputPlaceholder="B"
921
+ i18n-hexInputPlaceholder="kendo.colorpicker.hexInputPlaceholder|The placeholder for the HEX color input."
922
+ hexInputPlaceholder="HEX">
923
+ </ng-container>
924
+ <span #activeColor class="k-input-inner">
925
+ <span
926
+ class="k-value-icon k-color-preview"
927
+ [ngClass]="{'k-icon-color-preview': customIconStyles || iconStyles || svgIcon, 'k-no-color': !value}"
928
+ >
929
+ <kendo-icon-wrapper
930
+ *ngIf="iconClass || icon || svgIcon"
931
+ [name]="iconStyles"
932
+ innerCssClass="k-color-preview-icon"
933
+ [customFontClass]="customIconStyles"
934
+ [svgIcon]="svgIcon"
935
+ >
936
+ </kendo-icon-wrapper>
937
+ <span class="k-color-preview-mask" [style.background-color]="value"></span>
938
+ </span>
939
+
940
+ </span>
941
+ <button
942
+ kendoButton
943
+ tabindex="-1"
944
+ type="button"
945
+ icon="caret-alt-down"
946
+ [svgIcon]="arrowDownIcon"
947
+ aria-hidden="true"
948
+ class="k-input-button"
949
+ >
950
+ </button>
951
+ <ng-template #popupTemplate>
952
+ <kendo-flatcolorpicker
953
+ #flatColorPicker
954
+ [value]="value"
955
+ [format]="format"
956
+ [views]="views"
957
+ [activeView]="activeView"
958
+ [actionsLayout]="actionsLayout"
959
+ [preview]="preview"
960
+ [gradientSettings]="gradientSettings"
961
+ [paletteSettings]="paletteSettings"
962
+ [clearButton]="clearButton"
963
+ (cancel)="handleCancelEvent($event)"
964
+ (focusout)="handlePopupBlur($event)"
965
+ (valueChange)="handleValueChange($event)"
966
+ (keydown)="handlePopupKeyDown($event)"
967
+ (activeViewChange)="activeViewChange.emit($event)"
968
+ (clearButtonClick)="clearButtonClick.emit()"
969
+ (actionButtonClick)="togglePopup()">
970
+ </kendo-flatcolorpicker>
971
+ </ng-template>
972
+ <ng-container #container></ng-container>
973
+ `
974
+ }]
975
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.PopupService }, { type: i0.ChangeDetectorRef }, { type: i2.LocalizationService }, { type: i0.NgZone }, { type: i0.Renderer2 }, { type: i0.Injector }]; }, propDecorators: { hostClasses: [{
976
+ type: HostBinding,
977
+ args: ['class.k-colorpicker']
978
+ }, {
979
+ type: HostBinding,
980
+ args: ['class.k-icon-picker']
981
+ }, {
982
+ type: HostBinding,
983
+ args: ['class.k-picker']
984
+ }], focusedClass: [{
985
+ type: HostBinding,
986
+ args: ['class.k-focus']
987
+ }], disabledClass: [{
988
+ type: HostBinding,
989
+ args: ['attr.aria-disabled']
990
+ }, {
991
+ type: HostBinding,
992
+ args: ['class.k-disabled']
993
+ }], ariaReadonly: [{
994
+ type: HostBinding,
995
+ args: ['attr.aria-readonly']
996
+ }], ariaExpanded: [{
997
+ type: HostBinding,
998
+ args: ['attr.aria-expanded']
999
+ }], hostTabindex: [{
1000
+ type: HostBinding,
1001
+ args: ['attr.tabindex']
1002
+ }], direction: [{
1003
+ type: HostBinding,
1004
+ args: ['attr.dir']
1005
+ }], role: [{
1006
+ type: HostBinding,
1007
+ args: ['attr.role']
1008
+ }], hasPopup: [{
1009
+ type: HostBinding,
1010
+ args: ['attr.aria-haspopup']
1011
+ }], isControlInvalid: [{
1012
+ type: HostBinding,
1013
+ args: ['attr.aria-invalid']
1014
+ }], views: [{
1015
+ type: Input
1016
+ }], view: [{
1017
+ type: Input
1018
+ }], activeView: [{
1019
+ type: Input
1020
+ }], readonly: [{
1021
+ type: Input
1022
+ }], disabled: [{
1023
+ type: Input
1024
+ }], format: [{
1025
+ type: Input
1026
+ }], value: [{
1027
+ type: Input
1028
+ }], popupSettings: [{
1029
+ type: Input
1030
+ }], paletteSettings: [{
1031
+ type: Input
1032
+ }], gradientSettings: [{
1033
+ type: Input
1034
+ }], icon: [{
1035
+ type: Input
1036
+ }], iconClass: [{
1037
+ type: Input
1038
+ }], svgIcon: [{
1039
+ type: Input
1040
+ }], clearButton: [{
1041
+ type: Input
1042
+ }], tabindex: [{
1043
+ type: Input
1044
+ }], preview: [{
1045
+ type: Input
1046
+ }], actionsLayout: [{
1047
+ type: Input
1048
+ }], size: [{
1049
+ type: Input
1050
+ }], rounded: [{
1051
+ type: Input
1052
+ }], fillMode: [{
1053
+ type: Input
1054
+ }], valueChange: [{
1055
+ type: Output
1056
+ }], open: [{
1057
+ type: Output
1058
+ }], close: [{
1059
+ type: Output
1060
+ }], onFocus: [{
1061
+ type: Output,
1062
+ args: ['focus']
1063
+ }], onBlur: [{
1064
+ type: Output,
1065
+ args: ['blur']
1066
+ }], cancel: [{
1067
+ type: Output
1068
+ }], activeColorClick: [{
1069
+ type: Output
1070
+ }], clearButtonClick: [{
1071
+ type: Output
1072
+ }], activeViewChange: [{
1073
+ type: Output
1074
+ }], container: [{
1075
+ type: ViewChild,
1076
+ args: ['container', { read: ViewContainerRef, static: true }]
1077
+ }], activeColor: [{
1078
+ type: ViewChild,
1079
+ args: ['activeColor', { static: true }]
1080
+ }], popupTemplate: [{
1081
+ type: ViewChild,
1082
+ args: ['popupTemplate', { static: true }]
1083
+ }], flatColorPicker: [{
1084
+ type: ViewChild,
1085
+ args: ['flatColorPicker', { static: false }]
1086
+ }] } });