UNPKG

@loadsmart/miranda-wc

Version:

Miranda Web Components component library

29 lines (28 loc) 1.5 kB
import type { Constructor } from '../../utils/types'; import type { FieldStatus } from '../field'; import type { Component } from './component'; export interface FormComponentProps { name?: string; disabled?: boolean; status?: FieldStatus; form?: string; } export declare class WithFormComponentMixinInterface implements FormComponentProps { name?: string; disabled?: boolean; status?: FieldStatus; protected getAssociatedForm(): HTMLFormElement | null; protected setFormValue(value: File | string | FormData | null, state?: File | string | FormData | null): void; protected formDisabledCallback(disabled: boolean): void; /** * A component can be associated with a form either via the `form` attribute (`associatedForm` property) * or by being a descendant of a form element (in which case the form instance will be available via the * `ElementInternals` API). Here, we return the form that the component is actually associated with so * other parts of the component can use it. * * @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#form|MDN button element, form attribute} * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/form|MDN ElementInternals, form property} */ getActualForm(): HTMLFormElement | null; } export declare const WithFormComponentMixin: <T extends Constructor<Component>>(superClass: T) => Constructor<WithFormComponentMixinInterface> & T;