@progress/kendo-vue-inputs 9.0.1-develop.1 → 9.1.0-develop.1
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.
- package/dist/cdn/js/kendo-vue-inputs.js +1 -1
- package/index.d.mts +7 -0
- package/index.d.ts +7 -0
- package/index.js +1 -1
- package/index.mjs +17 -15
- package/messages/main.d.ts +10 -0
- package/messages/main.js +2 -2
- package/messages/main.mjs +27 -23
- package/otpinput/OTPInput.d.ts +256 -0
- package/otpinput/OTPInput.js +8 -0
- package/otpinput/OTPInput.mjs +424 -0
- package/otpinput/OTPInputCell.d.ts +168 -0
- package/otpinput/OTPInputCell.js +8 -0
- package/otpinput/OTPInputCell.mjs +173 -0
- package/otpinput/OTPInputHandle.d.ts +33 -0
- package/otpinput/OTPInputSeparator.d.ts +25 -0
- package/otpinput/OTPInputSeparator.js +8 -0
- package/otpinput/OTPInputSeparator.mjs +33 -0
- package/otpinput/interfaces/OTPInputBlurEvent.d.ts +25 -0
- package/otpinput/interfaces/OTPInputChangeEvent.d.ts +34 -0
- package/otpinput/interfaces/OTPInputFocusEvent.d.ts +29 -0
- package/otpinput/interfaces/OTPInputProps.d.ts +316 -0
- package/otpinput/interfaces/OTPSeparatorIcon.d.ts +27 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +9 -9
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { defineComponent as r, createVNode as a } from "vue";
|
|
9
|
+
import { classNames as u } from "@progress/kendo-vue-common";
|
|
10
|
+
import { provideLocalizationService as d } from "@progress/kendo-vue-intl";
|
|
11
|
+
import { TextBox as h } from "../textbox/TextBox.mjs";
|
|
12
|
+
import { otpInputCellAriaLabel as s, messages as p } from "../messages/main.mjs";
|
|
13
|
+
const C = /* @__PURE__ */ r({
|
|
14
|
+
name: "OTPInputCell",
|
|
15
|
+
props: {
|
|
16
|
+
index: {
|
|
17
|
+
type: Number,
|
|
18
|
+
required: !0
|
|
19
|
+
},
|
|
20
|
+
totalLength: {
|
|
21
|
+
type: Number,
|
|
22
|
+
required: !0
|
|
23
|
+
},
|
|
24
|
+
char: {
|
|
25
|
+
type: String,
|
|
26
|
+
required: !0
|
|
27
|
+
},
|
|
28
|
+
type: {
|
|
29
|
+
type: String
|
|
30
|
+
},
|
|
31
|
+
placeholder: {
|
|
32
|
+
type: String
|
|
33
|
+
},
|
|
34
|
+
disabled: {
|
|
35
|
+
type: Boolean
|
|
36
|
+
},
|
|
37
|
+
readOnly: {
|
|
38
|
+
type: Boolean
|
|
39
|
+
},
|
|
40
|
+
required: {
|
|
41
|
+
type: Boolean
|
|
42
|
+
},
|
|
43
|
+
size: {
|
|
44
|
+
type: String
|
|
45
|
+
},
|
|
46
|
+
fillMode: {
|
|
47
|
+
type: String
|
|
48
|
+
},
|
|
49
|
+
rounded: {
|
|
50
|
+
type: String
|
|
51
|
+
},
|
|
52
|
+
id: {
|
|
53
|
+
type: String
|
|
54
|
+
},
|
|
55
|
+
name: {
|
|
56
|
+
type: String
|
|
57
|
+
},
|
|
58
|
+
inputAttributes: {
|
|
59
|
+
type: Object
|
|
60
|
+
},
|
|
61
|
+
valid: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: void 0
|
|
64
|
+
},
|
|
65
|
+
onCellChange: {
|
|
66
|
+
type: Function
|
|
67
|
+
},
|
|
68
|
+
onCellKeyDown: {
|
|
69
|
+
type: Function
|
|
70
|
+
},
|
|
71
|
+
onCellFocus: {
|
|
72
|
+
type: Function
|
|
73
|
+
},
|
|
74
|
+
onCellBlur: {
|
|
75
|
+
type: Function
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
inject: {
|
|
79
|
+
kendoLocalizationService: {
|
|
80
|
+
default: null
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
data() {
|
|
84
|
+
return {
|
|
85
|
+
_input: null
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
mounted() {
|
|
89
|
+
var e, t;
|
|
90
|
+
this._input = (t = (e = this.$refs.textBoxRef) == null ? void 0 : e._input) != null ? t : null;
|
|
91
|
+
},
|
|
92
|
+
methods: {
|
|
93
|
+
focus() {
|
|
94
|
+
var t;
|
|
95
|
+
const e = (t = this.$refs.textBoxRef) == null ? void 0 : t._input;
|
|
96
|
+
e && e.focus();
|
|
97
|
+
},
|
|
98
|
+
blur() {
|
|
99
|
+
var t;
|
|
100
|
+
const e = (t = this.$refs.textBoxRef) == null ? void 0 : t._input;
|
|
101
|
+
e && e.blur();
|
|
102
|
+
},
|
|
103
|
+
select() {
|
|
104
|
+
var t;
|
|
105
|
+
const e = (t = this.$refs.textBoxRef) == null ? void 0 : t._input;
|
|
106
|
+
e && e.select();
|
|
107
|
+
},
|
|
108
|
+
handleChange(e) {
|
|
109
|
+
var t, i, n, l;
|
|
110
|
+
if (this.onCellChange) {
|
|
111
|
+
const o = (i = (t = e.event) != null ? t : e.syntheticEvent) != null ? i : e;
|
|
112
|
+
this.onCellChange(this.index, (l = (n = o == null ? void 0 : o.target) == null ? void 0 : n.value) != null ? l : "", o);
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
handleFocus(e) {
|
|
116
|
+
var n, l;
|
|
117
|
+
const t = (n = e.event) != null ? n : e, i = (l = this.$refs.textBoxRef) == null ? void 0 : l._input;
|
|
118
|
+
i && i.select(), this.onCellFocus && this.onCellFocus(this.index, t);
|
|
119
|
+
},
|
|
120
|
+
handleBlur(e) {
|
|
121
|
+
var i;
|
|
122
|
+
const t = (i = e.event) != null ? i : e;
|
|
123
|
+
this.onCellBlur && this.onCellBlur(this.index, t);
|
|
124
|
+
},
|
|
125
|
+
handleKeyDown(e) {
|
|
126
|
+
this.onCellKeyDown && this.onCellKeyDown(this.index, e);
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
render() {
|
|
130
|
+
const t = d(this).toLanguageString(s, p[s]).replace("{index}", String(this.index + 1)).replace("{total}", String(this.totalLength)), i = {
|
|
131
|
+
autoComplete: "off",
|
|
132
|
+
type: this.type === "number" ? "text" : this.type,
|
|
133
|
+
...this.inputAttributes,
|
|
134
|
+
// Protected attrs — cannot be overridden by user's inputAttributes:
|
|
135
|
+
maxLength: 1,
|
|
136
|
+
...this.name && {
|
|
137
|
+
name: this.name
|
|
138
|
+
},
|
|
139
|
+
...this.readOnly && {
|
|
140
|
+
readOnly: !0
|
|
141
|
+
},
|
|
142
|
+
...this.valid === !1 && {
|
|
143
|
+
"aria-invalid": !0
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
return a(h, {
|
|
147
|
+
ref: "textBoxRef",
|
|
148
|
+
wrapperClass: u("k-otp-input", {
|
|
149
|
+
"k-readonly": this.readOnly,
|
|
150
|
+
"k-invalid": this.valid === !1
|
|
151
|
+
}),
|
|
152
|
+
value: this.char === " " ? "" : this.char,
|
|
153
|
+
size: this.size,
|
|
154
|
+
fillMode: this.fillMode,
|
|
155
|
+
rounded: this.rounded,
|
|
156
|
+
disabled: this.disabled,
|
|
157
|
+
required: this.required,
|
|
158
|
+
valid: this.valid,
|
|
159
|
+
validityStyles: !1,
|
|
160
|
+
id: this.id,
|
|
161
|
+
placeholder: this.placeholder,
|
|
162
|
+
ariaLabel: t,
|
|
163
|
+
onInput: this.onCellChange ? this.handleChange : void 0,
|
|
164
|
+
onFocus: this.handleFocus,
|
|
165
|
+
onBlur: this.handleBlur,
|
|
166
|
+
onKeydown: this.handleKeyDown,
|
|
167
|
+
inputAttributes: i
|
|
168
|
+
}, null);
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
export {
|
|
172
|
+
C as OTPInputCell
|
|
173
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Represents the `ref` of the Kendo UI for Vue OTPInput component.
|
|
10
|
+
*/
|
|
11
|
+
export interface OTPInputHandle {
|
|
12
|
+
/**
|
|
13
|
+
* The root wrapper DOM element.
|
|
14
|
+
*/
|
|
15
|
+
element: HTMLDivElement | null;
|
|
16
|
+
/**
|
|
17
|
+
* The current string value of the OTPInput.
|
|
18
|
+
* Unfilled cells are represented with a space (`' '`).
|
|
19
|
+
*/
|
|
20
|
+
value: string;
|
|
21
|
+
/**
|
|
22
|
+
* Focuses the input cell at `index`.
|
|
23
|
+
* When `index` is omitted, focuses the first unfilled cell or
|
|
24
|
+
* the last cell if all are filled.
|
|
25
|
+
*
|
|
26
|
+
* @param index - Zero-based index of the cell to focus.
|
|
27
|
+
*/
|
|
28
|
+
focus: (index?: number) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Programmatically blurs the OTPInput.
|
|
31
|
+
*/
|
|
32
|
+
blur: () => void;
|
|
33
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { PropType } from 'vue';
|
|
9
|
+
import { OTPSeparatorIcon } from './interfaces/OTPSeparatorIcon';
|
|
10
|
+
/** @hidden */
|
|
11
|
+
export interface OTPInputSeparatorProps {
|
|
12
|
+
separator: string | OTPSeparatorIcon;
|
|
13
|
+
}
|
|
14
|
+
/** @hidden */
|
|
15
|
+
export declare const OTPInputSeparator: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
16
|
+
separator: {
|
|
17
|
+
type: PropType<string | OTPSeparatorIcon>;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
21
|
+
separator: {
|
|
22
|
+
type: PropType<string | OTPSeparatorIcon>;
|
|
23
|
+
required: true;
|
|
24
|
+
};
|
|
25
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),r=require("@progress/kendo-vue-common"),a=t.defineComponent({name:"OTPInputSeparator",props:{separator:{type:[String,Object],required:!0}},render(){let e;return typeof this.separator=="string"?e=this.separator:this.separator.type==="svgIcon"?e=t.createVNode(r.Icon,{icon:this.separator.value},null):this.separator.type==="iconClass"?e=t.createVNode("span",{class:this.separator.value},null):e=t.createVNode(r.Icon,{name:this.separator.value},null),t.createVNode("div",{class:"k-otp-separator"},[e])}});exports.OTPInputSeparator=a;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { defineComponent as a, createVNode as t } from "vue";
|
|
9
|
+
import { Icon as r } from "@progress/kendo-vue-common";
|
|
10
|
+
const p = /* @__PURE__ */ a({
|
|
11
|
+
name: "OTPInputSeparator",
|
|
12
|
+
props: {
|
|
13
|
+
separator: {
|
|
14
|
+
type: [String, Object],
|
|
15
|
+
required: !0
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
render() {
|
|
19
|
+
let e;
|
|
20
|
+
return typeof this.separator == "string" ? e = this.separator : this.separator.type === "svgIcon" ? e = t(r, {
|
|
21
|
+
icon: this.separator.value
|
|
22
|
+
}, null) : this.separator.type === "iconClass" ? e = t("span", {
|
|
23
|
+
class: this.separator.value
|
|
24
|
+
}, null) : e = t(r, {
|
|
25
|
+
name: this.separator.value
|
|
26
|
+
}, null), t("div", {
|
|
27
|
+
class: "k-otp-separator"
|
|
28
|
+
}, [e]);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
export {
|
|
32
|
+
p as OTPInputSeparator
|
|
33
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { OTPInputHandle } from '../OTPInputHandle';
|
|
9
|
+
/**
|
|
10
|
+
* Event object fired by `OTPInput` `blur` event.
|
|
11
|
+
*/
|
|
12
|
+
export interface OTPInputBlurEvent {
|
|
13
|
+
/**
|
|
14
|
+
* The component that originated the event.
|
|
15
|
+
*/
|
|
16
|
+
target: OTPInputHandle;
|
|
17
|
+
/**
|
|
18
|
+
* The underlying native blur event.
|
|
19
|
+
*/
|
|
20
|
+
nativeEvent: FocusEvent;
|
|
21
|
+
/**
|
|
22
|
+
* The underlying synthetic event.
|
|
23
|
+
*/
|
|
24
|
+
syntheticEvent: FocusEvent;
|
|
25
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { OTPInputHandle } from '../OTPInputHandle';
|
|
9
|
+
/**
|
|
10
|
+
* Event object fired by `OTPInput` `change` event.
|
|
11
|
+
*/
|
|
12
|
+
export interface OTPInputChangeEvent {
|
|
13
|
+
/**
|
|
14
|
+
* The component that originated the event.
|
|
15
|
+
*/
|
|
16
|
+
target: OTPInputHandle;
|
|
17
|
+
/**
|
|
18
|
+
* The native DOM event.
|
|
19
|
+
*/
|
|
20
|
+
nativeEvent: Event;
|
|
21
|
+
/**
|
|
22
|
+
* The synthetic Vue event.
|
|
23
|
+
*/
|
|
24
|
+
syntheticEvent: Event;
|
|
25
|
+
/**
|
|
26
|
+
* The new full string value of the OTPInput after the change.
|
|
27
|
+
* Unfilled cells are represented as a space (`' '`).
|
|
28
|
+
*/
|
|
29
|
+
value: string;
|
|
30
|
+
/**
|
|
31
|
+
* The component instance that originated the event.
|
|
32
|
+
*/
|
|
33
|
+
component?: any;
|
|
34
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { OTPInputHandle } from '../OTPInputHandle';
|
|
9
|
+
/**
|
|
10
|
+
* Event object fired by `OTPInput` `focus` event.
|
|
11
|
+
*/
|
|
12
|
+
export interface OTPInputFocusEvent {
|
|
13
|
+
/**
|
|
14
|
+
* The component that originated the event.
|
|
15
|
+
*/
|
|
16
|
+
target: OTPInputHandle;
|
|
17
|
+
/**
|
|
18
|
+
* The underlying native focus event.
|
|
19
|
+
*/
|
|
20
|
+
nativeEvent: FocusEvent;
|
|
21
|
+
/**
|
|
22
|
+
* The underlying synthetic event.
|
|
23
|
+
*/
|
|
24
|
+
syntheticEvent: FocusEvent;
|
|
25
|
+
/**
|
|
26
|
+
* The zero-based index of the cell that received focus.
|
|
27
|
+
*/
|
|
28
|
+
cellIndex: number;
|
|
29
|
+
}
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { OTPSeparatorIcon } from './OTPSeparatorIcon';
|
|
9
|
+
import { OTPInputChangeEvent } from './OTPInputChangeEvent';
|
|
10
|
+
import { OTPInputFocusEvent } from './OTPInputFocusEvent';
|
|
11
|
+
import { OTPInputBlurEvent } from './OTPInputBlurEvent';
|
|
12
|
+
/**
|
|
13
|
+
* The input `type` options for the OTPInput.
|
|
14
|
+
*/
|
|
15
|
+
export type OTPInputType = 'text' | 'password' | 'number';
|
|
16
|
+
/**
|
|
17
|
+
* Represents the props for the Kendo UI for Vue
|
|
18
|
+
* [OTPInput](https://www.telerik.com/kendo-vue-ui/components/inputs/otpinput/) component.
|
|
19
|
+
*/
|
|
20
|
+
export interface OTPInputProps {
|
|
21
|
+
/**
|
|
22
|
+
* Sets the current value of the OTPInput (controlled mode).
|
|
23
|
+
* Unfilled input cells are represented with a space (`' '`).
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```vue
|
|
27
|
+
* <OTPInput :value="'12 4'" :length="4" @change="handleChange" />
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
value?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Sets the current value of the OTPInput via `v-model` (two-way binding).
|
|
33
|
+
* Prefer using `v-model` over `value` + `@change` for simpler two-way binding.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```vue
|
|
37
|
+
* <OTPInput v-model="otpCode" :length="6" />
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
modelValue?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Sets the initial value of the OTPInput (uncontrolled mode).
|
|
43
|
+
* Once set, subsequent updates are managed internally.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```vue
|
|
47
|
+
* <OTPInput defaultValue="12" :length="6" />
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
defaultValue?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Sets the total number of individual input cells.
|
|
53
|
+
*
|
|
54
|
+
* @default 4
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```vue
|
|
58
|
+
* <OTPInput :length="6" />
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
length?: number;
|
|
62
|
+
/**
|
|
63
|
+
* Sets the length of each group of input cells.
|
|
64
|
+
*
|
|
65
|
+
* - Provide a `number` to give all groups the same length.
|
|
66
|
+
* - Provide a `number[]` to assign different lengths to each group.
|
|
67
|
+
*
|
|
68
|
+
* The sum of all group lengths must equal `length`.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```vue
|
|
72
|
+
* <OTPInput :length="6" :groupLength="3" separator="-" />
|
|
73
|
+
* <OTPInput :length="12" :groupLength="[4, 4, 4]" separator="-" />
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
groupLength?: number | number[];
|
|
77
|
+
/**
|
|
78
|
+
* Sets the separator rendered between groups of input cells.
|
|
79
|
+
* Only effective when `groupLength` is set.
|
|
80
|
+
*
|
|
81
|
+
* - Provide a `string` to render a text separator.
|
|
82
|
+
* - Provide an `OTPSeparatorIcon` to render an icon separator.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```vue
|
|
86
|
+
* <OTPInput :length="6" :groupLength="3" separator="-" />
|
|
87
|
+
* <OTPInput :length="6" :groupLength="3" :separator="{ type: 'svgIcon', value: minusIcon }" />
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
separator?: string | OTPSeparatorIcon;
|
|
91
|
+
/**
|
|
92
|
+
* Sets the input type.
|
|
93
|
+
*
|
|
94
|
+
* @default 'text'
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```vue
|
|
98
|
+
* <OTPInput type="number" :length="6" />
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
type?: OTPInputType;
|
|
102
|
+
/**
|
|
103
|
+
* Sets a placeholder character shown in each empty input cell.
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```vue
|
|
107
|
+
* <OTPInput placeholder="·" :length="6" />
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
placeholder?: string;
|
|
111
|
+
/**
|
|
112
|
+
* When `true`, renders the input cells as separate boxes with spacing
|
|
113
|
+
* between them. When `false`, renders them as adjacent (joined) cells.
|
|
114
|
+
*
|
|
115
|
+
* @default true
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```vue
|
|
119
|
+
* <OTPInput :spacing="false" :length="6" />
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
spacing?: boolean;
|
|
123
|
+
/**
|
|
124
|
+
* When `true`, disables the OTPInput so that it cannot be interacted
|
|
125
|
+
* with and receives the `k-disabled` CSS class.
|
|
126
|
+
*
|
|
127
|
+
* @default false
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```vue
|
|
131
|
+
* <OTPInput :disabled="true" :length="6" />
|
|
132
|
+
* ```
|
|
133
|
+
*/
|
|
134
|
+
disabled?: boolean;
|
|
135
|
+
/**
|
|
136
|
+
* When `true`, sets the OTPInput to read-only mode.
|
|
137
|
+
*
|
|
138
|
+
* @default false
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* ```vue
|
|
142
|
+
* <OTPInput :readOnly="true" value="123456" :length="6" />
|
|
143
|
+
* ```
|
|
144
|
+
*/
|
|
145
|
+
readOnly?: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* Sets additional HTML attributes on every inner `<input>` element.
|
|
148
|
+
* Attributes that are required for the component to work correctly cannot be overridden.
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* ```vue
|
|
152
|
+
* <OTPInput :inputAttributes="{ autoComplete: 'off' }" :length="6" />
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
155
|
+
inputAttributes?: Object;
|
|
156
|
+
/**
|
|
157
|
+
* Sets the `name` attribute used when the component participates in an
|
|
158
|
+
* HTML form. A hidden `<input>` with this name and the current value
|
|
159
|
+
* is rendered for native form submission.
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* ```vue
|
|
163
|
+
* <OTPInput name="verificationCode" :length="6" />
|
|
164
|
+
* ```
|
|
165
|
+
*/
|
|
166
|
+
name?: string;
|
|
167
|
+
/**
|
|
168
|
+
* Marks the field as required for HTML5 constraint validation.
|
|
169
|
+
*
|
|
170
|
+
* @default false
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* ```vue
|
|
174
|
+
* <OTPInput :required="true" :length="6" />
|
|
175
|
+
* ```
|
|
176
|
+
*/
|
|
177
|
+
required?: boolean;
|
|
178
|
+
/**
|
|
179
|
+
* When `false`, renders the component in an invalid visual state.
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* ```vue
|
|
183
|
+
* <OTPInput :valid="false" :length="6" />
|
|
184
|
+
* ```
|
|
185
|
+
*/
|
|
186
|
+
valid?: boolean;
|
|
187
|
+
/**
|
|
188
|
+
* Configures the `size` of the component.
|
|
189
|
+
*
|
|
190
|
+
* The available options are:
|
|
191
|
+
* - `'small'`
|
|
192
|
+
* - `'medium'`
|
|
193
|
+
* - `'large'`
|
|
194
|
+
*
|
|
195
|
+
* @example
|
|
196
|
+
* ```vue
|
|
197
|
+
* <OTPInput size="large" :length="6" />
|
|
198
|
+
* ```
|
|
199
|
+
*/
|
|
200
|
+
size?: 'small' | 'medium' | 'large';
|
|
201
|
+
/**
|
|
202
|
+
* Configures the `fillMode` of the component.
|
|
203
|
+
*
|
|
204
|
+
* The available options are:
|
|
205
|
+
* - `'solid'`
|
|
206
|
+
* - `'flat'`
|
|
207
|
+
* - `'outline'`
|
|
208
|
+
*
|
|
209
|
+
* @example
|
|
210
|
+
* ```vue
|
|
211
|
+
* <OTPInput fillMode="outline" :length="6" />
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
214
|
+
fillMode?: 'solid' | 'flat' | 'outline';
|
|
215
|
+
/**
|
|
216
|
+
* Configures the `rounded` property of the component.
|
|
217
|
+
*
|
|
218
|
+
* The available options are:
|
|
219
|
+
* - `'small'`
|
|
220
|
+
* - `'medium'`
|
|
221
|
+
* - `'large'`
|
|
222
|
+
* - `'full'`
|
|
223
|
+
* - `'none'`
|
|
224
|
+
*
|
|
225
|
+
* @example
|
|
226
|
+
* ```vue
|
|
227
|
+
* <OTPInput rounded="full" :length="6" />
|
|
228
|
+
* ```
|
|
229
|
+
*/
|
|
230
|
+
rounded?: 'small' | 'medium' | 'large' | 'full' | 'none';
|
|
231
|
+
/**
|
|
232
|
+
* Fires when the user changes the value of any input cell.
|
|
233
|
+
*
|
|
234
|
+
* @example
|
|
235
|
+
* ```vue
|
|
236
|
+
* <OTPInput @change="(e) => console.log(e.value)" :length="6" />
|
|
237
|
+
* ```
|
|
238
|
+
*/
|
|
239
|
+
onChange?: (event: OTPInputChangeEvent) => void;
|
|
240
|
+
/**
|
|
241
|
+
* Fires when any input cell receives focus.
|
|
242
|
+
*
|
|
243
|
+
* @example
|
|
244
|
+
* ```vue
|
|
245
|
+
* <OTPInput @focus="(e) => console.log('focused cell index', e.cellIndex)" :length="6" />
|
|
246
|
+
* ```
|
|
247
|
+
*/
|
|
248
|
+
onFocus?: (event: OTPInputFocusEvent) => void;
|
|
249
|
+
/**
|
|
250
|
+
* Fires when the entire OTPInput loses focus (not on every
|
|
251
|
+
* inter-cell navigation).
|
|
252
|
+
*
|
|
253
|
+
* @example
|
|
254
|
+
* ```vue
|
|
255
|
+
* <OTPInput @blur="(e) => console.log('blurred')" :length="6" />
|
|
256
|
+
* ```
|
|
257
|
+
*/
|
|
258
|
+
onBlur?: (event: OTPInputBlurEvent) => void;
|
|
259
|
+
/**
|
|
260
|
+
* Sets the `aria-label` attribute on the OTPInput wrapper element.
|
|
261
|
+
*
|
|
262
|
+
* @example
|
|
263
|
+
* ```vue
|
|
264
|
+
* <OTPInput ariaLabel="Enter your 6-digit code" :length="6" />
|
|
265
|
+
* ```
|
|
266
|
+
*/
|
|
267
|
+
ariaLabel?: string;
|
|
268
|
+
/**
|
|
269
|
+
* Sets the `aria-labelledby` attribute on the OTPInput wrapper element.
|
|
270
|
+
*/
|
|
271
|
+
ariaLabelledBy?: string;
|
|
272
|
+
/**
|
|
273
|
+
* Sets the `aria-describedby` attribute on the OTPInput wrapper element.
|
|
274
|
+
*/
|
|
275
|
+
ariaDescribedBy?: string;
|
|
276
|
+
/**
|
|
277
|
+
* Sets the `id` attribute on the OTPInput wrapper element.
|
|
278
|
+
*
|
|
279
|
+
* @example
|
|
280
|
+
* ```vue
|
|
281
|
+
* <OTPInput id="otp-code" :length="6" />
|
|
282
|
+
* ```
|
|
283
|
+
*/
|
|
284
|
+
id?: string;
|
|
285
|
+
/**
|
|
286
|
+
* Sets the text direction of the OTPInput.
|
|
287
|
+
*
|
|
288
|
+
* The available options are:
|
|
289
|
+
* - `'ltr'` — left-to-right (default)
|
|
290
|
+
* - `'rtl'` — right-to-left
|
|
291
|
+
*
|
|
292
|
+
* When set to `'rtl'`, the Arrow Left/Right keyboard navigation is reversed accordingly.
|
|
293
|
+
*
|
|
294
|
+
* @example
|
|
295
|
+
* ```vue
|
|
296
|
+
* <OTPInput dir="rtl" />
|
|
297
|
+
* ```
|
|
298
|
+
*/
|
|
299
|
+
dir?: 'ltr' | 'rtl';
|
|
300
|
+
/**
|
|
301
|
+
* @hidden
|
|
302
|
+
*/
|
|
303
|
+
touched?: boolean;
|
|
304
|
+
/**
|
|
305
|
+
* @hidden
|
|
306
|
+
*/
|
|
307
|
+
visited?: boolean;
|
|
308
|
+
/**
|
|
309
|
+
* @hidden
|
|
310
|
+
*/
|
|
311
|
+
modified?: boolean;
|
|
312
|
+
/**
|
|
313
|
+
* @hidden
|
|
314
|
+
*/
|
|
315
|
+
validationMessage?: string;
|
|
316
|
+
}
|