| 24 | scoped: true, |
| 25 | }) |
| 26 | export class InputOTP implements ComponentInterface { |
| 27 | private inheritedAttributes: Attributes = {}; |
| 28 | private inputRefs: HTMLInputElement[] = []; |
| 29 | private inputId = `ion-input-otp-${inputIds++}`; |
| 30 | private parsedSeparators: number[] = []; |
| 31 | |
| 32 | /** |
| 33 | * Stores the initial value of the input when it receives focus. |
| 34 | * Used to determine if the value changed during the focus session |
| 35 | * to avoid emitting unnecessary change events on blur. |
| 36 | */ |
| 37 | private focusedValue?: string | number | null; |
| 38 | |
| 39 | /** |
| 40 | * Tracks whether the user is navigating through input boxes using keyboard navigation |
| 41 | * (arrow keys, tab) versus mouse clicks. This is used to determine the appropriate |
| 42 | * focus behavior when an input box is focused. |
| 43 | */ |
| 44 | private isKeyboardNavigation = false; |
| 45 | |
| 46 | @Element() el!: HTMLIonInputOtpElement; |
| 47 | |
| 48 | @State() private inputValues: string[] = []; |
| 49 | @State() hasFocus = false; |
| 50 | @State() private previousInputValues: string[] = []; |
| 51 | |
| 52 | /** |
| 53 | * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user. |
| 54 | * Available options: `"off"`, `"none"`, `"on"`, `"sentences"`, `"words"`, `"characters"`. |
| 55 | */ |
| 56 | @Prop() autocapitalize = 'off'; |
| 57 | |
| 58 | /** |
| 59 | * The color to use from your application's color palette. |
| 60 | * Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`. |
| 61 | * For more information on colors, see [theming](/docs/theming/basics). |
| 62 | */ |
| 63 | @Prop({ reflect: true }) color?: Color; |
| 64 | |
| 65 | /** |
| 66 | * If `true`, the user cannot interact with the input. |
| 67 | */ |
| 68 | @Prop({ reflect: true }) disabled = false; |
| 69 | |
| 70 | /** |
| 71 | * The fill for the input boxes. If `"solid"` the input boxes will have a background. If |
| 72 | * `"outline"` the input boxes will be transparent with a border. |
| 73 | */ |
| 74 | @Prop() fill?: 'outline' | 'solid' = 'outline'; |
| 75 | |
| 76 | /** |
| 77 | * A hint to the browser for which keyboard to display. |
| 78 | * Possible values: `"none"`, `"text"`, `"tel"`, `"url"`, |
| 79 | * `"email"`, `"numeric"`, `"decimal"`, and `"search"`. |
| 80 | * |
| 81 | * For numbers (type="number"): "numeric" |
| 82 | * For text (type="text"): "text" |
| 83 | */ |
nothing calls this directly
no test coverage detected