PluginProbe
Booking Calendar / 11.8
Booking Calendar v11.8
11.8.4 11.8.3 11.8.2 11.8.1 11.8 11.7 11.6.1 11.6 11.5 11.4.3 11.4.2 11.4.1 11.4 11.3 11.2.1 11.2 11.1 11.0 10.15.7 10.15.6 10.1.3 10.10 10.10.1 10.10.2 10.11 All 204 releases
booking / vendors / imask / esm / controls / html-input-mask-element.js

html-input-mask-element.js in Booking Calendar 11.8, at vendors/imask/esm/controls/html-input-mask-element.js

38 lines 938 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import HTMLMaskElement from './html-mask-element.js';
2 import IMask from '../core/holder.js';
3 import './mask-element.js';
4
5 /** Bridge between InputElement and {@link Masked} */
6 class HTMLInputMaskElement extends HTMLMaskElement {
7 /** InputElement to use mask on */
8
9 constructor(input) {
10 super(input);
11 this.input = input;
12 }
13
14 /** Returns InputElement selection start */
15 get _unsafeSelectionStart() {
16 return this.input.selectionStart != null ? this.input.selectionStart : this.value.length;
17 }
18
19 /** Returns InputElement selection end */
20 get _unsafeSelectionEnd() {
21 return this.input.selectionEnd;
22 }
23
24 /** Sets InputElement selection */
25 _unsafeSelect(start, end) {
26 this.input.setSelectionRange(start, end);
27 }
28 get value() {
29 return this.input.value;
30 }
31 set value(value) {
32 this.input.value = value;
33 }
34 }
35 IMask.HTMLMaskElement = HTMLMaskElement;
36
37 export { HTMLInputMaskElement as default };
38