// #region Imports
import { ElementController } from '../../Controllers/Abstracts/ElementController';
/**
 * Represents a controller for a form element.
 *
 * @public
 */
export class FormController extends ElementController {
    // #region Ctor
    /**
     * Constructs a new instance of the `FormController` class.
     *
     * @public
     */
    constructor(host, config) {
        super(host, config);
    }
    // #endregion
    // #region Methods
    /**
     * Maps the element to a facade.
     *
     * @protected
     * @override
     * @param element - The element to map.
     * @returns The facade.
     */
    map(element) {
        return {
            name: element.name,
            get: (controlName) => {
                // we have to cast this diry because 'getFormData' it private
                const e = element;
                return e.getFormData().get(controlName);
            },
            submit: () => element.submit(),
            reset: () => element.reset(),
            reportValidity: () => element.reportValidity(),
            checkValidity: () => element.checkValidity()
        };
    }
}
//# sourceMappingURL=FormController.js.map