@progress/kendo-vue-inputs 3.5.0 → 3.5.1-dev.202208150613

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 (261) hide show
  1. package/dist/cdn/js/kendo-vue-inputs.js +1 -1
  2. package/dist/es/checkbox/Checkbox.js +1 -1
  3. package/dist/es/checkbox/interfaces/CheckboxChangeEvent.js +1 -0
  4. package/dist/es/checkbox/interfaces/CheckboxFocusEvent.js +1 -0
  5. package/dist/es/checkbox/interfaces/CheckboxProps.js +1 -0
  6. package/dist/es/colors/ColorContrastLabels.js +3 -3
  7. package/dist/es/colors/ColorContrastSvg.js +2 -2
  8. package/dist/es/colors/ColorGradient.js +7 -7
  9. package/dist/es/colors/ColorPalette.js +1 -1
  10. package/dist/es/colors/ColorPicker.js +4 -4
  11. package/dist/es/colors/interfaces/ColorGradientChangeEvent.js +1 -0
  12. package/dist/es/colors/interfaces/ColorGradientProps.js +1 -0
  13. package/dist/es/colors/interfaces/ColorPaletteChangeEvent.js +1 -0
  14. package/dist/es/colors/interfaces/ColorPaletteProps.js +1 -0
  15. package/dist/es/colors/interfaces/ColorPickerActiveColorClick.js +1 -0
  16. package/dist/es/colors/interfaces/ColorPickerBlurEvent.js +1 -0
  17. package/dist/es/colors/interfaces/ColorPickerChangeEvent.js +1 -0
  18. package/dist/es/colors/interfaces/ColorPickerFocusEvent.js +1 -0
  19. package/dist/es/colors/interfaces/ColorPickerPaletteSettings.js +1 -0
  20. package/dist/es/colors/interfaces/ColorPickerPopupSettings.js +1 -0
  21. package/dist/es/colors/interfaces/ColorPickerProps.js +1 -0
  22. package/dist/es/colors/interfaces/ColorPickerView.js +1 -0
  23. package/dist/es/colors/interfaces/FlatColorPickerViewChangeEvent.js +1 -0
  24. package/dist/es/colors/interfaces/PickerPopupSettings.js +1 -0
  25. package/dist/es/colors/interfaces/PickerProps.js +1 -0
  26. package/dist/es/colors/models/hsva.js +1 -0
  27. package/dist/es/colors/models/output-format.js +1 -0
  28. package/dist/es/colors/models/rgb.js +1 -0
  29. package/dist/es/colors/models/rgba.js +1 -0
  30. package/dist/es/colors/models/table-cell.js +1 -0
  31. package/dist/es/colors/models/tile-size.js +1 -0
  32. package/dist/es/colors/utils/color-parser.js +1 -1
  33. package/dist/es/colors/utils/svg-calc.js +4 -4
  34. package/dist/es/input/Input.js +2 -2
  35. package/dist/es/interfaces/Direction.js +1 -0
  36. package/dist/es/interfaces/ToggleBaseProps.js +1 -0
  37. package/dist/es/maskedtextbox/MaskedTextBox.js +3 -3
  38. package/dist/es/maskedtextbox/MaskedTextBoxProps.js +1 -0
  39. package/dist/es/maskedtextbox/parsing/result.js +1 -1
  40. package/dist/es/numerictextbox/NumericTextBox.js +2 -2
  41. package/dist/es/numerictextbox/interfaces/NumericTextBoxData.js +1 -0
  42. package/dist/es/numerictextbox/interfaces/NumericTextBoxProps.js +1 -0
  43. package/dist/es/numerictextbox/utils/index.js +4 -4
  44. package/dist/es/package-metadata.js +1 -1
  45. package/dist/es/radiobutton/RadioButton.js +1 -1
  46. package/dist/es/radiobutton/interfaces/RadioButtonBlurEvent.js +1 -0
  47. package/dist/es/radiobutton/interfaces/RadioButtonChangeEvent.js +1 -0
  48. package/dist/es/radiobutton/interfaces/RadioButtonFocusEvent.js +1 -0
  49. package/dist/es/radiobutton/interfaces/RadioButtonProps.js +1 -0
  50. package/dist/es/radiobutton/interfaces/RadioGroupChangeEvent.js +1 -0
  51. package/dist/es/radiobutton/interfaces/RadioGroupFocusEvent.js +1 -0
  52. package/dist/es/radiobutton/interfaces/RadioGroupProps.js +1 -0
  53. package/dist/es/range-slider/RangeSlider.js +4 -4
  54. package/dist/es/slider/SliderLabel.js +2 -2
  55. package/dist/es/switch/Switch.js +3 -3
  56. package/dist/es/textarea/TextArea.js +3 -3
  57. package/dist/es/textarea/interfaces/TextAreaBlurEvent.js +1 -0
  58. package/dist/es/textarea/interfaces/TextAreaChangeEvent.js +1 -0
  59. package/dist/es/textarea/interfaces/TextAreaFlow.js +1 -0
  60. package/dist/es/textarea/interfaces/TextAreaFocusEvent.js +1 -0
  61. package/dist/es/textarea/interfaces/TextAreaProps.js +1 -0
  62. package/dist/es/textarea/interfaces/TextAreaResize.js +1 -0
  63. package/dist/esm/additionalTypes.ts +21 -0
  64. package/dist/esm/checkbox/Checkbox.d.ts +79 -0
  65. package/dist/esm/checkbox/Checkbox.js +373 -0
  66. package/dist/esm/checkbox/interfaces/CheckboxChangeEvent.d.ts +9 -0
  67. package/dist/esm/checkbox/interfaces/CheckboxChangeEvent.js +1 -0
  68. package/dist/esm/checkbox/interfaces/CheckboxFocusEvent.d.ts +5 -0
  69. package/dist/esm/checkbox/interfaces/CheckboxFocusEvent.js +1 -0
  70. package/dist/esm/checkbox/interfaces/CheckboxProps.d.ts +110 -0
  71. package/dist/esm/checkbox/interfaces/CheckboxProps.js +1 -0
  72. package/dist/esm/colors/ColorContrastLabels.d.ts +49 -0
  73. package/dist/esm/colors/ColorContrastLabels.js +84 -0
  74. package/dist/esm/colors/ColorContrastSvg.d.ts +50 -0
  75. package/dist/esm/colors/ColorContrastSvg.js +130 -0
  76. package/dist/esm/colors/ColorGradient.d.ts +54 -0
  77. package/dist/esm/colors/ColorGradient.js +515 -0
  78. package/dist/esm/colors/ColorInput.d.ts +57 -0
  79. package/dist/esm/colors/ColorInput.js +343 -0
  80. package/dist/esm/colors/ColorPalette.d.ts +60 -0
  81. package/dist/esm/colors/ColorPalette.js +343 -0
  82. package/dist/esm/colors/ColorPicker.d.ts +57 -0
  83. package/dist/esm/colors/ColorPicker.js +505 -0
  84. package/dist/esm/colors/FlatColorPicker.d.ts +139 -0
  85. package/dist/esm/colors/FlatColorPicker.js +539 -0
  86. package/dist/esm/colors/HexInput.d.ts +52 -0
  87. package/dist/esm/colors/HexInput.js +110 -0
  88. package/dist/esm/colors/Picker.d.ts +46 -0
  89. package/dist/esm/colors/Picker.js +110 -0
  90. package/dist/esm/colors/interfaces/ColorGradientChangeEvent.d.ts +13 -0
  91. package/dist/esm/colors/interfaces/ColorGradientChangeEvent.js +1 -0
  92. package/dist/esm/colors/interfaces/ColorGradientProps.d.ts +68 -0
  93. package/dist/esm/colors/interfaces/ColorGradientProps.js +1 -0
  94. package/dist/esm/colors/interfaces/ColorPaletteChangeEvent.d.ts +13 -0
  95. package/dist/esm/colors/interfaces/ColorPaletteChangeEvent.js +1 -0
  96. package/dist/esm/colors/interfaces/ColorPaletteProps.d.ts +71 -0
  97. package/dist/esm/colors/interfaces/ColorPaletteProps.js +1 -0
  98. package/dist/esm/colors/interfaces/ColorPickerActiveColorClick.d.ts +13 -0
  99. package/dist/esm/colors/interfaces/ColorPickerActiveColorClick.js +1 -0
  100. package/dist/esm/colors/interfaces/ColorPickerBlurEvent.d.ts +9 -0
  101. package/dist/esm/colors/interfaces/ColorPickerBlurEvent.js +1 -0
  102. package/dist/esm/colors/interfaces/ColorPickerChangeEvent.d.ts +17 -0
  103. package/dist/esm/colors/interfaces/ColorPickerChangeEvent.js +1 -0
  104. package/dist/esm/colors/interfaces/ColorPickerFocusEvent.d.ts +9 -0
  105. package/dist/esm/colors/interfaces/ColorPickerFocusEvent.js +1 -0
  106. package/dist/esm/colors/interfaces/ColorPickerPaletteSettings.d.ts +32 -0
  107. package/dist/esm/colors/interfaces/ColorPickerPaletteSettings.js +1 -0
  108. package/dist/esm/colors/interfaces/ColorPickerPopupSettings.d.ts +14 -0
  109. package/dist/esm/colors/interfaces/ColorPickerPopupSettings.js +1 -0
  110. package/dist/esm/colors/interfaces/ColorPickerProps.d.ts +176 -0
  111. package/dist/esm/colors/interfaces/ColorPickerProps.js +1 -0
  112. package/dist/esm/colors/interfaces/ColorPickerView.d.ts +10 -0
  113. package/dist/esm/colors/interfaces/ColorPickerView.js +1 -0
  114. package/dist/esm/colors/interfaces/FlatColorPickerViewChangeEvent.d.ts +13 -0
  115. package/dist/esm/colors/interfaces/FlatColorPickerViewChangeEvent.js +1 -0
  116. package/dist/esm/colors/interfaces/PickerPopupSettings.d.ts +14 -0
  117. package/dist/esm/colors/interfaces/PickerPopupSettings.js +1 -0
  118. package/dist/esm/colors/interfaces/PickerProps.d.ts +46 -0
  119. package/dist/esm/colors/interfaces/PickerProps.js +1 -0
  120. package/dist/esm/colors/models/hsva.d.ts +9 -0
  121. package/dist/esm/colors/models/hsva.js +1 -0
  122. package/dist/esm/colors/models/output-format.d.ts +4 -0
  123. package/dist/esm/colors/models/output-format.js +1 -0
  124. package/dist/esm/colors/models/palette-presets.d.ts +53 -0
  125. package/dist/esm/colors/models/palette-presets.js +54 -0
  126. package/dist/esm/colors/models/rgb.d.ts +8 -0
  127. package/dist/esm/colors/models/rgb.js +1 -0
  128. package/dist/esm/colors/models/rgba.d.ts +9 -0
  129. package/dist/esm/colors/models/rgba.js +1 -0
  130. package/dist/esm/colors/models/table-cell.d.ts +7 -0
  131. package/dist/esm/colors/models/table-cell.js +1 -0
  132. package/dist/esm/colors/models/tile-size.d.ts +11 -0
  133. package/dist/esm/colors/models/tile-size.js +1 -0
  134. package/dist/esm/colors/utils/color-cache.d.ts +43 -0
  135. package/dist/esm/colors/utils/color-cache.js +75 -0
  136. package/dist/esm/colors/utils/color-palette.service.d.ts +13 -0
  137. package/dist/esm/colors/utils/color-palette.service.js +67 -0
  138. package/dist/esm/colors/utils/color-parser.d.ts +71 -0
  139. package/dist/esm/colors/utils/color-parser.js +145 -0
  140. package/dist/esm/colors/utils/misc.d.ts +15 -0
  141. package/dist/esm/colors/utils/misc.js +20 -0
  142. package/dist/esm/colors/utils/svg-calc.d.ts +62 -0
  143. package/dist/esm/colors/utils/svg-calc.js +103 -0
  144. package/dist/esm/input/Input.d.ts +189 -0
  145. package/dist/esm/input/Input.js +426 -0
  146. package/dist/esm/input-separator/InputSeparator.d.ts +26 -0
  147. package/dist/esm/input-separator/InputSeparator.js +43 -0
  148. package/dist/esm/interfaces/Direction.d.ts +1 -0
  149. package/dist/esm/interfaces/Direction.js +1 -0
  150. package/dist/esm/interfaces/ToggleBaseProps.d.ts +8 -0
  151. package/dist/esm/interfaces/ToggleBaseProps.js +1 -0
  152. package/dist/esm/main.d.ts +39 -0
  153. package/dist/esm/main.js +37 -0
  154. package/dist/esm/maskedtextbox/MaskedTextBox.d.ts +76 -0
  155. package/dist/esm/maskedtextbox/MaskedTextBox.js +511 -0
  156. package/dist/esm/maskedtextbox/MaskedTextBoxProps.d.ts +219 -0
  157. package/dist/esm/maskedtextbox/MaskedTextBoxProps.js +2 -0
  158. package/dist/esm/maskedtextbox/masking.service.d.ts +41 -0
  159. package/dist/esm/maskedtextbox/masking.service.js +206 -0
  160. package/dist/esm/maskedtextbox/parsing/combinators.d.ts +9 -0
  161. package/dist/esm/maskedtextbox/parsing/combinators.js +24 -0
  162. package/dist/esm/maskedtextbox/parsing/parsers.d.ts +47 -0
  163. package/dist/esm/maskedtextbox/parsing/parsers.js +154 -0
  164. package/dist/esm/maskedtextbox/parsing/result.d.ts +23 -0
  165. package/dist/esm/maskedtextbox/parsing/result.js +39 -0
  166. package/dist/esm/maskedtextbox/parsing/stream.d.ts +22 -0
  167. package/dist/esm/maskedtextbox/parsing/stream.js +41 -0
  168. package/dist/esm/maskedtextbox/utils.d.ts +16 -0
  169. package/dist/esm/maskedtextbox/utils.js +56 -0
  170. package/dist/esm/messages/index.d.ts +160 -0
  171. package/dist/esm/messages/index.js +162 -0
  172. package/dist/esm/numerictextbox/NumericTextBox.d.ts +87 -0
  173. package/dist/esm/numerictextbox/NumericTextBox.js +684 -0
  174. package/dist/esm/numerictextbox/interfaces/NumericTextBoxData.d.ts +15 -0
  175. package/dist/esm/numerictextbox/interfaces/NumericTextBoxData.js +1 -0
  176. package/dist/esm/numerictextbox/interfaces/NumericTextBoxProps.d.ts +178 -0
  177. package/dist/esm/numerictextbox/interfaces/NumericTextBoxProps.js +1 -0
  178. package/dist/esm/numerictextbox/utils/index.d.ts +119 -0
  179. package/dist/esm/numerictextbox/utils/index.js +646 -0
  180. package/dist/esm/package-metadata.d.ts +5 -0
  181. package/dist/esm/package-metadata.js +11 -0
  182. package/dist/esm/package.json +3 -0
  183. package/dist/esm/radiobutton/RadioButton.d.ts +55 -0
  184. package/dist/esm/radiobutton/RadioButton.js +195 -0
  185. package/dist/esm/radiobutton/RadioGroup.d.ts +57 -0
  186. package/dist/esm/radiobutton/RadioGroup.js +218 -0
  187. package/dist/esm/radiobutton/interfaces/RadioButtonBlurEvent.d.ts +5 -0
  188. package/dist/esm/radiobutton/interfaces/RadioButtonBlurEvent.js +1 -0
  189. package/dist/esm/radiobutton/interfaces/RadioButtonChangeEvent.d.ts +9 -0
  190. package/dist/esm/radiobutton/interfaces/RadioButtonChangeEvent.js +1 -0
  191. package/dist/esm/radiobutton/interfaces/RadioButtonFocusEvent.d.ts +5 -0
  192. package/dist/esm/radiobutton/interfaces/RadioButtonFocusEvent.js +1 -0
  193. package/dist/esm/radiobutton/interfaces/RadioButtonProps.d.ts +107 -0
  194. package/dist/esm/radiobutton/interfaces/RadioButtonProps.js +1 -0
  195. package/dist/esm/radiobutton/interfaces/RadioGroupChangeEvent.d.ts +9 -0
  196. package/dist/esm/radiobutton/interfaces/RadioGroupChangeEvent.js +1 -0
  197. package/dist/esm/radiobutton/interfaces/RadioGroupFocusEvent.d.ts +5 -0
  198. package/dist/esm/radiobutton/interfaces/RadioGroupFocusEvent.js +1 -0
  199. package/dist/esm/radiobutton/interfaces/RadioGroupProps.d.ts +81 -0
  200. package/dist/esm/radiobutton/interfaces/RadioGroupProps.js +1 -0
  201. package/dist/esm/range-slider/RangeSlider.d.ts +176 -0
  202. package/dist/esm/range-slider/RangeSlider.js +617 -0
  203. package/dist/esm/range-slider/range-raducer.d.ts +35 -0
  204. package/dist/esm/range-slider/range-raducer.js +157 -0
  205. package/dist/esm/slider/Slider.d.ts +140 -0
  206. package/dist/esm/slider/Slider.js +395 -0
  207. package/dist/esm/slider/SliderLabel.d.ts +65 -0
  208. package/dist/esm/slider/SliderLabel.js +121 -0
  209. package/dist/esm/switch/Switch.d.ts +182 -0
  210. package/dist/esm/switch/Switch.js +342 -0
  211. package/dist/esm/switch/util.d.ts +8 -0
  212. package/dist/esm/switch/util.js +46 -0
  213. package/dist/esm/textarea/TextArea.d.ts +81 -0
  214. package/dist/esm/textarea/TextArea.js +422 -0
  215. package/dist/esm/textarea/interfaces/TextAreaBlurEvent.d.ts +5 -0
  216. package/dist/esm/textarea/interfaces/TextAreaBlurEvent.js +1 -0
  217. package/dist/esm/textarea/interfaces/TextAreaChangeEvent.d.ts +9 -0
  218. package/dist/esm/textarea/interfaces/TextAreaChangeEvent.js +1 -0
  219. package/dist/esm/textarea/interfaces/TextAreaFlow.d.ts +8 -0
  220. package/dist/esm/textarea/interfaces/TextAreaFlow.js +1 -0
  221. package/dist/esm/textarea/interfaces/TextAreaFocusEvent.d.ts +5 -0
  222. package/dist/esm/textarea/interfaces/TextAreaFocusEvent.js +1 -0
  223. package/dist/esm/textarea/interfaces/TextAreaProps.d.ts +170 -0
  224. package/dist/esm/textarea/interfaces/TextAreaProps.js +1 -0
  225. package/dist/esm/textarea/interfaces/TextAreaResize.d.ts +10 -0
  226. package/dist/esm/textarea/interfaces/TextAreaResize.js +1 -0
  227. package/dist/npm/checkbox/Checkbox.js +12 -12
  228. package/dist/npm/colors/ColorContrastLabels.js +5 -5
  229. package/dist/npm/colors/ColorContrastSvg.js +4 -4
  230. package/dist/npm/colors/ColorGradient.js +42 -42
  231. package/dist/npm/colors/ColorInput.js +2 -2
  232. package/dist/npm/colors/ColorPalette.js +12 -12
  233. package/dist/npm/colors/ColorPicker.js +15 -15
  234. package/dist/npm/colors/FlatColorPicker.js +10 -10
  235. package/dist/npm/colors/HexInput.js +4 -4
  236. package/dist/npm/colors/Picker.js +2 -2
  237. package/dist/npm/colors/utils/color-palette.service.js +6 -6
  238. package/dist/npm/colors/utils/color-parser.js +48 -37
  239. package/dist/npm/colors/utils/misc.js +5 -3
  240. package/dist/npm/colors/utils/svg-calc.js +12 -8
  241. package/dist/npm/input/Input.js +4 -4
  242. package/dist/npm/input-separator/InputSeparator.js +1 -1
  243. package/dist/npm/main.js +7 -2
  244. package/dist/npm/maskedtextbox/MaskedTextBox.js +8 -8
  245. package/dist/npm/maskedtextbox/masking.service.js +19 -19
  246. package/dist/npm/maskedtextbox/parsing/combinators.js +4 -2
  247. package/dist/npm/maskedtextbox/parsing/parsers.js +14 -7
  248. package/dist/npm/maskedtextbox/parsing/result.js +1 -1
  249. package/dist/npm/numerictextbox/NumericTextBox.js +22 -22
  250. package/dist/npm/numerictextbox/utils/index.js +145 -116
  251. package/dist/npm/package-metadata.js +1 -1
  252. package/dist/npm/radiobutton/RadioButton.js +8 -8
  253. package/dist/npm/radiobutton/RadioGroup.js +5 -5
  254. package/dist/npm/range-slider/RangeSlider.js +17 -17
  255. package/dist/npm/range-slider/range-raducer.js +4 -2
  256. package/dist/npm/slider/Slider.js +7 -7
  257. package/dist/npm/slider/SliderLabel.js +3 -3
  258. package/dist/npm/switch/Switch.js +13 -13
  259. package/dist/npm/switch/util.js +2 -1
  260. package/dist/npm/textarea/TextArea.js +7 -7
  261. package/package.json +17 -11
@@ -0,0 +1,145 @@
1
+ import { parseColor as parse, Color } from '@progress/kendo-drawing';
2
+ import { isPresent, fitIntoBounds } from './misc.js';
3
+ /**
4
+ * @hidden
5
+ *
6
+ * Returns the hex or RGBA string representation of the color.
7
+ */
8
+ export var parseColor = function (value, format, opacityEnabled, safe) {
9
+ if (opacityEnabled === void 0) { opacityEnabled = false; }
10
+ if (safe === void 0) { safe = true; }
11
+ var allowedFormats = ['hex', 'rgba']; // TODO: constant?
12
+ // Angular supports third type: name : const allowedFormats: Array<string> = ['hex', 'rgba', 'name'];
13
+ if (allowedFormats.indexOf(format) === -1) {
14
+ throw new Error("Unsupported color output format '".concat(format, "'. The available options are 'hex' or 'rgba'."));
15
+ }
16
+ if (!isPresent(value)) {
17
+ return;
18
+ }
19
+ var parsedColor = parse(value.trim(), safe);
20
+ if (!isPresent(parsedColor)) {
21
+ return;
22
+ }
23
+ return format === 'hex' ? getHexValue(parsedColor, opacityEnabled) : parsedColor.toCssRgba();
24
+ };
25
+ /**
26
+ * @hidden
27
+ *
28
+ * Returns the HEX value.
29
+ */
30
+ export var getHexValue = function (color, opacity) {
31
+ return opacity && color.a < 1 ? color.toCss({ alpha: true }) : color.toCss();
32
+ };
33
+ /**
34
+ * @hidden
35
+ *
36
+ * Returns an HSV object representation of the color string.
37
+ */
38
+ export var getHSV = function (value, safe) {
39
+ if (safe === void 0) { safe = true; }
40
+ var parsed = parse(value, safe);
41
+ if (!isPresent(parsed)) {
42
+ return {};
43
+ }
44
+ return parsed.toHSV();
45
+ };
46
+ /**
47
+ * @hidden
48
+ *
49
+ * Returns an RGBA object representation of the color string.
50
+ */
51
+ export var getRGBA = function (value, safe) {
52
+ if (safe === void 0) { safe = true; }
53
+ var parsed = parse(value, safe);
54
+ if (!isPresent(parsed)) {
55
+ return {};
56
+ }
57
+ return parsed.toBytes();
58
+ };
59
+ /**
60
+ * @hidden
61
+ *
62
+ * Returns the RGBA string representation of the color.
63
+ */
64
+ export var getColorFromHSV = function (hsva) {
65
+ var hue = fitIntoBounds(hsva.h, 0, 359.9);
66
+ var saturation = fitIntoBounds(hsva.s, 0, 1);
67
+ var value = fitIntoBounds(hsva.v, 0, 1);
68
+ var alpha = fitIntoBounds(hsva.a, 0, 1);
69
+ return Color.fromHSV(hue, saturation, value, alpha).toCssRgba();
70
+ };
71
+ /**
72
+ * @hidden
73
+ *
74
+ * Returns the RGBA string representation of the color based on the `hue` and
75
+ * assuming the `value`, `saturation`, and `alpha` have a value of `1`.
76
+ */
77
+ export var getColorFromHue = function (hue) {
78
+ return getColorFromHSV({ h: hue, s: 1, v: 1, a: 1 });
79
+ };
80
+ /**
81
+ * @hidden
82
+ *
83
+ * Returns the RGBA string representation of the color.
84
+ */
85
+ export var getColorFromRGBA = function (rgba) {
86
+ var red = fitIntoBounds(rgba.r, 0, 255);
87
+ var green = fitIntoBounds(rgba.g, 0, 255);
88
+ var blue = fitIntoBounds(rgba.b, 0, 255);
89
+ var alpha = fitIntoBounds(rgba.a, 0, 1);
90
+ return Color.fromBytes(red, green, blue, alpha).toCssRgba();
91
+ };
92
+ /**
93
+ * @hidden
94
+ *
95
+ * Returns the RGB object representation of the color based on the background color.
96
+ */
97
+ export var getRGBFromRGBA = function (foregroundColor, backgroundColor) {
98
+ var r1 = fitIntoBounds(foregroundColor.r, 0, 255);
99
+ var g1 = fitIntoBounds(foregroundColor.g, 0, 255);
100
+ var b1 = fitIntoBounds(foregroundColor.b, 0, 255);
101
+ var a1 = fitIntoBounds(foregroundColor.a, 0, 1);
102
+ var r2 = fitIntoBounds(backgroundColor.r, 0, 255);
103
+ var g2 = fitIntoBounds(backgroundColor.g, 0, 255);
104
+ var b2 = fitIntoBounds(backgroundColor.b, 0, 255);
105
+ return {
106
+ r: Math.round(((1 - a1) * r2) + (a1 * r1)),
107
+ g: Math.round(((1 - a1) * g2) + (a1 * g1)),
108
+ b: Math.round(((1 - a1) * b2) + (a1 * b1))
109
+ };
110
+ };
111
+ /**
112
+ * @hidden
113
+ *
114
+ * Returns the relative luminance.
115
+ */
116
+ export var getLuminance = function (rgb) {
117
+ // @ts-ignore
118
+ var a = [rgb.r, rgb.g, rgb.b].map(function (v) {
119
+ v /= 255;
120
+ return v <= 0.03928
121
+ ? v / 12.92
122
+ : Math.pow((v + 0.055) / 1.055, 2.4);
123
+ });
124
+ // @ts-ignore
125
+ return a[0] * 0.2126 + a[1] * 0.7152 + a[2] * 0.0722;
126
+ };
127
+ /**
128
+ * @hidden
129
+ *
130
+ * Returns the color contrast.
131
+ */
132
+ export var getContrast = function (luminance1, luminance2) {
133
+ var brightest = Math.max(luminance1, luminance2);
134
+ var darkest = Math.min(luminance1, luminance2);
135
+ return (brightest + 0.05)
136
+ / (darkest + 0.05);
137
+ };
138
+ /**
139
+ * @hidden
140
+ *
141
+ * Returns the color contrast from two RGBA colors.
142
+ */
143
+ export var getContrastFromTwoRGBAs = function (a, b) {
144
+ return getContrast(getLuminance(getRGBFromRGBA(a, b)), getLuminance(getRGBFromRGBA(b, { r: 0, g: 0, b: 0, a: 1 })));
145
+ };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @hidden
3
+ */
4
+ export declare const isPresent: (value: any) => boolean;
5
+ /**
6
+ * @hidden
7
+ *
8
+ * Fits the contender number into the specified bounds.
9
+ * If the number is NaN or null, the minimum is returned.
10
+ *
11
+ * @param contender Represents the number you want to fit into the specified bounds.
12
+ * @param min The inclusive lower bound number.
13
+ * @param max The inclusive upper bound number.
14
+ */
15
+ export declare const fitIntoBounds: (contender: number | undefined, min: number, max: number) => number;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @hidden
3
+ */
4
+ export var isPresent = function (value) { return value !== null && value !== undefined; };
5
+ /**
6
+ * @hidden
7
+ *
8
+ * Fits the contender number into the specified bounds.
9
+ * If the number is NaN or null, the minimum is returned.
10
+ *
11
+ * @param contender Represents the number you want to fit into the specified bounds.
12
+ * @param min The inclusive lower bound number.
13
+ * @param max The inclusive upper bound number.
14
+ */
15
+ export var fitIntoBounds = function (contender, min, max) {
16
+ if (!isPresent(contender) || isNaN(contender)) {
17
+ return min;
18
+ }
19
+ return contender <= min ? min : contender >= max ? max : contender;
20
+ };
@@ -0,0 +1,62 @@
1
+ /**
2
+ * @hidden
3
+ *
4
+ * Render the svg <path> element.
5
+ *
6
+ * @param points (array) Represents the points coordinates as an array of tuples.
7
+ * @param command (function) The command that is used (bezierCommand, lineCommand).
8
+ * @param point (array) [x,y] Represents the current point coordinates.
9
+ * @param i (integer) Represents the index of 'point' in the array 'a'.
10
+ * @param a (array) Represents the complete array of points coordinates.
11
+ * @output (string) a svg path command.
12
+ * @output (string) a Svg <path> element
13
+ */
14
+ export declare const svgPath: (points: number[][], command: Function) => string;
15
+ /**
16
+ * @hidden
17
+ *
18
+ * Returns the properties of a line.
19
+ *
20
+ * @param pointA (array) [x,y] Represents the start point coordinates.
21
+ * @param pointB (array) [x,y] Represents the end point coordinates.
22
+ * @output (object) { length: (integer), angle: (integer) }
23
+ */
24
+ export declare const line: (pointA: number[], pointB: number[]) => {
25
+ length: number;
26
+ angle: number;
27
+ };
28
+ /**
29
+ * @hidden
30
+ *
31
+ * Create a function to calculate the position of the control point.
32
+ *
33
+ * @param lineCalc (function) Represents the line function.
34
+ * @param pointA (array) [x,y] Represents the start point coordinates.
35
+ * @param pointB (array) [x,y] Represents the end point coordinates.
36
+ * @output (object) { length: (integer), angle: (integer) }
37
+ * @output (function) closure.
38
+ * @param current (array) [x, y] Represents the current point coordinates.
39
+ * @param previous (array) [x, y] Represents the previous point coordinates.
40
+ * @param next (array) [x, y] ]Represents the next point coordinates.
41
+ * @param reverse (boolean, optional) Sets the direction.
42
+ * @output (array) [x, y] coordinates of a control point.
43
+ */
44
+ export declare const controlPoint: (lineCalc: Function) => (current: number[], previous: number[], next: number[], reverse?: boolean) => number[];
45
+ /**
46
+ * @hidden
47
+ *
48
+ * Create a function to calculate a bezier curve command.
49
+ *
50
+ * @param controlPointCalc (function) Represents the controlPoint function.
51
+ * @param current (array) [x, y] Represents the current point coordinates.
52
+ * @param previous (array) [x, y] Represents the previous point coordinates.
53
+ * @param next (array) [x, y] ]Represents the next point coordinates.
54
+ * @param reverse (boolean, optional) Sets the direction.
55
+ * @output (array) [x, y] coordinates of a control point.
56
+ * @output (function) closure.
57
+ * @param point (array) [x,y] Represents the current point coordinates.
58
+ * @param i (integer) Represents the index of 'point' in the array 'a'.
59
+ * @param a (array) Represents the complete array of points coordinates.
60
+ * @output (string) 'C x2,y2 x1,y1 x,y' Cubic bezier command.
61
+ */
62
+ export declare const bezierCommand: (controlPointCalc: Function) => (point: number[], i: number, a: number[]) => string;
@@ -0,0 +1,103 @@
1
+ /**
2
+ * @hidden
3
+ *
4
+ * Render the svg <path> element.
5
+ *
6
+ * @param points (array) Represents the points coordinates as an array of tuples.
7
+ * @param command (function) The command that is used (bezierCommand, lineCommand).
8
+ * @param point (array) [x,y] Represents the current point coordinates.
9
+ * @param i (integer) Represents the index of 'point' in the array 'a'.
10
+ * @param a (array) Represents the complete array of points coordinates.
11
+ * @output (string) a svg path command.
12
+ * @output (string) a Svg <path> element
13
+ */
14
+ export var svgPath = function (points, command) {
15
+ if (points.length === 0) {
16
+ return '';
17
+ }
18
+ // build the d attributes by looping over the points
19
+ var d = points.reduce(function (acc, point, i, a) {
20
+ return i === 0 ?
21
+ // if first point
22
+ "M ".concat(point[0], ",").concat(point[1]) :
23
+ // else
24
+ "".concat(acc, " ").concat(command(point, i, a));
25
+ }, '');
26
+ return "<path d=\"".concat(d, "\" fill=\"none\" stroke=\"white\" stroke-width=\"1\"/>");
27
+ };
28
+ /**
29
+ * @hidden
30
+ *
31
+ * Returns the properties of a line.
32
+ *
33
+ * @param pointA (array) [x,y] Represents the start point coordinates.
34
+ * @param pointB (array) [x,y] Represents the end point coordinates.
35
+ * @output (object) { length: (integer), angle: (integer) }
36
+ */
37
+ export var line = function (pointA, pointB) {
38
+ var lengthX = pointB[0] - pointA[0];
39
+ var lengthY = pointB[1] - pointA[1];
40
+ return {
41
+ length: Math.sqrt(Math.pow(lengthX, 2) + Math.pow(lengthY, 2)),
42
+ angle: Math.atan2(lengthY, lengthX)
43
+ };
44
+ };
45
+ /**
46
+ * @hidden
47
+ *
48
+ * Create a function to calculate the position of the control point.
49
+ *
50
+ * @param lineCalc (function) Represents the line function.
51
+ * @param pointA (array) [x,y] Represents the start point coordinates.
52
+ * @param pointB (array) [x,y] Represents the end point coordinates.
53
+ * @output (object) { length: (integer), angle: (integer) }
54
+ * @output (function) closure.
55
+ * @param current (array) [x, y] Represents the current point coordinates.
56
+ * @param previous (array) [x, y] Represents the previous point coordinates.
57
+ * @param next (array) [x, y] ]Represents the next point coordinates.
58
+ * @param reverse (boolean, optional) Sets the direction.
59
+ * @output (array) [x, y] coordinates of a control point.
60
+ */
61
+ export var controlPoint = function (lineCalc) {
62
+ return function (current, previous, next, reverse) {
63
+ // when 'current' is the first or last point of the array
64
+ // 'previous' and 'next' are undefined
65
+ // replace with 'current'
66
+ var p = previous || current;
67
+ var n = next || current;
68
+ var smooth = 0.1;
69
+ // properties of the line between previous and next
70
+ var l = lineCalc(p, n);
71
+ // If is end-control-point, add PI to the angle to go backward
72
+ var angle = l.angle + (reverse ? Math.PI : 0);
73
+ var length = l.length * smooth;
74
+ // The control point position is relative to the current point
75
+ var x = current[0] + Math.cos(angle) * length;
76
+ var y = current[1] + Math.sin(angle) * length;
77
+ return [x, y];
78
+ };
79
+ };
80
+ /**
81
+ * @hidden
82
+ *
83
+ * Create a function to calculate a bezier curve command.
84
+ *
85
+ * @param controlPointCalc (function) Represents the controlPoint function.
86
+ * @param current (array) [x, y] Represents the current point coordinates.
87
+ * @param previous (array) [x, y] Represents the previous point coordinates.
88
+ * @param next (array) [x, y] ]Represents the next point coordinates.
89
+ * @param reverse (boolean, optional) Sets the direction.
90
+ * @output (array) [x, y] coordinates of a control point.
91
+ * @output (function) closure.
92
+ * @param point (array) [x,y] Represents the current point coordinates.
93
+ * @param i (integer) Represents the index of 'point' in the array 'a'.
94
+ * @param a (array) Represents the complete array of points coordinates.
95
+ * @output (string) 'C x2,y2 x1,y1 x,y' Cubic bezier command.
96
+ */
97
+ export var bezierCommand = function (controlPointCalc) { return function (point, i, a) {
98
+ // start control point
99
+ var _a = controlPointCalc(a[i - 1], a[i - 2], point), cpsX = _a[0], cpsY = _a[1];
100
+ // end control point
101
+ var _b = controlPointCalc(point, a[i - 1], a[i + 1], true), cpeX = _b[0], cpeY = _b[1];
102
+ return "C ".concat(cpsX, ",").concat(cpsY, " ").concat(cpeX, ",").concat(cpeY, " ").concat(point[0], ",").concat(point[1]);
103
+ }; };
@@ -0,0 +1,189 @@
1
+ import { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type } from '../additionalTypes';
2
+ import { FormComponentProps } from '@progress/kendo-vue-common';
3
+ declare type DefaultData<V> = object | ((this: V) => InputData);
4
+ declare type DefaultMethods<V> = {
5
+ [key: string]: (this: V, ...args: any[]) => any;
6
+ };
7
+ /**
8
+ * Represents the props of the [KendoVue Input component]({% slug overview_textbox %}).
9
+ * Extends the [native input props](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement).
10
+ */
11
+ export interface InputProps extends FormComponentProps {
12
+ /**
13
+ * Renders a floating label for the Input component.
14
+ */
15
+ id?: string;
16
+ label?: string;
17
+ value?: string | string[] | number;
18
+ modelValue?: string | number;
19
+ defaultValue?: string | string[] | number | undefined;
20
+ disabled?: boolean;
21
+ validate?: boolean;
22
+ /**
23
+ * Configures the `size` of the MaskedTextBox.
24
+ *
25
+ * The available options are:
26
+ * - small
27
+ * - medium
28
+ * - large
29
+ * - null&mdash;Does not set a size `class`.
30
+ *
31
+ * @default `medium`
32
+ */
33
+ size?: null | 'small' | 'medium' | 'large' | string;
34
+ /**
35
+ * Configures the `roundness` of the MaskedTextBox.
36
+ *
37
+ * The available options are:
38
+ * - small
39
+ * - medium
40
+ * - large
41
+ * - full
42
+ * - null&mdash;Does not set a rounded `class`.
43
+ *
44
+ * @default `medium`
45
+ */
46
+ rounded?: null | 'small' | 'medium' | 'large' | 'full' | string;
47
+ /**
48
+ * Configures the `fillMode` of the MaskedTextBox.
49
+ *
50
+ * The available options are:
51
+ * - solid
52
+ * - outline
53
+ * - flat
54
+ * - null&mdash;Does not set a fillMode `class`.
55
+ *
56
+ * @default `solid`
57
+ */
58
+ fillMode?: null | 'solid' | 'flat' | 'outline' | string;
59
+ dir?: string;
60
+ /**
61
+ * Fires when the `change` event of the input is triggered.
62
+ */
63
+ onChange?: (event: any) => void;
64
+ /**
65
+ * Fires when the `input` event of the input is triggered.
66
+ */
67
+ onInput?: (event: any) => void;
68
+ /**
69
+ * Fires when the input is focused.
70
+ */
71
+ onFocus?: (event: any) => void;
72
+ /**
73
+ * Fires when the input is blurred.
74
+ */
75
+ onBlur?: (event: any) => void;
76
+ /**
77
+ * Fires when the 'keyup' input event is triggered.
78
+ */
79
+ onKeyup?: (event: any) => void;
80
+ /**
81
+ * Fires when the 'keydown' input event is triggered.
82
+ */
83
+ onKeydown?: (event: any) => void;
84
+ /**
85
+ * Fires when the 'keypress' input event is triggered.
86
+ */
87
+ onKeypress?: (event: any) => void;
88
+ /**
89
+ * Specifies the placeholder of an `input` element. Used to define if the input is empty.
90
+ */
91
+ placeholder?: string;
92
+ /**
93
+ * Defines a string prop that controls the input icon.
94
+ */
95
+ iconName?: String;
96
+ /**
97
+ * Defines if the inputPrefix will be shown. Accepts a slot name, a `render` function, or a Vue component.
98
+ */
99
+ inputPrefix?: Boolean | String | Object | Function;
100
+ /**
101
+ * Defines if the inputSuffix will be shown. Accepts a slot name, a `render` function, or a Vue component.
102
+ */
103
+ inputSuffix?: Boolean | String | Object | Function;
104
+ /**
105
+ * Defines a boolean prop that controls whether to show the validation icon. Defaults to 'false'.
106
+ */
107
+ showValidationIcon?: Boolean;
108
+ /**
109
+ * Defines a boolean prop that controls whether to show the loading icon. Defaults to 'false'.
110
+ */
111
+ showLoadingIcon?: Boolean;
112
+ /**
113
+ * Defines a boolean prop that controls whether to show the clear icon. Defaults to 'false'.
114
+ */
115
+ showClearButton?: Boolean;
116
+ /**
117
+ * Defines additional class to the wrapper element.
118
+ */
119
+ wrapperClass?: String;
120
+ /**
121
+ * Defines tabindex to the input element.
122
+ */
123
+ tabIndex?: Number;
124
+ /**
125
+ * Defines additional class to the input element.
126
+ */
127
+ inputClass?: String;
128
+ }
129
+ /**
130
+ * @hidden
131
+ */
132
+ export interface InputData {
133
+ hasMounted?: boolean;
134
+ autofill?: boolean;
135
+ currentValue?: string | string[] | number;
136
+ valueDuringOnChange?: string;
137
+ focused?: boolean;
138
+ }
139
+ /**
140
+ * @hidden
141
+ */
142
+ export interface InputState {
143
+ inputRef: any;
144
+ _input: any;
145
+ _inputId?: string;
146
+ v3: boolean;
147
+ }
148
+ /**
149
+ * @hidden
150
+ */
151
+ export interface InputMethods {
152
+ [key: string]: any;
153
+ emitBlur?: (_: any) => void;
154
+ emitFocus?: (_: any) => void;
155
+ focus?: () => void;
156
+ validity: () => any;
157
+ isInvalid: (state: any) => any;
158
+ setValidity: () => void;
159
+ handleInput?: () => void;
160
+ handleChange: (event: any) => void;
161
+ handleKeyup?: (event: any) => void;
162
+ handleKeydown?: (event: any) => void;
163
+ handleKeypress?: (event: any) => void;
164
+ handleAutoFill?: (e: any) => void;
165
+ handleAutoFillEnd?: (e: any) => void;
166
+ inputWrapperClass: () => any;
167
+ }
168
+ /**
169
+ * @hidden
170
+ */
171
+ export interface InputComputed {
172
+ [key: string]: any;
173
+ computedValue?: any;
174
+ spanClassNames?: any;
175
+ }
176
+ /**
177
+ * @hidden
178
+ */
179
+ export interface InputAllMethods extends Vue2type, InputMethods, InputComputed, InputState {
180
+ }
181
+ /**
182
+ * @hidden
183
+ */
184
+ declare let InputVue2: ComponentOptions<InputAllMethods, DefaultData<InputData>, DefaultMethods<InputAllMethods>, InputComputed, RecordPropsDefinition<InputProps>>;
185
+ /**
186
+ * @hidden
187
+ */
188
+ declare const Input: DefineComponent<InputProps, any, InputData, InputComputed, InputMethods, {}, {}, {}, string, InputProps, InputProps, {}>;
189
+ export { Input, InputVue2 };