/**
 * Page object for `nimble-number-field` component to provide consistent ways
 * of querying and interacting with the component during tests.
 */
export class NumberFieldPageObject {
    constructor(numberFieldElement) {
        this.numberFieldElement = numberFieldElement;
    }
    /**
     * @returns The string visible in the control.
     */
    getDisplayValue() {
        return this.inputControl.value;
    }
    /**
     * Inputs the given text via a single input event.
     */
    inputText(text) {
        this.inputTextInternal(text);
    }
    /**
     * Inputs the given text via a single input event, replacing any text that was already there.
     */
    setText(text) {
        this.inputTextInternal(text, true);
    }
    inputTextInternal(text, replace = false) {
        this.inputControl.value = text;
        this.inputControl.dispatchEvent(new InputEvent('input', {
            data: text,
            inputType: replace ? 'deleteContentForward' : 'insertText'
        }));
    }
    get inputControl() {
        return this.numberFieldElement.shadowRoot.querySelector('input');
    }
}
//# sourceMappingURL=number-field.pageobject.js.map