PluginProbe
Booking Calendar / 11.9
Booking Calendar v11.9
11.9 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 All 205 releases
booking / vendors / imask / esm / core / continuous-tail-details.js

continuous-tail-details.js in Booking Calendar 11.9, at vendors/imask/esm/core/continuous-tail-details.js

56 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /** Provides details of continuous extracted tail */
2 class ContinuousTailDetails {
3 /** Tail value as string */
4
5 /** Tail start position */
6
7 /** Start position */
8
9 constructor(value, from, stop) {
10 if (value === void 0) {
11 value = '';
12 }
13 if (from === void 0) {
14 from = 0;
15 }
16 this.value = value;
17 this.from = from;
18 this.stop = stop;
19 }
20 toString() {
21 return this.value;
22 }
23 extend(tail) {
24 this.value += String(tail);
25 }
26 appendTo(masked) {
27 return masked.append(this.toString(), {
28 tail: true
29 }).aggregate(masked._appendPlaceholder());
30 }
31 get state() {
32 return {
33 value: this.value,
34 from: this.from,
35 stop: this.stop
36 };
37 }
38 set state(state) {
39 Object.assign(this, state);
40 }
41 unshift(beforePos) {
42 if (!this.value.length || beforePos != null && this.from >= beforePos) return '';
43 const shiftChar = this.value[0];
44 this.value = this.value.slice(1);
45 return shiftChar;
46 }
47 shift() {
48 if (!this.value.length) return '';
49 const shiftChar = this.value[this.value.length - 1];
50 this.value = this.value.slice(0, -1);
51 return shiftChar;
52 }
53 }
54
55 export { ContinuousTailDetails as default };
56