UNPKG

@lion/ui

Version:

A package of extendable web components

55 lines 2.1 kB
/** * @typedef {import('lit').TemplateResult} TemplateResult */ /** * This adds functionality for form buttons (type 'submit' and 'reset'). * It allows to submit or reset a <form> by spawning a click on a temporrary native button inside * the form. * Use LionButtonSubmit when implicit form submission should be supported as well. * * Functionality in this button is not purely for type="reset", also for type="submit". * For mainainability purposes the submit functionality is part of LionButtonReset * (it needs the same logic). * LionButtonReset could therefore actually be considered as 'LionButtonForm' (without the * implicit form submission logic), but LionButtonReset is an easier to grasp name for * Application Developers: for reset buttons, always use LionButtonReset, for submit * buttons always use LionButtonSubmit. * * @customElement lion-button-reset */ export class LionButtonReset extends LionButton { /** @type {HTMLButtonElement} */ __submitAndResetHelperButton: HTMLButtonElement; /** * Prevents that someone who listens outside or on form catches the click event * @param {Event} e * @private */ private __preventEventLeakage; /** * @protected */ protected _setupSubmitAndResetHelperOnConnected(): void; /** @type {HTMLFormElement|null} */ _form: HTMLFormElement | null | undefined; /** * @protected */ protected _teardownSubmitAndResetHelperOnDisconnected(): void; /** * Delegate click, by flashing a native button as a direct child * of the form, and firing click on this button. This will fire the form submit * without side effects caused by the click bubbling back up to lion-button. * @param {Event} ev * @protected * @returns {Promise<void>} */ protected __clickDelegationHandler(ev: Event): Promise<void>; /** * @private */ private __setupDelegationInConstructor; } export type TemplateResult = import('lit').TemplateResult; import { LionButton } from "./LionButton.js"; //# sourceMappingURL=LionButtonReset.d.ts.map