@progress/kendo-vue-inputs 2.7.0 → 2.7.2-dev.202201020746

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 (144) hide show
  1. package/dist/cdn/js/kendo-vue-inputs.js +1 -1
  2. package/dist/es/colors/ColorPalette.d.ts +55 -0
  3. package/dist/es/colors/ColorPalette.js +340 -0
  4. package/dist/es/colors/ColorPicker.d.ts +52 -0
  5. package/dist/es/colors/ColorPicker.js +382 -0
  6. package/dist/es/colors/Picker.d.ts +41 -0
  7. package/dist/es/colors/Picker.js +94 -0
  8. package/dist/es/colors/interfaces/ColorPaletteChangeEvent.d.ts +13 -0
  9. package/dist/es/colors/interfaces/ColorPaletteChangeEvent.js +0 -0
  10. package/dist/es/colors/interfaces/ColorPaletteProps.d.ts +75 -0
  11. package/dist/es/colors/interfaces/ColorPaletteProps.js +0 -0
  12. package/dist/es/colors/interfaces/ColorPickerActiveColorClick.d.ts +13 -0
  13. package/dist/es/colors/interfaces/ColorPickerActiveColorClick.js +0 -0
  14. package/dist/es/colors/interfaces/ColorPickerBlurEvent.d.ts +9 -0
  15. package/dist/es/colors/interfaces/ColorPickerBlurEvent.js +0 -0
  16. package/dist/es/colors/interfaces/ColorPickerChangeEvent.d.ts +13 -0
  17. package/dist/es/colors/interfaces/ColorPickerChangeEvent.js +0 -0
  18. package/dist/es/colors/interfaces/ColorPickerFocusEvent.d.ts +9 -0
  19. package/dist/es/colors/interfaces/ColorPickerFocusEvent.js +0 -0
  20. package/dist/es/colors/interfaces/ColorPickerPaletteSettings.d.ts +32 -0
  21. package/dist/es/colors/interfaces/ColorPickerPaletteSettings.js +0 -0
  22. package/dist/es/colors/interfaces/ColorPickerPopupSettings.d.ts +14 -0
  23. package/dist/es/colors/interfaces/ColorPickerPopupSettings.js +0 -0
  24. package/dist/es/colors/interfaces/ColorPickerProps.d.ts +142 -0
  25. package/dist/es/colors/interfaces/ColorPickerProps.js +0 -0
  26. package/dist/es/colors/interfaces/ColorPickerView.d.ts +10 -0
  27. package/dist/es/colors/interfaces/ColorPickerView.js +0 -0
  28. package/dist/es/colors/interfaces/PickerPopupSettings.d.ts +14 -0
  29. package/dist/es/colors/interfaces/PickerPopupSettings.js +0 -0
  30. package/dist/es/colors/interfaces/PickerProps.d.ts +42 -0
  31. package/dist/es/colors/interfaces/PickerProps.js +0 -0
  32. package/dist/es/colors/models/hsva.d.ts +9 -0
  33. package/dist/es/colors/models/hsva.js +0 -0
  34. package/dist/es/colors/models/output-format.d.ts +4 -0
  35. package/dist/es/colors/models/output-format.js +0 -0
  36. package/dist/es/colors/models/palette-presets.d.ts +53 -0
  37. package/dist/es/colors/models/palette-presets.js +54 -0
  38. package/dist/es/colors/models/rgb.d.ts +8 -0
  39. package/dist/es/colors/models/rgb.js +0 -0
  40. package/dist/es/colors/models/rgba.d.ts +9 -0
  41. package/dist/es/colors/models/rgba.js +0 -0
  42. package/dist/es/colors/models/table-cell.d.ts +7 -0
  43. package/dist/es/colors/models/table-cell.js +0 -0
  44. package/dist/es/colors/models/tile-size.d.ts +11 -0
  45. package/dist/es/colors/models/tile-size.js +0 -0
  46. package/dist/es/colors/utils/color-cache.d.ts +30 -0
  47. package/dist/es/colors/utils/color-cache.js +61 -0
  48. package/dist/es/colors/utils/color-palette.service.d.ts +12 -0
  49. package/dist/es/colors/utils/color-palette.service.js +76 -0
  50. package/dist/es/colors/utils/color-parser.d.ts +65 -0
  51. package/dist/es/colors/utils/color-parser.js +136 -0
  52. package/dist/es/colors/utils/misc.d.ts +15 -0
  53. package/dist/es/colors/utils/misc.js +20 -0
  54. package/dist/es/colors/utils/svg-calc.d.ts +62 -0
  55. package/dist/es/colors/utils/svg-calc.js +103 -0
  56. package/dist/es/main.d.ts +15 -0
  57. package/dist/es/main.js +15 -0
  58. package/dist/es/package-metadata.js +1 -1
  59. package/dist/es/switch/Switch.d.ts +131 -0
  60. package/dist/es/switch/Switch.js +307 -0
  61. package/dist/es/switch/util.d.ts +8 -0
  62. package/dist/es/switch/util.js +46 -0
  63. package/dist/es/textarea/TextArea.d.ts +46 -0
  64. package/dist/es/textarea/TextArea.js +251 -0
  65. package/dist/es/textarea/interfaces/TextAreaBlurEvent.d.ts +5 -0
  66. package/dist/es/textarea/interfaces/TextAreaBlurEvent.js +0 -0
  67. package/dist/es/textarea/interfaces/TextAreaChangeEvent.d.ts +9 -0
  68. package/dist/es/textarea/interfaces/TextAreaChangeEvent.js +0 -0
  69. package/dist/es/textarea/interfaces/TextAreaFocusEvent.d.ts +5 -0
  70. package/dist/es/textarea/interfaces/TextAreaFocusEvent.js +0 -0
  71. package/dist/es/textarea/interfaces/TextAreaProps.d.ts +84 -0
  72. package/dist/es/textarea/interfaces/TextAreaProps.js +0 -0
  73. package/dist/npm/colors/ColorPalette.d.ts +55 -0
  74. package/dist/npm/colors/ColorPalette.js +355 -0
  75. package/dist/npm/colors/ColorPicker.d.ts +52 -0
  76. package/dist/npm/colors/ColorPicker.js +395 -0
  77. package/dist/npm/colors/Picker.d.ts +41 -0
  78. package/dist/npm/colors/Picker.js +105 -0
  79. package/dist/npm/colors/interfaces/ColorPaletteChangeEvent.d.ts +13 -0
  80. package/dist/npm/colors/interfaces/ColorPaletteChangeEvent.js +2 -0
  81. package/dist/npm/colors/interfaces/ColorPaletteProps.d.ts +75 -0
  82. package/dist/npm/colors/interfaces/ColorPaletteProps.js +2 -0
  83. package/dist/npm/colors/interfaces/ColorPickerActiveColorClick.d.ts +13 -0
  84. package/dist/npm/colors/interfaces/ColorPickerActiveColorClick.js +2 -0
  85. package/dist/npm/colors/interfaces/ColorPickerBlurEvent.d.ts +9 -0
  86. package/dist/npm/colors/interfaces/ColorPickerBlurEvent.js +2 -0
  87. package/dist/npm/colors/interfaces/ColorPickerChangeEvent.d.ts +13 -0
  88. package/dist/npm/colors/interfaces/ColorPickerChangeEvent.js +2 -0
  89. package/dist/npm/colors/interfaces/ColorPickerFocusEvent.d.ts +9 -0
  90. package/dist/npm/colors/interfaces/ColorPickerFocusEvent.js +2 -0
  91. package/dist/npm/colors/interfaces/ColorPickerPaletteSettings.d.ts +32 -0
  92. package/dist/npm/colors/interfaces/ColorPickerPaletteSettings.js +2 -0
  93. package/dist/npm/colors/interfaces/ColorPickerPopupSettings.d.ts +14 -0
  94. package/dist/npm/colors/interfaces/ColorPickerPopupSettings.js +2 -0
  95. package/dist/npm/colors/interfaces/ColorPickerProps.d.ts +142 -0
  96. package/dist/npm/colors/interfaces/ColorPickerProps.js +2 -0
  97. package/dist/npm/colors/interfaces/ColorPickerView.d.ts +10 -0
  98. package/dist/npm/colors/interfaces/ColorPickerView.js +2 -0
  99. package/dist/npm/colors/interfaces/PickerPopupSettings.d.ts +14 -0
  100. package/dist/npm/colors/interfaces/PickerPopupSettings.js +2 -0
  101. package/dist/npm/colors/interfaces/PickerProps.d.ts +42 -0
  102. package/dist/npm/colors/interfaces/PickerProps.js +2 -0
  103. package/dist/npm/colors/models/hsva.d.ts +9 -0
  104. package/dist/npm/colors/models/hsva.js +2 -0
  105. package/dist/npm/colors/models/output-format.d.ts +4 -0
  106. package/dist/npm/colors/models/output-format.js +2 -0
  107. package/dist/npm/colors/models/palette-presets.d.ts +53 -0
  108. package/dist/npm/colors/models/palette-presets.js +57 -0
  109. package/dist/npm/colors/models/rgb.d.ts +8 -0
  110. package/dist/npm/colors/models/rgb.js +2 -0
  111. package/dist/npm/colors/models/rgba.d.ts +9 -0
  112. package/dist/npm/colors/models/rgba.js +2 -0
  113. package/dist/npm/colors/models/table-cell.d.ts +7 -0
  114. package/dist/npm/colors/models/table-cell.js +2 -0
  115. package/dist/npm/colors/models/tile-size.d.ts +11 -0
  116. package/dist/npm/colors/models/tile-size.js +2 -0
  117. package/dist/npm/colors/utils/color-cache.d.ts +30 -0
  118. package/dist/npm/colors/utils/color-cache.js +71 -0
  119. package/dist/npm/colors/utils/color-palette.service.d.ts +12 -0
  120. package/dist/npm/colors/utils/color-palette.service.js +79 -0
  121. package/dist/npm/colors/utils/color-parser.d.ts +65 -0
  122. package/dist/npm/colors/utils/color-parser.js +139 -0
  123. package/dist/npm/colors/utils/misc.d.ts +15 -0
  124. package/dist/npm/colors/utils/misc.js +23 -0
  125. package/dist/npm/colors/utils/svg-calc.d.ts +62 -0
  126. package/dist/npm/colors/utils/svg-calc.js +106 -0
  127. package/dist/npm/main.d.ts +15 -0
  128. package/dist/npm/main.js +17 -0
  129. package/dist/npm/package-metadata.js +1 -1
  130. package/dist/npm/switch/Switch.d.ts +131 -0
  131. package/dist/npm/switch/Switch.js +320 -0
  132. package/dist/npm/switch/util.d.ts +8 -0
  133. package/dist/npm/switch/util.js +49 -0
  134. package/dist/npm/textarea/TextArea.d.ts +46 -0
  135. package/dist/npm/textarea/TextArea.js +261 -0
  136. package/dist/npm/textarea/interfaces/TextAreaBlurEvent.d.ts +5 -0
  137. package/dist/npm/textarea/interfaces/TextAreaBlurEvent.js +2 -0
  138. package/dist/npm/textarea/interfaces/TextAreaChangeEvent.d.ts +9 -0
  139. package/dist/npm/textarea/interfaces/TextAreaChangeEvent.js +2 -0
  140. package/dist/npm/textarea/interfaces/TextAreaFocusEvent.d.ts +5 -0
  141. package/dist/npm/textarea/interfaces/TextAreaFocusEvent.js +2 -0
  142. package/dist/npm/textarea/interfaces/TextAreaProps.d.ts +84 -0
  143. package/dist/npm/textarea/interfaces/TextAreaProps.js +5 -0
  144. package/package.json +13 -7
@@ -0,0 +1,65 @@
1
+ import { HSVA } from '../models/hsva';
2
+ import { OutputFormat } from '../models/output-format';
3
+ import { RGB } from '../models/rgb';
4
+ import { RGBA } from '../models/rgba';
5
+ /**
6
+ * @hidden
7
+ *
8
+ * Returns the hex or RGBA string representation of the color.
9
+ */
10
+ export declare const parseColor: (value: string, format: OutputFormat, safe?: boolean) => string | undefined;
11
+ /**
12
+ * @hidden
13
+ *
14
+ * Returns an HSV object representation of the color string.
15
+ */
16
+ export declare const getHSV: (value: string, safe?: boolean) => HSVA;
17
+ /**
18
+ * @hidden
19
+ *
20
+ * Returns an RGBA object representation of the color string.
21
+ */
22
+ export declare const getRGBA: (value: string, safe?: boolean) => RGBA;
23
+ /**
24
+ * @hidden
25
+ *
26
+ * Returns the RGBA string representation of the color.
27
+ */
28
+ export declare const getColorFromHSV: (hsva: HSVA) => string;
29
+ /**
30
+ * @hidden
31
+ *
32
+ * Returns the RGBA string representation of the color based on the `hue` and
33
+ * assuming the `value`, `saturation`, and `alpha` have a value of `1`.
34
+ */
35
+ export declare const getColorFromHue: (hue: number) => string;
36
+ /**
37
+ * @hidden
38
+ *
39
+ * Returns the RGBA string representation of the color.
40
+ */
41
+ export declare const getColorFromRGBA: (rgba: RGBA) => string;
42
+ /**
43
+ * @hidden
44
+ *
45
+ * Returns the RGB object representation of the color based on the background color.
46
+ */
47
+ export declare const getRGBFromRGBA: (foregroundColor: RGBA, backgroundColor: RGBA) => RGB;
48
+ /**
49
+ * @hidden
50
+ *
51
+ * Returns the relative luminance.
52
+ */
53
+ export declare const getLuminance: (rgb: RGB) => number;
54
+ /**
55
+ * @hidden
56
+ *
57
+ * Returns the color contrast.
58
+ */
59
+ export declare const getContrast: (luminance1: number, luminance2: number) => number;
60
+ /**
61
+ * @hidden
62
+ *
63
+ * Returns the color contrast from two RGBA colors.
64
+ */
65
+ export declare const getContrastFromTwoRGBAs: (a: RGBA, b: RGBA) => number;
@@ -0,0 +1,136 @@
1
+ import { parseColor as parse, Color } from '@progress/kendo-drawing';
2
+ import { isPresent, fitIntoBounds } from './misc';
3
+ /**
4
+ * @hidden
5
+ *
6
+ * Returns the hex or RGBA string representation of the color.
7
+ */
8
+ export var parseColor = function (value, format, safe) {
9
+ if (safe === void 0) { safe = true; }
10
+ var allowedFormats = ['hex', 'rgba']; // TODO: constant?
11
+ // Angular supports third type: name : const allowedFormats: Array<string> = ['hex', 'rgba', 'name'];
12
+ if (allowedFormats.indexOf(format) === -1) {
13
+ throw new Error("Unsupported color output format '" + format + "'. The available options are 'hex' or 'rgba'.");
14
+ }
15
+ if (!isPresent(value)) {
16
+ return;
17
+ }
18
+ var parsedColor = parse(value.trim(), safe);
19
+ if (!isPresent(parsedColor)) {
20
+ return;
21
+ }
22
+ return format === 'hex' ? parsedColor.toCss() : parsedColor.toCssRgba();
23
+ };
24
+ /**
25
+ * @hidden
26
+ *
27
+ * Returns an HSV object representation of the color string.
28
+ */
29
+ export var getHSV = function (value, safe) {
30
+ if (safe === void 0) { safe = true; }
31
+ var parsed = parse(value, safe);
32
+ if (!isPresent(parsed)) {
33
+ return {};
34
+ }
35
+ return parsed.toHSV();
36
+ };
37
+ /**
38
+ * @hidden
39
+ *
40
+ * Returns an RGBA object representation of the color string.
41
+ */
42
+ export var getRGBA = function (value, safe) {
43
+ if (safe === void 0) { safe = true; }
44
+ var parsed = parse(value, safe);
45
+ if (!isPresent(parsed)) {
46
+ return {};
47
+ }
48
+ return parsed.toBytes();
49
+ };
50
+ /**
51
+ * @hidden
52
+ *
53
+ * Returns the RGBA string representation of the color.
54
+ */
55
+ export var getColorFromHSV = function (hsva) {
56
+ var hue = fitIntoBounds(hsva.h, 0, 359.9);
57
+ var saturation = fitIntoBounds(hsva.s, 0, 1);
58
+ var value = fitIntoBounds(hsva.v, 0, 1);
59
+ var alpha = fitIntoBounds(hsva.a, 0, 1);
60
+ return Color.fromHSV(hue, saturation, value, alpha).toCssRgba();
61
+ };
62
+ /**
63
+ * @hidden
64
+ *
65
+ * Returns the RGBA string representation of the color based on the `hue` and
66
+ * assuming the `value`, `saturation`, and `alpha` have a value of `1`.
67
+ */
68
+ export var getColorFromHue = function (hue) {
69
+ return getColorFromHSV({ h: hue, s: 1, v: 1, a: 1 });
70
+ };
71
+ /**
72
+ * @hidden
73
+ *
74
+ * Returns the RGBA string representation of the color.
75
+ */
76
+ export var getColorFromRGBA = function (rgba) {
77
+ var red = fitIntoBounds(rgba.r, 0, 255);
78
+ var green = fitIntoBounds(rgba.g, 0, 255);
79
+ var blue = fitIntoBounds(rgba.b, 0, 255);
80
+ var alpha = fitIntoBounds(rgba.a, 0, 1);
81
+ return Color.fromBytes(red, green, blue, alpha).toCssRgba();
82
+ };
83
+ /**
84
+ * @hidden
85
+ *
86
+ * Returns the RGB object representation of the color based on the background color.
87
+ */
88
+ export var getRGBFromRGBA = function (foregroundColor, backgroundColor) {
89
+ var r1 = fitIntoBounds(foregroundColor.r, 0, 255);
90
+ var g1 = fitIntoBounds(foregroundColor.g, 0, 255);
91
+ var b1 = fitIntoBounds(foregroundColor.b, 0, 255);
92
+ var a1 = fitIntoBounds(foregroundColor.a, 0, 1);
93
+ var r2 = fitIntoBounds(backgroundColor.r, 0, 255);
94
+ var g2 = fitIntoBounds(backgroundColor.g, 0, 255);
95
+ var b2 = fitIntoBounds(backgroundColor.b, 0, 255);
96
+ return {
97
+ r: Math.round(((1 - a1) * r2) + (a1 * r1)),
98
+ g: Math.round(((1 - a1) * g2) + (a1 * g1)),
99
+ b: Math.round(((1 - a1) * b2) + (a1 * b1))
100
+ };
101
+ };
102
+ /**
103
+ * @hidden
104
+ *
105
+ * Returns the relative luminance.
106
+ */
107
+ export var getLuminance = function (rgb) {
108
+ // @ts-ignore
109
+ var a = [rgb.r, rgb.g, rgb.b].map(function (v) {
110
+ v /= 255;
111
+ return v <= 0.03928
112
+ ? v / 12.92
113
+ : Math.pow((v + 0.055) / 1.055, 2.4);
114
+ });
115
+ // @ts-ignore
116
+ return a[0] * 0.2126 + a[1] * 0.7152 + a[2] * 0.0722;
117
+ };
118
+ /**
119
+ * @hidden
120
+ *
121
+ * Returns the color contrast.
122
+ */
123
+ export var getContrast = function (luminance1, luminance2) {
124
+ var brightest = Math.max(luminance1, luminance2);
125
+ var darkest = Math.min(luminance1, luminance2);
126
+ return (brightest + 0.05)
127
+ / (darkest + 0.05);
128
+ };
129
+ /**
130
+ * @hidden
131
+ *
132
+ * Returns the color contrast from two RGBA colors.
133
+ */
134
+ export var getContrastFromTwoRGBAs = function (a, b) {
135
+ return getContrast(getLuminance(getRGBFromRGBA(a, b)), getLuminance(getRGBFromRGBA(b, { r: 0, g: 0, b: 0, a: 1 })));
136
+ };
@@ -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 " + point[0] + "," + point[1] :
23
+ // else
24
+ acc + " " + command(point, i, a);
25
+ }, '');
26
+ return "<path d=\"" + 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 " + cpsX + "," + cpsY + " " + cpeX + "," + cpeY + " " + point[0] + "," + point[1];
103
+ }; };
package/dist/es/main.d.ts CHANGED
@@ -1,5 +1,16 @@
1
1
  import { FormComponentValidity } from '@progress/kendo-vue-common';
2
2
  export { FormComponentValidity };
3
+ export { ColorPalette, ColorPaletteState } from './colors/ColorPalette';
4
+ export * from './colors/ColorPicker';
5
+ export * from './colors/interfaces/ColorPaletteChangeEvent';
6
+ export * from './colors/interfaces/ColorPaletteProps';
7
+ export * from './colors/interfaces/ColorPickerBlurEvent';
8
+ export * from './colors/interfaces/ColorPickerChangeEvent';
9
+ export * from './colors/interfaces/ColorPickerFocusEvent';
10
+ export * from './colors/interfaces/ColorPickerPaletteSettings';
11
+ export * from './colors/interfaces/ColorPickerPopupSettings';
12
+ export * from './colors/interfaces/ColorPickerProps';
13
+ export { Switch, SwitchProps, SwitchState, SwitchChangeEvent } from './switch/Switch';
3
14
  export * from './input/Input';
4
15
  export * from './numerictextbox/NumericTextBox';
5
16
  export * from './maskedtextbox/MaskedTextBox';
@@ -18,3 +29,7 @@ export * from './radiobutton/RadioButton';
18
29
  export * from './radiobutton/interfaces/RadioButtonProps';
19
30
  export * from './radiobutton/interfaces/RadioButtonChangeEvent';
20
31
  export * from './radiobutton/interfaces/RadioButtonFocusEvent';
32
+ export * from './textarea/TextArea';
33
+ export * from './textarea/interfaces/TextAreaProps';
34
+ export * from './textarea/interfaces/TextAreaChangeEvent';
35
+ export * from './textarea/interfaces/TextAreaFocusEvent';
package/dist/es/main.js CHANGED
@@ -1,3 +1,14 @@
1
+ export { ColorPalette } from './colors/ColorPalette';
2
+ export * from './colors/ColorPicker';
3
+ export * from './colors/interfaces/ColorPaletteChangeEvent';
4
+ export * from './colors/interfaces/ColorPaletteProps';
5
+ export * from './colors/interfaces/ColorPickerBlurEvent';
6
+ export * from './colors/interfaces/ColorPickerChangeEvent';
7
+ export * from './colors/interfaces/ColorPickerFocusEvent';
8
+ export * from './colors/interfaces/ColorPickerPaletteSettings';
9
+ export * from './colors/interfaces/ColorPickerPopupSettings';
10
+ export * from './colors/interfaces/ColorPickerProps';
11
+ export { Switch } from './switch/Switch';
1
12
  export * from './input/Input';
2
13
  export * from './numerictextbox/NumericTextBox';
3
14
  export * from './maskedtextbox/MaskedTextBox';
@@ -16,3 +27,7 @@ export * from './radiobutton/RadioButton';
16
27
  export * from './radiobutton/interfaces/RadioButtonProps';
17
28
  export * from './radiobutton/interfaces/RadioButtonChangeEvent';
18
29
  export * from './radiobutton/interfaces/RadioButtonFocusEvent';
30
+ export * from './textarea/TextArea';
31
+ export * from './textarea/interfaces/TextAreaProps';
32
+ export * from './textarea/interfaces/TextAreaChangeEvent';
33
+ export * from './textarea/interfaces/TextAreaFocusEvent';
@@ -5,7 +5,7 @@ export var packageMetadata = {
5
5
  name: '@progress/kendo-vue-inputs',
6
6
  productName: 'Kendo UI for Vue',
7
7
  productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
8
- publishDate: 1638944812,
8
+ publishDate: 1641108958,
9
9
  version: '',
10
10
  licensingDocsUrl: 'https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning'
11
11
  };
@@ -0,0 +1,131 @@
1
+ import { DefineComponent } from '../additionalTypes';
2
+ import { RecordPropsDefinition, ComponentOptions } from 'vue/types/options';
3
+ declare type DefaultData<V> = object | ((this: V) => {});
4
+ declare type DefaultMethods<V> = {
5
+ [key: string]: (this: V, ...args: any[]) => any;
6
+ };
7
+ import { FormComponentProps } from '@progress/kendo-vue-common';
8
+ import { ToggleBaseProps } from '../interfaces/ToggleBaseProps';
9
+ import { LocalizationService } from '@progress/kendo-vue-intl';
10
+ /**
11
+ * The arguments for the `onChange` Switch event.
12
+ */
13
+ export interface SwitchChangeEvent {
14
+ /**
15
+ * The new value of the Switch.
16
+ */
17
+ value: boolean;
18
+ }
19
+ /**
20
+ * Represents the props of the [Kendo UI for Vue Switch component]({% slug overview_switch %}).
21
+ */
22
+ export interface SwitchProps extends ToggleBaseProps, FormComponentProps {
23
+ /**
24
+ * Specifies the `accessKey` of the Switch.
25
+ */
26
+ accessKey?: string;
27
+ /**
28
+ * Sets the current value of the Switch ([see example]({% slug controlled_switch %})).
29
+ */
30
+ checked?: boolean;
31
+ /**
32
+ * Sets the `className` of the wrapping element of the Switch.
33
+ */
34
+ className?: string;
35
+ /**
36
+ * Sets the value of the Switch when it is initially displayed ([see example]({% slug default_state %})).
37
+ */
38
+ defaultChecked?: boolean;
39
+ /**
40
+ * Sets the default value of the Switch.
41
+ */
42
+ defaultValue?: any;
43
+ /**
44
+ * Disables the Switch when set to `true` ([see example]({% slug disabled_switch %})).
45
+ */
46
+ disabled?: boolean;
47
+ /**
48
+ * Sets the `dir` property of the wrapping element of the Switch.
49
+ */
50
+ dir?: string;
51
+ /**
52
+ * Sets the `id` of the Switch.
53
+ */
54
+ id?: string;
55
+ /**
56
+ * Identifies the element(s) which will describe the component, similar to [HTML aria-describedby attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-describedby_attribute).
57
+ * For example these elements could contain error or hint message.
58
+ */
59
+ ariaDescribedBy?: string;
60
+ /**
61
+ * Identifies the element(s) which will label the component.
62
+ */
63
+ ariaLabelledBy?: string;
64
+ /**
65
+ * Changes the **Off** label([see example]({% slug labels_switch %})).
66
+ */
67
+ offLabel?: string;
68
+ /**
69
+ * Fires each time the Switch gets blurred.
70
+ */
71
+ onBlur?: (event: any) => void;
72
+ /**
73
+ * Fires each time the user selects a new value ([see example]({% slug controlled_switch %})).
74
+ */
75
+ onChange?: (event: SwitchChangeEvent) => void;
76
+ /**
77
+ * Fires each time the Switch component gets focused.
78
+ */
79
+ onFocus?: (event: any) => void;
80
+ /**
81
+ * Changes the **On** label ([see example]({% slug labels_switch %})).
82
+ */
83
+ onLabel?: string;
84
+ /**
85
+ * Specifies the [`tabIndex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
86
+ */
87
+ tabIndex?: number;
88
+ /**
89
+ * Sets the value of the Switch. It can either be of the primitive (string, number, boolean) or of the complex (array) type.
90
+ */
91
+ value?: string | number | string[] | boolean | null;
92
+ modelValue?: string | number | string[] | boolean | null;
93
+ }
94
+ /**
95
+ * @hidden
96
+ */
97
+ export interface SwitchState {
98
+ _element: HTMLSpanElement | null;
99
+ _input: HTMLInputElement | null;
100
+ _id: string;
101
+ dir?: string;
102
+ defaultValidationMessage: LocalizationService;
103
+ eventTimeStamp?: number;
104
+ }
105
+ /**
106
+ * @hidden
107
+ */
108
+ export interface SwitchComputed {
109
+ }
110
+ /**
111
+ * @hidden
112
+ */
113
+ export interface SwitchMethods {
114
+ [key: string]: any;
115
+ }
116
+ /**
117
+ * @hidden
118
+ */
119
+ export interface SwitchData {
120
+ valueDuringOnChange?: boolean;
121
+ currentChecked: boolean;
122
+ focused: boolean;
123
+ }
124
+ /**
125
+ * @hidden
126
+ */
127
+ export interface SwitchAll extends Vue, SwitchMethods, SwitchData, SwitchComputed, SwitchState {
128
+ }
129
+ declare let Switch: ComponentOptions<SwitchAll, DefaultData<SwitchData>, DefaultMethods<SwitchAll>, SwitchComputed, RecordPropsDefinition<SwitchProps>>;
130
+ declare const SwitchVue3: DefineComponent<SwitchProps, any, SwitchData, SwitchComputed, SwitchMethods, {}, {}, {}, string, SwitchProps, SwitchProps, {}>;
131
+ export { Switch, SwitchVue3 };