ng-primitives 0.87.0 → 0.88.0
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/fesm2022/ng-primitives-combobox.mjs +6 -0
- package/fesm2022/ng-primitives-combobox.mjs.map +1 -1
- package/fesm2022/ng-primitives-input-otp.mjs +514 -0
- package/fesm2022/ng-primitives-input-otp.mjs.map +1 -0
- package/input-otp/README.md +3 -0
- package/input-otp/index.d.ts +4 -0
- package/input-otp/input-otp/input-otp-state.d.ts +17 -0
- package/input-otp/input-otp/input-otp.d.ts +133 -0
- package/input-otp/input-otp-input/input-otp-input.d.ts +57 -0
- package/input-otp/input-otp-slot/input-otp-slot.d.ts +45 -0
- package/package.json +24 -20
- package/schematics/ng-generate/schema.d.ts +2 -1
- package/schematics/ng-generate/schema.json +2 -1
- package/schematics/ng-generate/templates/input-otp/input-otp.__fileSuffix@dasherize__.ts.template +197 -0
|
@@ -0,0 +1,514 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { HostListener, Directive, computed, input, booleanAttribute, output, signal } from '@angular/core';
|
|
3
|
+
import * as i1 from 'ng-primitives/a11y';
|
|
4
|
+
import { NgpVisuallyHidden } from 'ng-primitives/a11y';
|
|
5
|
+
import { injectElementRef } from 'ng-primitives/internal';
|
|
6
|
+
import { createStateToken, createStateProvider, createStateInjector, createState } from 'ng-primitives/state';
|
|
7
|
+
import { ngpInteractions } from 'ng-primitives/interactions';
|
|
8
|
+
import { uniqueId } from 'ng-primitives/utils';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The state token for the InputOtp primitive.
|
|
12
|
+
*/
|
|
13
|
+
const NgpInputOtpStateToken = createStateToken('InputOtp');
|
|
14
|
+
/**
|
|
15
|
+
* Provides the InputOtp state.
|
|
16
|
+
*/
|
|
17
|
+
const provideInputOtpState = createStateProvider(NgpInputOtpStateToken);
|
|
18
|
+
/**
|
|
19
|
+
* Injects the InputOtp state.
|
|
20
|
+
*/
|
|
21
|
+
const injectInputOtpState = createStateInjector(NgpInputOtpStateToken);
|
|
22
|
+
/**
|
|
23
|
+
* The InputOtp state registration function.
|
|
24
|
+
*/
|
|
25
|
+
const inputOtpState = createState(NgpInputOtpStateToken);
|
|
26
|
+
|
|
27
|
+
class NgpInputOtpInput {
|
|
28
|
+
constructor() {
|
|
29
|
+
/**
|
|
30
|
+
* Access the element reference.
|
|
31
|
+
*/
|
|
32
|
+
this.elementRef = injectElementRef();
|
|
33
|
+
/**
|
|
34
|
+
* Access the input-otp state.
|
|
35
|
+
*/
|
|
36
|
+
this.state = injectInputOtpState();
|
|
37
|
+
// Register this input with the parent
|
|
38
|
+
this.state().registerInput(this);
|
|
39
|
+
}
|
|
40
|
+
ngAfterViewInit() {
|
|
41
|
+
// Set initial value
|
|
42
|
+
this.elementRef.nativeElement.value = this.state().value();
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Focus the input.
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
focus() {
|
|
49
|
+
this.elementRef.nativeElement.focus();
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Set selection range.
|
|
53
|
+
* @param start Start position
|
|
54
|
+
* @param end End position
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
57
|
+
setSelectionRange(start, end) {
|
|
58
|
+
this.elementRef.nativeElement.setSelectionRange(start, end);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Handle input events (typing).
|
|
62
|
+
*/
|
|
63
|
+
onInput(event) {
|
|
64
|
+
if (this.state().disabled()) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const input = event.target;
|
|
68
|
+
let newValue = input.value;
|
|
69
|
+
// Validate against pattern if provided
|
|
70
|
+
const pattern = this.state().pattern();
|
|
71
|
+
if (pattern) {
|
|
72
|
+
const patternRegex = new RegExp(pattern);
|
|
73
|
+
const filteredValue = newValue
|
|
74
|
+
.split('')
|
|
75
|
+
.filter(char => patternRegex.test(char))
|
|
76
|
+
.join('');
|
|
77
|
+
if (filteredValue !== newValue) {
|
|
78
|
+
newValue = filteredValue;
|
|
79
|
+
input.value = newValue;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
// Clamp to maxLength
|
|
83
|
+
const maxLength = this.state().maxLength();
|
|
84
|
+
if (newValue.length > maxLength) {
|
|
85
|
+
newValue = newValue.substring(0, maxLength);
|
|
86
|
+
input.value = newValue;
|
|
87
|
+
}
|
|
88
|
+
this.state().updateValue(newValue);
|
|
89
|
+
this.updateSelection();
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Handle paste events.
|
|
93
|
+
*/
|
|
94
|
+
onPaste(event) {
|
|
95
|
+
if (this.state().disabled()) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
event.preventDefault();
|
|
99
|
+
const clipboardData = event.clipboardData?.getData('text') || '';
|
|
100
|
+
let pastedText = clipboardData.trim();
|
|
101
|
+
// Apply paste transformer if provided
|
|
102
|
+
const transformer = this.state().pasteTransformer();
|
|
103
|
+
if (transformer) {
|
|
104
|
+
pastedText = transformer(pastedText);
|
|
105
|
+
}
|
|
106
|
+
// Validate against pattern if provided
|
|
107
|
+
const pattern = this.state().pattern();
|
|
108
|
+
if (pattern) {
|
|
109
|
+
const patternRegex = new RegExp(pattern);
|
|
110
|
+
pastedText = pastedText
|
|
111
|
+
.split('')
|
|
112
|
+
.filter(char => patternRegex.test(char))
|
|
113
|
+
.join('');
|
|
114
|
+
}
|
|
115
|
+
// Clamp to maxLength
|
|
116
|
+
const maxLength = this.state().maxLength();
|
|
117
|
+
if (pastedText.length > maxLength) {
|
|
118
|
+
pastedText = pastedText.substring(0, maxLength);
|
|
119
|
+
}
|
|
120
|
+
// Update the input value and state
|
|
121
|
+
this.elementRef.nativeElement.value = pastedText;
|
|
122
|
+
this.state().updateValue(pastedText);
|
|
123
|
+
// Set caret to the end
|
|
124
|
+
const endPosition = pastedText.length;
|
|
125
|
+
this.setSelectionRange(endPosition, endPosition);
|
|
126
|
+
this.updateSelection();
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Handle focus events.
|
|
130
|
+
*/
|
|
131
|
+
onFocus() {
|
|
132
|
+
this.state().updateFocus(true);
|
|
133
|
+
this.updateSelection();
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Handle blur events.
|
|
137
|
+
*/
|
|
138
|
+
onBlur() {
|
|
139
|
+
this.state().updateFocus(false);
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Handle keyup events to update selection.
|
|
143
|
+
*/
|
|
144
|
+
onKeyup() {
|
|
145
|
+
this.updateSelection();
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Handle selection change events.
|
|
149
|
+
*/
|
|
150
|
+
onSelect() {
|
|
151
|
+
this.updateSelection();
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Update the selection state.
|
|
155
|
+
*/
|
|
156
|
+
updateSelection() {
|
|
157
|
+
const input = this.elementRef.nativeElement;
|
|
158
|
+
const maxLength = this.state().maxLength();
|
|
159
|
+
// If input is at max length, set selection to last character
|
|
160
|
+
if (input.value.length === maxLength) {
|
|
161
|
+
input.setSelectionRange(input.value.length - 1, input.value.length);
|
|
162
|
+
}
|
|
163
|
+
// if the input is not at max length, set selection at the end
|
|
164
|
+
if (input.value.length < maxLength) {
|
|
165
|
+
input.setSelectionRange(input.value.length, input.value.length);
|
|
166
|
+
}
|
|
167
|
+
const start = input.selectionStart || 0;
|
|
168
|
+
const end = input.selectionEnd || 0;
|
|
169
|
+
this.state().updateSelection(start, end);
|
|
170
|
+
}
|
|
171
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpInputOtpInput, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
172
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: NgpInputOtpInput, isStandalone: true, selector: "input[ngpInputOtpInput]", host: { attributes: { "autocomplete": "one-time-code" }, listeners: { "input": "onInput($event)", "paste": "onPaste($event)", "focus": "onFocus()", "blur": "onBlur()", "keyup": "onKeyup()", "select": "onSelect()" }, properties: { "attr.inputmode": "state().inputMode()", "attr.maxlength": "state().maxLength()", "attr.pattern": "state().pattern() || null", "attr.disabled": "state().disabled() ? \"\" : null" } }, exportAs: ["ngpInputOtpInput"], hostDirectives: [{ directive: i1.NgpVisuallyHidden }], ngImport: i0 }); }
|
|
173
|
+
}
|
|
174
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpInputOtpInput, decorators: [{
|
|
175
|
+
type: Directive,
|
|
176
|
+
args: [{
|
|
177
|
+
selector: 'input[ngpInputOtpInput]',
|
|
178
|
+
exportAs: 'ngpInputOtpInput',
|
|
179
|
+
hostDirectives: [NgpVisuallyHidden],
|
|
180
|
+
host: {
|
|
181
|
+
autocomplete: 'one-time-code',
|
|
182
|
+
'[attr.inputmode]': 'state().inputMode()',
|
|
183
|
+
'[attr.maxlength]': 'state().maxLength()',
|
|
184
|
+
'[attr.pattern]': 'state().pattern() || null',
|
|
185
|
+
'[attr.disabled]': 'state().disabled() ? "" : null',
|
|
186
|
+
},
|
|
187
|
+
}]
|
|
188
|
+
}], ctorParameters: () => [], propDecorators: { onInput: [{
|
|
189
|
+
type: HostListener,
|
|
190
|
+
args: ['input', ['$event']]
|
|
191
|
+
}], onPaste: [{
|
|
192
|
+
type: HostListener,
|
|
193
|
+
args: ['paste', ['$event']]
|
|
194
|
+
}], onFocus: [{
|
|
195
|
+
type: HostListener,
|
|
196
|
+
args: ['focus']
|
|
197
|
+
}], onBlur: [{
|
|
198
|
+
type: HostListener,
|
|
199
|
+
args: ['blur']
|
|
200
|
+
}], onKeyup: [{
|
|
201
|
+
type: HostListener,
|
|
202
|
+
args: ['keyup']
|
|
203
|
+
}], onSelect: [{
|
|
204
|
+
type: HostListener,
|
|
205
|
+
args: ['select']
|
|
206
|
+
}] } });
|
|
207
|
+
|
|
208
|
+
class NgpInputOtpSlot {
|
|
209
|
+
constructor() {
|
|
210
|
+
/**
|
|
211
|
+
* Access the input-otp state.
|
|
212
|
+
*/
|
|
213
|
+
this.state = injectInputOtpState();
|
|
214
|
+
/**
|
|
215
|
+
* The computed index of this slot based on registration order.
|
|
216
|
+
*/
|
|
217
|
+
this.index = computed(() => this.state().getSlotIndex(this));
|
|
218
|
+
/**
|
|
219
|
+
* The character for this slot from the value string.
|
|
220
|
+
*/
|
|
221
|
+
this.char = computed(() => {
|
|
222
|
+
const value = this.state().value();
|
|
223
|
+
const currentIndex = this.index();
|
|
224
|
+
return currentIndex >= 0 && currentIndex < value.length ? value[currentIndex] : null;
|
|
225
|
+
});
|
|
226
|
+
/**
|
|
227
|
+
* Whether this slot is focused (active).
|
|
228
|
+
*/
|
|
229
|
+
this.focused = computed(() => {
|
|
230
|
+
const currentIndex = this.index();
|
|
231
|
+
const isFocused = this.state().isFocused();
|
|
232
|
+
const selectionStart = this.state().selectionStart();
|
|
233
|
+
const value = this.state().value();
|
|
234
|
+
const maxLength = this.state().maxLength();
|
|
235
|
+
return (isFocused &&
|
|
236
|
+
(currentIndex === selectionStart ||
|
|
237
|
+
(value.length === maxLength && currentIndex === maxLength - 1)));
|
|
238
|
+
});
|
|
239
|
+
/**
|
|
240
|
+
* Whether this slot should show the caret.
|
|
241
|
+
*/
|
|
242
|
+
this.caret = computed(() => {
|
|
243
|
+
const currentIndex = this.index();
|
|
244
|
+
const isFocused = this.state().isFocused();
|
|
245
|
+
const selectionStart = this.state().selectionStart();
|
|
246
|
+
const selectionEnd = this.state().selectionEnd();
|
|
247
|
+
const value = this.state().value();
|
|
248
|
+
const maxLength = this.state().maxLength();
|
|
249
|
+
return (isFocused &&
|
|
250
|
+
currentIndex === selectionStart &&
|
|
251
|
+
selectionStart === selectionEnd &&
|
|
252
|
+
value.length < maxLength);
|
|
253
|
+
});
|
|
254
|
+
/**
|
|
255
|
+
* Whether this slot is filled with a character.
|
|
256
|
+
*/
|
|
257
|
+
this.filled = computed(() => this.char() !== null);
|
|
258
|
+
/**
|
|
259
|
+
* Whether to show placeholder for this slot.
|
|
260
|
+
*/
|
|
261
|
+
this.showPlaceholder = computed(() => {
|
|
262
|
+
const placeholder = this.state().placeholder();
|
|
263
|
+
return !this.filled() && !!placeholder;
|
|
264
|
+
});
|
|
265
|
+
/**
|
|
266
|
+
* The display character for this slot (character or placeholder).
|
|
267
|
+
*/
|
|
268
|
+
this.displayChar = computed(() => {
|
|
269
|
+
const char = this.char();
|
|
270
|
+
if (char)
|
|
271
|
+
return char;
|
|
272
|
+
if (this.showPlaceholder())
|
|
273
|
+
return this.state().placeholder();
|
|
274
|
+
return '';
|
|
275
|
+
});
|
|
276
|
+
this.state().registerSlot(this);
|
|
277
|
+
}
|
|
278
|
+
ngOnDestroy() {
|
|
279
|
+
// Unregister this slot when destroyed
|
|
280
|
+
this.state().unregisterSlot(this);
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Handle click events on the slot.
|
|
284
|
+
* @internal
|
|
285
|
+
*/
|
|
286
|
+
onClick(event) {
|
|
287
|
+
if (this.state().disabled())
|
|
288
|
+
return;
|
|
289
|
+
const currentValue = this.state().value();
|
|
290
|
+
const maxLength = this.state().maxLength();
|
|
291
|
+
// Focus the first empty slot, or the last slot if all are filled
|
|
292
|
+
const targetPosition = currentValue.length < maxLength ? currentValue.length : maxLength - 1;
|
|
293
|
+
this.state().focusAtPosition(targetPosition);
|
|
294
|
+
event.preventDefault();
|
|
295
|
+
event.stopPropagation();
|
|
296
|
+
}
|
|
297
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpInputOtpSlot, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
298
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: NgpInputOtpSlot, isStandalone: true, selector: "[ngpInputOtpSlot]", host: { attributes: { "role": "presentation" }, listeners: { "click": "onClick($event)" }, properties: { "attr.data-slot-index": "index()", "attr.data-active": "focused() ? \"\" : null", "attr.data-filled": "filled() ? \"\" : null", "attr.data-caret": "caret() ? \"\" : null", "attr.data-placeholder": "showPlaceholder() ? \"\" : null", "textContent": "displayChar()" } }, exportAs: ["ngpInputOtpSlot"], ngImport: i0 }); }
|
|
299
|
+
}
|
|
300
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpInputOtpSlot, decorators: [{
|
|
301
|
+
type: Directive,
|
|
302
|
+
args: [{
|
|
303
|
+
selector: '[ngpInputOtpSlot]',
|
|
304
|
+
exportAs: 'ngpInputOtpSlot',
|
|
305
|
+
host: {
|
|
306
|
+
role: 'presentation',
|
|
307
|
+
'[attr.data-slot-index]': 'index()',
|
|
308
|
+
'[attr.data-active]': 'focused() ? "" : null',
|
|
309
|
+
'[attr.data-filled]': 'filled() ? "" : null',
|
|
310
|
+
'[attr.data-caret]': 'caret() ? "" : null',
|
|
311
|
+
'[attr.data-placeholder]': 'showPlaceholder() ? "" : null',
|
|
312
|
+
'[textContent]': 'displayChar()',
|
|
313
|
+
'(click)': 'onClick($event)',
|
|
314
|
+
},
|
|
315
|
+
}]
|
|
316
|
+
}], ctorParameters: () => [] });
|
|
317
|
+
|
|
318
|
+
class NgpInputOtp {
|
|
319
|
+
constructor() {
|
|
320
|
+
/**
|
|
321
|
+
* Access the element reference.
|
|
322
|
+
*/
|
|
323
|
+
this.elementRef = injectElementRef();
|
|
324
|
+
/**
|
|
325
|
+
* The id of the input-otp.
|
|
326
|
+
*/
|
|
327
|
+
this.id = input(uniqueId('ngp-input-otp'));
|
|
328
|
+
/**
|
|
329
|
+
* The current value of the OTP.
|
|
330
|
+
*/
|
|
331
|
+
this.value = input('', {
|
|
332
|
+
alias: 'ngpInputOtpValue',
|
|
333
|
+
});
|
|
334
|
+
/**
|
|
335
|
+
* The regex pattern for allowed characters.
|
|
336
|
+
*/
|
|
337
|
+
this.pattern = input('[0-9]', {
|
|
338
|
+
alias: 'ngpInputOtpPattern',
|
|
339
|
+
});
|
|
340
|
+
/**
|
|
341
|
+
* The input mode for the hidden input.
|
|
342
|
+
*/
|
|
343
|
+
this.inputMode = input('text', {
|
|
344
|
+
alias: 'ngpInputOtpInputMode',
|
|
345
|
+
});
|
|
346
|
+
/**
|
|
347
|
+
* Function to transform pasted text.
|
|
348
|
+
*/
|
|
349
|
+
this.pasteTransformer = input(undefined, {
|
|
350
|
+
alias: 'ngpInputOtpPasteTransformer',
|
|
351
|
+
});
|
|
352
|
+
/**
|
|
353
|
+
* Whether the input-otp is disabled.
|
|
354
|
+
*/
|
|
355
|
+
this.disabled = input(false, {
|
|
356
|
+
alias: 'ngpInputOtpDisabled',
|
|
357
|
+
transform: booleanAttribute,
|
|
358
|
+
});
|
|
359
|
+
/**
|
|
360
|
+
* The placeholder character to display when a slot is empty.
|
|
361
|
+
*/
|
|
362
|
+
this.placeholder = input('', {
|
|
363
|
+
alias: 'ngpInputOtpPlaceholder',
|
|
364
|
+
});
|
|
365
|
+
/**
|
|
366
|
+
* Event emitted when the value changes.
|
|
367
|
+
*/
|
|
368
|
+
this.valueChange = output({
|
|
369
|
+
alias: 'ngpInputOtpValueChange',
|
|
370
|
+
});
|
|
371
|
+
/**
|
|
372
|
+
* Event emitted when the OTP is complete (maxLength characters entered).
|
|
373
|
+
*/
|
|
374
|
+
this.complete = output({
|
|
375
|
+
alias: 'ngpInputOtpComplete',
|
|
376
|
+
});
|
|
377
|
+
/**
|
|
378
|
+
* Store the input element reference.
|
|
379
|
+
* @internal
|
|
380
|
+
*/
|
|
381
|
+
this.inputElement = signal(undefined);
|
|
382
|
+
/**
|
|
383
|
+
* Store registered slots in order.
|
|
384
|
+
* @internal
|
|
385
|
+
*/
|
|
386
|
+
this.slots = signal([]);
|
|
387
|
+
/**
|
|
388
|
+
* The number of characters in the OTP, derived from registered slots.
|
|
389
|
+
*/
|
|
390
|
+
this.maxLength = computed(() => this.slots().length);
|
|
391
|
+
/**
|
|
392
|
+
* The focus state of the input.
|
|
393
|
+
* @internal
|
|
394
|
+
*/
|
|
395
|
+
this.isFocused = signal(false);
|
|
396
|
+
/**
|
|
397
|
+
* The selection start position.
|
|
398
|
+
* @internal
|
|
399
|
+
*/
|
|
400
|
+
this.selectionStart = signal(0);
|
|
401
|
+
/**
|
|
402
|
+
* The selection end position.
|
|
403
|
+
* @internal
|
|
404
|
+
*/
|
|
405
|
+
this.selectionEnd = signal(0);
|
|
406
|
+
/**
|
|
407
|
+
* The state of the input-otp.
|
|
408
|
+
*/
|
|
409
|
+
this.state = inputOtpState(this);
|
|
410
|
+
ngpInteractions({
|
|
411
|
+
hover: true,
|
|
412
|
+
press: true,
|
|
413
|
+
focus: true,
|
|
414
|
+
disabled: this.state.disabled,
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Register an input element with the input-otp.
|
|
419
|
+
* @param input The input element to register.
|
|
420
|
+
* @internal
|
|
421
|
+
*/
|
|
422
|
+
registerInput(input) {
|
|
423
|
+
this.inputElement.set(input);
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Register a slot with the input-otp.
|
|
427
|
+
* @param slot The slot to register.
|
|
428
|
+
* @internal
|
|
429
|
+
*/
|
|
430
|
+
registerSlot(slot) {
|
|
431
|
+
this.slots.update(currentSlots => [...currentSlots, slot]);
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Unregister a slot from the input-otp.
|
|
435
|
+
* @param slot The slot to unregister.
|
|
436
|
+
* @internal
|
|
437
|
+
*/
|
|
438
|
+
unregisterSlot(slot) {
|
|
439
|
+
this.slots.update(currentSlots => currentSlots.filter(s => s !== slot));
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Get the index of a registered slot.
|
|
443
|
+
* @param slot The slot to get the index for.
|
|
444
|
+
* @returns The index of the slot, or -1 if not found.
|
|
445
|
+
* @internal
|
|
446
|
+
*/
|
|
447
|
+
getSlotIndex(slot) {
|
|
448
|
+
return this.slots().indexOf(slot);
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* Update the value and emit change events.
|
|
452
|
+
* @param newValue The new value.
|
|
453
|
+
* @internal
|
|
454
|
+
*/
|
|
455
|
+
updateValue(newValue) {
|
|
456
|
+
if (newValue === this.state.value()) {
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
459
|
+
this.state.value.set(newValue);
|
|
460
|
+
this.valueChange.emit(newValue);
|
|
461
|
+
// Emit complete event when the OTP is complete
|
|
462
|
+
if (newValue.length === this.maxLength()) {
|
|
463
|
+
this.complete.emit(newValue);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Update focus state.
|
|
468
|
+
* @param focused Whether the input is focused.
|
|
469
|
+
* @internal
|
|
470
|
+
*/
|
|
471
|
+
updateFocus(focused) {
|
|
472
|
+
this.isFocused.set(focused);
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* Update selection state.
|
|
476
|
+
* @param start Selection start position.
|
|
477
|
+
* @param end Selection end position.
|
|
478
|
+
* @internal
|
|
479
|
+
*/
|
|
480
|
+
updateSelection(start, end) {
|
|
481
|
+
this.selectionStart.set(start);
|
|
482
|
+
this.selectionEnd.set(end);
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* Focus the input and set caret to the specified position.
|
|
486
|
+
* @param position The position to set the caret to.
|
|
487
|
+
* @internal
|
|
488
|
+
*/
|
|
489
|
+
focusAtPosition(position) {
|
|
490
|
+
const input = this.inputElement();
|
|
491
|
+
if (!input) {
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
494
|
+
input.focus();
|
|
495
|
+
input.setSelectionRange(position, position);
|
|
496
|
+
}
|
|
497
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpInputOtp, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
498
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpInputOtp, isStandalone: true, selector: "[ngpInputOtp]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "ngpInputOtpValue", isSignal: true, isRequired: false, transformFunction: null }, pattern: { classPropertyName: "pattern", publicName: "ngpInputOtpPattern", isSignal: true, isRequired: false, transformFunction: null }, inputMode: { classPropertyName: "inputMode", publicName: "ngpInputOtpInputMode", isSignal: true, isRequired: false, transformFunction: null }, pasteTransformer: { classPropertyName: "pasteTransformer", publicName: "ngpInputOtpPasteTransformer", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpInputOtpDisabled", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "ngpInputOtpPlaceholder", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "ngpInputOtpValueChange", complete: "ngpInputOtpComplete" }, providers: [provideInputOtpState()], exportAs: ["ngpInputOtp"], ngImport: i0 }); }
|
|
499
|
+
}
|
|
500
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpInputOtp, decorators: [{
|
|
501
|
+
type: Directive,
|
|
502
|
+
args: [{
|
|
503
|
+
selector: '[ngpInputOtp]',
|
|
504
|
+
exportAs: 'ngpInputOtp',
|
|
505
|
+
providers: [provideInputOtpState()],
|
|
506
|
+
}]
|
|
507
|
+
}], ctorParameters: () => [] });
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* Generated bundle index. Do not edit.
|
|
511
|
+
*/
|
|
512
|
+
|
|
513
|
+
export { NgpInputOtp, NgpInputOtpInput, NgpInputOtpSlot, injectInputOtpState, provideInputOtpState };
|
|
514
|
+
//# sourceMappingURL=ng-primitives-input-otp.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-primitives-input-otp.mjs","sources":["../../../../packages/ng-primitives/input-otp/src/input-otp/input-otp-state.ts","../../../../packages/ng-primitives/input-otp/src/input-otp-input/input-otp-input.ts","../../../../packages/ng-primitives/input-otp/src/input-otp-slot/input-otp-slot.ts","../../../../packages/ng-primitives/input-otp/src/input-otp/input-otp.ts","../../../../packages/ng-primitives/input-otp/src/ng-primitives-input-otp.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpInputOtp } from './input-otp';\n\n/**\n * The state token for the InputOtp primitive.\n */\nexport const NgpInputOtpStateToken = createStateToken<NgpInputOtp>('InputOtp');\n\n/**\n * Provides the InputOtp state.\n */\nexport const provideInputOtpState = createStateProvider(NgpInputOtpStateToken);\n\n/**\n * Injects the InputOtp state.\n */\nexport const injectInputOtpState = createStateInjector<NgpInputOtp>(NgpInputOtpStateToken);\n\n/**\n * The InputOtp state registration function.\n */\nexport const inputOtpState = createState(NgpInputOtpStateToken);\n","import { AfterViewInit, Directive, HostListener } from '@angular/core';\nimport { NgpVisuallyHidden } from 'ng-primitives/a11y';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { injectInputOtpState } from '../input-otp/input-otp-state';\n\n@Directive({\n selector: 'input[ngpInputOtpInput]',\n exportAs: 'ngpInputOtpInput',\n hostDirectives: [NgpVisuallyHidden],\n host: {\n autocomplete: 'one-time-code',\n '[attr.inputmode]': 'state().inputMode()',\n '[attr.maxlength]': 'state().maxLength()',\n '[attr.pattern]': 'state().pattern() || null',\n '[attr.disabled]': 'state().disabled() ? \"\" : null',\n },\n})\nexport class NgpInputOtpInput implements AfterViewInit {\n /**\n * Access the element reference.\n */\n readonly elementRef = injectElementRef<HTMLInputElement>();\n\n /**\n * Access the input-otp state.\n */\n protected readonly state = injectInputOtpState();\n\n constructor() {\n // Register this input with the parent\n this.state().registerInput(this);\n }\n\n ngAfterViewInit(): void {\n // Set initial value\n this.elementRef.nativeElement.value = this.state().value();\n }\n\n /**\n * Focus the input.\n * @internal\n */\n focus(): void {\n this.elementRef.nativeElement.focus();\n }\n\n /**\n * Set selection range.\n * @param start Start position\n * @param end End position\n * @internal\n */\n setSelectionRange(start: number, end: number): void {\n this.elementRef.nativeElement.setSelectionRange(start, end);\n }\n\n /**\n * Handle input events (typing).\n */\n @HostListener('input', ['$event'])\n protected onInput(event: Event): void {\n if (this.state().disabled()) {\n return;\n }\n\n const input = event.target as HTMLInputElement;\n let newValue = input.value;\n\n // Validate against pattern if provided\n const pattern = this.state().pattern();\n if (pattern) {\n const patternRegex = new RegExp(pattern);\n const filteredValue = newValue\n .split('')\n .filter(char => patternRegex.test(char))\n .join('');\n\n if (filteredValue !== newValue) {\n newValue = filteredValue;\n input.value = newValue;\n }\n }\n\n // Clamp to maxLength\n const maxLength = this.state().maxLength();\n if (newValue.length > maxLength) {\n newValue = newValue.substring(0, maxLength);\n input.value = newValue;\n }\n\n this.state().updateValue(newValue);\n this.updateSelection();\n }\n\n /**\n * Handle paste events.\n */\n @HostListener('paste', ['$event'])\n protected onPaste(event: ClipboardEvent): void {\n if (this.state().disabled()) {\n return;\n }\n\n event.preventDefault();\n\n const clipboardData = event.clipboardData?.getData('text') || '';\n let pastedText = clipboardData.trim();\n\n // Apply paste transformer if provided\n const transformer = this.state().pasteTransformer();\n if (transformer) {\n pastedText = transformer(pastedText);\n }\n\n // Validate against pattern if provided\n const pattern = this.state().pattern();\n if (pattern) {\n const patternRegex = new RegExp(pattern);\n pastedText = pastedText\n .split('')\n .filter(char => patternRegex.test(char))\n .join('');\n }\n\n // Clamp to maxLength\n const maxLength = this.state().maxLength();\n if (pastedText.length > maxLength) {\n pastedText = pastedText.substring(0, maxLength);\n }\n\n // Update the input value and state\n this.elementRef.nativeElement.value = pastedText;\n this.state().updateValue(pastedText);\n\n // Set caret to the end\n const endPosition = pastedText.length;\n this.setSelectionRange(endPosition, endPosition);\n this.updateSelection();\n }\n\n /**\n * Handle focus events.\n */\n @HostListener('focus')\n protected onFocus(): void {\n this.state().updateFocus(true);\n this.updateSelection();\n }\n\n /**\n * Handle blur events.\n */\n @HostListener('blur')\n protected onBlur(): void {\n this.state().updateFocus(false);\n }\n\n /**\n * Handle keyup events to update selection.\n */\n @HostListener('keyup')\n protected onKeyup(): void {\n this.updateSelection();\n }\n\n /**\n * Handle selection change events.\n */\n @HostListener('select')\n protected onSelect(): void {\n this.updateSelection();\n }\n\n /**\n * Update the selection state.\n */\n private updateSelection(): void {\n const input = this.elementRef.nativeElement;\n const maxLength = this.state().maxLength();\n\n // If input is at max length, set selection to last character\n if (input.value.length === maxLength) {\n input.setSelectionRange(input.value.length - 1, input.value.length);\n }\n\n // if the input is not at max length, set selection at the end\n if (input.value.length < maxLength) {\n input.setSelectionRange(input.value.length, input.value.length);\n }\n\n const start = input.selectionStart || 0;\n const end = input.selectionEnd || 0;\n this.state().updateSelection(start, end);\n }\n}\n","import { computed, Directive, OnDestroy } from '@angular/core';\nimport { injectInputOtpState } from '../input-otp/input-otp-state';\n\n@Directive({\n selector: '[ngpInputOtpSlot]',\n exportAs: 'ngpInputOtpSlot',\n host: {\n role: 'presentation',\n '[attr.data-slot-index]': 'index()',\n '[attr.data-active]': 'focused() ? \"\" : null',\n '[attr.data-filled]': 'filled() ? \"\" : null',\n '[attr.data-caret]': 'caret() ? \"\" : null',\n '[attr.data-placeholder]': 'showPlaceholder() ? \"\" : null',\n '[textContent]': 'displayChar()',\n '(click)': 'onClick($event)',\n },\n})\nexport class NgpInputOtpSlot implements OnDestroy {\n /**\n * Access the input-otp state.\n */\n protected readonly state = injectInputOtpState();\n\n /**\n * The computed index of this slot based on registration order.\n */\n readonly index = computed(() => this.state().getSlotIndex(this));\n\n /**\n * The character for this slot from the value string.\n */\n private readonly char = computed(() => {\n const value = this.state().value();\n const currentIndex = this.index();\n return currentIndex >= 0 && currentIndex < value.length ? value[currentIndex] : null;\n });\n\n /**\n * Whether this slot is focused (active).\n */\n protected readonly focused = computed(() => {\n const currentIndex = this.index();\n const isFocused = this.state().isFocused();\n const selectionStart = this.state().selectionStart();\n const value = this.state().value();\n const maxLength = this.state().maxLength();\n\n return (\n isFocused &&\n (currentIndex === selectionStart ||\n (value.length === maxLength && currentIndex === maxLength - 1))\n );\n });\n\n /**\n * Whether this slot should show the caret.\n */\n protected readonly caret = computed(() => {\n const currentIndex = this.index();\n const isFocused = this.state().isFocused();\n const selectionStart = this.state().selectionStart();\n const selectionEnd = this.state().selectionEnd();\n const value = this.state().value();\n const maxLength = this.state().maxLength();\n\n return (\n isFocused &&\n currentIndex === selectionStart &&\n selectionStart === selectionEnd &&\n value.length < maxLength\n );\n });\n\n /**\n * Whether this slot is filled with a character.\n */\n protected readonly filled = computed(() => this.char() !== null);\n\n /**\n * Whether to show placeholder for this slot.\n */\n protected readonly showPlaceholder = computed(() => {\n const placeholder = this.state().placeholder();\n return !this.filled() && !!placeholder;\n });\n\n /**\n * The display character for this slot (character or placeholder).\n */\n protected readonly displayChar = computed(() => {\n const char = this.char();\n if (char) return char;\n if (this.showPlaceholder()) return this.state().placeholder();\n return '';\n });\n\n constructor() {\n this.state().registerSlot(this);\n }\n\n ngOnDestroy(): void {\n // Unregister this slot when destroyed\n this.state().unregisterSlot(this);\n }\n\n /**\n * Handle click events on the slot.\n * @internal\n */\n protected onClick(event: Event): void {\n if (this.state().disabled()) return;\n\n const currentValue = this.state().value();\n const maxLength = this.state().maxLength();\n\n // Focus the first empty slot, or the last slot if all are filled\n const targetPosition = currentValue.length < maxLength ? currentValue.length : maxLength - 1;\n this.state().focusAtPosition(targetPosition);\n event.preventDefault();\n event.stopPropagation();\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, input, output, signal } from '@angular/core';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport type { NgpInputOtpInput } from '../input-otp-input/input-otp-input';\nimport type { NgpInputOtpSlot } from '../input-otp-slot/input-otp-slot';\nimport { inputOtpState, provideInputOtpState } from './input-otp-state';\n\nexport type NgpInputOtpInputMode =\n | 'numeric'\n | 'text'\n | 'decimal'\n | 'tel'\n | 'search'\n | 'email'\n | 'url';\n\n@Directive({\n selector: '[ngpInputOtp]',\n exportAs: 'ngpInputOtp',\n providers: [provideInputOtpState()],\n})\nexport class NgpInputOtp {\n /**\n * Access the element reference.\n */\n readonly elementRef = injectElementRef<HTMLElement>();\n\n /**\n * The id of the input-otp.\n */\n readonly id = input(uniqueId('ngp-input-otp'));\n\n /**\n * The current value of the OTP.\n */\n readonly value = input<string>('', {\n alias: 'ngpInputOtpValue',\n });\n\n /**\n * The regex pattern for allowed characters.\n */\n readonly pattern = input<string>('[0-9]', {\n alias: 'ngpInputOtpPattern',\n });\n\n /**\n * The input mode for the hidden input.\n */\n readonly inputMode = input<NgpInputOtpInputMode>('text', {\n alias: 'ngpInputOtpInputMode',\n });\n\n /**\n * Function to transform pasted text.\n */\n readonly pasteTransformer = input<(text: string) => string>(undefined, {\n alias: 'ngpInputOtpPasteTransformer',\n });\n\n /**\n * Whether the input-otp is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpInputOtpDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * The placeholder character to display when a slot is empty.\n */\n readonly placeholder = input<string>('', {\n alias: 'ngpInputOtpPlaceholder',\n });\n\n /**\n * Event emitted when the value changes.\n */\n readonly valueChange = output<string>({\n alias: 'ngpInputOtpValueChange',\n });\n\n /**\n * Event emitted when the OTP is complete (maxLength characters entered).\n */\n readonly complete = output<string>({\n alias: 'ngpInputOtpComplete',\n });\n\n /**\n * Store the input element reference.\n * @internal\n */\n private readonly inputElement = signal<NgpInputOtpInput | undefined>(undefined);\n\n /**\n * Store registered slots in order.\n * @internal\n */\n private readonly slots = signal<NgpInputOtpSlot[]>([]);\n\n /**\n * The number of characters in the OTP, derived from registered slots.\n */\n readonly maxLength = computed(() => this.slots().length);\n\n /**\n * The focus state of the input.\n * @internal\n */\n readonly isFocused = signal(false);\n\n /**\n * The selection start position.\n * @internal\n */\n readonly selectionStart = signal(0);\n\n /**\n * The selection end position.\n * @internal\n */\n readonly selectionEnd = signal(0);\n\n /**\n * The state of the input-otp.\n */\n protected readonly state = inputOtpState<NgpInputOtp>(this);\n\n constructor() {\n ngpInteractions({\n hover: true,\n press: true,\n focus: true,\n disabled: this.state.disabled,\n });\n }\n\n /**\n * Register an input element with the input-otp.\n * @param input The input element to register.\n * @internal\n */\n registerInput(input: NgpInputOtpInput): void {\n this.inputElement.set(input);\n }\n\n /**\n * Register a slot with the input-otp.\n * @param slot The slot to register.\n * @internal\n */\n registerSlot(slot: NgpInputOtpSlot): void {\n this.slots.update(currentSlots => [...currentSlots, slot]);\n }\n\n /**\n * Unregister a slot from the input-otp.\n * @param slot The slot to unregister.\n * @internal\n */\n unregisterSlot(slot: NgpInputOtpSlot): void {\n this.slots.update(currentSlots => currentSlots.filter(s => s !== slot));\n }\n\n /**\n * Get the index of a registered slot.\n * @param slot The slot to get the index for.\n * @returns The index of the slot, or -1 if not found.\n * @internal\n */\n getSlotIndex(slot: NgpInputOtpSlot): number {\n return this.slots().indexOf(slot);\n }\n\n /**\n * Update the value and emit change events.\n * @param newValue The new value.\n * @internal\n */\n updateValue(newValue: string): void {\n if (newValue === this.state.value()) {\n return;\n }\n\n this.state.value.set(newValue);\n this.valueChange.emit(newValue);\n\n // Emit complete event when the OTP is complete\n if (newValue.length === this.maxLength()) {\n this.complete.emit(newValue);\n }\n }\n\n /**\n * Update focus state.\n * @param focused Whether the input is focused.\n * @internal\n */\n updateFocus(focused: boolean): void {\n this.isFocused.set(focused);\n }\n\n /**\n * Update selection state.\n * @param start Selection start position.\n * @param end Selection end position.\n * @internal\n */\n updateSelection(start: number, end: number): void {\n this.selectionStart.set(start);\n this.selectionEnd.set(end);\n }\n\n /**\n * Focus the input and set caret to the specified position.\n * @param position The position to set the caret to.\n * @internal\n */\n focusAtPosition(position: number): void {\n const input = this.inputElement();\n if (!input) {\n return;\n }\n\n input.focus();\n input.setSelectionRange(position, position);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAQA;;AAEG;AACI,MAAM,qBAAqB,GAAG,gBAAgB,CAAc,UAAU,CAAC;AAE9E;;AAEG;MACU,oBAAoB,GAAG,mBAAmB,CAAC,qBAAqB;AAE7E;;AAEG;MACU,mBAAmB,GAAG,mBAAmB,CAAc,qBAAqB;AAEzF;;AAEG;AACI,MAAM,aAAa,GAAG,WAAW,CAAC,qBAAqB,CAAC;;MCTlD,gBAAgB,CAAA;AAW3B,IAAA,WAAA,GAAA;AAVA;;AAEG;QACM,IAAA,CAAA,UAAU,GAAG,gBAAgB,EAAoB;AAE1D;;AAEG;QACgB,IAAA,CAAA,KAAK,GAAG,mBAAmB,EAAE;;QAI9C,IAAI,CAAC,KAAK,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC;IAClC;IAEA,eAAe,GAAA;;AAEb,QAAA,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE;IAC5D;AAEA;;;AAGG;IACH,KAAK,GAAA;AACH,QAAA,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,EAAE;IACvC;AAEA;;;;;AAKG;IACH,iBAAiB,CAAC,KAAa,EAAE,GAAW,EAAA;QAC1C,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,iBAAiB,CAAC,KAAK,EAAE,GAAG,CAAC;IAC7D;AAEA;;AAEG;AAEO,IAAA,OAAO,CAAC,KAAY,EAAA;QAC5B,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,EAAE;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AA,OAAA,EAAA,EAAA,WAAA,EAAA,wBAAA,EAAA,QAAA,EAAA,qBAAA,EAAA,EAAA,SAAA,EAFX,CAAC,oBAAoB,EAAE,CAAC,EAAA,QAAA,EAAA,CAAA,aAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAExB,WAAW,EAAA,UAAA,EAAA,CAAA;kBALvB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,SAAS,EAAE,CAAC,oBAAoB,EAAE,CAAC;AACpC,iBAAA;;;ACtBD;;AAEG;;;;"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { NgpInputOtpInput } from './input-otp-input/input-otp-input';
|
|
2
|
+
export { NgpInputOtpSlot } from './input-otp-slot/input-otp-slot';
|
|
3
|
+
export { NgpInputOtp, type NgpInputOtpInputMode } from './input-otp/input-otp';
|
|
4
|
+
export { injectInputOtpState, provideInputOtpState } from './input-otp/input-otp-state';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { NgpInputOtp } from './input-otp';
|
|
2
|
+
/**
|
|
3
|
+
* The state token for the InputOtp primitive.
|
|
4
|
+
*/
|
|
5
|
+
export declare const NgpInputOtpStateToken: import("@angular/core").InjectionToken<NgpInputOtp>;
|
|
6
|
+
/**
|
|
7
|
+
* Provides the InputOtp state.
|
|
8
|
+
*/
|
|
9
|
+
export declare const provideInputOtpState: (options?: import("ng-primitives/state").CreateStateProviderOptions) => import("@angular/core").FactoryProvider;
|
|
10
|
+
/**
|
|
11
|
+
* Injects the InputOtp state.
|
|
12
|
+
*/
|
|
13
|
+
export declare const injectInputOtpState: <U = NgpInputOtp>(injectOptions?: import("@angular/core").InjectOptions) => import("@angular/core").Signal<import("ng-primitives/state").State<U>>;
|
|
14
|
+
/**
|
|
15
|
+
* The InputOtp state registration function.
|
|
16
|
+
*/
|
|
17
|
+
export declare const inputOtpState: <U>(state: U) => import("ng-primitives/state").CreatedState<U>;
|