@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,164 @@
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 { parseColor as parse, Color, namedColors as colors } from '@progress/kendo-drawing';
6
+ import { isPresent, fitIntoBounds } from '../../common/utils';
7
+ /**
8
+ * @hidden
9
+ *
10
+ * Returns the hex or rgba string representation of the color.
11
+ */
12
+ export const parseColor = (value, format, opacityEnabled = false, safe = true) => {
13
+ const allowedFormats = ['hex', 'rgba', 'name'];
14
+ if (allowedFormats.indexOf(format) === -1) {
15
+ throw new Error(`Unsupported color output format '${format}'. The available options are 'hex', 'rgba' or 'name'.`);
16
+ }
17
+ if (!isPresent(value)) {
18
+ return;
19
+ }
20
+ if (format === 'name') {
21
+ return nameFormat(value, safe);
22
+ }
23
+ const parsedColor = parse(value.trim(), safe);
24
+ if (!isPresent(parsedColor)) {
25
+ return;
26
+ }
27
+ const parsedColorResult = format === 'hex' ? getHexValue(parsedColor, opacityEnabled) : parsedColor.toCssRgba();
28
+ return parsedColorResult;
29
+ };
30
+ /**
31
+ * @hidden
32
+ *
33
+ * Returns an HSV object representation of the color string.
34
+ */
35
+ export const getHSV = (value, safe = true) => {
36
+ const parsed = parse(value, safe);
37
+ if (!isPresent(parsed)) {
38
+ return {};
39
+ }
40
+ return parsed.toHSV();
41
+ };
42
+ /**
43
+ * @hidden
44
+ *
45
+ * Returns an RGBA object representation of the color string.
46
+ */
47
+ export const getRGBA = (value, safe = true) => {
48
+ const parsed = parse(value, safe);
49
+ if (!isPresent(parsed)) {
50
+ return {};
51
+ }
52
+ return parsed.toBytes();
53
+ };
54
+ /**
55
+ * @hidden
56
+ *
57
+ * Returns the RGBA string representation of the color.
58
+ */
59
+ export const getColorFromHSV = (hsva, format = 'rgba', opacityEnabled = false) => {
60
+ const hue = fitIntoBounds(hsva.h, 0, 359.9);
61
+ const saturation = fitIntoBounds(hsva.s, 0, 1);
62
+ const value = fitIntoBounds(hsva.v, 0, 1);
63
+ const alpha = fitIntoBounds(hsva.a, 0, 1);
64
+ const color = Color.fromHSV(hue, saturation, value, alpha);
65
+ return format === 'hex' ? getHexValue(color, opacityEnabled) : color.toCssRgba();
66
+ };
67
+ /**
68
+ * @hidden
69
+ *
70
+ * Returns the HEX value.
71
+ */
72
+ export const getHexValue = (color, opacity) => {
73
+ return opacity && color.a < 1 ? color.toCss({ alpha: true }) : color.toCss();
74
+ };
75
+ /**
76
+ * @hidden
77
+ *
78
+ * Returns the RGBA string representation of the color based on the `hue`, assuming the `value`, `saturation` and `alpha` have value of `1`.
79
+ */
80
+ export const getColorFromHue = (hue) => {
81
+ return getColorFromHSV({ h: hue, s: 1, v: 1, a: 1 });
82
+ };
83
+ /**
84
+ * @hidden
85
+ *
86
+ * Returns the RGBA string representation of the color.
87
+ */
88
+ export const getColorFromRGBA = (rgba) => {
89
+ const red = fitIntoBounds(rgba.r, 0, 255);
90
+ const green = fitIntoBounds(rgba.g, 0, 255);
91
+ const blue = fitIntoBounds(rgba.b, 0, 255);
92
+ const alpha = fitIntoBounds(rgba.a, 0, 1);
93
+ return Color.fromBytes(red, green, blue, alpha).toCssRgba();
94
+ };
95
+ /**
96
+ *
97
+ * @hidden
98
+ */
99
+ export function nameFormat(value, safe) {
100
+ value = value.toLowerCase().trim();
101
+ if (isPresent(colors[value])) {
102
+ return value;
103
+ }
104
+ if (parse(value, safe)) {
105
+ value = parse(value, safe).toHex();
106
+ }
107
+ const key = Object.keys(colors).find(key => colors[key] === value);
108
+ if (!key && !safe) {
109
+ throw new Error(`The provided color ${value} is not supported for 'format="name"' property.To display ${value} color, the component 'format' property should be set to 'hex' or 'rgba' `);
110
+ }
111
+ return key;
112
+ }
113
+ /**
114
+ * @hidden
115
+ *
116
+ * Returns the RGB object representation of the color based on the background color.
117
+ */
118
+ export const getRGBFromRGBA = (foregroundColor, backgroundColor) => {
119
+ const r1 = fitIntoBounds(foregroundColor.r, 0, 255);
120
+ const g1 = fitIntoBounds(foregroundColor.g, 0, 255);
121
+ const b1 = fitIntoBounds(foregroundColor.b, 0, 255);
122
+ const a1 = fitIntoBounds(foregroundColor.a, 0, 1);
123
+ const r2 = fitIntoBounds(backgroundColor.r, 0, 255);
124
+ const g2 = fitIntoBounds(backgroundColor.g, 0, 255);
125
+ const b2 = fitIntoBounds(backgroundColor.b, 0, 255);
126
+ return {
127
+ r: Math.round(((1 - a1) * r2) + (a1 * r1)),
128
+ g: Math.round(((1 - a1) * g2) + (a1 * g1)),
129
+ b: Math.round(((1 - a1) * b2) + (a1 * b1))
130
+ };
131
+ };
132
+ /**
133
+ * @hidden
134
+ *
135
+ * Returns the relative luminance.
136
+ */
137
+ export const getLuminance = (rgb) => {
138
+ const a = [rgb.r, rgb.g, rgb.b].map(function (v) {
139
+ v /= 255;
140
+ return v <= 0.03928
141
+ ? v / 12.92
142
+ : Math.pow((v + 0.055) / 1.055, 2.4);
143
+ });
144
+ return a[0] * 0.2126 + a[1] * 0.7152 + a[2] * 0.0722;
145
+ };
146
+ /**
147
+ * @hidden
148
+ *
149
+ * Returns the color contrast.
150
+ */
151
+ export const getContrast = (luminance1, luminance2) => {
152
+ const brightest = Math.max(luminance1, luminance2);
153
+ const darkest = Math.min(luminance1, luminance2);
154
+ return (brightest + 0.05)
155
+ / (darkest + 0.05);
156
+ };
157
+ /**
158
+ * @hidden
159
+ *
160
+ * Returns the color contrast from two RGBA colors.
161
+ */
162
+ export const getContrastFromTwoRGBAs = (a, b) => {
163
+ return getContrast(getLuminance(getRGBFromRGBA(a, b)), getLuminance(getRGBFromRGBA(b, { r: 0, g: 0, b: 0, a: 1 })));
164
+ };
@@ -0,0 +1,85 @@
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
+ /**
6
+ * @hidden
7
+ */
8
+ export const bezierCommand = (controlPointCalc) => (point, i, a) => {
9
+ // start control point
10
+ const [cpsX, cpsY] = controlPointCalc(a[i - 1], a[i - 2], point);
11
+ // end control point
12
+ const [cpeX, cpeY] = controlPointCalc(point, a[i - 1], a[i + 1], true);
13
+ return `C ${cpsX},${cpsY} ${cpeX},${cpeY} ${point[0]},${point[1]}`;
14
+ };
15
+ /**
16
+ * @hidden
17
+ */
18
+ export const controlPoint = (lineCalc) => (current, previous, next, reverse) => {
19
+ // when 'current' is the first or last point of the array
20
+ // 'previous' and 'next' are undefined
21
+ // replace with 'current'
22
+ const p = previous || current;
23
+ const n = next || current;
24
+ const smooth = 0.1;
25
+ // properties of the line between previous and next
26
+ const l = lineCalc(p, n);
27
+ // If is end-control-point, add PI to the angle to go backward
28
+ const angle = l.angle + (reverse ? Math.PI : 0);
29
+ const length = l.length * smooth;
30
+ // The control point position is relative to the current point
31
+ const x = current[0] + Math.cos(angle) * length;
32
+ const y = current[1] + Math.sin(angle) * length;
33
+ return [x, y];
34
+ };
35
+ /**
36
+ * @hidden
37
+ */
38
+ export const line = (pointA, pointB) => {
39
+ const lengthX = pointB[0] - pointA[0];
40
+ const lengthY = pointB[1] - pointA[1];
41
+ return {
42
+ length: Math.sqrt(Math.pow(lengthX, 2) + Math.pow(lengthY, 2)),
43
+ angle: Math.atan2(lengthY, lengthX)
44
+ };
45
+ };
46
+ /**
47
+ * @hidden
48
+ */
49
+ export const d = (points, command) => {
50
+ if (points.length === 0) {
51
+ return '';
52
+ }
53
+ // build the d attributes by looping over the points
54
+ const d = points.reduce((acc, point, i, a) => i === 0 ?
55
+ // if first point
56
+ `M ${point[0]},${point[1]}` :
57
+ // else
58
+ `${acc} ${command(point, i, a)}`, '');
59
+ return d;
60
+ };
61
+ /**
62
+ * @hidden
63
+ *
64
+ * Render the svg <path> element.
65
+ *
66
+ * @param points (array) Represents the points coordinates as an array of tuples.
67
+ * @param command (function) The command that is used (bezierCommand, lineCommand).
68
+ * @param point (array) [x,y] Represents the current point coordinates.
69
+ * @param i (integer) Represents the index of 'point' in the array 'a'.
70
+ * @param a (array) Represents the complete array of points coordinates.
71
+ * @output (string) a svg path command.
72
+ * @output (string) a Svg <path> element
73
+ */
74
+ export const svgPath = (points, command) => {
75
+ if (points.length === 0) {
76
+ return '';
77
+ }
78
+ // build the d attributes by looping over the points
79
+ const d = points.reduce((acc, point, i, a) => i === 0 ?
80
+ // if first point
81
+ `M ${point[0]},${point[1]}` :
82
+ // else
83
+ `${acc} ${command(point, i, a)}`, '');
84
+ return d;
85
+ };
@@ -0,0 +1,6 @@
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
+ export * from './utils/color-parser';
6
+ export * from './utils/contrast-curve';
@@ -0,0 +1,104 @@
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 { PopupModule } from '@progress/kendo-angular-popup';
8
+ import { DraggableModule } from '@progress/kendo-angular-common';
9
+ import { SliderModule } from './slider.module';
10
+ import { NumericTextBoxModule } from './numerictextbox.module';
11
+ import { ColorPickerComponent } from './colorpicker/colorpicker.component';
12
+ import { ColorPaletteComponent } from './colorpicker/color-palette.component';
13
+ import { ColorGradientComponent } from './colorpicker/color-gradient.component';
14
+ import { ColorInputComponent } from './colorpicker/color-input.component';
15
+ import { FlatColorPickerHeaderComponent } from './colorpicker/flatcolorpicker-header.component';
16
+ import { FlatColorPickerActionButtonsComponent } from './colorpicker/flatcolorpicker-actions.component';
17
+ import { FlatColorPickerComponent } from './colorpicker/flatcolorpicker.component';
18
+ import { ColorPickerCustomMessagesComponent } from './colorpicker/localization/custom-messages.component';
19
+ import { LocalizedColorPickerMessagesDirective } from './colorpicker/localization/localized-colorpicker-messages.directive';
20
+ import { FocusOnDomReadyDirective } from './colorpicker/focus-on-dom-ready.directive';
21
+ import { ContrastValidationComponent } from './colorpicker/contrast-validation.component';
22
+ import { ContrastComponent } from './colorpicker/contrast.component';
23
+ import { ColorContrastSvgComponent } from './colorpicker/color-contrast-svg.component';
24
+ import { NumericLabelDirective } from './colorpicker/color-gradient-numeric-label.directive';
25
+ import { ButtonModule } from '@progress/kendo-angular-buttons';
26
+ import { IconsModule } from '@progress/kendo-angular-icons';
27
+ import * as i0 from "@angular/core";
28
+ const PUBLIC_DIRECTIVES = [
29
+ ColorPickerComponent,
30
+ ColorPaletteComponent,
31
+ ColorGradientComponent,
32
+ FlatColorPickerComponent,
33
+ LocalizedColorPickerMessagesDirective,
34
+ ColorPickerCustomMessagesComponent
35
+ ];
36
+ const INTERNAL_DIRECTIVES = [
37
+ NumericLabelDirective,
38
+ ColorInputComponent,
39
+ FocusOnDomReadyDirective,
40
+ ContrastComponent,
41
+ ContrastValidationComponent,
42
+ FlatColorPickerHeaderComponent,
43
+ FlatColorPickerActionButtonsComponent,
44
+ ColorContrastSvgComponent
45
+ ];
46
+ /**
47
+ * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
48
+ * definition for the ColorPicker.
49
+ */
50
+ export class ColorPickerModule {
51
+ }
52
+ ColorPickerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ColorPickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
53
+ ColorPickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ColorPickerModule, declarations: [ColorPickerComponent,
54
+ ColorPaletteComponent,
55
+ ColorGradientComponent,
56
+ FlatColorPickerComponent,
57
+ LocalizedColorPickerMessagesDirective,
58
+ ColorPickerCustomMessagesComponent, NumericLabelDirective,
59
+ ColorInputComponent,
60
+ FocusOnDomReadyDirective,
61
+ ContrastComponent,
62
+ ContrastValidationComponent,
63
+ FlatColorPickerHeaderComponent,
64
+ FlatColorPickerActionButtonsComponent,
65
+ ColorContrastSvgComponent], imports: [SliderModule,
66
+ NumericTextBoxModule,
67
+ CommonModule,
68
+ PopupModule,
69
+ DraggableModule,
70
+ ButtonModule,
71
+ IconsModule], exports: [ColorPickerComponent,
72
+ ColorPaletteComponent,
73
+ ColorGradientComponent,
74
+ FlatColorPickerComponent,
75
+ LocalizedColorPickerMessagesDirective,
76
+ ColorPickerCustomMessagesComponent] });
77
+ ColorPickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ColorPickerModule, imports: [[
78
+ SliderModule,
79
+ NumericTextBoxModule,
80
+ CommonModule,
81
+ PopupModule,
82
+ DraggableModule,
83
+ ButtonModule,
84
+ IconsModule
85
+ ]] });
86
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ColorPickerModule, decorators: [{
87
+ type: NgModule,
88
+ args: [{
89
+ declarations: [
90
+ PUBLIC_DIRECTIVES,
91
+ INTERNAL_DIRECTIVES
92
+ ],
93
+ exports: [PUBLIC_DIRECTIVES],
94
+ imports: [
95
+ SliderModule,
96
+ NumericTextBoxModule,
97
+ CommonModule,
98
+ PopupModule,
99
+ DraggableModule,
100
+ ButtonModule,
101
+ IconsModule
102
+ ]
103
+ }]
104
+ }] });
@@ -0,0 +1,36 @@
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
+ const UNTOUCHED = 'ng-untouched';
6
+ const toClassList = (classNames) => String(classNames).trim().split(' ');
7
+ /**
8
+ * @hidden
9
+ */
10
+ export const hasClass = (element, className) => Boolean(toClassList(element.className).find((name) => name === className));
11
+ /**
12
+ * @hidden
13
+ */
14
+ export function invokeElementMethod(element, name, ...args) {
15
+ if (element && element.nativeElement) {
16
+ // eslint-disable-next-line prefer-spread
17
+ return element.nativeElement[name].apply(element.nativeElement, args);
18
+ }
19
+ }
20
+ /**
21
+ * @hidden
22
+ */
23
+ export const isUntouched = (element) => element && element.nativeElement && hasClass(element.nativeElement, UNTOUCHED);
24
+ /**
25
+ * @hidden
26
+ */
27
+ export const containsFocus = (hostElement, contender) => hostElement && contender && (hostElement === contender || hostElement.contains(contender));
28
+ /**
29
+ * @hidden
30
+ */
31
+ export const closest = (node, predicate) => {
32
+ while (node && !predicate(node)) {
33
+ node = node.parentNode;
34
+ }
35
+ return node;
36
+ };
@@ -0,0 +1,65 @@
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
+ /**
6
+ * @hidden
7
+ */
8
+ const MAX_PRECISION = 20;
9
+ /**
10
+ * @hidden
11
+ */
12
+ export const limitPrecision = (precision) => Math.min(precision, MAX_PRECISION);
13
+ /**
14
+ * @hidden
15
+ */
16
+ export const fractionLength = (value) => {
17
+ return (String(value).split('.')[1] || "").length;
18
+ };
19
+ const maxFractionLength = (value1, value2) => {
20
+ return Math.max(fractionLength(value1), fractionLength(value2));
21
+ };
22
+ /**
23
+ * @hidden
24
+ */
25
+ export const toFixedPrecision = (value, precision) => {
26
+ const maxPrecision = limitPrecision(precision);
27
+ return parseFloat(value.toFixed(maxPrecision));
28
+ };
29
+ /**
30
+ * @hidden
31
+ */
32
+ export const add = (value1, value2) => {
33
+ const maxPrecision = maxFractionLength(value1, value2);
34
+ return toFixedPrecision(value1 + value2, maxPrecision);
35
+ };
36
+ /**
37
+ * @hidden
38
+ */
39
+ export const subtract = (value1, value2) => {
40
+ return add(value1, -value2);
41
+ };
42
+ /**
43
+ * @hidden
44
+ */
45
+ export const multiply = (value1, value2) => {
46
+ const maxPrecision = fractionLength(value1) + fractionLength(value2);
47
+ return toFixedPrecision(value1 * value2, maxPrecision);
48
+ };
49
+ /**
50
+ * @hidden
51
+ */
52
+ export const divide = (dividend, divisor) => {
53
+ if (divisor === 0) {
54
+ return NaN;
55
+ }
56
+ const power = maxFractionLength(dividend, divisor);
57
+ const correctionValue = Math.pow(10, power);
58
+ return ((correctionValue * dividend) / (correctionValue * divisor));
59
+ };
60
+ /**
61
+ * @hidden
62
+ */
63
+ export const remainder = (dividend, divisor) => {
64
+ return Math.abs(subtract(dividend, multiply(divisor, Math.floor(divide(dividend, divisor)))));
65
+ };
@@ -0,0 +1,5 @@
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
+ export {};
@@ -0,0 +1,5 @@
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
+ export {};
@@ -0,0 +1,5 @@
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
+ export {};
@@ -0,0 +1,5 @@
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
+ export {};
@@ -0,0 +1,8 @@
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
+ export * from './models/fillmode';
6
+ export * from './models/rounded';
7
+ export * from './models/size';
8
+ export * from './models/styling-classes';
@@ -0,0 +1,81 @@
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
+ /**
6
+ * @hidden
7
+ *
8
+ * Checks if the value is `null` or `undefined`. Falsy values like '', 0, false, NaN, etc. are regarded as present.
9
+ */
10
+ export const isPresent = (value) => value !== null && value !== undefined;
11
+ /**
12
+ * @hidden
13
+ */
14
+ export const areSame = (value1, value2) => value1 === value2 || (value1 === null && value2 === undefined) || (value1 === undefined && value2 === null);
15
+ /**
16
+ * @hidden
17
+ */
18
+ export const requiresZoneOnBlur = (ngControl) => ngControl &&
19
+ (!ngControl.touched || (ngControl.control && ngControl.control.updateOn === 'blur'));
20
+ /**
21
+ * @hidden
22
+ *
23
+ * Fits the contender number into the specified bounds. If the number is NaN or null, the min is returned.
24
+ *
25
+ * @param contender Represents the number you want to fit into specified bounds.
26
+ * @param min The inclusive lower bound number.
27
+ * @param max The inclusive upper bound number.
28
+ */
29
+ export const fitIntoBounds = (contender, min, max) => {
30
+ if (!isPresent(contender) || isNaN(contender)) {
31
+ return min;
32
+ }
33
+ return contender <= min ? min : contender >= max ? max : contender;
34
+ };
35
+ /**
36
+ * @hidden
37
+ */
38
+ export const SIZE_MAP = {
39
+ small: 'sm',
40
+ medium: 'md',
41
+ large: 'lg'
42
+ };
43
+ /**
44
+ * @hidden
45
+ */
46
+ export const ROUNDED_MAP = {
47
+ small: 'sm',
48
+ medium: 'md',
49
+ large: 'lg',
50
+ full: 'full'
51
+ };
52
+ /**
53
+ * @hidden
54
+ */
55
+ export const isNone = (style) => style === 'none';
56
+ /**
57
+ * @hidden
58
+ *
59
+ * Returns the styling classes to be added and removed
60
+ */
61
+ export const getStylingClasses = (componentType, stylingOption, previousValue, newValue) => {
62
+ switch (stylingOption) {
63
+ case 'size':
64
+ return {
65
+ toRemove: `k-${componentType}-${SIZE_MAP[previousValue]}`,
66
+ toAdd: newValue !== 'none' ? `k-${componentType}-${SIZE_MAP[newValue]}` : ''
67
+ };
68
+ case 'rounded':
69
+ return {
70
+ toRemove: `k-rounded-${ROUNDED_MAP[previousValue]}`,
71
+ toAdd: newValue !== 'none' ? `k-rounded-${ROUNDED_MAP[newValue]}` : ''
72
+ };
73
+ case 'fillMode':
74
+ return {
75
+ toRemove: `k-${componentType}-${previousValue}`,
76
+ toAdd: newValue !== 'none' ? `k-${componentType}-${newValue}` : ''
77
+ };
78
+ default:
79
+ break;
80
+ }
81
+ };
@@ -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 { Component, HostBinding, Input } from '@angular/core';
6
+ import * as i0 from "@angular/core";
7
+ let serial = 0;
8
+ /**
9
+ * Represents an error message that will be shown underneath
10
+ * a Kendo control or native HTML form-bound component after a validation.
11
+ */
12
+ export class ErrorComponent {
13
+ constructor() {
14
+ this.hostClass = true;
15
+ /**
16
+ * Specifies the alignment of the Error message.
17
+ *
18
+ * The possible values are:
19
+ * * (Default) `start`
20
+ * * `end`
21
+ */
22
+ this.align = 'start';
23
+ /**
24
+ * @hidden
25
+ */
26
+ this.id = `kendo-error-${serial++}`;
27
+ this.roleAttribute = 'alert';
28
+ }
29
+ get startClass() {
30
+ return this.align === 'start';
31
+ }
32
+ get endClass() {
33
+ return this.align === 'end';
34
+ }
35
+ get idAttribute() {
36
+ return this.id;
37
+ }
38
+ }
39
+ ErrorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
40
+ ErrorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: ErrorComponent, selector: "kendo-formerror", inputs: { align: "align" }, host: { properties: { "class.k-form-error": "this.hostClass", "attr.role": "this.roleAttribute", "class.k-text-start": "this.startClass", "class.k-text-end": "this.endClass", "attr.id": "this.idAttribute" } }, ngImport: i0, template: `
41
+ <ng-content></ng-content>
42
+ `, isInline: true });
43
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ErrorComponent, decorators: [{
44
+ type: Component,
45
+ args: [{
46
+ selector: 'kendo-formerror',
47
+ template: `
48
+ <ng-content></ng-content>
49
+ `
50
+ }]
51
+ }], propDecorators: { hostClass: [{
52
+ type: HostBinding,
53
+ args: ['class.k-form-error']
54
+ }], align: [{
55
+ type: Input
56
+ }], roleAttribute: [{
57
+ type: HostBinding,
58
+ args: ['attr.role']
59
+ }], startClass: [{
60
+ type: HostBinding,
61
+ args: ['class.k-text-start']
62
+ }], endClass: [{
63
+ type: HostBinding,
64
+ args: ['class.k-text-end']
65
+ }], idAttribute: [{
66
+ type: HostBinding,
67
+ args: ['attr.id']
68
+ }] } });