@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,157 @@
1
+ var __assign = this && this.__assign || function () {
2
+ __assign = Object.assign || function (t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+
6
+ for (var p in s) {
7
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
8
+ }
9
+ }
10
+
11
+ return t;
12
+ };
13
+
14
+ return __assign.apply(this, arguments);
15
+ };
16
+ /**
17
+ * @hidden
18
+ */
19
+
20
+
21
+ export var RANGE_ACTION;
22
+
23
+ (function (RANGE_ACTION) {
24
+ RANGE_ACTION["start"] = "start";
25
+ RANGE_ACTION["end"] = "end";
26
+ RANGE_ACTION["min"] = "min";
27
+ RANGE_ACTION["max"] = "max";
28
+ RANGE_ACTION["increase"] = "increase";
29
+ RANGE_ACTION["decrease"] = "decrease";
30
+ })(RANGE_ACTION || (RANGE_ACTION = {}));
31
+ /**
32
+ * @hidden
33
+ */
34
+
35
+
36
+ export var rangeReducer = function rangeReducer(state, action) {
37
+ var newState;
38
+ var newValue;
39
+
40
+ switch (action.type) {
41
+ case RANGE_ACTION.start:
42
+ if (action.payload === undefined) {
43
+ return state;
44
+ }
45
+
46
+ newState = {
47
+ start: action.payload > state.end ? state.end : Math.max(action.payload, action.min),
48
+ end: state.end
49
+ };
50
+ break;
51
+
52
+ case RANGE_ACTION.end:
53
+ if (action.payload === undefined) {
54
+ return state;
55
+ }
56
+
57
+ newState = {
58
+ start: state.start,
59
+ end: action.payload < state.start ? state.start : Math.min(action.payload, action.max)
60
+ };
61
+ break;
62
+
63
+ case RANGE_ACTION.min:
64
+ if (action.key === 'start') {
65
+ newState = __assign(__assign({}, state), {
66
+ start: action.min
67
+ });
68
+ } else {
69
+ newState = __assign(__assign({}, state), {
70
+ end: Math.max(action.min, state.start)
71
+ });
72
+ }
73
+
74
+ break;
75
+
76
+ case RANGE_ACTION.max:
77
+ if (action.key === 'start') {
78
+ newState = __assign(__assign({}, state), {
79
+ start: Math.min(action.max, state.end)
80
+ });
81
+ } else {
82
+ newState = __assign(__assign({}, state), {
83
+ end: action.max
84
+ });
85
+ }
86
+
87
+ break;
88
+
89
+ case RANGE_ACTION.increase:
90
+ if (action.step === undefined || action.key === undefined) {
91
+ return state;
92
+ }
93
+
94
+ newValue = state[action.key] + action.step;
95
+
96
+ if (action.key === 'start') {
97
+ if (newValue < action.min) {
98
+ newState = __assign(__assign({}, state), {
99
+ start: action.min
100
+ });
101
+ } else {
102
+ newState = __assign(__assign({}, state), {
103
+ start: Math.min(newValue, state.end)
104
+ });
105
+ }
106
+ } else {
107
+ if (newValue > action.max) {
108
+ newState = __assign(__assign({}, state), {
109
+ end: action.max
110
+ });
111
+ } else {
112
+ newState = __assign(__assign({}, state), {
113
+ end: Math.max(newValue, state.start)
114
+ });
115
+ }
116
+ }
117
+
118
+ break;
119
+
120
+ case RANGE_ACTION.decrease:
121
+ if (action.step === undefined || action.key === undefined) {
122
+ return state;
123
+ }
124
+
125
+ newValue = state[action.key] - action.step;
126
+
127
+ if (action.key === 'start') {
128
+ if (newValue < action.min) {
129
+ newState = __assign(__assign({}, state), {
130
+ start: action.min
131
+ });
132
+ } else {
133
+ newState = __assign(__assign({}, state), {
134
+ start: Math.min(newValue, state.end)
135
+ });
136
+ }
137
+ } else {
138
+ if (newValue > action.max) {
139
+ newState = __assign(__assign({}, state), {
140
+ end: action.max
141
+ });
142
+ } else {
143
+ newState = __assign(__assign({}, state), {
144
+ end: Math.max(newValue, state.start)
145
+ });
146
+ }
147
+ }
148
+
149
+ break;
150
+
151
+ default:
152
+ newState = state;
153
+ break;
154
+ }
155
+
156
+ return newState;
157
+ };
@@ -0,0 +1,140 @@
1
+ import { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type } from '../additionalTypes';
2
+ declare type DefaultData<V> = object | ((this: V) => {});
3
+ declare type DefaultMethods<V> = {
4
+ [key: string]: (this: V, ...args: any[]) => any;
5
+ };
6
+ import { FormComponentProps, DraggableDragEvent, DraggablePressEvent } from '@progress/kendo-vue-common';
7
+ import { Direction } from '../interfaces/Direction';
8
+ /**
9
+ * The arguments for the `change` Slider event.
10
+ */
11
+ export interface SliderChangeEvent {
12
+ /**
13
+ * The current value of the Slider.
14
+ */
15
+ value: number;
16
+ /**
17
+ * The native event.
18
+ */
19
+ event: any;
20
+ }
21
+ /**
22
+ * Represents the props of the [Kendo UI for Vue Slider component]({% slug overview_slider %}).
23
+ */
24
+ export interface SliderProps extends FormComponentProps {
25
+ /**
26
+ * The value of the Slider.
27
+ */
28
+ value?: number;
29
+ /**
30
+ * @hidden
31
+ */
32
+ modelValue?: number;
33
+ /**
34
+ * The default value of the Slider.
35
+ */
36
+ defaultValue?: number;
37
+ /**
38
+ * The minimum value of the Slider.
39
+ */
40
+ min: number;
41
+ /**
42
+ * The maximum value of the Slider.
43
+ */
44
+ max: number;
45
+ /**
46
+ * Specifies the step of the value increase and decrease.
47
+ */
48
+ step?: number;
49
+ /**
50
+ * Determines the event handler that will be fired when the user edits the value.
51
+ */
52
+ onChange?: (event: SliderChangeEvent) => void;
53
+ /**
54
+ * Renders the arrow side buttons of the Slider if set to true.
55
+ */
56
+ buttons?: boolean;
57
+ /**
58
+ * Specifies the [tabindex](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex)
59
+ * of the Slider.
60
+ */
61
+ tabIndex?: number;
62
+ /**
63
+ * Determines whether the Slider is disabled.
64
+ *
65
+ */
66
+ disabled?: boolean;
67
+ /**
68
+ * If `vertical` is set to `true`, the orientation of the Slider changes from horizontal to vertical
69
+ * ([see example]({% slug orientation_slider %})).
70
+ */
71
+ vertical?: boolean;
72
+ /**
73
+ * Specifies the id of the component.
74
+ */
75
+ id?: string;
76
+ /**
77
+ * 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).
78
+ * For example these elements could contain error or hint message.
79
+ */
80
+ ariaDescribedBy?: string;
81
+ /**
82
+ * Identifies the element(s) which will label the component.
83
+ */
84
+ ariaLabelledBy?: string;
85
+ dir?: String;
86
+ }
87
+ /**
88
+ * @hidden
89
+ */
90
+ export interface SliderData {
91
+ currentValue: number;
92
+ currentFocused: boolean;
93
+ currentDir?: Direction;
94
+ }
95
+ /**
96
+ * @hidden
97
+ */
98
+ export interface SliderState {
99
+ _sliderTrack: any;
100
+ draggable: any;
101
+ }
102
+ /**
103
+ * @hidden
104
+ */
105
+ export interface SliderMethods {
106
+ [key: string]: any;
107
+ focus: () => void;
108
+ isLabel: (target: any) => boolean;
109
+ onFocus: () => void;
110
+ onBlur: () => void;
111
+ onKeyDown: (e: any) => void;
112
+ decrement: (e: any) => void;
113
+ increment: (e: any) => void;
114
+ dragStart: (e: DraggablePressEvent) => void;
115
+ dragOver: (e: DraggableDragEvent) => void;
116
+ drag: (e: any) => void;
117
+ change: (e: any, value: number) => void;
118
+ }
119
+ /**
120
+ * @hidden
121
+ */
122
+ export interface SliderComputed {
123
+ [key: string]: any;
124
+ sliderTrack: any;
125
+ computedValue: number;
126
+ }
127
+ /**
128
+ * @hidden
129
+ */
130
+ export interface SliderAll extends Vue2type, SliderMethods, SliderComputed, SliderState, SliderData {
131
+ }
132
+ /**
133
+ * @hidden
134
+ */
135
+ declare let SliderVue2: ComponentOptions<SliderAll, DefaultData<SliderData>, DefaultMethods<SliderAll>, SliderComputed, RecordPropsDefinition<SliderProps>>;
136
+ /**
137
+ * @hidden
138
+ */
139
+ declare const Slider: DefineComponent<SliderProps, any, SliderData, SliderComputed, SliderMethods, {}, {}, {}, string, SliderProps, SliderProps, {}>;
140
+ export { Slider, SliderVue2 };
@@ -0,0 +1,395 @@
1
+ // @ts-ignore
2
+ import * as Vue from 'vue';
3
+ var allVue = Vue;
4
+ var gh = allVue.h;
5
+ var isV3 = allVue.version && allVue.version[0] === '3';
6
+ var ref = allVue.ref;
7
+ var inject = allVue.inject;
8
+ import { Button } from '@progress/kendo-vue-buttons';
9
+ import { Keys, classNames, Draggable, getTabIndex, validatePackage, getDefaultSlots } from '@progress/kendo-vue-common';
10
+ import { provideLocalizationService } from '@progress/kendo-vue-intl';
11
+ import { messages, sliderIncreaseValue, sliderDecreaseValue, sliderDragTitle } from './../messages.js';
12
+ import { SLIDER_LABEL_ATTRIBUTE } from './SliderLabel.js';
13
+ import { packageMetadata } from '../package-metadata.js';
14
+ /**
15
+ * @hidden
16
+ */
17
+
18
+ var SliderVue2 = {
19
+ name: 'KendoSlider',
20
+ model: {
21
+ event: 'changemodel'
22
+ },
23
+ // @ts-ignore
24
+ emits: {
25
+ 'changemodel': null,
26
+ 'update:modelValue': null,
27
+ 'change': null,
28
+ 'blur': null,
29
+ 'focus': null
30
+ },
31
+ props: {
32
+ modelValue: {
33
+ type: Number,
34
+ default: undefined
35
+ },
36
+ defaultValue: {
37
+ type: Number,
38
+ default: undefined
39
+ },
40
+ name: String,
41
+ buttons: Boolean,
42
+ tabIndex: Number,
43
+ disabled: Boolean,
44
+ dir: String,
45
+ step: Number,
46
+ min: {
47
+ type: Number,
48
+ required: true
49
+ },
50
+ max: {
51
+ type: Number,
52
+ required: true
53
+ },
54
+ value: Number,
55
+ vertical: Boolean,
56
+ id: String,
57
+ ariaLabelledBy: String,
58
+ ariaDescribedBy: String
59
+ },
60
+ provide: function provide() {
61
+ return {
62
+ kendoMin: this.$props.min,
63
+ kendoMax: this.$props.max,
64
+ kendoVertical: this.$props.vertical
65
+ };
66
+ },
67
+ inject: {
68
+ kendoLocalizationService: {
69
+ default: null
70
+ }
71
+ },
72
+ data: function data() {
73
+ return {
74
+ currentValue: undefined,
75
+ currentFocused: false,
76
+ currentDir: 'ltr'
77
+ };
78
+ },
79
+ computed: {
80
+ computedValue: function computedValue() {
81
+ var value = this.$props.value !== undefined ? this.$props.value : this.currentValue;
82
+ var _a = this.$props,
83
+ min = _a.min,
84
+ max = _a.max;
85
+ return value === undefined ? value : Math.min(Math.max(value, min), max);
86
+ },
87
+ sliderTrack: function sliderTrack() {
88
+ return this._sliderTrack;
89
+ }
90
+ },
91
+ created: function created() {
92
+ validatePackage(packageMetadata);
93
+
94
+ if (this.$props.value !== undefined) {
95
+ this.$data.currentValue = this.$props.value;
96
+ } else if (this.$props.modelValue !== undefined) {
97
+ this.$data.currentValue = this.$props.modelValue;
98
+ } else if (this.$props.defaultValue !== undefined) {
99
+ this.$data.currentValue = this.$props.defaultValue;
100
+ } else {
101
+ this.$data.currentValue = this.$props.min;
102
+ }
103
+
104
+ this.currentFocused = false;
105
+ this.currentDir = this.$props.dir;
106
+ },
107
+ mounted: function mounted() {
108
+ this._sliderTrack = this.$refs.sliderTrack;
109
+
110
+ if (this.$el) {
111
+ this.draggable = this.$refs.draggable;
112
+ }
113
+
114
+ if (!this.currentDir && window && this.$el) {
115
+ // Note: getComputedStyle forces reflow
116
+ var direction = window.getComputedStyle(this.$el).direction;
117
+
118
+ if (direction) {
119
+ this.currentDir = direction;
120
+ }
121
+ }
122
+ },
123
+ updated: function updated() {
124
+ if (this.$el) {
125
+ this.draggable = this.$refs.draggable;
126
+ }
127
+ },
128
+ // @ts-ignore
129
+ setup: !isV3 ? undefined : function () {
130
+ var v3 = !!isV3;
131
+ var inputRef = ref(null);
132
+ var kendoLocalizationService = inject('kendoLocalizationService', {});
133
+ return {
134
+ v3: v3,
135
+ inputRef: inputRef,
136
+ kendoLocalizationService: kendoLocalizationService
137
+ };
138
+ },
139
+ render: function render(createElement) {
140
+ var _this = this;
141
+
142
+ var _a;
143
+
144
+ var h = gh || createElement;
145
+ var lS = provideLocalizationService(this);
146
+ var percentValue = (this.computedValue - this.$props.min) / (this.$props.max - this.$props.min) * 100;
147
+ var defaultSlot = getDefaultSlots(this);
148
+ return h("div", {
149
+ "aria-valuemin": this.$props.min,
150
+ attrs: this.v3 ? undefined : {
151
+ "aria-valuemin": this.$props.min,
152
+ "aria-valuemax": this.$props.max,
153
+ "aria-valuenow": this.computedValue,
154
+ "aria-disabled": this.$props.disabled ? 'true' : undefined,
155
+ "aria-labelledby": this.$props.ariaLabelledBy,
156
+ "aria-describedby": this.$props.ariaDescribedBy,
157
+ dir: this.currentDir,
158
+ role: "slider",
159
+ id: this.$props.id,
160
+ tabindex: getTabIndex(this.$props.tabIndex, this.$props.disabled, undefined)
161
+ },
162
+ "aria-valuemax": this.$props.max,
163
+ "aria-valuenow": this.computedValue,
164
+ "aria-disabled": this.$props.disabled ? 'true' : undefined,
165
+ "aria-labelledby": this.$props.ariaLabelledBy,
166
+ "aria-describedby": this.$props.ariaDescribedBy,
167
+ dir: this.currentDir,
168
+ role: "slider",
169
+ id: this.$props.id,
170
+ style: this.$props.style,
171
+ tabindex: getTabIndex(this.$props.tabIndex, this.$props.disabled, undefined),
172
+ onFocus: this.onFocus,
173
+ on: this.v3 ? undefined : {
174
+ "focus": this.onFocus,
175
+ "blur": this.onBlur,
176
+ "keydown": this.onKeyDown
177
+ },
178
+ onBlur: this.onBlur,
179
+ onKeydown: this.onKeyDown,
180
+ "class": classNames('k-slider k-widget', {
181
+ 'k-focus': this.currentFocused,
182
+ 'k-disabled': this.$props.disabled,
183
+ 'k-slider-horizontal': !this.$props.vertical,
184
+ 'k-slider-vertical': this.$props.vertical
185
+ }, this.$props.className)
186
+ }, [h("div", {
187
+ "class": classNames('k-slider-wrap')
188
+ }, [this.$props.buttons && // @ts-ignore
189
+ h(Button, {
190
+ type: "button",
191
+ attrs: this.v3 ? undefined : {
192
+ type: "button",
193
+ tabIndex: -1,
194
+ icon: this.$props.vertical ? 'arrow-s' : 'arrow-w',
195
+ rounded: 'full',
196
+ title: lS.toLanguageString(sliderDecreaseValue, messages[sliderDecreaseValue])
197
+ },
198
+ tabIndex: -1,
199
+ icon: this.$props.vertical ? 'arrow-s' : 'arrow-w',
200
+ style: {
201
+ position: 'relative'
202
+ },
203
+ rounded: 'full',
204
+ "class": "k-button-decrease",
205
+ title: lS.toLanguageString(sliderDecreaseValue, messages[sliderDecreaseValue]),
206
+ onClick: this.decrement,
207
+ on: this.v3 ? undefined : {
208
+ "click": this.decrement
209
+ }
210
+ }), // @ts-ignore function children
211
+ h(Draggable, {
212
+ onDrag: this.dragOver,
213
+ on: this.v3 ? undefined : {
214
+ "drag": this.dragOver,
215
+ "press": this.dragStart
216
+ },
217
+ onPress: this.dragStart,
218
+ ref: 'draggable'
219
+ }, this.v3 ? function () {
220
+ return [h("div", {
221
+ "class": "k-slider-track-wrap",
222
+ style: {
223
+ touchAction: 'none'
224
+ }
225
+ }, [defaultSlot && h("ul", {
226
+ "class": "k-reset k-slider-items"
227
+ }, [defaultSlot]), h("div", {
228
+ "class": "k-slider-track",
229
+ ref: 'sliderTrack'
230
+ }, [h("div", {
231
+ "class": "k-slider-selection",
232
+ style: _this.$props.vertical ? {
233
+ height: percentValue + '%'
234
+ } : {
235
+ width: percentValue + '%'
236
+ }
237
+ }), h("a", {
238
+ "class": "k-draghandle",
239
+ title: lS.toLanguageString(sliderDragTitle, messages[sliderDragTitle]),
240
+ attrs: _this.v3 ? undefined : {
241
+ title: lS.toLanguageString(sliderDragTitle, messages[sliderDragTitle])
242
+ },
243
+ style: _this.$props.vertical ? {
244
+ bottom: percentValue + '%',
245
+ zIndex: 1
246
+ } : (_a = {}, _a[_this.currentDir === 'rtl' ? 'right' : 'left'] = percentValue + '%', _a.zIndex = 1, _a)
247
+ })])])];
248
+ } : [h("div", {
249
+ "class": "k-slider-track-wrap",
250
+ style: {
251
+ touchAction: 'none'
252
+ }
253
+ }, [defaultSlot && h("ul", {
254
+ "class": "k-reset k-slider-items"
255
+ }, [defaultSlot]), h("div", {
256
+ "class": "k-slider-track",
257
+ ref: 'sliderTrack'
258
+ }, [h("div", {
259
+ "class": "k-slider-selection",
260
+ style: _this.$props.vertical ? {
261
+ height: percentValue + '%'
262
+ } : {
263
+ width: percentValue + '%'
264
+ }
265
+ }), h("a", {
266
+ "class": "k-draghandle",
267
+ title: lS.toLanguageString(sliderDragTitle, messages[sliderDragTitle]),
268
+ attrs: _this.v3 ? undefined : {
269
+ title: lS.toLanguageString(sliderDragTitle, messages[sliderDragTitle])
270
+ },
271
+ style: _this.$props.vertical ? {
272
+ bottom: percentValue + '%',
273
+ zIndex: 1
274
+ } : (_a = {}, _a[_this.currentDir === 'rtl' ? 'right' : 'left'] = percentValue + '%', _a.zIndex = 1, _a)
275
+ })])])]), this.$props.buttons && // @ts-ignore
276
+ h(Button, {
277
+ type: "button",
278
+ attrs: this.v3 ? undefined : {
279
+ type: "button",
280
+ tabIndex: -1,
281
+ icon: this.$props.vertical ? 'arrow-n' : 'arrow-e',
282
+ rounded: 'full',
283
+ title: lS.toLanguageString(sliderIncreaseValue, messages[sliderIncreaseValue])
284
+ },
285
+ tabIndex: -1,
286
+ icon: this.$props.vertical ? 'arrow-n' : 'arrow-e',
287
+ rounded: 'full',
288
+ style: {
289
+ position: 'relative'
290
+ },
291
+ "class": "k-button-increase",
292
+ title: lS.toLanguageString(sliderIncreaseValue, messages[sliderIncreaseValue]),
293
+ onClick: this.increment,
294
+ on: this.v3 ? undefined : {
295
+ "click": this.increment
296
+ }
297
+ })])]);
298
+ },
299
+ methods: {
300
+ focus: function focus() {
301
+ if (this.$el) {
302
+ // @ts-ignore
303
+ this.$el.focus();
304
+ }
305
+ },
306
+ isLabel: function isLabel(target) {
307
+ var currentTarget = target;
308
+
309
+ while (currentTarget) {
310
+ if (Boolean(currentTarget.getAttribute(SLIDER_LABEL_ATTRIBUTE))) {
311
+ return true;
312
+ }
313
+
314
+ currentTarget = currentTarget.parentElement;
315
+ }
316
+
317
+ return false;
318
+ },
319
+ onFocus: function onFocus(event) {
320
+ this.currentFocused = true;
321
+ this.$emit('focus', event);
322
+ },
323
+ onBlur: function onBlur(event) {
324
+ this.currentFocused = false;
325
+ this.$emit('blur', event);
326
+ },
327
+ onKeyDown: function onKeyDown(e) {
328
+ var newValue = undefined;
329
+
330
+ if (e.keyCode === Keys.left || e.keyCode === Keys.down) {
331
+ newValue = this.currentValue - (this.$props.step || 0);
332
+ } else if (e.keyCode === Keys.right || e.keyCode === Keys.up) {
333
+ newValue = this.currentValue + (this.$props.step || 0);
334
+ } else if (e.keyCode === Keys.home) {
335
+ newValue = this.$props.min;
336
+ } else if (e.keyCode === Keys.end) {
337
+ newValue = this.$props.max;
338
+ }
339
+
340
+ if (newValue !== undefined) {
341
+ e.preventDefault();
342
+ this.change(e, newValue);
343
+ }
344
+ },
345
+ decrement: function decrement(e) {
346
+ e.preventDefault();
347
+ this.change(e, this.currentValue - (this.$props.step || 0));
348
+ },
349
+ increment: function increment(e) {
350
+ e.preventDefault();
351
+ this.change(e, this.currentValue + (this.$props.step || 0));
352
+ },
353
+ dragStart: function dragStart(e) {
354
+ if (!this.isLabel(e.originalEvent.target)) {
355
+ if (e.isTouch) {
356
+ e.originalEvent.preventDefault();
357
+ }
358
+
359
+ this.drag(e);
360
+ }
361
+ },
362
+ dragOver: function dragOver(e) {
363
+ e.originalEvent.preventDefault();
364
+ this.drag(e);
365
+ },
366
+ drag: function drag(e) {
367
+ var computed = this.draggable.element.getBoundingClientRect();
368
+ var distance = this.$props.vertical ? computed.bottom - e.clientY : this.currentDir === 'rtl' ? computed.right - e.clientX : e.clientX - computed.left;
369
+ var size = this.$props.vertical ? computed.height : computed.width;
370
+ var percentage = distance / size;
371
+ this.change(e, this.$props.min + percentage * (this.$props.max - this.$props.min));
372
+ },
373
+ change: function change(e, value) {
374
+ value = Math.min(Math.max(value, this.$props.min), this.$props.max);
375
+ this.currentValue = value;
376
+ this.$emit('changemodel', value);
377
+ this.$emit('update:modelValue', value);
378
+ this.$emit('change', {
379
+ event: e,
380
+ value: value,
381
+ component: this,
382
+ target: {
383
+ name: this.$props.name,
384
+ value: value
385
+ }
386
+ });
387
+ }
388
+ }
389
+ };
390
+ /**
391
+ * @hidden
392
+ */
393
+
394
+ var Slider = SliderVue2;
395
+ export { Slider, SliderVue2 };