import * as i0 from '@angular/core'; import { EventEmitter } from '@angular/core'; /** * Which keys a {@link MnKeyboard} renders. * * `alphanumeric` is the full QWERTY block with a digit row on top — the layout for * a field that accepts either a membership number or a name. `numeric` is a phone- * style 3x4 pad for digits only. `alpha` drops the digit row for name-only fields. */ type MnKeyboardLayout = 'alphanumeric' | 'numeric' | 'alpha'; /** * How a {@link MnKeyboard} presents itself. * * `inline` renders the keys in normal document flow. `sheet` mounts them in an * {@link MnBottomSheet}, so the keyboard rises from the bottom of the screen over * whatever the user was looking at and can be swiped away. */ type MnKeyboardPresentation = 'inline' | 'sheet'; /** * Labels for a {@link MnKeyboard}'s named keys. * * Supplied by the consumer rather than defaulted in the component: the library * ships no user-facing English, so the host app translates these in its own * bundles. The character keys need no labels — a digit and a letter read the same * in every supported language. */ type MnKeyboardLabels = { /** The backspace key (also its accessible name). */ backspace: string; /** The clear-everything key. */ clear: string; /** The space key. */ space: string; /** The confirm/submit key. */ submit: string; /** Accessible name for the keyboard as a whole. */ keyboard: string; }; /** * An on-screen keyboard for touch devices that have no keyboard of their own. * * It exists for unattended screens — a tablet on a wall, a kiosk by a door — where * the OS keyboard is either unavailable or unwanted, and where the same field may * need to take a membership number *or* a name. Hence one component with a * {@link layout} switch rather than a separate number pad and text pad. * * It is a controlled component: it never owns the text. The host passes {@link value} * and reacts to {@link valueChange}, exactly like a form control, so the same value * can also be filled by a barcode scanner or a real keyboard without this component * fighting it. * * With {@link presentation} set to `sheet` it mounts inside an {@link MnBottomSheet}, * rising from the bottom of the screen and swipeable away — the shape a kiosk wants * so the keys do not permanently occupy half the display. * * The library ships no user-facing English, so every named key takes its caption * from {@link labels}. */ declare class MnKeyboard { /** The current text. This component never mutates it — see {@link valueChange}. */ value: string; /** Which keys to render. */ layout: MnKeyboardLayout; /** Whether the keys sit in the page or rise from the bottom as a sheet. */ presentation: MnKeyboardPresentation; /** * Captions and accessible names for the named keys. * * The defaults are language-neutral glyphs rather than words, so a consumer that * forgets to translate still ships no English (or Dutch) from the library. The * accessible name for the keyboard as a whole has no neutral glyph, so it * defaults to empty and the attribute is simply omitted until a host supplies one. */ labels: MnKeyboardLabels; /** Whether letters are rendered (and typed) upper-case. */ uppercase: boolean; /** Whether to offer a space key. Off for a field that can never contain one. */ allowSpace: boolean; /** Whether to offer a submit key. */ showSubmit: boolean; /** Whether the submit key is currently actionable. */ submitDisabled: boolean; /** Hard cap on the text length, or null for none. */ maxLength: number | null; /** Cap on the sheet height as a fraction of the viewport, in vh (sheet presentation only). */ sheetMaxHeightVh: number; /** Emits the full text after every key press, so the host can drive its own field. */ valueChange: EventEmitter; /** Emits when the submit key is pressed. */ submitted: EventEmitter; /** Emits when a sheet-presented keyboard is swiped or tapped away. */ dismissed: EventEmitter; get hostClasses(): string; /** The character rows to render, driven by {@link layout}. */ get rows(): readonly string[][]; /** Whether the space key should be offered (never on a digits-only pad). */ get spaceVisible(): boolean; /** * Appends a character, respecting {@link maxLength}. * @param key The character pressed. */ press(key: string): void; /** Appends a space. */ pressSpace(): void; /** Removes the last character. */ backspace(): void; /** Empties the field. */ clear(): void; /** Reports a submit press. The host decides what submitting means. */ submit(): void; /** Reports that a sheet-presented keyboard was dismissed. */ onDismiss(): void; /** * Emits a new value, clamped to {@link maxLength}. * * Clamping happens here rather than in each key handler so a paste-like burst * from a scanner and a tapped key are bounded the same way. * @param next The candidate text. */ private emit; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export { MnKeyboard }; export type { MnKeyboardLabels, MnKeyboardLayout, MnKeyboardPresentation };