@progress/kendo-vue-inputs 2.7.1 → 2.7.3-dev.202201070829

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 (118) 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 +10 -0
  57. package/dist/es/main.js +10 -0
  58. package/dist/es/package-metadata.js +1 -1
  59. package/dist/es/switch/Switch.js +4 -1
  60. package/dist/npm/colors/ColorPalette.d.ts +55 -0
  61. package/dist/npm/colors/ColorPalette.js +355 -0
  62. package/dist/npm/colors/ColorPicker.d.ts +52 -0
  63. package/dist/npm/colors/ColorPicker.js +395 -0
  64. package/dist/npm/colors/Picker.d.ts +41 -0
  65. package/dist/npm/colors/Picker.js +105 -0
  66. package/dist/npm/colors/interfaces/ColorPaletteChangeEvent.d.ts +13 -0
  67. package/dist/npm/colors/interfaces/ColorPaletteChangeEvent.js +2 -0
  68. package/dist/npm/colors/interfaces/ColorPaletteProps.d.ts +75 -0
  69. package/dist/npm/colors/interfaces/ColorPaletteProps.js +2 -0
  70. package/dist/npm/colors/interfaces/ColorPickerActiveColorClick.d.ts +13 -0
  71. package/dist/npm/colors/interfaces/ColorPickerActiveColorClick.js +2 -0
  72. package/dist/npm/colors/interfaces/ColorPickerBlurEvent.d.ts +9 -0
  73. package/dist/npm/colors/interfaces/ColorPickerBlurEvent.js +2 -0
  74. package/dist/npm/colors/interfaces/ColorPickerChangeEvent.d.ts +13 -0
  75. package/dist/npm/colors/interfaces/ColorPickerChangeEvent.js +2 -0
  76. package/dist/npm/colors/interfaces/ColorPickerFocusEvent.d.ts +9 -0
  77. package/dist/npm/colors/interfaces/ColorPickerFocusEvent.js +2 -0
  78. package/dist/npm/colors/interfaces/ColorPickerPaletteSettings.d.ts +32 -0
  79. package/dist/npm/colors/interfaces/ColorPickerPaletteSettings.js +2 -0
  80. package/dist/npm/colors/interfaces/ColorPickerPopupSettings.d.ts +14 -0
  81. package/dist/npm/colors/interfaces/ColorPickerPopupSettings.js +2 -0
  82. package/dist/npm/colors/interfaces/ColorPickerProps.d.ts +142 -0
  83. package/dist/npm/colors/interfaces/ColorPickerProps.js +2 -0
  84. package/dist/npm/colors/interfaces/ColorPickerView.d.ts +10 -0
  85. package/dist/npm/colors/interfaces/ColorPickerView.js +2 -0
  86. package/dist/npm/colors/interfaces/PickerPopupSettings.d.ts +14 -0
  87. package/dist/npm/colors/interfaces/PickerPopupSettings.js +2 -0
  88. package/dist/npm/colors/interfaces/PickerProps.d.ts +42 -0
  89. package/dist/npm/colors/interfaces/PickerProps.js +2 -0
  90. package/dist/npm/colors/models/hsva.d.ts +9 -0
  91. package/dist/npm/colors/models/hsva.js +2 -0
  92. package/dist/npm/colors/models/output-format.d.ts +4 -0
  93. package/dist/npm/colors/models/output-format.js +2 -0
  94. package/dist/npm/colors/models/palette-presets.d.ts +53 -0
  95. package/dist/npm/colors/models/palette-presets.js +57 -0
  96. package/dist/npm/colors/models/rgb.d.ts +8 -0
  97. package/dist/npm/colors/models/rgb.js +2 -0
  98. package/dist/npm/colors/models/rgba.d.ts +9 -0
  99. package/dist/npm/colors/models/rgba.js +2 -0
  100. package/dist/npm/colors/models/table-cell.d.ts +7 -0
  101. package/dist/npm/colors/models/table-cell.js +2 -0
  102. package/dist/npm/colors/models/tile-size.d.ts +11 -0
  103. package/dist/npm/colors/models/tile-size.js +2 -0
  104. package/dist/npm/colors/utils/color-cache.d.ts +30 -0
  105. package/dist/npm/colors/utils/color-cache.js +71 -0
  106. package/dist/npm/colors/utils/color-palette.service.d.ts +12 -0
  107. package/dist/npm/colors/utils/color-palette.service.js +79 -0
  108. package/dist/npm/colors/utils/color-parser.d.ts +65 -0
  109. package/dist/npm/colors/utils/color-parser.js +139 -0
  110. package/dist/npm/colors/utils/misc.d.ts +15 -0
  111. package/dist/npm/colors/utils/misc.js +23 -0
  112. package/dist/npm/colors/utils/svg-calc.d.ts +62 -0
  113. package/dist/npm/colors/utils/svg-calc.js +106 -0
  114. package/dist/npm/main.d.ts +10 -0
  115. package/dist/npm/main.js +11 -0
  116. package/dist/npm/package-metadata.js +1 -1
  117. package/dist/npm/switch/Switch.js +4 -1
  118. 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,15 @@
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';
3
13
  export { Switch, SwitchProps, SwitchState, SwitchChangeEvent } from './switch/Switch';
4
14
  export * from './input/Input';
5
15
  export * from './numerictextbox/NumericTextBox';
package/dist/es/main.js CHANGED
@@ -1,3 +1,13 @@
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';
1
11
  export { Switch } from './switch/Switch';
2
12
  export * from './input/Input';
3
13
  export * from './numerictextbox/NumericTextBox';
@@ -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: 1640003732,
8
+ publishDate: 1641543462,
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
  };
@@ -66,7 +66,10 @@ var Switch = {
66
66
  default: false
67
67
  },
68
68
  validationMessage: String,
69
- value: [String, Number, Boolean],
69
+ value: {
70
+ type: [String, Number, Boolean],
71
+ default: undefined
72
+ },
70
73
  modelValue: {
71
74
  type: Boolean,
72
75
  default: undefined
@@ -0,0 +1,55 @@
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 { ColorPaletteService } from './utils/color-palette.service';
8
+ import { ColorPaletteProps } from './interfaces/ColorPaletteProps';
9
+ /**
10
+ * @hidden
11
+ */
12
+ export declare const DEFAULT_TILE_SIZE = 24;
13
+ /**
14
+ * @hidden
15
+ */
16
+ export declare const DEFAULT_COLUMNS_COUNT = 10;
17
+ /**
18
+ * @hidden
19
+ */
20
+ export declare const DEFAULT_PRESET = "office";
21
+ /**
22
+ * @hidden
23
+ */
24
+ export interface ColorPaletteState {
25
+ wrapper: HTMLDivElement | null;
26
+ paletteService: ColorPaletteService;
27
+ }
28
+ /**
29
+ * @hidden
30
+ */
31
+ export interface ColorPaletteComputed {
32
+ [key: string]: any;
33
+ }
34
+ /**
35
+ * @hidden
36
+ */
37
+ export interface ColorPaletteMethods {
38
+ [key: string]: any;
39
+ }
40
+ /**
41
+ * @hidden
42
+ */
43
+ export interface ColorPaletteData {
44
+ selectedColor?: string;
45
+ focusedColor?: string;
46
+ isFirstRender: boolean;
47
+ }
48
+ /**
49
+ * @hidden
50
+ */
51
+ export interface ColorPaletteAll extends Vue, ColorPaletteMethods, ColorPaletteData, ColorPaletteComputed, ColorPaletteState {
52
+ }
53
+ declare let ColorPalette: ComponentOptions<ColorPaletteAll, DefaultData<ColorPaletteData>, DefaultMethods<ColorPaletteAll>, ColorPaletteComputed, RecordPropsDefinition<ColorPaletteProps>>;
54
+ declare const ColorPaletteVue3: DefineComponent<ColorPaletteProps, any, ColorPaletteData, ColorPaletteComputed, ColorPaletteMethods, {}, {}, {}, string, ColorPaletteProps, ColorPaletteProps, {}>;
55
+ export { ColorPalette, ColorPaletteVue3 };