@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,511 @@
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
+ import { MaskingService } from './masking.service.js';
8
+ import { defaultRules, maskingChanged, returnFalse } from './utils.js';
9
+ import { guid, getTabIndex, validatePackage, kendoThemeMaps, templateDefinition, templateRendering, getListeners, getTemplate, setRef } from '@progress/kendo-vue-common';
10
+ import { packageMetadata } from '../package-metadata.js';
11
+ /**
12
+ * @hidden
13
+ */
14
+
15
+ var MaskedTextBoxVue2 = {
16
+ model: {
17
+ event: 'changemodel'
18
+ },
19
+ props: {
20
+ type: {
21
+ type: String,
22
+ default: 'text'
23
+ },
24
+ modelValue: String,
25
+ modelRawValue: String,
26
+ value: String,
27
+ defaultValue: String,
28
+ placeholder: String,
29
+ title: String,
30
+ dir: String,
31
+ id: String,
32
+ ariaLabelledBy: String,
33
+ ariaDescribedBy: String,
34
+ tabIndex: Number,
35
+ accessKey: String,
36
+ disabled: Boolean,
37
+ readonly: Boolean,
38
+ size: {
39
+ type: String,
40
+ default: 'medium',
41
+ validator: function validator(value) {
42
+ return [null, 'small', 'medium', 'large'].includes(value);
43
+ }
44
+ },
45
+ rounded: {
46
+ type: String,
47
+ default: 'medium',
48
+ validator: function validator(value) {
49
+ return [null, 'small', 'medium', 'large', 'full'].includes(value);
50
+ }
51
+ },
52
+ fillMode: {
53
+ type: String,
54
+ default: 'solid',
55
+ validator: function validator(value) {
56
+ return [null, 'solid', 'flat', 'outline'].includes(value);
57
+ }
58
+ },
59
+ prompt: {
60
+ type: String,
61
+ default: '_'
62
+ },
63
+ promptPlaceholder: {
64
+ type: String,
65
+ default: ' '
66
+ },
67
+ includeLiterals: {
68
+ type: Boolean,
69
+ default: false
70
+ },
71
+ maskValidation: {
72
+ type: Boolean,
73
+ default: true
74
+ },
75
+ mask: String,
76
+ rules: {
77
+ type: Object,
78
+ default: function _default() {
79
+ return defaultRules;
80
+ }
81
+ },
82
+ selection: Object,
83
+ name: String,
84
+ label: String,
85
+ validationMessage: String,
86
+ required: {
87
+ type: Boolean,
88
+ default: false
89
+ },
90
+ valid: {
91
+ type: Boolean,
92
+ default: undefined
93
+ },
94
+ validityStyles: {
95
+ type: Boolean,
96
+ default: true
97
+ },
98
+ iconName: String,
99
+ inputPrefix: templateDefinition,
100
+ inputSuffix: templateDefinition,
101
+ showValidationIcon: Boolean,
102
+ showLoadingIcon: Boolean,
103
+ showClearButton: Boolean,
104
+ inputClass: String,
105
+ wrapperClass: String
106
+ },
107
+ data: function data() {
108
+ return {
109
+ currentValue: undefined,
110
+ currentFocused: false,
111
+ inputValue: undefined,
112
+ currentSelection: [null, null]
113
+ };
114
+ },
115
+ created: function created() {
116
+ validatePackage(packageMetadata);
117
+ this.hasMounted = false;
118
+ this.valueDuringOnChange = undefined;
119
+ this.inputId = "k-".concat(guid());
120
+ this.service = new MaskingService();
121
+ this.isPasted = false;
122
+ },
123
+ // @ts-ignore
124
+ setup: !isV3 ? undefined : function () {
125
+ var v3 = !!isV3;
126
+ var inputRef = ref(null);
127
+ return {
128
+ v3: v3,
129
+ inputRef: inputRef
130
+ };
131
+ },
132
+ mounted: function mounted() {
133
+ this.hasMounted = true; // @ts-ignore
134
+
135
+ this.element = this.input = this.v3 ? this.inputRef : this.$refs.input;
136
+ this.updateService();
137
+ this.setValidity();
138
+ },
139
+ watch: {
140
+ currentFocused: function currentFocused(_, oldValue) {
141
+ this.prevCurrentFocused = oldValue;
142
+ },
143
+ selection: function selection(_, oldValue) {
144
+ this.prevSelection = oldValue;
145
+ },
146
+ includeLiterals: function includeLiterals(_, oldValue) {
147
+ this.prevIncludeLiterals = oldValue;
148
+ },
149
+ mask: function mask(_, oldValue) {
150
+ this.prevMask = oldValue;
151
+ },
152
+ prompt: function prompt(_, oldValue) {
153
+ this.prevPrompt = oldValue;
154
+ },
155
+ promptPlaceholder: function promptPlaceholder(_, oldValue) {
156
+ this.prevPromptPlaceholder = oldValue;
157
+ },
158
+ rules: function rules(_, oldValue) {
159
+ this.prevRules = oldValue;
160
+ }
161
+ },
162
+ updated: function updated() {
163
+ if (this.element && this.currentFocused) {
164
+ // && this.prevCurrentFocused
165
+ var _a = this.currentSelection,
166
+ start = _a[0],
167
+ end = _a[1];
168
+ var prevSelection = this.prevSelection;
169
+ var nextSelection = this.$props.selection;
170
+
171
+ if (!prevSelection && nextSelection || prevSelection && nextSelection && (prevSelection.start !== nextSelection.start || prevSelection.end !== nextSelection.end)) {
172
+ start = nextSelection.start;
173
+ end = nextSelection.end;
174
+ }
175
+
176
+ if (start !== null && end !== null) {
177
+ this.element.setSelectionRange(start, end);
178
+ }
179
+ }
180
+
181
+ var prevProps = {
182
+ includeLiterals: this.prevIncludeLiterals,
183
+ mask: this.prevMask,
184
+ prompt: this.prevPrompt,
185
+ promptPlaceholder: this.prevPromptPlaceholder,
186
+ rules: this.prevRules
187
+ };
188
+
189
+ if (maskingChanged(prevProps, this.$props)) {
190
+ this.updateService();
191
+ }
192
+
193
+ this.setValidity();
194
+ },
195
+ computed: {
196
+ computedRules: {
197
+ get: function get() {
198
+ return Object.assign({}, defaultRules, this.$props.rules);
199
+ }
200
+ },
201
+ spanClassNames: {
202
+ get: function get() {
203
+ var _a;
204
+
205
+ var isValid = !this.hasMounted || !this.$props.validityStyles || this.validity().valid;
206
+ return _a = {
207
+ 'k-floating-label-container': true,
208
+ 'k-focus': this.currentFocused,
209
+ 'k-empty': !this.computedValue(),
210
+ 'k-invalid': !isValid && isValid !== undefined,
211
+ 'k-rtl': this.$props.dir === 'rtl',
212
+ 'k-loading': this.showLoadingIcon
213
+ }, _a[this.wrapperClass] = this.wrapperClass, _a;
214
+ }
215
+ },
216
+ wrapperSpanClass: function wrapperSpanClass() {
217
+ var _a;
218
+
219
+ var _b = this.$props,
220
+ size = _b.size,
221
+ fillMode = _b.fillMode,
222
+ rounded = _b.rounded;
223
+ var isValid = !this.$props.validityStyles || this.validity().valid;
224
+ return _a = {
225
+ 'k-maskedtextbox': true,
226
+ 'k-input': true
227
+ }, _a["k-input-".concat(kendoThemeMaps.sizeMap[size] || size)] = size, _a["k-input-".concat(fillMode)] = fillMode, _a["k-rounded-".concat(kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded, _a['k-invalid'] = !isValid, _a['k-required'] = this.required, _a['k-disabled'] = this.$props.disabled, _a['k-loading'] = this.showLoadingIcon, _a[this.wrapperClass] = this.wrapperClass, _a;
228
+ },
229
+ inputInnerClass: function inputInnerClass() {
230
+ var _a;
231
+
232
+ return _a = {
233
+ 'k-input-inner': true
234
+ }, _a[this.inputClass] = this.inputClass, _a;
235
+ }
236
+ },
237
+ methods: {
238
+ focus: function focus() {
239
+ if (this.input) {
240
+ this.input.focus();
241
+ }
242
+ },
243
+ computedValue: function computedValue() {
244
+ var value;
245
+
246
+ if (this.valueDuringOnChange !== undefined) {
247
+ value = this.valueDuringOnChange;
248
+ } else if (this.$props.value !== undefined) {
249
+ value = this.$props.value;
250
+ } else if (this.$props.modelValue !== undefined) {
251
+ value = this.$props.modelValue;
252
+ } else if (this.currentValue !== undefined) {
253
+ value = this.currentValue;
254
+ } else if (this.$props.defaultValue !== undefined) {
255
+ value = this.$props.defaultValue;
256
+ }
257
+
258
+ return value || '';
259
+ },
260
+ rawValue: function rawValue() {
261
+ return this.service.rawValue(this.computedValue());
262
+ },
263
+ validity: function validity() {
264
+ var maskedValue = this.computedValue();
265
+ var value = this.service.validationValue(maskedValue);
266
+ var customError = this.$props.validationMessage !== undefined;
267
+ var valid = this.$props.valid !== undefined ? this.$props.valid : (!this.$props.required || !!value) && (!this.$props.maskValidation || !this.$props.prompt || maskedValue.indexOf(this.$props.prompt) === -1);
268
+ return {
269
+ customError: customError,
270
+ valid: valid,
271
+ valueMissing: !value
272
+ };
273
+ },
274
+ pasteHandler: function pasteHandler(event) {
275
+ var _a = event.target,
276
+ selectionStart = _a.selectionStart,
277
+ selectionEnd = _a.selectionEnd;
278
+
279
+ if (selectionEnd === selectionStart) {
280
+ return;
281
+ }
282
+
283
+ this.isPasted = true;
284
+ this.currentSelection = [selectionStart || 0, selectionEnd || 0];
285
+ },
286
+ clearClick: function clearClick(event) {
287
+ this.triggerOnChange('', event);
288
+ },
289
+ onChangeHandler: function onChangeHandler(event) {
290
+ var input = event.currentTarget;
291
+ var value = this.inputValue = input.value;
292
+ var start = this.currentSelection[0] || 0;
293
+ var end = this.currentSelection[1] || 0;
294
+
295
+ if (!this.$props.mask) {
296
+ this.isPasted = false;
297
+ this.currentSelection = [null, null];
298
+ this.triggerOnChange(value, event);
299
+ return;
300
+ }
301
+
302
+ var maskedValue = this.computedValue();
303
+ var result;
304
+
305
+ if (this.isPasted) {
306
+ this.isPasted = false;
307
+ var rightPart = maskedValue.length - end;
308
+ var to = value.length - rightPart;
309
+ result = this.service.maskInRange(value.slice(start, to), maskedValue, start, end);
310
+ } else {
311
+ result = this.service.maskInput(value, maskedValue, input.selectionStart || 0);
312
+ }
313
+
314
+ this.currentSelection = [result.selection, result.selection];
315
+ this.triggerOnChange(result.value, event);
316
+ this.inputValue = undefined;
317
+ },
318
+ focusHandler: function focusHandler(event) {
319
+ if (!this.currentFocused) {
320
+ this.currentFocused = true;
321
+ this.$emit('focus', {
322
+ target: this,
323
+ event: event
324
+ });
325
+ }
326
+ },
327
+ blurHandler: function blurHandler(event) {
328
+ if (this.currentFocused) {
329
+ this.currentFocused = false;
330
+ this.$emit('blur', {
331
+ target: this,
332
+ event: event
333
+ });
334
+ }
335
+ },
336
+ triggerOnChange: function triggerOnChange(maskedValue, event) {
337
+ this.currentValue = maskedValue;
338
+ this.valueDuringOnChange = maskedValue;
339
+ this.$emit('change', {
340
+ event: event,
341
+ selectionStart: this.currentSelection[0],
342
+ selectionEnd: this.currentSelection[1],
343
+ value: this.computedValue(),
344
+ component: this,
345
+ target: {
346
+ name: this.$props.name,
347
+ value: this.computedValue(),
348
+ rawValue: this.rawValue()
349
+ },
350
+ validity: this.validity()
351
+ });
352
+ this.$emit('update:modelValue', this.computedValue());
353
+ this.$emit('update:modelRawValue', this.rawValue());
354
+ this.$emit('changemodel', this.computedValue());
355
+ this.valueDuringOnChange = undefined;
356
+ },
357
+ updateService: function updateService(extra) {
358
+ var config = Object.assign({
359
+ includeLiterals: this.$props.includeLiterals,
360
+ mask: this.$props.mask,
361
+ prompt: this.$props.prompt,
362
+ promptPlaceholder: this.$props.promptPlaceholder,
363
+ rules: this.$props.rules
364
+ }, extra); // tslint:disable-line:align
365
+
366
+ this.service.update(config);
367
+ },
368
+ setValidity: function setValidity() {
369
+ if (this.element) {
370
+ this.element.setCustomValidity(this.validity().valid ? '' : this.$props.validationMessage || '');
371
+ }
372
+ }
373
+ },
374
+ // @ts-ignore
375
+ render: function render(createElement) {
376
+ var h = gh || createElement;
377
+ var inputId = this.$props.id || this.inputId;
378
+ var _a = this.$props,
379
+ iconName = _a.iconName,
380
+ showValidationIcon = _a.showValidationIcon,
381
+ showLoadingIcon = _a.showLoadingIcon,
382
+ showClearButton = _a.showClearButton;
383
+ var isValid = !this.$props.validityStyles || this.validity().valid;
384
+ var newValue = this.computedValue();
385
+ var inputValue = this.inputValue;
386
+ var inputPrefixTemplate = templateRendering.call(this, this.$props.inputPrefix, getListeners.call(this));
387
+ var inputSuffixTemplate = templateRendering.call(this, this.$props.inputSuffix, getListeners.call(this));
388
+ var inputPrefix = getTemplate.call(this, {
389
+ h: h,
390
+ template: inputPrefixTemplate,
391
+ additionalProps: {
392
+ value: newValue,
393
+ valid: isValid
394
+ }
395
+ });
396
+ var inputSuffix = getTemplate.call(this, {
397
+ h: h,
398
+ template: inputSuffixTemplate,
399
+ additionalProps: {
400
+ value: newValue,
401
+ valid: isValid
402
+ }
403
+ });
404
+ var wrapper = h("span", {
405
+ dir: this.$props.dir,
406
+ attrs: this.v3 ? undefined : {
407
+ dir: this.$props.dir
408
+ },
409
+ "class": this.wrapperSpanClass,
410
+ style: !this.$props.label ? {
411
+ width: this.$props.width
412
+ } : undefined
413
+ }, [iconName && h("span", {
414
+ "class": "k-input-icon k-icon k-i-".concat(iconName)
415
+ }), this.$props.inputPrefix && h("span", {
416
+ "class": "k-input-prefix"
417
+ }, [inputPrefix]), h("input", {
418
+ type: this.$props.type,
419
+ attrs: this.v3 ? undefined : {
420
+ type: this.$props.type,
421
+ autocomplete: "off",
422
+ autocorrect: "off",
423
+ autocapitalize: "off",
424
+ spellcheck: false,
425
+ id: inputId,
426
+ "aria-labelledby": this.$props.ariaLabelledBy,
427
+ "aria-describedby": this.$props.ariaDescribedBy,
428
+ name: this.$props.name,
429
+ tabindex: getTabIndex(this.$props.tabIndex, this.$props.disabled, true),
430
+ accesskey: this.$props.accessKey,
431
+ title: this.$props.title,
432
+ disabled: this.$props.disabled || undefined,
433
+ readonly: this.$props.readonly || undefined,
434
+ placeholder: this.$props.placeholder,
435
+ required: this.$props.required
436
+ },
437
+ autocomplete: "off",
438
+ autocorrect: "off",
439
+ autocapitalize: "off",
440
+ spellcheck: false,
441
+ "class": this.inputInnerClass,
442
+ value: this.v3 ? newValue : null,
443
+ domProps: this.v3 ? undefined : {
444
+ "value": newValue
445
+ },
446
+ id: inputId,
447
+ "aria-labelledby": this.$props.ariaLabelledBy,
448
+ "aria-describedby": this.$props.ariaDescribedBy,
449
+ name: this.$props.name,
450
+ tabindex: getTabIndex(this.$props.tabIndex, this.$props.disabled, true),
451
+ accesskey: this.$props.accessKey,
452
+ title: this.$props.title,
453
+ disabled: this.$props.disabled || undefined,
454
+ readonly: this.$props.readonly || undefined,
455
+ placeholder: this.$props.placeholder,
456
+ required: this.$props.required,
457
+ ref: setRef(this, 'input'),
458
+ onInput: this.onChangeHandler,
459
+ on: this.v3 ? undefined : {
460
+ "input": this.onChangeHandler,
461
+ "paste": this.pasteHandler,
462
+ "focus": this.focusHandler,
463
+ "blur": this.blurHandler,
464
+ "dragstart": returnFalse,
465
+ "drop": returnFalse
466
+ },
467
+ onPaste: this.pasteHandler,
468
+ onFocus: this.focusHandler,
469
+ onBlur: this.blurHandler,
470
+ onDragstart: returnFalse,
471
+ onDrop: returnFalse
472
+ }), this.$props.inputSuffix && h("span", {
473
+ "class": "k-input-suffix"
474
+ }, [inputSuffix]), showValidationIcon && isValid && h("span", {
475
+ "class": "k-input-validation-icon k-icon k-i-check"
476
+ }), showValidationIcon && !isValid && h("span", {
477
+ "class": "k-input-validation-icon k-icon k-i-warning"
478
+ }), showLoadingIcon && h("span", {
479
+ "class": "k-input-loading-icon k-icon k-i-loading"
480
+ }), showClearButton && newValue && h("span", {
481
+ onClick: this.clearClick,
482
+ on: this.v3 ? undefined : {
483
+ "click": this.clearClick
484
+ },
485
+ "class": "k-clear-value"
486
+ }, [h("span", {
487
+ "class": "k-icon k-i-x"
488
+ })])]);
489
+ return this.$props.label ? h("span", {
490
+ "class": this.spanClassNames,
491
+ dir: this.$props.dir,
492
+ attrs: this.v3 ? undefined : {
493
+ dir: this.$props.dir
494
+ }
495
+ }, [wrapper, this.$props.label ? inputId ? h("label", {
496
+ "for": inputId,
497
+ attrs: this.v3 ? undefined : {
498
+ "for": inputId
499
+ },
500
+ "class": "k-label"
501
+ }, [this.$props.label]) : h("span", {
502
+ "class": "k-label"
503
+ }, [this.$props.label]) : null]) : wrapper;
504
+ }
505
+ };
506
+ /**
507
+ * @hidden
508
+ */
509
+
510
+ var MaskedTextBox = MaskedTextBoxVue2;
511
+ export { MaskedTextBox, MaskedTextBoxVue2 };