@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,79 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ColorPaletteService = void 0;
4
+ var misc_1 = require("./misc");
5
+ var kendo_drawing_1 = require("@progress/kendo-drawing");
6
+ /**
7
+ * @hidden
8
+ */
9
+ var ColorPaletteService = /** @class */ (function () {
10
+ function ColorPaletteService() {
11
+ this.colorRows = [];
12
+ }
13
+ ColorPaletteService.prototype.setColorMatrix = function (palette, columns) {
14
+ this.colorRows = [];
15
+ if (!(misc_1.isPresent(palette) && palette.length)) {
16
+ return;
17
+ }
18
+ columns = columns || palette.length;
19
+ for (var start = 0; start < palette.length; start += columns) {
20
+ var row = palette.slice(start, columns + start);
21
+ this.colorRows.push(row);
22
+ }
23
+ };
24
+ ColorPaletteService.prototype.getCellCoordsFor = function (color) {
25
+ var _this = this;
26
+ if (!misc_1.isPresent(color)) {
27
+ return;
28
+ }
29
+ var parsedColor = color ? kendo_drawing_1.parseColor(color, true) : color;
30
+ var colors = [color];
31
+ if (misc_1.isPresent(parsedColor)) {
32
+ colors.push(parsedColor.toCss(), parsedColor.toCssRgba());
33
+ }
34
+ var _loop_1 = function (row) {
35
+ var _loop_2 = function (col) {
36
+ if (colors.some(function (c) { return c === _this.colorRows[row][col]; })) {
37
+ return { value: { row: row, col: col } };
38
+ }
39
+ };
40
+ for (var col = 0; col < this_1.colorRows[row].length; col++) {
41
+ var state_2 = _loop_2(col);
42
+ if (typeof state_2 === "object")
43
+ return state_2;
44
+ }
45
+ };
46
+ var this_1 = this;
47
+ for (var row = 0; row < this.colorRows.length; row++) {
48
+ var state_1 = _loop_1(row);
49
+ if (typeof state_1 === "object")
50
+ return state_1.value;
51
+ }
52
+ };
53
+ ColorPaletteService.prototype.getColorAt = function (cellCoords) {
54
+ if (!(misc_1.isPresent(cellCoords) && misc_1.isPresent(this.colorRows[cellCoords.row]))) {
55
+ return;
56
+ }
57
+ return this.colorRows[cellCoords.row][cellCoords.col];
58
+ };
59
+ ColorPaletteService.prototype.getNextCell = function (current, horizontalStep, verticalStep) {
60
+ if (!(misc_1.isPresent(current) && misc_1.isPresent(current.row) && misc_1.isPresent(current.col))) {
61
+ return { row: 0, col: 0 };
62
+ }
63
+ var row = this.clampIndex(current.row + verticalStep, this.colorRows.length - 1);
64
+ var col = this.clampIndex(current.col + horizontalStep, this.colorRows[row].length - 1);
65
+ return { row: row, col: col };
66
+ };
67
+ ColorPaletteService.prototype.clampIndex = function (index, max) {
68
+ var minArrayIndex = 0;
69
+ if (index < minArrayIndex) {
70
+ return minArrayIndex;
71
+ }
72
+ if (index > max) {
73
+ return max;
74
+ }
75
+ return index;
76
+ };
77
+ return ColorPaletteService;
78
+ }());
79
+ exports.ColorPaletteService = ColorPaletteService;
@@ -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,139 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getContrastFromTwoRGBAs = exports.getContrast = exports.getLuminance = exports.getRGBFromRGBA = exports.getColorFromRGBA = exports.getColorFromHue = exports.getColorFromHSV = exports.getRGBA = exports.getHSV = exports.parseColor = void 0;
4
+ var kendo_drawing_1 = require("@progress/kendo-drawing");
5
+ var misc_1 = require("./misc");
6
+ /**
7
+ * @hidden
8
+ *
9
+ * Returns the hex or RGBA string representation of the color.
10
+ */
11
+ exports.parseColor = function (value, format, safe) {
12
+ if (safe === void 0) { safe = true; }
13
+ var allowedFormats = ['hex', 'rgba']; // TODO: constant?
14
+ // Angular supports third type: name : const allowedFormats: Array<string> = ['hex', 'rgba', 'name'];
15
+ if (allowedFormats.indexOf(format) === -1) {
16
+ throw new Error("Unsupported color output format '" + format + "'. The available options are 'hex' or 'rgba'.");
17
+ }
18
+ if (!misc_1.isPresent(value)) {
19
+ return;
20
+ }
21
+ var parsedColor = kendo_drawing_1.parseColor(value.trim(), safe);
22
+ if (!misc_1.isPresent(parsedColor)) {
23
+ return;
24
+ }
25
+ return format === 'hex' ? parsedColor.toCss() : parsedColor.toCssRgba();
26
+ };
27
+ /**
28
+ * @hidden
29
+ *
30
+ * Returns an HSV object representation of the color string.
31
+ */
32
+ exports.getHSV = function (value, safe) {
33
+ if (safe === void 0) { safe = true; }
34
+ var parsed = kendo_drawing_1.parseColor(value, safe);
35
+ if (!misc_1.isPresent(parsed)) {
36
+ return {};
37
+ }
38
+ return parsed.toHSV();
39
+ };
40
+ /**
41
+ * @hidden
42
+ *
43
+ * Returns an RGBA object representation of the color string.
44
+ */
45
+ exports.getRGBA = function (value, safe) {
46
+ if (safe === void 0) { safe = true; }
47
+ var parsed = kendo_drawing_1.parseColor(value, safe);
48
+ if (!misc_1.isPresent(parsed)) {
49
+ return {};
50
+ }
51
+ return parsed.toBytes();
52
+ };
53
+ /**
54
+ * @hidden
55
+ *
56
+ * Returns the RGBA string representation of the color.
57
+ */
58
+ exports.getColorFromHSV = function (hsva) {
59
+ var hue = misc_1.fitIntoBounds(hsva.h, 0, 359.9);
60
+ var saturation = misc_1.fitIntoBounds(hsva.s, 0, 1);
61
+ var value = misc_1.fitIntoBounds(hsva.v, 0, 1);
62
+ var alpha = misc_1.fitIntoBounds(hsva.a, 0, 1);
63
+ return kendo_drawing_1.Color.fromHSV(hue, saturation, value, alpha).toCssRgba();
64
+ };
65
+ /**
66
+ * @hidden
67
+ *
68
+ * Returns the RGBA string representation of the color based on the `hue` and
69
+ * assuming the `value`, `saturation`, and `alpha` have a value of `1`.
70
+ */
71
+ exports.getColorFromHue = function (hue) {
72
+ return exports.getColorFromHSV({ h: hue, s: 1, v: 1, a: 1 });
73
+ };
74
+ /**
75
+ * @hidden
76
+ *
77
+ * Returns the RGBA string representation of the color.
78
+ */
79
+ exports.getColorFromRGBA = function (rgba) {
80
+ var red = misc_1.fitIntoBounds(rgba.r, 0, 255);
81
+ var green = misc_1.fitIntoBounds(rgba.g, 0, 255);
82
+ var blue = misc_1.fitIntoBounds(rgba.b, 0, 255);
83
+ var alpha = misc_1.fitIntoBounds(rgba.a, 0, 1);
84
+ return kendo_drawing_1.Color.fromBytes(red, green, blue, alpha).toCssRgba();
85
+ };
86
+ /**
87
+ * @hidden
88
+ *
89
+ * Returns the RGB object representation of the color based on the background color.
90
+ */
91
+ exports.getRGBFromRGBA = function (foregroundColor, backgroundColor) {
92
+ var r1 = misc_1.fitIntoBounds(foregroundColor.r, 0, 255);
93
+ var g1 = misc_1.fitIntoBounds(foregroundColor.g, 0, 255);
94
+ var b1 = misc_1.fitIntoBounds(foregroundColor.b, 0, 255);
95
+ var a1 = misc_1.fitIntoBounds(foregroundColor.a, 0, 1);
96
+ var r2 = misc_1.fitIntoBounds(backgroundColor.r, 0, 255);
97
+ var g2 = misc_1.fitIntoBounds(backgroundColor.g, 0, 255);
98
+ var b2 = misc_1.fitIntoBounds(backgroundColor.b, 0, 255);
99
+ return {
100
+ r: Math.round(((1 - a1) * r2) + (a1 * r1)),
101
+ g: Math.round(((1 - a1) * g2) + (a1 * g1)),
102
+ b: Math.round(((1 - a1) * b2) + (a1 * b1))
103
+ };
104
+ };
105
+ /**
106
+ * @hidden
107
+ *
108
+ * Returns the relative luminance.
109
+ */
110
+ exports.getLuminance = function (rgb) {
111
+ // @ts-ignore
112
+ var a = [rgb.r, rgb.g, rgb.b].map(function (v) {
113
+ v /= 255;
114
+ return v <= 0.03928
115
+ ? v / 12.92
116
+ : Math.pow((v + 0.055) / 1.055, 2.4);
117
+ });
118
+ // @ts-ignore
119
+ return a[0] * 0.2126 + a[1] * 0.7152 + a[2] * 0.0722;
120
+ };
121
+ /**
122
+ * @hidden
123
+ *
124
+ * Returns the color contrast.
125
+ */
126
+ exports.getContrast = function (luminance1, luminance2) {
127
+ var brightest = Math.max(luminance1, luminance2);
128
+ var darkest = Math.min(luminance1, luminance2);
129
+ return (brightest + 0.05)
130
+ / (darkest + 0.05);
131
+ };
132
+ /**
133
+ * @hidden
134
+ *
135
+ * Returns the color contrast from two RGBA colors.
136
+ */
137
+ exports.getContrastFromTwoRGBAs = function (a, b) {
138
+ return exports.getContrast(exports.getLuminance(exports.getRGBFromRGBA(a, b)), exports.getLuminance(exports.getRGBFromRGBA(b, { r: 0, g: 0, b: 0, a: 1 })));
139
+ };
@@ -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,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fitIntoBounds = exports.isPresent = void 0;
4
+ /**
5
+ * @hidden
6
+ */
7
+ exports.isPresent = function (value) { return value !== null && value !== undefined; };
8
+ /**
9
+ * @hidden
10
+ *
11
+ * Fits the contender number into the specified bounds.
12
+ * If the number is NaN or null, the minimum is returned.
13
+ *
14
+ * @param contender Represents the number you want to fit into the specified bounds.
15
+ * @param min The inclusive lower bound number.
16
+ * @param max The inclusive upper bound number.
17
+ */
18
+ exports.fitIntoBounds = function (contender, min, max) {
19
+ if (!exports.isPresent(contender) || isNaN(contender)) {
20
+ return min;
21
+ }
22
+ return contender <= min ? min : contender >= max ? max : contender;
23
+ };
@@ -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,106 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bezierCommand = exports.controlPoint = exports.line = exports.svgPath = void 0;
4
+ /**
5
+ * @hidden
6
+ *
7
+ * Render the svg <path> element.
8
+ *
9
+ * @param points (array) Represents the points coordinates as an array of tuples.
10
+ * @param command (function) The command that is used (bezierCommand, lineCommand).
11
+ * @param point (array) [x,y] Represents the current point coordinates.
12
+ * @param i (integer) Represents the index of 'point' in the array 'a'.
13
+ * @param a (array) Represents the complete array of points coordinates.
14
+ * @output (string) a svg path command.
15
+ * @output (string) a Svg <path> element
16
+ */
17
+ exports.svgPath = function (points, command) {
18
+ if (points.length === 0) {
19
+ return '';
20
+ }
21
+ // build the d attributes by looping over the points
22
+ var d = points.reduce(function (acc, point, i, a) {
23
+ return i === 0 ?
24
+ // if first point
25
+ "M " + point[0] + "," + point[1] :
26
+ // else
27
+ acc + " " + command(point, i, a);
28
+ }, '');
29
+ return "<path d=\"" + d + "\" fill=\"none\" stroke=\"white\" stroke-width=\"1\"/>";
30
+ };
31
+ /**
32
+ * @hidden
33
+ *
34
+ * Returns the properties of a line.
35
+ *
36
+ * @param pointA (array) [x,y] Represents the start point coordinates.
37
+ * @param pointB (array) [x,y] Represents the end point coordinates.
38
+ * @output (object) { length: (integer), angle: (integer) }
39
+ */
40
+ exports.line = function (pointA, pointB) {
41
+ var lengthX = pointB[0] - pointA[0];
42
+ var lengthY = pointB[1] - pointA[1];
43
+ return {
44
+ length: Math.sqrt(Math.pow(lengthX, 2) + Math.pow(lengthY, 2)),
45
+ angle: Math.atan2(lengthY, lengthX)
46
+ };
47
+ };
48
+ /**
49
+ * @hidden
50
+ *
51
+ * Create a function to calculate the position of the control point.
52
+ *
53
+ * @param lineCalc (function) Represents the line function.
54
+ * @param pointA (array) [x,y] Represents the start point coordinates.
55
+ * @param pointB (array) [x,y] Represents the end point coordinates.
56
+ * @output (object) { length: (integer), angle: (integer) }
57
+ * @output (function) closure.
58
+ * @param current (array) [x, y] Represents the current point coordinates.
59
+ * @param previous (array) [x, y] Represents the previous point coordinates.
60
+ * @param next (array) [x, y] ]Represents the next point coordinates.
61
+ * @param reverse (boolean, optional) Sets the direction.
62
+ * @output (array) [x, y] coordinates of a control point.
63
+ */
64
+ exports.controlPoint = function (lineCalc) {
65
+ return function (current, previous, next, reverse) {
66
+ // when 'current' is the first or last point of the array
67
+ // 'previous' and 'next' are undefined
68
+ // replace with 'current'
69
+ var p = previous || current;
70
+ var n = next || current;
71
+ var smooth = 0.1;
72
+ // properties of the line between previous and next
73
+ var l = lineCalc(p, n);
74
+ // If is end-control-point, add PI to the angle to go backward
75
+ var angle = l.angle + (reverse ? Math.PI : 0);
76
+ var length = l.length * smooth;
77
+ // The control point position is relative to the current point
78
+ var x = current[0] + Math.cos(angle) * length;
79
+ var y = current[1] + Math.sin(angle) * length;
80
+ return [x, y];
81
+ };
82
+ };
83
+ /**
84
+ * @hidden
85
+ *
86
+ * Create a function to calculate a bezier curve command.
87
+ *
88
+ * @param controlPointCalc (function) Represents the controlPoint function.
89
+ * @param current (array) [x, y] Represents the current point coordinates.
90
+ * @param previous (array) [x, y] Represents the previous point coordinates.
91
+ * @param next (array) [x, y] ]Represents the next point coordinates.
92
+ * @param reverse (boolean, optional) Sets the direction.
93
+ * @output (array) [x, y] coordinates of a control point.
94
+ * @output (function) closure.
95
+ * @param point (array) [x,y] Represents the current point coordinates.
96
+ * @param i (integer) Represents the index of 'point' in the array 'a'.
97
+ * @param a (array) Represents the complete array of points coordinates.
98
+ * @output (string) 'C x2,y2 x1,y1 x,y' Cubic bezier command.
99
+ */
100
+ exports.bezierCommand = function (controlPointCalc) { return function (point, i, a) {
101
+ // start control point
102
+ var _a = controlPointCalc(a[i - 1], a[i - 2], point), cpsX = _a[0], cpsY = _a[1];
103
+ // end control point
104
+ var _b = controlPointCalc(point, a[i - 1], a[i + 1], true), cpeX = _b[0], cpeY = _b[1];
105
+ return "C " + cpsX + "," + cpsY + " " + cpeX + "," + cpeY + " " + point[0] + "," + point[1];
106
+ }; };
@@ -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/npm/main.js CHANGED
@@ -10,6 +10,17 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
+ var ColorPalette_1 = require("./colors/ColorPalette");
14
+ Object.defineProperty(exports, "ColorPalette", { enumerable: true, get: function () { return ColorPalette_1.ColorPalette; } });
15
+ __exportStar(require("./colors/ColorPicker"), exports);
16
+ __exportStar(require("./colors/interfaces/ColorPaletteChangeEvent"), exports);
17
+ __exportStar(require("./colors/interfaces/ColorPaletteProps"), exports);
18
+ __exportStar(require("./colors/interfaces/ColorPickerBlurEvent"), exports);
19
+ __exportStar(require("./colors/interfaces/ColorPickerChangeEvent"), exports);
20
+ __exportStar(require("./colors/interfaces/ColorPickerFocusEvent"), exports);
21
+ __exportStar(require("./colors/interfaces/ColorPickerPaletteSettings"), exports);
22
+ __exportStar(require("./colors/interfaces/ColorPickerPopupSettings"), exports);
23
+ __exportStar(require("./colors/interfaces/ColorPickerProps"), exports);
13
24
  var Switch_1 = require("./switch/Switch");
14
25
  Object.defineProperty(exports, "Switch", { enumerable: true, get: function () { return Switch_1.Switch; } });
15
26
  __exportStar(require("./input/Input"), exports);
@@ -8,7 +8,7 @@ exports.packageMetadata = {
8
8
  name: '@progress/kendo-vue-inputs',
9
9
  productName: 'Kendo UI for Vue',
10
10
  productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
11
- publishDate: 1640003732,
11
+ publishDate: 1641543462,
12
12
  version: '',
13
13
  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'
14
14
  };
@@ -78,7 +78,10 @@ var Switch = {
78
78
  default: false
79
79
  },
80
80
  validationMessage: String,
81
- value: [String, Number, Boolean],
81
+ value: {
82
+ type: [String, Number, Boolean],
83
+ default: undefined
84
+ },
82
85
  modelValue: {
83
86
  type: Boolean,
84
87
  default: undefined
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@progress/kendo-vue-inputs",
3
3
  "description": "Kendo UI for Vue Input package",
4
- "version": "2.7.1",
4
+ "version": "2.7.3-dev.202201070829",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/telerik/kendo-vue.git"
@@ -32,20 +32,26 @@
32
32
  "framework": "Kendo UI for Vue"
33
33
  },
34
34
  "peerDependencies": {
35
+ "@progress/kendo-drawing": "^1.8.0",
35
36
  "@progress/kendo-licensing": "^1.1.0",
36
37
  "@progress/kendo-vue-intl": "^2.3.0",
37
38
  "vue": "^2.6.12 || ^3.0.2"
38
39
  },
39
40
  "dependencies": {
40
- "@progress/kendo-vue-common": "2.7.1",
41
- "@progress/kendo-vue-labels": "2.7.1"
41
+ "@progress/kendo-vue-common": "2.7.3-dev.202201070829",
42
+ "@progress/kendo-vue-labels": "2.7.3-dev.202201070829",
43
+ "@progress/kendo-vue-popup": "2.7.3-dev.202201070829"
42
44
  },
43
45
  "devDependencies": {
46
+ "@progress/kendo-data-query": "^1.5.5",
47
+ "@progress/kendo-date-math": "^1.5.4",
48
+ "@progress/kendo-drawing": "^1.8.0",
44
49
  "@progress/kendo-licensing": "^1.1.0",
45
- "@progress/kendo-vue-buttons": "2.7.1",
46
- "@progress/kendo-vue-form": "2.7.1",
47
- "@progress/kendo-vue-intl": "2.7.1",
48
- "@progress/kendo-vue-labels": "2.7.1",
50
+ "@progress/kendo-vue-buttons": "2.7.3-dev.202201070829",
51
+ "@progress/kendo-vue-form": "2.7.3-dev.202201070829",
52
+ "@progress/kendo-vue-intl": "2.7.3-dev.202201070829",
53
+ "@progress/kendo-vue-labels": "2.7.3-dev.202201070829",
54
+ "@progress/kendo-vue-tooltip": "2.7.3-dev.202201070829",
49
55
  "cldr-core": "^34.0.0",
50
56
  "cldr-dates-full": "^34.0.0",
51
57
  "cldr-numbers-full": "^34.0.0"